pace-chart-lib 1.0.76 → 1.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".highlight{fill-opacity:1!important;stroke-opacity:1;transition:fill-opacity .25s ease-out}.unhighlight{fill-opacity:.08!important;stroke-opacity:.08;transition:fill-opacity .25s ease-in}")),document.head.appendChild(t)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- (function(We,Te){typeof exports=="object"&&typeof module<"u"?Te(exports,require("react"),require("d3"),require("d3-svg-annotation"),require("d3-cloud"),require("venn.js"),require("d3-sankey"),require("d3-org-chart"),require("chart.js"),require("chartjs-plugin-datalabels")):typeof define=="function"&&define.amd?define(["exports","react","d3","d3-svg-annotation","d3-cloud","venn.js","d3-sankey","d3-org-chart","chart.js","chartjs-plugin-datalabels"],Te):(We=typeof globalThis<"u"?globalThis:We||self,Te(We["pace-chart-lib"]={},We.React,We.d3,We.d3Annotation,We.d3Cloud,We.venn,We.d3Sankey,We.OrgChart,We.Chart,We.ChartDataLabels))})(this,(function(We,Te,ii,dl,yl,ul,hl,xl,ft,pl){"use strict";function li(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const T=li(ii),dt=li(dl),bl=li(ul),ki=li(hl);var ri={exports:{}},_a={};/**
2
+ (function(We,Te){typeof exports=="object"&&typeof module<"u"?Te(exports,require("react"),require("d3"),require("d3-svg-annotation"),require("d3-cloud"),require("venn.js"),require("d3-sankey"),require("d3-org-chart"),require("chart.js"),require("chartjs-plugin-datalabels")):typeof define=="function"&&define.amd?define(["exports","react","d3","d3-svg-annotation","d3-cloud","venn.js","d3-sankey","d3-org-chart","chart.js","chartjs-plugin-datalabels"],Te):(We=typeof globalThis<"u"?globalThis:We||self,Te(We["pace-chart-lib"]={},We.React,We.d3,We.d3Annotation,We.d3Cloud,We.venn,We.d3Sankey,We.OrgChart,We.Chart,We.ChartDataLabels))})(this,(function(We,Te,ii,cl,dl,yl,ul,hl,ft,xl){"use strict";function li(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const T=li(ii),dt=li(cl),pl=li(yl),Ti=li(ul);var ri={exports:{}},_a={};/**
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 Ci;function gl(){if(Ci)return _a;Ci=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(o,h,n){var l=null;if(n!==void 0&&(l=""+n),h.key!==void 0&&(l=""+h.key),"key"in h){n={};for(var s in h)s!=="key"&&(n[s]=h[s])}else n=h;return h=n.ref,{$$typeof:t,type:o,key:l,ref:h!==void 0?h:null,props:n}}return _a.Fragment=e,_a.jsx=r,_a.jsxs=r,_a}var ja={};/**
10
+ */var vi;function bl(){if(vi)return _a;vi=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(o,h,n){var l=null;if(n!==void 0&&(l=""+n),h.key!==void 0&&(l=""+h.key),"key"in h){n={};for(var s in h)s!=="key"&&(n[s]=h[s])}else n=h;return h=n.ref,{$$typeof:t,type:o,key:l,ref:h!==void 0?h:null,props:n}}return _a.Fragment=e,_a.jsx=r,_a.jsxs=r,_a}var ja={};/**
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 Mi;function Al(){return Mi||(Mi=1,process.env.NODE_ENV!=="production"&&(function(){function t(b){if(b==null)return null;if(typeof b=="function")return b.$$typeof===ce?null:b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case g:return"Fragment";case V:return"Profiler";case G:return"StrictMode";case Y:return"Suspense";case N:return"SuspenseList";case q:return"Activity"}if(typeof b=="object")switch(typeof b.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),b.$$typeof){case H:return"Portal";case K:return(b.displayName||"Context")+".Provider";case j:return(b._context.displayName||"Context")+".Consumer";case Z:var k=b.render;return b=b.displayName,b||(b=k.displayName||k.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case E:return k=b.displayName||null,k!==null?k:t(b.type)||"Memo";case z:k=b._payload,b=b._init;try{return t(b(k))}catch{}}return null}function e(b){return""+b}function r(b){try{e(b);var k=!1}catch{k=!0}if(k){k=console;var d=k.error,c=typeof Symbol=="function"&&Symbol.toStringTag&&b[Symbol.toStringTag]||b.constructor.name||"Object";return d.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",c),e(b)}}function o(b){if(b===g)return"<>";if(typeof b=="object"&&b!==null&&b.$$typeof===z)return"<...>";try{var k=t(b);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function h(){var b=ne.A;return b===null?null:b.getOwner()}function n(){return Error("react-stack-top-frame")}function l(b){if(oe.call(b,"key")){var k=Object.getOwnPropertyDescriptor(b,"key").get;if(k&&k.isReactWarning)return!1}return b.key!==void 0}function s(b,k){function d(){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))}d.isReactWarning=!0,Object.defineProperty(b,"key",{get:d,configurable:!0})}function x(){var b=t(this.type);return ue[b]||(ue[b]=!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.")),b=this.props.ref,b!==void 0?b:null}function m(b,k,d,c,i,y,f,a){return d=y.ref,b={$$typeof:p,type:b,key:k,props:y,_owner:i},(d!==void 0?d:null)!==null?Object.defineProperty(b,"ref",{enumerable:!1,get:x}):Object.defineProperty(b,"ref",{enumerable:!1,value:null}),b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(b,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(b,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:f}),Object.defineProperty(b,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b}function A(b,k,d,c,i,y,f,a){var L=k.children;if(L!==void 0)if(c)if(xe(L)){for(c=0;c<L.length;c++)u(L[c]);Object.freeze&&Object.freeze(L)}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(L);if(oe.call(k,"key")){L=t(b);var P=Object.keys(k).filter(function(Q){return Q!=="key"});c=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",F[L+c]||(P=0<P.length?"{"+P.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ */var ki;function gl(){return ki||(ki=1,process.env.NODE_ENV!=="production"&&(function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===se?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case g:return"Fragment";case D:return"Profiler";case H:return"StrictMode";case U:return"Suspense";case V:return"SuspenseList";case X:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case _:return"Portal";case K:return(p.displayName||"Context")+".Provider";case j:return(p._context.displayName||"Context")+".Consumer";case J:var C=p.render;return p=p.displayName,p||(p=C.displayName||C.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case N:return C=p.displayName||null,C!==null?C:t(p.type)||"Memo";case $:C=p._payload,p=p._init;try{return t(p(C))}catch{}}return null}function e(p){return""+p}function r(p){try{e(p);var C=!1}catch{C=!0}if(C){C=console;var c=C.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return c.call(C,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),e(p)}}function o(p){if(p===g)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===$)return"<...>";try{var C=t(p);return C?"<"+C+">":"<...>"}catch{return"<...>"}}function h(){var p=re.A;return p===null?null:p.getOwner()}function n(){return Error("react-stack-top-frame")}function l(p){if(oe.call(p,"key")){var C=Object.getOwnPropertyDescriptor(p,"key").get;if(C&&C.isReactWarning)return!1}return p.key!==void 0}function s(p,C){function c(){pe||(pe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",C))}c.isReactWarning=!0,Object.defineProperty(p,"key",{get:c,configurable:!0})}function x(){var p=t(this.type);return ue[p]||(ue[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function L(p,C,c,d,i,y,f,a){return c=y.ref,p={$$typeof:b,type:p,key:C,props:y,_owner:i},(c!==void 0?c:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:x}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:f}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function A(p,C,c,d,i,y,f,a){var m=C.children;if(m!==void 0)if(d)if(he(m)){for(d=0;d<m.length;d++)u(m[d]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(m);if(oe.call(C,"key")){m=t(p);var P=Object.keys(C).filter(function(Q){return Q!=="key"});d=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",w[m+d]||(P=0<P.length?"{"+P.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
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} />`,c,L,P,L),F[L+c]=!0)}if(L=null,d!==void 0&&(r(d),L=""+d),l(k)&&(r(k.key),L=""+k.key),"key"in k){d={};for(var ae in k)ae!=="key"&&(d[ae]=k[ae])}else d=k;return L&&s(d,typeof b=="function"?b.displayName||b.name||"Unknown":b),m(b,L,y,i,h(),d,f,a)}function u(b){typeof b=="object"&&b!==null&&b.$$typeof===p&&b._store&&(b._store.validated=1)}var S=Te,p=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),K=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),ne=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,xe=Array.isArray,Ae=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(b){return b()}};var pe,ue={},O=S["react-stack-bottom-frame"].bind(S,n)(),J=Ae(o(n)),F={};ja.Fragment=g,ja.jsx=function(b,k,d,c,i){var y=1e4>ne.recentlyCreatedOwnerStacks++;return A(b,k,d,!1,c,i,y?Error("react-stack-top-frame"):O,y?Ae(o(b)):J)},ja.jsxs=function(b,k,d,c,i){var y=1e4>ne.recentlyCreatedOwnerStacks++;return A(b,k,d,!0,c,i,y?Error("react-stack-top-frame"):O,y?Ae(o(b)):J)}})()),ja}var Si;function Ll(){return Si||(Si=1,process.env.NODE_ENV==="production"?ri.exports=gl():ri.exports=Al()),ri.exports}var $e=Ll();function ge(t,e,r){console.error(t,e,r)}var nt=(t=>(t.rectangle="rectangle",t.circle="circle",t.hollowCircle="hollowCircle",t.areaWithLine="areaWithLine",t.line="line",t.custom="custom",t.none="none",t))(nt||{}),Et=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))(Et||{}),yt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(yt||{}),sa=(t=>(t.butt="butt",t.round="round",t.square="square",t))(sa||{}),at=(t=>(t.primary="Primary",t.secondary="Secondary",t))(at||{}),Vt=(t=>(t.visible="visible",t.hidden="hidden",t))(Vt||{});const ba="20,10,5,5,5,10",ml={1:"",2:T.curveLinear,3:T.curveStep},fl={1:dt.annotationLabel,2:dt.annotationLabel,3:dt.annotationCallout,4:dt.annotationCalloutElbow,5:dt.annotationCalloutCurve};var Be=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(Be||{}),Ja=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(Ja||{}),ha=(t=>(t.percentage=",.0%",t.general="",t.scientific=".2n",t.currency_USD=".2$",t.currency_CAD=".2c",t.currency_EUR=".2ē",t.currency_CHF=".2ch",t.currency_UK=".2£",t.currency_INR=".2₹",t.commaSeparated=",",t))(ha||{}),ni=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(ni||{}),$t=(t=>(t.start="1",t.middle="2",t.end="3",t))($t||{}),va=(t=>(t.top="1",t.bottom="2",t))(va||{});const ga={none:"1",discrete:"2",colorTheme:"3"},Wt={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var Za=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(Za||{});const Tl={singleColor:"2",multiColor:"1"},se={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Fa=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Fa||{}),wa=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(wa||{});const Yt={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var we=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(we||{});const qe="Calibri";var bi=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(bi||{}),Aa=(t=>(t.total="Total",t.base="base",t.dimensionTotal="dimensionTotal",t.up="up",t.down="down",t))(Aa||{});const Xe={easeLinear:T.easeLinear,easeCubicIn:T.easeCubicIn,easeCubicOut:T.easeCubicOut,easeCubicInOut:T.easeCubicInOut,easeBounceOut:T.easeBounceOut,easeElasticOut:T.easeElasticOut,easeBackOut:T.easeBackOut},Fi={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:we.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:we.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:qe,chartTitleFontStyle:[],chartTitleColor:we.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:we.black,xAxisColorInverted:we.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:qe,xAxisLabelFontStyle:[],xAxisLabelColor:we.black,xAxisNumberFormat:"MMM-YY",xAxisQuarterFormat:"Long",xAxisDisplayUnits:"None",xAxisDisplayUnitsLabel:!1,xAxisLabelRotation:90,xAxisDateFormat:"DD-MM-YYYY",xAxisLabelDecimalPrecision:"2",xAxisLabelText:"",xAxisLabelDynamicText:"",xAxisLabelHTML:"",xAxisPosition:"0",xAxisBackgroundColor:"",xAxisIntervalsVisibility:!1,xAxisMinText:"",xAxisMaxText:"",xAxisIntervalText:"",hideZeroValues:!1,xAxisSortBy:"0",customSort:[],labelTextWrap:!0,multiLineLabelWrap:!1,maxXAxisLabelWidth:100},xAxisScale:{absoluteXAxisScale:!1,customScale:"0"},xAxisTitle:{xAxisTitleVisibility:!0,xAxisTitleFontSize:"11",xAxisTitleFontFamily:qe,xAxisTitleFontStyle:[],xAxisTitleColor:we.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:we.transparent,yAxisColorInverted:we.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:qe,yAxisLabelFontStyle:[],yAxisLabelColor:we.black,yAxisNumberFormat:",",yAxisDisplayUnits:"Auto",yAxisLabelRotation:90,yAxisDisplayUnitsLabel:!1,yAxisDateFormat:"DD-MM-YYYY",yAxisLabelDecimalPrecision:"0",yAxisLabelText:"",yAxisLabelDynamicText:"",yAxisLabelHTML:"",yAxisPosition:"0",yAxisBackgroundColor:"",yAxisIntervalsVisibility:!1,yAxisMinText:"",yAxisMaxText:"",yAxisIntervalText:"",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:qe,yAxisTitleFontStyle:[],yAxisTitleColor:we.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:we.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:qe,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:we.black,secondaryYAxisNumberFormat:",",secondaryYAxisDisplayUnits:"None",secondaryYAxisDisplayUnitsLabel:!1,secondaryYAxisSyncWithPrimaryLabel:!1,secondaryYAxisDateFormat:"DD-MM-YYYY",secondaryYAxisLabelDecimalPrecision:"2",secondaryYAxisBackgroundColor:"#e5e5e5",secondaryYAxisIntervalsVisibility:!1,secondaryYAxisMinText:"",secondaryYAxisMaxText:"",secondaryYAxisIntervalText:""},secondaryYAxisTitle:{secondaryYAxisTitleVisibility:!0,secondaryYAxisTitleFontSize:"11",secondaryYAxisTitleFontFamily:qe,secondaryYAxisTitleFontStyle:[],secondaryYAxisTitleColor:we.black,secondaryYAxisTitleText:"Measure",secondaryYAxisDynamicTitleText:"",secondaryYAxisTitleHTML:""},legends:{legendVisibility:!0,primaryTitleVisibility:!0,primaryTitleText:"Primary Axis",primaryTitleFontSize:"11",primaryTitleFontFamily:qe,primaryTitleFontStyle:[],secondaryTitleVisibility:!0,secondaryTitleText:"Secondary Axis",secondaryTitleFontSize:"11",secondaryTitleFontFamily:qe,secondaryTitleFontStyle:[],legendPosition:"Top",legendAlignment:"Top",legendAlignmentTopBottom:"Start",legendFontSize:"11",legendFontFamily:qe,legendFontStyle:[],legendBorder:!1,legendBorderThickness:"1",legendBorderColor:we.black,vennLabelColor:we.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:we.black},plotArea:{plotAreaColor:we.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:we.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:we.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:we.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:qe,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:we.black,dataLabelNameFontSize:"11",dataLabelNameFontFamily:qe,dataLabelNameFontStyle:[],fillOpacity:"0.7",innerRadius:"50",cornerRadius:"0",axialGrid:!0,arcPadding:"5",axialTicks:"10",arcTransition:!0,innerRadiusForSpeedometer:"30",ticks:"3",pointerColor:we.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:we.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:we.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:we.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:we.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:we.black,annotationFontSize:"9",annotationFontFamily:qe,annotationFontStyle:[],annotationDecimalPrecision:"2",annotationDisplayUnits:"None",annotationBoxVisibility:[],annotationHideZeroValues:!0,annotationShowHiddenValues:!0,annotationSetLabelColor:"1",annotationRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},total:{totalVisibility:!1,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsCoordinates:[],totalNumberFormat:",",totalColor:we.black,totalFontSize:"9",totalFontFamily:qe,totalFontStyle:[],totalConnectorType:"None",totalDecimalPrecision:"2",totalPosition:"1",totalAlignment:"1",totalHideZeroValues:!0,totalDisplayUnits:"None",editTotalTextToggle:!1,editTotalText:"Total",showTotalLabel:!0},toolTip:{toolTipVisibility:!0,toolTipTheme:"Light",toolTipNumberFormat:",",toolTipNumberFormatProgress:",.0%",toolTipDecimalPrecision:"2",toolTipLabelText:"",toolTipDisplayUnits:"None",toolTipLabelDynamicText:""},nodes:{nodesColor:"#d9d7d7",nodesSingleColor:!1,nodesFillOpacity:"1",spacing:"15",sankeyNodeWidth:"10",sankeyChartType:"Left",curviness:"0.5",nodesBorderVisibility:!0,nodesBorderThickness:"1",nodesBorderColor:we.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:qe,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:we.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:we.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:we.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:we.black,binsBorderOpacity:"0.5"},connector:{connectorVisibility:"2",connectorFollow:"1",connectorStepSize:"1",connectorExclude:[],connectorCustomRange:[],connectorFontSize:"11",connectorFontFamily:qe,connectorFontStyle:[],connectorKPI:"1",connectorNumberFormat:",",connectorLineThickness:"1",connectorLineColor:"#080808",connectorMarkerColor:we.black,connectorFontColor:we.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:we.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:qe,footerNoteFontStyle:[],footerNoteFontColor:we.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:we.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:we.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:qe,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:we.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:qe,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:we.black,pointerValueDecimalPrecision:"2",displayUnits:"None"},text:{textFontFamily:qe,textSpacing:"5",textRotation:90},colorScale:{showColor:"1",startColor:"#c1d8f3",endColor:"#4c6ba5",division1:"#c1d8f3",division2:"#b3cbed",division3:"#a4bfe8",division4:"#96b2e2",division5:"#88a6dc",division6:"#7999d7",division7:"#6b8dd1",division8:"#5c80cb",division9:"#4e74c6",division10:"#4c6ba5"},customScaling:{warningTextDummyNode:!1,customScalingtoggle:!1,division1:"#b3b3b3",share1:"",division2:"#b3b3b3",share2:"",division3:"#b3b3b3",share3:"",division4:"#b3b3b3",share4:"",division5:"#b3b3b3",share5:"",division6:"#b3b3b3",share6:"",division7:"#b3b3b3",share7:"",division8:"#b3b3b3",share8:"",division9:"#b3b3b3",share9:"",division10:"#b3b3b3",share10:""},colorScaleForMaps:{defaultColor:"#808080",showColorForMaps:"1",startColorForMaps:"#c1d8f3",endColorForMaps:"#4c6ba5"},pointerValue:{showPointerValue:!1,pointerValueNumberFormat:",",pointerValueDecimalPrecision:"2",connectorKPIforSpeedometer:"1",kpiAlias:!1,kpiAliasText:"",pointerValueDisplayUnits:"None",pointerValueFontSize:"11",pointerValueFontFamily:qe,pointerValueFontStyle:[],pointerValueColor:we.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:we.black,bubbleBorderColor:we.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:we.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:we.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:qe,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:we.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:qe,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:we.black,dataTableAxisLabel:!0,dataTableLegends:!0,disableLegendIcon:!0,legendsWrapText:!1},dataTableOuterBorder:{borderButtonVisibility:!0,lineStyle:"solid",lineColor:"#d9d9d9",lineWidth:"1"},dataTableInnerBorder:{verticalBorderLineButton:!0,verticalBorderLineStyle:"solid",verticalBorderLineColor:"#d9d9d9",verticalBorderLineWidth:"1",horizontalBorderLineButton:!0,horizontalBorderLineStyle:"solid",horizontalBorderLineColor:"#d9d9d9",horizontalBorderLineWidth:"1"},chartPadding:{paddingArrayLTRB:[0,0,0,0]},statisticalTest:{zTest:!1,runZTest:[],zTestInputData:[]},cjsOptions:{cjsTension:0,cjsBorderRadius:0},animation:{animationEnabled:!1,animationDuration:1500,animationEffect:"easeCubicOut"}},Ht={top:0,right:0,bottom:0,left:0};var re=(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))(re||{});const si={1:"",2:T.curveLinear,3:T.curveStep},vl=[re.ColumnChart,re.StackColumnChart,re.NormalizedStackColumnChart,re.LineChart,re.StackLineChart,re.NormalizedStackLineChart,re.AreaChart,re.StackAreaChart,re.NormalizedStackAreaChart],wi=[re.PieChart,re.PieofPie,re.DonutChart,re.PyramidChart,re.OrganizationChart,re.VennChart,re.ProgressChart,re.Maps,re.WordCloud,re.SankeyChart,re.Speedometer,re.RadialBarChart];function Tt(t,e,r,o,h){var n=document.createElement("div");n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.fontSize=e==null?"":e+"px",n.style.fontFamily=r??"",n.style.margin="0",n.style.padding="1px",n.style.border="none",h?(n.style.width=h+"px",n.style.whiteSpace="normal",n.style.overflowWrap="break-word"):n.style.whiteSpace="nowrap",n.innerHTML=t,document.body.appendChild(n);var l=n.getBoundingClientRect(),s=l.width,x=l.height;return o!=null?(n.style.transform=`rotate(${o}deg)`,l=n.getBoundingClientRect(),n.remove(),[s,x,l.width,l.height]):(n.remove(),[l.width,l.height])}function kl(t,e){let r=t.dataTableProperties&&t.dataTableProperties.dataTable,o=r?e*7<50?50:e*7>100?100:e*7:0;return r&&o<30&&(o=30),o}function gi(t,e,r,o,h,n,l,s,x,m,A,u,S){let p=n.dataTableProperties&&n.dataTableProperties.dataTable&&n.xAxisLabel.xAxisPosition=="0"&&!S,H=!1;//!formatOptions.plotArea.fitChart;
24
- let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),K=V<j[0]+10?V:j[0]+10,Z=u?gt(n.xAxisLabel.xAxisNumberFormat,s).map(b=>b):s,Y=Z?Z[0]+"":"",N=Y.length;Z&&Z.forEach(b=>{b=b+"";let k=b.trim()?.length||0;k>N&&(N=k,Y=b.trim())});let E=Tt(Y,n.xAxisLabel.xAxisLabelFontSize,n.xAxisLabel.xAxisLabelFontFamily,n.xAxisLabel.xAxisLabelRotation),z=E[0]+5,q=E[3]+10,ce;n.xAxisLabel.labelTextWrap?n.xAxisLabel.multiLineLabelWrap?ce=n.xAxisLabel.maxXAxisLabelWidth:ce=q<G*.15?q:G*.15:ce=q;let ne=n.xAxisTitle.xAxisTitleVisibility?n.xAxisTitle.xAxisDynamicTitleText.length!==0?Tt(n.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:Tt(n.xAxisTitle.xAxisTitleText,"13",qe)[1]:p?5:0;ne=ne>G*.1?G*.1:ne;let oe=p?0:n.xAxisLabel.xAxisLabelVisibility?ce:0,xe=n.yAxisTitle.yAxisTitleVisibility?n.yAxisTitle.yAxisDynamicTitleText.length!==0?Tt(n.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:Tt(n.yAxisTitle.yAxisTitleText,"13",qe)[1]:0;xe=xe>g*.1?g*.1:xe;const Ae=r*1.1,pe=h*1.1;let ue=n.yAxisLabel.yAxisLabelVisibility?Ni(Ae,pe,n,!1,A)+5:kl(n,T.max(l,b=>b?.length||0)||0)+10,O=n.secondaryYAxisLabel.secondaryYAxisLabelVisibility?Ni(o,x,n,!0,A):0,J=n.secondaryYAxisTitle.secondaryYAxisTitleVisibility?n.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?Tt(n.secondaryYAxisTitle.secondaryYAxisTitleHTML,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:Tt(n.secondaryYAxisTitle.secondaryYAxisTitleText,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;J=J>g*.1?g*.1:J;let F=n.chartTitle.chartTitleVisibility?n.chartTitle.dynamicTitleText.length!==0?Tt(n.chartTitle.chartTitleHTML,void 0,void 0)[1]:Tt(n.chartTitle.chartTitleText,"16",qe)[1]:0;return F=F>G*.1?G*.1:F,{width:g,height:G,isChartScrollable:H,legendMargin:K,dimensionHeightWidthArray:E,actualDimesionWidth:z,maxDimensionWidth:q,xTitle:ne,xLabel:oe,yTitle:xe,yLabel:ue,secondaryYLabel:O,secondaryAxisTitleWidth:J,chartTitleHeight:F}}function Cl(t,e,r,o,h,n,l,s,x,m,A,u,S,p){try{const H=p??gi(t,e,r,o,h,n,l,s,x,m,A,u,S),g=S?H.xTitle+H.xLabel:H.yTitle+H.yLabel,G=n.legends.legendPosition,V=n.legends.legendVisibility,j=n.xAxisLabel.xAxisPosition=="1"&&S;let K=0,Z=0;const Y=m&&!S?H.secondaryYLabel+H.secondaryAxisTitleWidth:0;switch(G){case Be.none:case Be.none:Z=15+Y,K=g+5;break;case Be.top:Z=j?g+5:15+Y,K=j?5+Y+H.xTitle:g+5;break;case Be.right:Z=j?g+5+H.legendMargin:H.legendMargin+Y+20,K=j?5+Y+H.xTitle+H.legendMargin:g+5;break;case Be.bottom:Z=j?g+5:15+Y,K=j?5+Y+H.xTitle:g+5;break;case Be.left:K=H.legendMargin+g+33,Z=15+Y;break;default:Z=15+Y,K=g+5}const N=n.chartPadding?.paddingArrayLTRB;return N&&(K+=N[0],Z+=N[2]),n.dataTableProperties&&n.dataTableProperties.dataTable&&A&&!S&&(K=K+35),{left:K,right:Z,yLabel:H.yLabel,yTitle:H.yTitle,xLabel:H.xLabel,xTitle:H.xTitle,dimensionHeightWidthArray:H.dimensionHeightWidthArray,chartTitleHeight:H.chartTitleHeight,legendMargin:H.legendMargin,secondaryYLabel:H.secondaryYLabel,secondaryAxisTitleWidth:H.secondaryAxisTitleWidth}}catch(H){throw H}}function Ml(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H){try{const g=p??gi(t,e,r,o,h,n,l,s,x,m,A,u,S),V=n.legends.legendVisibility?n.legends.legendPosition:Be.none,j=H&&!S?12:0,K=S?g.yTitle+g.yLabel:g.xTitle+g.xLabel;let Z=0,Y=0;switch(V){case Be.none:Z=g.chartTitleHeight+5,Y=K+5+j;break;case Be.top:Z=35+g.chartTitleHeight,Y=K+j;break;case Be.right:Z=g.chartTitleHeight+5,Y=K+5+j;break;case Be.bottom:Y=30+K+j,Z=g.chartTitleHeight+5;break;case Be.left:Z=g.chartTitleHeight+5,Y=K+5+j;break;default:Z=g.chartTitleHeight+5,Y=K+5+j}n.xAxisLabel.xAxisPosition&&!S&&n.xAxisLabel.xAxisPosition=="1"&&(Y=Y-g.xLabel,Z=Z+g.xLabel),A&&!S&&(Z=Z+12);const N=m&&S?g.secondaryYLabel+g.secondaryAxisTitleWidth:0;N&&(Z=Z+N);const E=n.chartPadding?.paddingArrayLTRB;return E&&(Z+=E[1],Y+=E[3]),{top:Z,bottom:Y,chartTitleHeight:g.chartTitleHeight,xAxisRelatedMargin:K,xLabel:g.xLabel,xTitle:g.xTitle}}catch(g){throw g}}function vt(t,e,r,o,h,n,l,s,x,m,A,u,S,p){try{const H=gi(t,e,r,o,h,n,l,s,x,m,A,u,S),g=Cl(t,e,r,o,h,n,l,s,x,m,A,u,S,H),G=Ml(t,e,r,o,h,n,l,s,x,m,A,u,S,H,!0);let V,j=t-g.left-g.right,K=e-G.top-G.bottom,Z,Y=!1;({visibleBars:V,columnWidth:Z,scrollbarVisible:Y}=$l(S?K:j,n,p));const N={top:G.top,bottom:G.bottom,left:g.left,right:g.right};if(S){const E=A?30:0;N.right=N.right+E}return n.connector.connectorVisibility!="2"&&p?.chartType==re.StackColumnChart&&(N.top=N.top+20),n.connector.connectorVisibility!="2"&&p?.chartType==re.StackHorizontalBarChart&&(N.right=N.top+20),{margin:N,yLabel:g.yLabel,xLabel:g.xLabel,yTitle:g.yTitle,xTitle:g.xTitle,dimensionHeightWidthArray:g.dimensionHeightWidthArray,chartTitleHeight:g.chartTitleHeight,legendMargin:g.legendMargin,secondaryYLabel:g.secondaryYLabel,secondaryAxisTitleWidth:g.secondaryAxisTitleWidth,visibleBars:V,columnWidth:Z,scrollbarVisible:Y}}catch(H){throw H}}function kt(t,e,r,o){t.attr("viewBox","0 0 "+e+" "+r);const{chartAreaColor:h,chartAreaBorder:n}=o.chartArea;if(t.style("background-color",h),n){const l=o.chartArea.chartAreaBorderColor,s=o.chartArea.chartAreaBorderThickness,x=o.chartArea.chartAreaBorderStyle.toString(),m=x==="1"?"solid":x==="2"?"dashed":"dotted";t.style("outline",`${s}px ${m} ${l}`).style("outline-offset",`-${s}px`)}else t.style("outline","none").style("outline-offset",null)}const Ct=(t,e)=>{let r=T.select(t.current);r.selectAll("*").remove();let o=Di(Fi,e),h=t.current.getBoundingClientRect(),n=h.width,l=h.height;return{formatOptions:o,svg:r,width:n,height:l}},Qt=(t,e,r)=>{if(!t.dataTableProperties.dataTable)return{formatOptions:t};let o=!1;return e.forEach(h=>{h?.properties?.showInDataTable==!0&&(o=!0)}),r.forEach(h=>{h?.properties?.showInDataTable==!0&&(o=!0)}),o||(t.dataTableProperties.dataTable=!1),{formatOptions:t}};function Di(t,e){if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const o=t[r],h=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!h||n===void 0){e[r]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const l=Vi(o),s=Vi(n);l&&s&&Di(o,n)}),e}function Vi(t){return Object.prototype.toString.call(t)==="[object Object]"}function Nt(t,e,r,o,h){parseFloat(t.yAxisLabel.yAxisIntervalText);let n=parseFloat(t.yAxisLabel.yAxisMaxText),l=parseFloat(t.yAxisLabel.yAxisMinText),s=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText),x=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText);if(parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText),t.yAxisLabel.yAxisIntervalsVisibility){t.xAxisLabel.xAxisPosition=="2"&&(t.xAxisLabel.xAxisPosition="0"),l=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let K=t.yAxisLabel.yAxisMaxText;n=K.length>0?parseFloat(K):r,n&&(r=n),parseFloat(t.yAxisLabel.yAxisIntervalText)<r&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else n=void 0,l=void 0;t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<h&&(x=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),s=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):h,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(s=void 0,x=void 0);let m=e?_e(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,A=r?_e(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,u=o?_e(o,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=h?_e(h,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,p=n?_e(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,H=l?_e(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,g=s?_e(s,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,G=x?_e(x,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,V=m<A||m===A?r:e;if(l){let K=H<A?r:l;V=V<K?K:V}if(n){let K=p>m?n:e;V=V<K?K:V}n&&l&&(V=p>H?n:l);let j=u<S?h:o;if(x){let K=G<S?h:x;j=j<K?K:j}if(s){let K=g>S?s:h;j=j<K?K:j}return s&&x&&(j=g>G?s:x),{maxNumberForPrimaryAxis:V,maxNumberForSecondaryAxis:j}}function _e(t,e,r,o,h){try{let n,l="",s=o,x;if(e==="Auto")return Sl(t);switch(e!=Ja.none&&(e==Ja.thousands&&(n=1e3,l="K"),e==Ja.millions&&(n=1e6,l="M"),e==Ja.billions&&(n=1e9,l="B"),t=t/n),h&&t<0&&(t=-t),r){case ha.percentage:return x=`.${s}%`,T.format(x)(t);case ha.general:return x=`.${s}f`,T.format(x)(t)+l;case ha.scientific:let m=Number(s);return x=`.${m==0?1:(m+1).toString()}n`,T.format(x)(t)+l;case ha.currency_USD:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"$"+T.format(x)(t)+l;case ha.currency_CAD:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"C$"+T.format(x)(t)+l;case ha.currency_EUR:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"€"+T.format(x)(t)+l;case ha.currency_CHF:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"CHF"+T.format(x)(t)+l;case ha.currency_UK:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"£"+T.format(x)(t)+l;case ha.currency_INR:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"₹"+T.format(x)(t)+l;case ha.commaSeparated:return x=`,.${s}f`,T.format(x)(t)+l;default:return x=".2f",T.format(x)(t)+l}}catch(n){throw n}}function Sl(t){if(t==null||isNaN(t))return"-";const e=Math.abs(t);if(e>=1e9)return T.format(".2s")(t).replace("G","B");if(e>=1e6)return T.format(".2s")(t);if(e>=1e3)return T.format(".2s")(t);if(e>=1){const r=T.format(".2f")(t);return+r===Math.floor(t)?T.format(".0f")(t):r}else return e>=.01?T.format(".2f")(t):e>0?T.format(".2e")(t):"0"}function Ni(t,e,r,o,h){try{{let n,l,s=o?r.secondaryYAxisLabel.secondaryYAxisDisplayUnits:r.yAxisLabel.yAxisDisplayUnits,x=o?r.secondaryYAxisLabel.secondaryYAxisNumberFormat:r.yAxisLabel.yAxisNumberFormat,m=o?r.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:r.yAxisLabel.yAxisLabelDecimalPrecision,A=o?r.secondaryYAxisLabel.secondaryYAxisLabelFontSize:r.yAxisLabel.yAxisLabelFontSize,u=o?r.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:r.yAxisLabel.yAxisLabelFontFamily;if(s!="None")return n=_e(Math.floor(t)||Math.floor(e),s,x,m??"2").toString(),l=Tt(n,A,u)[0],l<30?30:l+5;try{return n=_e(Math.floor(t)||Math.floor(e),s,x,m??"2").toString(),h&&(n="-100%"),l=Tt(n,A,u)[0],l<30?30:l+5}catch{}}}catch(n){throw n}}function oi(t,e,r,o){try{let h=!0,n=parseFloat(r.secondaryYAxisLabel.secondaryYAxisIntervalText),l=parseFloat(r.secondaryYAxisLabel.secondaryYAxisMinText),s=parseFloat(r.secondaryYAxisLabel.secondaryYAxisMaxText),x,m=[];if(n&&n!==0&&n!==void 0){let A=l||l==0?l:e,u=s||s==0?s:t;A<0?x=Math.floor((u-A)/n):x=Math.floor(u/n);let S=18,p=l==0||l?l:e<0?Math.round(e):0;if(m.push(p),h=!1,x>100){let H="Tick count cannot exceed more than 100.";A<0?n=(u-p)/100:n=u/100}if(x=x<100?x:100,x>S)for(let H=0;H<x&&(p+=n,parseFloat(p.toFixed(5))<=t);H++)m.push(p);else for(let H=0;H<S&&(p+=n,p<=t);H++)m.push(p)}else{let A=Tt(t.toString(),r.secondaryYAxisLabel.secondaryYAxisLabelFontSize,r.secondaryYAxisLabel.secondaryYAxisLabelFontFamily,0);m=Ai(e,t,o,A[0])}return{secondaryYAxisLabelArray:m,secondaryCustomTickValue:x,autoLabelFlag:h}}catch{}}function Mt(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){throw r}}function mt(t,e,r,o,h,n,l){try{let s=l??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",s+"-clip").append("rect").attr("width",o).attr("height",r>0?h-r:h),t.append("rect").attr("width",o).attr("height",r>0?h-r:h).attr("stroke",e.plotArea.plotAreaBorder&&!wi.includes(n)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==we.white&&!wi.includes(n)?e.plotArea.plotAreaColor:"none")}catch(s){throw s}}function Fl(t,e){const r=t.yPosition,o=t.yPosition+t.height,h=e.yPosition,n=e.yPosition+e.height;return r<n&&o>h}function ot(t,e,r,o,h,n,l,s,x){try{let m=o.yAxisLabel.yAxisIntervalsVisibility,A=!1,u=m?parseFloat(o.yAxisLabel.yAxisIntervalText):void 0,S=[],p;if(h.chartType===re.TornadoChart){const g=Math.max(Math.abs(e),Math.abs(t)),G=l||g,V=n||e;if(u&&u>0){for(let j=V;j<=G+1e-6;j+=u)S.push(parseFloat(j.toFixed(6)));p=S.length}else{A=!0;const j=6,Z=(G-V)/j;for(let Y=0;Y<=j;Y++){const N=V+Y*Z;S.push(parseFloat(N.toFixed(6)))}p=s?x/80:r/80}return{yAxisLabelArray:S,customTickValue:p,autoLabelFlag:A}}if(!l&&t>0){const G=(t-e)*.05;t=t+G}if(u&&u!==0&&u!==void 0){let g=n||n==0?n:e,G=l||l==0?l:t;g<0?p=Math.floor((G-g)/u):p=Math.floor(G/u);let V=18;(l||l==0)&&(t=l);let j=n||n==0?n:e<0?Math.round(e):0;if(S.push(j),p>100){let K="Tick count cannot exceed more than 100.";g<0?u=(G-j)/100:u=G/100}if(p=p<100?p:100,p>V)for(let K=0;K<parseInt(p)&&(j+=u,parseFloat(j.toFixed(5))<=t);K++)S.push(j);else for(let K=0;K<V&&(j+=u,j<=t);K++)S.push(j)}else{A=!0;let g=Tt((l||h.yMaxLeft).toString(),o.yAxisLabel.yAxisLabelFontSize,o.yAxisLabel.yAxisLabelFontFamily,0);S=Ai(n||h.yMinLeft,t,s?x:r,s?g[1]:g[0]),p=s?x/80:r/80}return{yAxisLabelArray:S,customTickValue:p,autoLabelFlag:A}}catch(m){throw m}}function Ai(t,e,r,o=80){const h=e-t;if(!isFinite(h)||Math.abs(h)<1e-12)return[Number(t.toFixed(12))];const n=h<10?10:Math.max(2,Math.floor(r/o)),l=h/n,s=Math.pow(10,Math.floor(Math.log10(l))),x=[1,1.5,2,2.5,5,10];let m=x.map(H=>H*s).find(H=>Math.ceil(h/H)<=n);m||(m=x.at(-1)*s);const A=Math.floor(t/m)*m,u=Math.ceil(e/m)*m,S=Math.round((u-A)/m),p=new Array(S+1);for(let H=0;H<=S;H++)p[H]=Number((A+H*m).toFixed(12));return p}function Gt(t,e,r,o,h,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==we.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(h);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==we.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(l){throw l}}function ci(t,e,r,o,h,n,l){let s=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${l},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==we.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const x=t.append("g").call(h).attr("transform",`translate(${l},0)`);x.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==we.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",s.includes("Italic")?"Italic":"").style("text-decoration",s.includes("Underline")?"Underline":"").style("font-weight",s.includes("Bold")?"Bold":"").attr("visibility",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),x.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",e.secondaryYAxisLabel.secondaryYAxisWidth),x.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",e.plotArea.fitChart?"1":"0").append("text").attr("transform","rotate(90)").attr("text-anchor","start").attr("class","DisplayUnit").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor).style("font-size",parseFloat(e.secondaryYAxisLabel.secondaryYAxisLabelFontSize)*.8).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle).attr("visibility",e.secondaryYAxisLabel.secondaryYAxisDisplayUnitsLabel==!1?"hidden":"visible").text("("+e.secondaryYAxisLabel.secondaryYAxisDisplayUnits+")")}function Lt(t,e){try{let r=[],o=e/30<t.length?Math.round(e/30):t.length;if(o>=t.length)return r=t,r;let h=Math.round(t.length/o);(t.length-1)%h!=0&&(t.length-1)%(h+1)==0&&(h=h+1),r.push(t[0]);let n;for(let l=1;l<t.length-1;l++){const s=l*h;if(s>t.length)break;r.push(t[s]),n=s}if(!r.includes(t[t.length-1])){let l=n>=Math.round(t.length-t.length*.02);r.push(t[t.length-1])}return r=r.filter(l=>l)}catch(r){throw r}}function qt(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H){try{let g=e.chartType!==re.ColumnHistogramChart?Lt(p,u):[],G=[],V=s[3]+10;e.chartType!=re.ColumnHistogramChart?G=A?gt(o.xAxisLabel.xAxisNumberFormat,g.map(O=>O)).map(O=>O):g:g.forEach(O=>{G.push(e.formattedDimensionListMap.get(O))});let j=!o.plotArea.fitChart&&(e.chartType==re.AreaChart||e.chartType==re.StackAreaChart||e.chartType==re.NormalizedStackAreaChart);t||(t=t);let K=o.xAxisLabel.xAxisLabelFontStyle,Z="rotate("+-o.xAxisLabel.xAxisLabelRotation+")";o.dataTableProperties&&o.dataTableProperties.dataTable&&vl.includes(e.chartType)&&o.xAxisLabel.xAxisPosition!="1"&&(o.xAxisLabel.xAxisLabelVisibility=!1);let Y=o.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const N=t.append("g").attr("id","x-axis");N.append("rect").attr("transform",`translate(1,${Y==="0"?h>0?S-h:S:Y==="1"?-r:n(0)})`).attr("height",r).attr("width",u).attr("fill",o.xAxisLabel.xAxisLabelVisibility&&o.xAxisLabel.xAxisBackgroundColor?o.xAxisLabel.xAxisBackgroundColor!==we.white?o.xAxisLabel.xAxisBackgroundColor:"none":o.chartArea.chartAreaColor);const E=N.append("g").attr("transform",`translate(0,${Y=="0"?h>0?S-h:S:Y=="1"?0:n(0)})`).call(l);let z=Y==="1"?"5":"0",q;o.xAxisLabel.labelTextWrap?o.xAxisLabel.multiLineLabelWrap?q=o.xAxisLabel.maxXAxisLabelWidth:q=V<x*.15?V:x*.15:q=o.xAxisLabel.xAxisLabelRotation==0?m:V;const ce=H.step(),ne=parseInt(o.xAxisLabel.xAxisLabelFontSize)*1.2,oe=Math.floor(ce/ne),xe=o.xAxisLabel.xAxisLabelRotation==0;let Ae=E.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(q)).style("height",ce+"px").attr("transform",(O,J)=>`rotate(${Y==="1"?-o.xAxisLabel.xAxisLabelRotation:o.xAxisLabel.xAxisLabelRotation!=0?180-o.xAxisLabel.xAxisLabelRotation:0}) translate (${o.xAxisLabel.xAxisLabelRotation!=0?z+`, -${J==0&&j?15:ce/2}`:-q/2+" , "+(Y==="1"?"-15":"8")})`);xe||Ae.style("overflow","visible"),Pi()==="safari"&&Ae.attr("width",o.xAxisLabel.labelTextWrap?V<x*.125?V:x*.125:r).attr("height","20px");let ue=Ae.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",Pi()==="safari"||Y==="1"?"":o.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(o.xAxisLabel.labelTextWrap&&!o.xAxisLabel.multiLineLabelWrap||!o.xAxisLabel.labelTextWrap)&&ue.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),o.xAxisLabel.labelTextWrap&&o.xAxisLabel.multiLineLabelWrap&&ue.style("-webkit-line-clamp",oe.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),ue.style("text-align",o.xAxisLabel.xAxisLabelRotation!=0?"start":"center").style("user-select","none").style("margin",0).style("padding","0 1px").style("font-family",o.xAxisLabel.xAxisLabelFontFamily).style("color",o.xAxisLabel.xAxisLabelColor).style("font-size",o.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",K.includes("Italic")?"Italic":"").style("text-decoration",K.includes("Underline")?"Underline":"").style("font-weight",K.includes("Bold")?"Bold":"").style("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===re.ColumnHistogramChart?ue.attr("title",(O,J)=>_e(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((O,J)=>_e(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)):ue.attr("title",(O,J)=>(""+G[J]).trim()).html((O,J)=>(""+G[J]).trim()),E.selectAll("text").style("visibility",(o.xAxisLabel.xAxisLabelVisibility,"hidden")),E.selectAll("line").style("stroke",o.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility||o.plotArea.gridLinesVertical?"visible":"hidden"),E.select(".domain").style("stroke",o.xAxisLabel.xAxisColor).attr("stroke-width",o.xAxisLabel.xAxisWidth?o.xAxisLabel.xAxisWidth:o.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").raise(),t}catch(g){throw g}}function Pi(){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 Ii={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"]},wl=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const r=Math.floor(e-25569),o=new Date(r*86400*1e3);return Number.isNaN(o.getTime())?null:{day:o.getUTCDate(),month:o.getUTCMonth(),year:o.getUTCFullYear()}},Dl=t=>String(t%100).padStart(2,"0"),Vl=(t,e,r,o)=>{const h=Ii.short[e],n=Ii.long[e],l=String(t).padStart(2,"0"),s=String(e+1).padStart(2,"0"),x=Dl(r),m=String(r);switch(o){case"Month":return n;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${m}`;case"Year":return m;case"Default":return`${l}-${h}-${m}`;case"DD-MM-YYYY":return`${l}-${s}-${m}`;case"MM-DD-YYYY":return`${s}-${l}-${m}`;case"DD-MM":return`${l}-${s}`;case"YYYY-MM-DD":return`${m}-${s}-${l}`;case"YYYY-MM":return`${m}-${s}`;case"YYYY":return m;case"MM-YYYY":return`${s}-${m}`;case"MMM-YY":return`${h}-${x}`;case"YY-MMM":return`${x}-${h}`;case"MMMM-YY":return`${n}-${x}`;case"MMMM-YYYY":return`${n}-${m}`;case"DD-MMM":return`${l}-${h}`;case"DD-MMM-YY":return`${l}-${h}-${x}`;case"DD-MMM-YYYY":return`${l}-${h}-${m}`;default:return`${l}-${h}-${m}`}},gt=(t,e)=>{try{return e.map(r=>{const o=wl(r);if(!o)return r;const{day:h,month:n,year:l}=o;return Vl(h,n,l,t)})}catch(r){throw r}};function za(t,e,r){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let o=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(r).enter().filter(n=>n.isVisible).append("g").attr("class","seriesLabels").attr("transform",n=>`translate(${n.xPosition}, ${n.yPosition})`).append("foreignObject").attr("width",n=>n.width).attr("height",n=>n.height).append("xhtml:div").style("display","flex").style("align-items","center").style("justify-content","center").style("width","100%").style("height","100%").append("xhtml:div").style("width","fit-content").style("height","100%").style("padding-left","5px").style("padding-right","5px").style("border-radius","4px").style("background-color",t.seriesLabel.seriesLabelBackgroundColor).style("font-size",t.seriesLabel.seriesLabelFontSize+"px").style("font-family",t.seriesLabel.seriesLabelFontFamily).style("font-style",o.includes("Italic")?"italic":"").style("text-decoration",o.includes("Underline")?"underline":"").style("font-weight",o.includes("Bold")?"bold":"").style("color","black").text(n=>n.seriesValue)}}function Nl(t,e,r,o,h,n){const l=r.xAxisLabel.xAxisPosition!="1"?e.left-20-h:5;return t?`rotate(-90) translate(-${e.top+o},${l})`:`translate(${e.left},${e.top+o+(r?.xAxisLabel?.xAxisPosition=="1"?0:t?n:h)})`}function St(t,e,r,o,h,n,l,s,x,m,A){try{let u=r.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",Nl(e,o,t,A,h,x)).attr("class","xAxisTitle").attr("width",e?A:m).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?u.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):u.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){throw u}}function Ft(t,e,r,o,h,n,l,s,x,m,A){try{let u=r>0?t-r:t,S=h.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",o?n.left:`-${n.top+u}`).attr("y",o?n.top+u+s:n.left-l-s).attr("class","yAxisTitle").attr("transform",o?"":"rotate(-90)").attr("width",o?x:u).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?S.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):S.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),h}catch(u){throw u}}function Ut(t,e,r,o,h,n,l,s,x,m=!1){let A=t.append("foreignObject").attr("visibility",e&&o.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",m?`${r.left}`:`-${r.top+(h>0?n-h:n)}`).attr("y",m?`${r.top-s-x-2}`:`${r.left+l+s-2}`).attr("class","yAxisTitleSecondary").attr("transform",m?"rotate(0)":"rotate(-90)").attr("width",m?l:h>0?n-h:n).attr("height",x+"px");o.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?A.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleHTML?o.secondaryYAxisTitle.secondaryYAxisTitleHTML:o.secondaryYAxisTitle.secondaryYAxisTitleText):A.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","3px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size",o.secondaryYAxisTitle.secondaryYAxisTitleFontSize+"px").style("font-family",o.secondaryYAxisTitle.secondaryYAxisTitleFontFamily).style("font-style",o.secondaryYAxisTitle.secondaryYAxisTitleFontStyle).attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleText)}function wt(t,e,r,o){let h=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r-4).attr("height",o+"px");const n=x=>{const m=document.createElement("div");return m.innerHTML=x,m.textContent||m.innerText||""},s=!!e.chartTitle.chartTitleHTML?n(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?h.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",s).style("white-space","pre").style("text-overflow","ellipsis").html(e.chartTitle.chartTitleHTML?e.chartTitle.chartTitleHTML:e.chartTitle.chartTitleText):h.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow","hidden").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",e.chartTitle.chartTitleFontFamily).attr("title",e.chartTitle.chartTitleText).html(e.chartTitle.chartTitleText)}function Ot(t){if(t.line.interpolationType=="1")return T.curveLinear;if(t.line.interpolationType=="2"&&t.line.smoothType=="1")return T.curveMonotoneX;if(t.line.interpolationType=="2"&&t.line.smoothType=="2")return T.curveCardinal.tension(parseFloat(t.line.cardinalTension));if(t.line.interpolationType=="3"&&t.line.stepPosition=="1")return T.curveStepBefore;if(t.line.interpolationType=="3"&&t.line.stepPosition=="2")return T.curveStep;if(t.line.interpolationType=="3"&&t.line.stepPosition=="3")return T.curveStepAfter}function Pl(t){const e=t.indexOf(" - ");return e==-1?bi.default:t.slice(e+3)}const La=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function $a(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Rt(t,e,r){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:o,minVal:h,maxVal:n}=e.annotation.annotationRangeFilter;return t.filter(l=>{const s=r(l);switch(o){case"lt":return s<=n;case"gt":return s>=h;case"in":return s>=h&&s<=n;case"not-in":return s<h||s>n;default:return!0}})}function Da(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H,g,G,V,j,K,Z,Y,N,E){try{const z=m===re.TornadoChart;let q=new Map,ce=x.annotation.annotationType??"1",ne=x.annotation.annotationPosition.toString()!="4"?x.annotation.annotationPosition:null,oe=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const xe=x.annotation.connectorType?.toLowerCase()==="curve";if(x.annotation.annotationVisibility){let Ae=[ce=="1"?"connector":""],pe=[],ue=n.annotation(),O=x.annotation.connectorType,J=x.annotation.annotationVisibility,F=x.annotation.annotationFontStyle,b=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates)),k=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";b=Li(b,x,m);let d=[],c=[];switch(b.length!=0&&b.forEach(a=>{a.dx=a.dx*u/a.width,a.dy=a.dy*A/a.height,a.width=u,a.height=A}),J){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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"1":for(let a=0;a<t[0].data.length;a++)t.forEach(L=>{L.data[a]&&pe.push({Dimension:L.data[a].dimension,Measure:L.data[a].value,Legend:L.data[a].legend,LabelPosition:ne||L.properties.annotationPosition,Labelcolor:L.properties[oe],hoverText:La(L,E),Axis:L.properties.axis,LegendUniqueId:L.properties.legendUniqueId})});break;case"5":break;case"6":t.forEach(a=>{switch(a.properties.annotation.toString()){case"1":for(let P=0;P<t[0].data.length;P++)a.data[P]&&pe.push({Dimension:a.data[P].dimension,Measure:a.data[P].value,Legend:a.data[P].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),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:ne||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,E),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;pe.forEach((a,L)=>{i<a.Measure&&(i=a.Measure)});let y=i*.1;pe.forEach((a,L)=>{let P={note:{label:a.Measure>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":_e(m===re.TornadoChart?Math.abs(a.Measure):a.Measure,x.annotation.annotationDisplayUnits||x.plotArea.plotAreaDisplayUnits,x.annotation.annotationNumberFormat,x.annotation.annotationDecimalPrecision),align:N&&m!==re.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":m===re.TornadoChart?"end":"middle"},data:N?{y:z?Pl(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:si[x.annotation.connectorCurve],points:xe?$a(0,0):[[0,0],[0,0]]},disable:Ae,subject:{height:15,width:15},color:a.Labelcolor,type:di(n,parseFloat(ce)),height:A,width:u};if(N){let ae=a.Axis===at.primary?r:o;(Lt(p,H).includes(a.Dimension)||m===re.TornadoChart)&&!l.includes(a.Legend)&&ae(a.Measure)<=S&&ae(a.Measure)>=0&&d.push(P)}else Lt(p,S).includes(a.Dimension)&&!l.includes(a.Legend)&&(a.Axis==at.primary?r(a.Measure)<=H&&r(a.Measure)>=0:o(a.Measure)<=H&&o(a.Measure)>=0)&&d.push(P)}),x.annotation.annotationHideZeroValues&&(d=d.filter(a=>N?a.data.x.measure!==0:a.data.y.measure!==0)),d=Rt(d,x,a=>N?a.data.x.measure:a.data.y.measure),b.length===0?(b=d,q=new Map(b.map(a=>[a.data.legendUniqueId,{measure:N?a.data.x.measure:a.data.y.measure,dimension:N?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}]))):q=new Map(b.map(a=>[a.legendUniqueId,a])),d.forEach(a=>{const L=a.data.legendUniqueId;if(b.length!=0){const P=q.get(L);P&&(a.dx=P.dx,a.dy=P.dy,a.data.isVisible=P.isVisible??!0,P?.connectorPoints&&P.connectorPoints.length>=(xe?3:2)?a.connector.points=P.connectorPoints:a.connector.points=xe?$a(a.dx,a.dy):[[0,0],[0,0]])}c.push(a)}),ue.editMode(x.annotation.annotationDraggable&&Z).accessors({x:function(a){if(N){let L=a.x.axis===at.primary?r:o,P=a.x.axis;return Ei(x,a.x.measure?a.x.measure:0,a.position,L,y,void 0,m,Y,P)}else if(m===re.ColumnChart){const L=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=j(L);return P!=null?e(a.x)+P-(K-j.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==at.primary)return Xa(a.y.measure,parseFloat(a.position),r,y,a.prevValue,m);if(N){const L=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=j&&m!==re.DotPlot?j(L):0;return z?j(a.y)+j.bandwidth()/2:j?e(a.y)+P-(K-j.bandwidth())/2-5:e(a.y)-5}else return Xa(a.y.measure,parseFloat(a.position),o,y,a.prevValue,m)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,b.forEach(L=>{L.data.x==a.data.x&&L.data.y.measure==a.data.y.measure&&(f.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","block"),L.data.isVisible=!0)})),c.forEach(L=>{(L.data?.legendUniqueId==a.data.legendUniqueId||L.legendUniqueId==a.data.legendUniqueId)&&(L.dx=a._dx*u/L.width,L.dy=a._dy*A/L.height,L.connectorPoints=a.connector?.points?.map(P=>[...P])||[])}),V){const L=c.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}));V(L)}f.selectAll(".connector").attr("hoverId",L=>L.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]),f.selectAll(`.connector-${k}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),f.selectAll(".note-line").attr("hoverId",L=>L.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]).filter(L=>L._dx==0&&L._dy==0).remove(),f.selectAll(".annotation-note-label").filter(L=>L.data&&L.data.isVisible).style("display","block")}).on("noteclick",function(a){x.annotation.annotationDraggable&&Z&&(a.data.isVisible=!1,b.forEach(L=>{L.data.x==a.data.x&&L.data.y.measure==a.data.y.measure&&(f.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","none"),L.data.isVisible=!1)}),f.selectAll(".annotation-note-label").filter(L=>L.data&&!L.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>r.invert(a.y)}).notePadding(0).annotations(c),x.plotArea.fitChart&&G.selectAll(".annotation-group").remove();let f=fi(G,x,h,F,ue,k,N);if(x.animation?.animationEnabled){const a=x.animation.animationDuration,L=Xe[x.animation.animationEffect],P=ue.accessors(),ae=m===re.LineChart,Q=m===re.DotPlot,be=(Le,Fe=0)=>{const me=P.x(Le.data),te=P.y(Le.data);return`translate(${me+Fe}, ${te})`};if(Q)f.selectAll(".annotation").attr("opacity",0).attr("transform",Le=>be(Le,-15)).transition().duration(a).ease(L).attr("opacity",1).attr("transform",Le=>be(Le));else if(ae){const Le=e.range?e.range():[0,1],Fe=Math.min(Le[0],Le[1]),me=Math.max(Le[0],Le[1])-Fe,te=(ke,ee=100)=>{for(let De=0;De<=ee;De++){const Ve=De/ee;if((L??T.easeLinear)(Ve)>=ke)return Ve}return 1};f.selectAll(".annotation").attr("opacity",0).each(function(ke){const ee=P.x(ke.data)??Fe,De=me>0?Math.max(0,Math.min(1,(ee-Fe)/me)):0,Ve=te(De)*a;T.select(this).transition().delay(Ve).duration(0).attr("opacity",1)})}else f.selectAll(".annotation").attr("transform",function(Le){if(N){const Fe=r?r(0):0,me=P.y(Le.data);return`translate(${Fe}, ${me})`}else{const Fe=P.x(Le.data),me=Le.data?.y?.axis===at.primary?r:o??r,te=me?me(0):0;return`translate(${Fe}, ${te})`}}).transition().duration(a).ease(L).attr("transform",function(Le){const Fe=P.x(Le.data),me=P.y(Le.data);return`translate(${Fe}, ${me})`})}}}catch(z){throw z}}function Il(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H,g,G,V,j,K,Z,Y){try{let N=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let E=[N=="1"?"connector":""],z=[],q=new Map,ce=n.annotation(),ne=u.annotation.connectorType,oe=u.annotation.annotationVisibility,xe=u.annotation.annotationFontStyle,Ae=[],pe=[],ue=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const O=u.annotation.connectorType?.toLowerCase()==="curve";let J=JSON.parse(JSON.stringify(u.plotArea.dataLabelsCoordinates));J=Li(J,u,re.CustomColumnChart);let F=[],b=[];J.length!=0&&J.forEach(i=>{i.dx=i.dx*p/i.width,i.dy=i.dy*S/i.height,i.width=p,i.height=S});for(let i=0;i<t.length;i++)t.forEach(y=>{y.properties.type&&y.properties.type!=re.ColumnChart&&!pe.includes(y.properties.type)&&pe.push(y.properties.type)});switch(oe){case"2":t.forEach((i,y)=>{switch(i.properties.type){case re.ColumnChart:case re.LineChart:case re.AreaChart:z.push({...i.data[0],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(f=>z.push(f[0]));break;case re.StackAreaChart:s.forEach(f=>z.push(f[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case re.ColumnChart:case re.LineChart:case re.AreaChart:z.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(y=>z.push(y[y.length-1]));break;case re.StackAreaChart:s.forEach(y=>z.push(y[y.length-1]));break}});break;case"4":t.forEach((i,y)=>{switch(i.properties.type){case re.ColumnChart:case re.LineChart:case re.AreaChart:z.push({...i.data[0],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(f=>z.push(f[0]));break;case re.StackAreaChart:s.forEach(f=>z.push(f[0]));break}}),t.forEach(i=>{switch(i.properties.type){case re.ColumnChart:case re.LineChart:case re.AreaChart:z.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(y=>z.push(y[y.length-1]));break;case re.StackAreaChart:s.forEach(y=>z.push(y[y.length-1]));break}});break;case"1":t.forEach(i=>{switch(i.properties.type){case re.ColumnChart:case re.LineChart:case re.AreaChart:i.data.forEach(a=>z.push({...a,alias:i.properties?.alias}));break;case re.StackColumnChart:let y=l.findIndex(a=>a.key===i.properties.legend);y!==-1&&l[y].forEach(a=>z.push(a));break;case re.StackAreaChart:let f=s.findIndex(a=>a.key===i.properties.legend);f!==-1&&s[f].forEach(a=>z.push(a));break}});break;case"5":break;case"6":t.forEach((i,y)=>{let f=i.properties.annotation.toString();switch(i.properties.type){case re.ColumnChart:switch(f){case"1":for(let P=0;P<t[y].data.length;P++)z.push(i.data[P]);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 re.AreaChart:case re.LineChart:switch(f){case"1":for(let P=0;P<t[y].data.length;P++)z.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":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 re.StackColumnChart:const a=l.findIndex(P=>P.key===i.properties.legend);a!==-1&&l[a].forEach((P,ae)=>{switch(String(l[a].individualAnnotationVisibility)){case"1":z.push(l[a][ae]);break;case"2":break;case"3":let Q=l[a][0];z.find(me=>me.key==Q.key)||z.push(Q);break;case"4":let be=l[a][l[0].length-1];z.find(me=>me.key==be.key)||z.push(be);break;case"5":let Le=l[a][0],Fe=l[a][l[0].length-1];if(!z.find(me=>me.key==Le.key||me.key==Fe.key)){z.push(l[a][0]),z.push(l[a][l[0].length-1]);break}}});break;case re.StackAreaChart:const L=s.findIndex(P=>P.key===i.properties.legend);L!=-1&&s[L].forEach((P,ae)=>{switch(String(s[L].individualAnnotationVisibility)){case"1":z.push(s[L][ae]);break;case"2":break;case"3":let Q=s[L][0];z.find(me=>me.key==Q.key)||z.push(Q);break;case"4":let be=s[L][s[0].length-1];z.find(me=>me.key==be.key)||z.push(be);break;case"5":let Le=s[L][0],Fe=s[L][s[0].length-1];if(!z.find(me=>me.key==Le.key||me.key==Fe.key)){z.push(Le),z.push(Fe);break}}});break}});break}let k=0;z.forEach((i,y)=>{k<i.value&&(k=i.value)});let d=k*.1;z.forEach((i,y)=>{let f={note:{label:i.value||i.value==0?i.value>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i.value/1e9)+"B":_e(i.value,u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision):i[1]-i[0]>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i[1]-i[0]/1e9)+"B":_e(i[1]-i[0],u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision),align:"middle"},data:{x:i.dimension&&i.legend?{dimension:i.dimension,legend:i.legend,type:i.type,axis:i.axis||i.data.axis}:{dimension:i.data.dimension,legend:i.key,type:i.data.type,stacklegend:i.data.legend,axis:i.data.axis},y:i.value||i.value==0?i.value:i.data.type!=re.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!=re.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0])},dx:0,dy:0,connector:{end:ue,curve:si[u.annotation.connectorCurve],points:O?$a(0,0):[[0,0],[0,0]]},disable:E,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:di(n,parseFloat(N)),height:S,width:p};i.legend&&i.dimension?!x.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==at.primary?r(i.value)<=G&&r(i.value)>=0:o(i.value)<=G&&o(i.value)>=0)&&F.push(f):!x.includes(i.key)&&(i.data.axis==at.primary?r(i[1])<=G&&r(i[1])>=0:o(i[1])<=G&&o(i[1])>=0)&&F.push(f)}),u.annotation.annotationHideZeroValues&&(F=F.filter(i=>i.data.y!==0)),F=Rt(F,u,i=>i.data.y),J.length===0?(J=F,q=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}]))):q=new Map(J.map(i=>[i.legendUniqueId,i])),F.forEach(i=>{const y=i.data.legendUniqueId;if(J.length!=0){const f=q.get(y);f&&(i.dx=f.dx,i.dy=f.dy,i.data.isVisible=f.isVisible??!0,f?.connectorPoints&&f.connectorPoints.length>=(O?3:2)?i.connector.points=f.connectorPoints:i.connector.points=O?$a(i.dx,i.dy):[[0,0],[0,0]],u.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&b.push(i)}),ce.editMode(u.annotation.annotationDraggable&&Y).accessors({x:function(i){const y=i.x.type||i.type;if(pe.includes(y))switch(y){case re.StackColumnChart:return e(i.x.dimension)+Z(i.x.stacklegend)-(A-Z.bandwidth())/2;case re.StackAreaChart:case re.LineChart:case re.AreaChart:return e(i.x.dimension)}else{if(i.x.legend){const f=i.legendUniqueId.includes("~$~")?i.legendUniqueId.split("~$~")[0]:i.legendUniqueId;return e(i.x.dimension)+Z(f)-(A-Z.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const y=i.type??i.x.type;return i.x.axis==at.primary?Xa(i.y,parseFloat(i.position),r,d,i.prevValue,y):Xa(i.y,parseFloat(i.position),o,d,i.prevValue,y)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,J.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&&(c.selectAll(".annotation-note-label").filter(f=>f.data.x.dimension==i.data.x.dimension&&f.data.x.legend==i.data.x.legend&&f.data.x.type==i.data.x.type&&f.data.prevValue==i.data.prevValue).attr("display","block"),y.data.isVisible=!0)})),b.forEach(y=>{(y.data?.legendUniqueId==i.data.legendUniqueId||y.legendUniqueId==i.data.legendUniqueId)&&(y.dx=i._dx*p/y.width,y.dy=i._dy*S/y.height,y.connectorPoints=i.connector?.points?.map(f=>[...f])||[])}),K){const y=b.map(f=>({legendUniqueId:f.data?.legendUniqueId||f.legendUniqueId,dx:f.dx,dy:f.dy,connectorPoints:f.connector.points||f.connectorPoints||[],isVisible:(f.data?.isVisible||f.isVisible)??!0,width:f.width,height:f.height}));K(y)}c.selectAll(".connector").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[u.annotation.connectorStyle.toLowerCase()]),c.selectAll(`.connector-${ue}`).attr("fill",u.annotation.connectorColor||"#ccc").style("stroke",u.annotation.connectorColor||"#ccc"),c.selectAll(".note-line").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[u.annotation.connectorStyle.toLowerCase()]).filter(y=>y._dx==0&&y._dy==0).remove(),c.selectAll(".annotation-note-label").filter(y=>y.data&&y.data.isVisible).style("display","block")}).on("noteclick",function(i){u.annotation.annotationDraggable&&Y&&(i.data.isVisible=!1,J.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&&(c.selectAll(".annotation-note-label").filter(f=>f.data.x.dimension==i.data.x.dimension&&f.data.x.legend==i.data.x.legend&&f.data.x.type==i.data.x.type&&f.data.prevValue==i.data.prevValue).attr("display","none"),y.data.isVisible=!1)}),c.selectAll(".annotation-note-label").filter(y=>y.data&&!y.data.isVisible).style("display","none"))}).accessorsInverse({x:i=>e.invert(i.x),y:i=>i.x.axis==at.primary?r.invert(i.y):o.invert(i.y)}).notePadding(0).annotations(b),u.plotArea.fitChart||j.selectAll(".annotation-group").remove();let c=fi(j,u,h,xe,ce,ue,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=Xe[u.animation.animationEffect],f=ce.accessors();c.selectAll(".annotation").attr("transform",function(a){const L=f.x(a.data),P=a.data.type||a.type,Q=(a.data?.x?.axis||a.data?.axis)===at.primary?r:o;let be;return P===re.StackColumnChart||P===re.StackAreaChart?be=Q(a.data.prevValue??0):be=Q(0),`translate(${L}, ${be})`}).transition().duration(i).ease(y).attr("transform",function(a){const L=f.x(a.data),P=f.y(a.data);return`translate(${L}, ${P})`})}}}catch(N){throw N}}const Li=(t,e,r)=>{try{let o=[re.PieChart,re.DonutChart].includes(r)?"plotArea":"annotation";return t=e[o].annotationDraggable&&!!1?t??[]:[],t}catch(o){throw o}},di=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},Xa=(t,e,r,o,h,n)=>{try{let l=[re.LineChart,re.StackLineChart,re.StackAreaChart,re.NormalizedStackAreaChart,re.NormalizedStackLineChart,re.StackAreaChart];switch(h||(h=0),e){case 1:let s;switch(n){case re.LineChart:case re.HorizontalBarChart:case re.ColumnChart:case re.AreaChart:case re.StackAreaChart:s=t<0?r(t)+7:r(t)-15;break;case re.StackHorizontalBarChart:case re.NormalizedStackLineChart:case re.StackLineChart:case re.NormalizedStackAreaChart:case re.StackAreaChart:case re.StackColumnChart:s=t<0?r(t)+5:r(t)-15;break;case re.TornadoChart:s=r(t)+r.bandwidth()/2;break;default:s=t<0?r(h)+5:r(t)-15}return s;case 2:return l.includes(n)?r(t):t===0?n==="stack"?"":r(0)-15:r(h+(t-h)/2);case 3:return l.includes(n)?t===-1||t<0?r(t)-10:r(t)+10:n.includes("stack")?t===-1&&h===0?r(0)+10:t===1&&h!==0?r(h)-10:h<0?r(h)+10:h===0&&t<0?r(0)+10:h===0&&t>0?r(0)-10:r(h)-10:t<0?r(0)+10:r(0)-10}}catch(l){throw l}},ea=(t,e,r,o,h,n)=>{try{const l=n?.DataTableData??[];let s=[],x=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){t.dataTableProperties.dataTableAxisLabel?x=mi(h[0],void 0,t):x=0;const m=[...o,...l];t.xAxisLabel.xAxisLabelVisibility=!1;const u=!t.dataTableProperties.disableLegendIcon?35:0;let S=e+r-u;m.forEach((p,H)=>{if(p?.properties?.showInDataTable??!0){let g={data:p.data.filter(G=>h.includes(G.dimension)),properties:{legend:p.properties.alias,color:p.properties.color,markerColor:p.properties.markerColor,markerShape:p.properties.markerShape,lineStyle:p.properties.lineStyle,height:mi(p.properties.alias.includes("~$~")?p.properties.alias.split("~$~")[1]:p.properties.alias,S,t)}};x+=g.properties.height,s.push(g)}})}else x=0,s=[];return s.length==0&&(x=0,s=[],t.dataTableProperties.dataTable=!1),{dataTable:s,dataTableHeight:x}}catch{}},mi=(t,e,r)=>{try{let o=20,h=Tt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily)[0];return o=Tt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily,void 0,h>e&&!r.dataTableProperties.legendsWrapText?e:void 0)[1],o}catch(o){throw o}};function ta(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H,g,G,V,j,K,Z,Y){try{let N=function(f,a,L,P){a===0&&f.append("foreignObject").attr("x",-Z.left).attr("y",xe).attr("class","blankClass").attr("width",Z.left).attr("height",y).append("xhtml:div").style("width",Z.left).style("height",`${y}px`).style("border-width",O?`0px 0px ${E.dataTableAxisLabel?F:0}px 0px`:"0px 0px 0px 0px").style("border-style",O?`solid ${b} ${b} solid`:"solid solid solid solid").style("border-color",O?`black ${J} ${J} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const Q=f.append("foreignObject").attr("x",-Z.left).attr("y",xe+ue).attr("width",Z.left).attr("height",P).append("xhtml:div").style("display","flex").style("justify-content","center").style("align-items","center").attr("class","parentClass").style("flex-wrap","wrap").style("flex-direction","row").style("pointer-events","auto").style("width",oe).style("height",`${P}px`).style("padding-left",E.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>ka(S,a,void 0,q,ce,"width")).style("border-style",()=>ka(S,a,void 0,q,ce,"style")).style("border-color",()=>ka(S,a,void 0,q,ce,"color"));if(!E.disableLegendIcon)switch(u){case re.ColumnChart:case re.StackColumnChart:case re.NormalizedStackColumnChart:Q.append("xhtml:div").style("height","10px").style("width","15px").style("background",L.properties.color).style("border-radius","1px");break;case re.LineChart:case re.StackLineChart:case re.NormalizedStackLineChart:Wi(L,Q,S);break;case re.AreaChart:case re.StackAreaChart:case re.NormalizedStackAreaChart:Hi(L,Q,S);break}const be=L.properties.legend,Le=S?.legends?.legendColorMode=="1"?L?.properties?.color:S?.legends?.legendSelectedUnicolor,Fe=Q.append("xhtml:div").style("max-width",oe).attr("class","legendsColumn").style("text-align","left").style("vertical-align","middle").call(c).style("padding-left","5px").style("white-space","normal").style("overflow-wrap","break-word").style("color",Le??"black").style("width",E.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",be).text(be);E.legendsWrapText&&Fe.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const E=S.dataTableProperties,z=E.dataTableFontStyle,q=g.length,ce=o.length,ne=V[0]?V[0]:0,oe=l.step(),xe=Y-A,Ae=2;let pe=20,ue=0;const O=S.dataTableOuterBorder.borderButtonVisibility,J=S.dataTableOuterBorder.lineColor,F=S.dataTableOuterBorder.lineWidth,b=S.dataTableOuterBorder.lineStyle,k=f=>f===0?oe+Ae+ne/2:f===q-1?oe+Ae-ne/2:oe,d=f=>_e(u.includes("100stack")?f.TooltipMeasure/f.TotalMeasure:f.TooltipMeasure||f.value,E.dataTableDisplayUnits,E.dataTableNumberFormat,E.dataTableDecimalPrecision),c=f=>f.style("font-size",E.dataTableFontSize+"px").style("font-family",E.dataTableFontFamily).style("font-style",z.includes("Italic")?"Italic":"").style("text-decoration",z.includes("Underline")?"Underline":"").style("font-weight",z.includes("Bold")?"Bold":"");T.selectAll("#dataTableG"+K).remove();const i=r.append("g").attr("id","dataTableG"+K);let y=0;E.dataTableAxisLabel&&(y=mi(g[0],void 0,S),pe=y),o.forEach((f,a)=>{ue+=!E.dataTableAxisLabel&&a===0?0:pe,pe=f.properties.height,E.dataTableLegends&&N(i,a,f,pe);const L=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+K+" .foreignObject").data(()=>f.data).enter().filter(P=>l(P.dimension)).append("g").attr("fill",we.transparent).attr("transform",(P,ae)=>`translate(${ae===0?0:l(P.dimension)-oe/2},0)`);a===0&&E.dataTableAxisLabel&&L.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",xe).attr("id",(P,ae)=>ae).attr("width",(P,ae)=>k(ae)).attr("height",`${y}px`).append("xhtml:div").style("width",(P,ae)=>k(ae)).style("height",`${y}px`).style("border-width",(P,ae)=>ka(S,ae,void 0,q,ce,"width","colHeaders")).style("border-style",(P,ae)=>ka(S,ae,void 0,q,ce,"style","colHeaders")).style("border-color",(P,ae)=>ka(S,ae,void 0,q,ce,"color","colHeaders")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-left","3px").call(c).style("color",S.xAxisLabel.xAxisLabelColor??"black").attr("title",P=>j.get(Array.isArray(P.dimension)?P.dimension[0]:P.dimension)).text(P=>j.get(Array.isArray(P.dimension)?P.dimension[0]:P.dimension)),L.append("foreignObject").attr("x",0).attr("y",xe+ue).attr("width",(P,ae)=>k(ae)).attr("height",pe).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(P,ae)=>k(ae)).style("height",`${pe}px`).style("line-height",`${pe}px`).style("border-width",(P,ae)=>ka(S,a,ae,q,ce,"width")).style("border-style",(P,ae)=>ka(S,a,ae,q,ce,"style")).style("border-color",(P,ae)=>ka(S,a,ae,q,ce,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(c).style("color",E.dataTableLabelColor).attr("title",P=>d(P)).text(P=>d(P))})}catch(N){throw N}}function ka(t,e,r,o,h,n,l){try{const s=t.dataTableOuterBorder,x=t.dataTableInnerBorder,m=s.borderButtonVisibility,A=x.horizontalBorderLineButton,u=x.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,p={w:s.lineWidth,s:s.lineStyle,c:s.lineColor},H={w:x.horizontalBorderLineWidth,s:x.horizontalBorderLineStyle,c:x.horizontalBorderLineColor},g={w:x.verticalBorderLineWidth,s:x.verticalBorderLineStyle,c:x.verticalBorderLineColor},G={w:"0",s:"solid",c:"black"},V=m?p:G,j=A?H:G,K=u?g:G,Z=o-1,Y=h-1;let N=G,E=G,z=G,q=G;switch(l?(N=V,z=j,q=e===0?V:G,E=e===Z?V:K):r===void 0?(q=V,E=G,N=e===0&&!S?V:G,z=e===Y?V:j):(N=e===0&&!S?V:G,z=e===Y?V:j,q=r===0?K:G,E=r===Z?V:K),n){case"width":return`${N.w}px ${E.w}px ${z.w}px ${q.w}px`;case"style":return`${N.s} ${E.s} ${z.s} ${q.s}`;case"color":return`${N.c} ${E.c} ${z.c} ${q.c}`}}catch(s){throw s}}function pt(t,e,r){let o=[];for(let h=0;h<t.length;h++){const n=t[h];let l={},s=0,x=0,m=0;for(let A=0;A<e.length;A++){let u=e[A].data.find(S=>S.dimension===t[h])?.value||0;l[e[A].properties.legend]=u,s=s+(r?Math.abs(u):u),x+=u>0?u:0,m+=u}l.total=s,l.dimension=n,l.absoluteTotal=x,l.displayTotal=m,o.push(l)}return o}function aa(t,e,r,o,h,n,l,s){try{let x=r.seriesLabel.seriesLabelApplySeries,m=r.seriesLabel.seriesLabelPosition,A=[],u=o[0].legend,S=Tt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily);return o.forEach(p=>{let H=!1;if(x=="1"?H=!0:H=p.properties.seriesLabelVisibility,H){let g={},G=m=="Right"?p.data[p.data.length-1]:p.data[0],V=s?G.value>0?G[1]:G[0]:G.value;p.properties.axis==at.primary||!h?g.yPosition=e(V):n&&h&&(g.yPosition=h(V)),(g.yPosition<0||g.yPosition>l)&&(H=!1),g.yPosition=g.yPosition-S[1]/2,g.isVisible=H,g.seriesValue=p.properties.alias,g.height=S[1],g.width=S[0];let j=!1;A.length>0&&A.some(K=>{j||(j=Fl(K,g))}),H&&!j&&A.push(g)}else return}),u="",A.forEach(p=>{p.seriesValue.length>u.length&&(u=p.seriesValue)}),S=Tt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,A.forEach(p=>{p.height=S[1],p.width=S[0],p.xPosition=m=="Right"?t+(n?10:0)-S[0]:5}),{labelArray:A,heightWidth:S}}catch(x){throw x}}function Va(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H,g,G,V,j,K,Z){try{let Y=x.annotation.annotationType??"1";if(x.annotation.annotationVisibility){let N=[Y=="1"?"connector":""],E=[],z=new Map,q=n.annotation(),ce=x.annotation.connectorType,ne=x.annotation.annotationVisibility,oe=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",xe=x.annotation.annotationFontStyle,Ae=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";const pe=x.annotation.connectorType?.toLowerCase()==="curve";let ue=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates));ue=Li(ue,x,m);let O=[],J=[];switch(ue.length!=0&&ue.forEach(d=>{d.dx=d.dx*u/d.width,d.dy=d.dy*A/d.height,d.width=u,d.height=A}),ne){case"2":t.forEach(d=>E.push(d[0]));break;case"3":t.forEach(d=>E.push(d[d.length-1]));break;case"4":t.forEach(d=>E.push(d[0])),t.forEach(d=>E.push(d[d.length-1]));break;case"1":for(let d=0;d<t[0].length;d++)t.forEach(c=>E.push(c[d]));break;case"5":break;case"6":t.forEach(d=>{switch(d[0]?.properties?.annotation?.toString()){case"1":for(let i=0;i<t[0].length;i++)E.push(d[i]);break;case"2":break;case"3":E.push(d[0]);break;case"4":E.push(d[t[0].length-1]);break;case"5":E.push(d[0]),E.push(d[t[0].length-1]);break}});break}let F=0;E.forEach((d,c)=>{F<d.Measure&&(F=d.Measure)});let b=F*.1;x.annotation.annotationHideZeroValues&&(E=E.filter(d=>(d[1]<0&&d[0]<0?d[0]-d[1]:d[1]===0&&d[0]<0?d[1]+d[0]:d[1]-d[0])!==0)),E.forEach((d,c)=>{let i={note:{label:d[1]-d[0]>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(d[1]-d[0]/1e9)+"B":_e(d[1]<0&&d[0]<0?d[0]-d[1]:d[1]===0&&d[0]<0?d[1]+d[0]:d[1]-d[0],x.annotation.annotationDisplayUnits||x.plotArea.plotAreaDisplayUnits,x.annotation.annotationNumberFormat,x.annotation.annotationDecimalPrecision),align:Z?d.data.labelPosition==2?"middle":"start":"middle"},data:Z?{y:d.data.dimension,x:d[1]>0?d[1]:d[0],prevValue:d[0]>=0?d[0]:d[1],position:x.annotation.annotationPosition=="4"?d.data.labelPosition:JSON.parse(x.annotation.annotationPosition),currentLegend:d.key.includes("~$~")?d.key.split("~$~")[1]:d.key,isVisible:!0,hoverId:d.properties.alias?Wa(d.properties.alias):Wa(d.key),legendUniqueId:d.properties.legendUniqueId+"~$~"+d.data.dimension+"~$~"+(d.key.includes("~$~")?d.key.split("~$~")[1]:d.key)+"~$~"+(d[1]>0?d[1]:d[0])}:{x:d.data.dimension,y:d[1]>0?d[1]:d[0],prevValue:d[0]>=0?d[0]:d[1],position:x.annotation.annotationPosition=="4"?d.data.labelPosition:JSON.parse(x.annotation.annotationPosition),currentLegend:d.key.includes("~$~")?d.key.split("~$~")[1]:d.key,isVisible:!0,hoverId:d.properties?.alias?Wa(d.properties.alias):Wa(d.key),legendUniqueId:d.properties.legendUniqueId+"~$~"+d.data.dimension+"~$~"+(d.key.includes("~$~")?d.key.split("~$~")[1]:d.key)+"~$~"+(d[1]>0?d[1]:d[0])},dx:0,dy:0,connector:{end:Ae,curve:si[x.annotation.connectorCurve],points:pe?$a(0,0):[[0,0],[0,0]]},disable:N,subject:{height:15,width:15},color:d.properties&&d.properties[oe]?d.properties[oe]:d.data.labelColor,type:di(n,parseFloat(Y)),height:A,width:u};p.includes(d.data.dimension)&&El(H,S,Z,d,r)&&O.push(i)}),O=Rt(O,x,d=>Z?d.data.x-d.data.prevValue:d.data.y-d.data.prevValue),ue.length===0?(ue=O,z=new Map(ue.map(d=>[d.data.legendUniqueId,{measure:Z?d.data.x:d.data.y,dimension:Z?d.data.y:d.data.x,legendUniqueId:d.data.legendUniqueId,dx:d.dx,dy:d.dy,connectorPoints:d.connector?.points||[],isVisible:d.data.isVisible??!0,width:d.width,height:d.height}]))):z=new Map(ue.map(d=>[d.legendUniqueId,d])),O.forEach(d=>{const c=d.data.legendUniqueId;if(ue.length!=0){const i=z.get(c);i&&(d.dx=i.dx,d.dy=i.dy,d.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(pe?3:2)?d.connector.points=i.connectorPoints:d.connector.points=pe?$a(d.dx,d.dy):[[0,0],[0,0]])}J.push(d)}),q.editMode(x.annotation.annotationDraggable&&K).accessors({x:function(d){return Z?Ei(x,d.x,parseFloat(d.position),r,b,d.prevValue,m):e(d.x)+e.bandwidth()/2},y:function(d){return Z?e(d.y)+e.bandwidth()/2:Xa(d.y,parseFloat(d.position),r,b,d.prevValue,m)}}).on("dragend",function(d){if(d.data.isVisible||(d.data.isVisible=!0,ue.forEach(c=>{c.data.x==d.data.x&&c.data.y==d.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==d.data.x&&i.data.y==d.data.y).attr("display","block"),c.data.isVisible=!0)})),J.forEach(c=>{(c.data?.legendUniqueId==d.data.legendUniqueId||c.legendUniqueId==d.data.legendUniqueId)&&(c.dx=d._dx*u/c.width,c.dy=d._dy*A/c.height,c.connectorPoints=d.connector?.points?.map(i=>[...i])||[])}),V){const c=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}));V(c)}k.selectAll(".connector").attr("hoverId",c=>c.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]),k.selectAll(`.connector-${Ae}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",c=>c.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]).filter(c=>c._dx==0&&c._dy==0).remove(),k.selectAll(".annotation-note-label").filter(c=>c.data&&c.data.isVisible).style("display","block")}).on("noteclick",function(d){x.annotation.annotationDraggable&&K&&(d.data.isVisible=!1,ue.forEach(c=>{c.data.x==d.data.x&&c.data.y==d.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==d.data.x&&i.data.y==d.data.y).attr("display","none"),c.data.isVisible=!1)}),k.selectAll(".annotation-note-label").filter(c=>c.data&&!c.data.isVisible).style("display","none"))}).accessorsInverse({x:d=>e.invert(d.x),y:d=>r.invert(d.y)}).notePadding(0).annotations(J),G.selectAll(".annotation-group").remove();let k=fi(G,x,h,xe,q,Ae,Z);if(x.animation?.animationEnabled){const d=x.animation.animationDuration,c=Xe[x.animation.animationEffect],i=q.accessors();if(m===re.StackLineChart||m===re.NormalizedStackLineChart){const f=e.range?e.range():[0,1],a=Math.min(f[0],f[1]),L=Math.max(f[0],f[1])-a,P=(ae,Q=100)=>{for(let be=0;be<=Q;be++){const Le=be/Q;if((c??T.easeLinear)(Le)>=ae)return Le}return 1};k.selectAll(".annotation").attr("opacity",0).each(function(ae){const Q=i.x(ae.data)??a,be=L>0?Math.max(0,Math.min(1,(Q-a)/L)):0,Le=P(be)*d;T.select(this).transition().delay(Le).duration(0).attr("opacity",1)})}else k.selectAll(".annotation").attr("transform",function(f){if(Z){const a=r?r(0):0,L=i.y(f.data);return`translate(${a}, ${L})`}else{const a=i.x(f.data),L=r?r(0):0;return`translate(${a}, ${L})`}}).transition().duration(d).ease(c).attr("transform",function(f){const a=i.x(f.data),L=i.y(f.data);return`translate(${a}, ${L})`})}}}catch(Y){throw Y}}function El(t,e,r,o,h){const n=h(o[1]>0?o[1]:o[0]);return r?n>=0&&n<=e:n<=t&&n>=0}const fi=(t,e,r,o,h,n,l)=>{t.selectAll(".annotation-group").remove();let s=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.annotation.annotationColor).style("font-family",e.annotation.annotationFontFamily).style("font-size",e.annotation.annotationFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(h);return s.selectAll("rect").style("visibility","hidden"),s.selectAll(".annotation-subject").remove(),s.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.annotation.connectorStyle.toLowerCase()]).style("visibility",x=>(l?parseFloat(x.data.x)==0:parseFloat(x.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(`.connector-${n}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",x=>(l?parseFloat(x.data.x)==0:parseFloat(x.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.annotation.connectorStyle.toLowerCase()]).filter(x=>x._dx==0&&x._dy==0).remove(),s.selectAll(".connector-end").filter(x=>x.connector.end=="dot"&&x._dx==0&&x._dy==0).remove(),s.selectAll(".annotation-note-label").filter(x=>x.data&&!x.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&s.selectAll(".annotation-note-content").attr("transform",function(){const m=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(m)return`translate(${l?0:parseFloat(m[1])}, 0)`}),s.selectAll("text").style("text-anchor",x=>l&&x.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==we.white?e.annotation.annotationColor:"none"),s.selectAll("tspan").attr("hoverId",x=>x.data.hoverId?x.data.hoverId:x.data.currentLegend.replaceAll(" ","-")).style("visibility",x=>parseFloat(x.data.y)==0&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s},Ya=(t,e,r,o,h,n)=>{try{let l=t.yAxisLabel.yAxisLabelFontStyle,s="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${o})`).attr("height",r+10).attr("width",h).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==we.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const x=e.append("g").call(n).attr("transform",`translate(0,${o})`);x.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),x.selectAll("text").style("text-anchor",s=="rotate(0)"?"middle":"end").attr("dx",s=="rotate(0)"?".2em":"-.1em").attr("dy",s=="rotate(0)"?"1em":".15em").attr("transform",s).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==we.white?t.yAxisLabel.yAxisLabelColor:"none").style("font-size",t.yAxisLabel.yAxisLabelFontSize).style("font-family",t.yAxisLabel.yAxisLabelFontFamily).style("font-style",t.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",t.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),x.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.yAxisLabel.yAxisColor).attr("stroke-width",t.yAxisLabel.yAxisWidth?t.yAxisLabel.yAxisWidth:t.plotArea.plotAreaBorderThickness)}catch(l){throw l}};function Rl(t,e,r,o,h,n,l,s){return t?`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
23
+ <%s key={someKey} {...props} />`,d,m,P,m),w[m+d]=!0)}if(m=null,c!==void 0&&(r(c),m=""+c),l(C)&&(r(C.key),m=""+C.key),"key"in C){c={};for(var ie in C)ie!=="key"&&(c[ie]=C[ie])}else c=C;return m&&s(c,typeof p=="function"?p.displayName||p.name||"Unknown":p),L(p,m,y,i,h(),c,f,a)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===b&&p._store&&(p._store.validated=1)}var S=Te,b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),K=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),re=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,he=Array.isArray,Le=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(p){return p()}};var pe,ue={},O=S["react-stack-bottom-frame"].bind(S,n)(),q=Le(o(n)),w={};ja.Fragment=g,ja.jsx=function(p,C,c,d,i){var y=1e4>re.recentlyCreatedOwnerStacks++;return A(p,C,c,!1,d,i,y?Error("react-stack-top-frame"):O,y?Le(o(p)):q)},ja.jsxs=function(p,C,c,d,i){var y=1e4>re.recentlyCreatedOwnerStacks++;return A(p,C,c,!0,d,i,y?Error("react-stack-top-frame"):O,y?Le(o(p)):q)}})()),ja}var Ci;function Al(){return Ci||(Ci=1,process.env.NODE_ENV==="production"?ri.exports=bl():ri.exports=gl()),ri.exports}var $e=Al();function be(t,e,r){console.error(t,e,r)}var nt=(t=>(t.rectangle="rectangle",t.circle="circle",t.hollowCircle="hollowCircle",t.areaWithLine="areaWithLine",t.line="line",t.custom="custom",t.none="none",t))(nt||{}),Et=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))(Et||{}),yt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(yt||{}),sa=(t=>(t.butt="butt",t.round="round",t.square="square",t))(sa||{}),at=(t=>(t.primary="Primary",t.secondary="Secondary",t))(at||{}),Vt=(t=>(t.visible="visible",t.hidden="hidden",t))(Vt||{});const ba="20,10,5,5,5,10",Ll={1:"",2:T.curveLinear,3:T.curveStep},ml={1:dt.annotationLabel,2:dt.annotationLabel,3:dt.annotationCallout,4:dt.annotationCalloutElbow,5:dt.annotationCalloutCurve};var Be=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(Be||{}),Ja=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(Ja||{}),ha=(t=>(t.percentage=",.0%",t.general="",t.scientific=".2n",t.currency_USD=".2$",t.currency_CAD=".2c",t.currency_EUR=".2ē",t.currency_CHF=".2ch",t.currency_UK=".2£",t.currency_INR=".2₹",t.commaSeparated=",",t))(ha||{}),ni=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(ni||{}),$t=(t=>(t.start="1",t.middle="2",t.end="3",t))($t||{}),va=(t=>(t.top="1",t.bottom="2",t))(va||{});const ga={none:"1",discrete:"2",colorTheme:"3"},Wt={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var Za=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(Za||{});const fl={singleColor:"2",multiColor:"1"},ne={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Fa=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Fa||{}),wa=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(wa||{});const Yt={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var De=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(De||{});const qe="Calibri";var pi=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(pi||{}),Aa=(t=>(t.total="Total",t.base="base",t.dimensionTotal="dimensionTotal",t.up="up",t.down="down",t))(Aa||{});const Xe={easeLinear:T.easeLinear,easeCubicIn:T.easeCubicIn,easeCubicOut:T.easeCubicOut,easeCubicInOut:T.easeCubicInOut,easeBounceOut:T.easeBounceOut,easeElasticOut:T.easeElasticOut,easeBackOut:T.easeBackOut},Mi={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:De.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:De.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:qe,chartTitleFontStyle:[],chartTitleColor:De.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:De.black,xAxisColorInverted:De.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:qe,xAxisLabelFontStyle:[],xAxisLabelColor:De.black,xAxisNumberFormat:"MMM-YY",xAxisQuarterFormat:"Long",xAxisDisplayUnits:"None",xAxisDisplayUnitsLabel:!1,xAxisLabelRotation:90,xAxisDateFormat:"DD-MM-YYYY",xAxisLabelDecimalPrecision:"2",xAxisLabelText:"",xAxisLabelDynamicText:"",xAxisLabelHTML:"",xAxisPosition:"0",xAxisBackgroundColor:"",xAxisIntervalsVisibility:!1,xAxisMinText:"",xAxisMaxText:"",xAxisIntervalText:"",hideZeroValues:!1,xAxisSortBy:"0",customSort:[],labelTextWrap:!0,multiLineLabelWrap:!1,maxXAxisLabelWidth:100},xAxisScale:{absoluteXAxisScale:!1,customScale:"0"},xAxisTitle:{xAxisTitleVisibility:!0,xAxisTitleFontSize:"11",xAxisTitleFontFamily:qe,xAxisTitleFontStyle:[],xAxisTitleColor:De.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:De.transparent,yAxisColorInverted:De.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:qe,yAxisLabelFontStyle:[],yAxisLabelColor:De.black,yAxisNumberFormat:",",yAxisDisplayUnits:"Auto",yAxisLabelRotation:90,yAxisDisplayUnitsLabel:!1,yAxisDateFormat:"DD-MM-YYYY",yAxisLabelDecimalPrecision:"0",yAxisLabelText:"",yAxisLabelDynamicText:"",yAxisLabelHTML:"",yAxisPosition:"0",yAxisBackgroundColor:"",yAxisIntervalsVisibility:!1,yAxisMinText:"",yAxisMaxText:"",yAxisIntervalText:"",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:qe,yAxisTitleFontStyle:[],yAxisTitleColor:De.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:De.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:qe,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:De.black,secondaryYAxisNumberFormat:",",secondaryYAxisDisplayUnits:"None",secondaryYAxisDisplayUnitsLabel:!1,secondaryYAxisSyncWithPrimaryLabel:!1,secondaryYAxisDateFormat:"DD-MM-YYYY",secondaryYAxisLabelDecimalPrecision:"2",secondaryYAxisBackgroundColor:"#e5e5e5",secondaryYAxisIntervalsVisibility:!1,secondaryYAxisMinText:"",secondaryYAxisMaxText:"",secondaryYAxisIntervalText:""},secondaryYAxisTitle:{secondaryYAxisTitleVisibility:!0,secondaryYAxisTitleFontSize:"11",secondaryYAxisTitleFontFamily:qe,secondaryYAxisTitleFontStyle:[],secondaryYAxisTitleColor:De.black,secondaryYAxisTitleText:"Measure",secondaryYAxisDynamicTitleText:"",secondaryYAxisTitleHTML:""},legends:{legendVisibility:!0,primaryTitleVisibility:!0,primaryTitleText:"Primary Axis",primaryTitleFontSize:"11",primaryTitleFontFamily:qe,primaryTitleFontStyle:[],secondaryTitleVisibility:!0,secondaryTitleText:"Secondary Axis",secondaryTitleFontSize:"11",secondaryTitleFontFamily:qe,secondaryTitleFontStyle:[],legendPosition:"Top",legendAlignment:"Top",legendAlignmentTopBottom:"Start",legendFontSize:"11",legendFontFamily:qe,legendFontStyle:[],legendBorder:!1,legendBorderThickness:"1",legendBorderColor:De.black,vennLabelColor:De.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:De.black},plotArea:{plotAreaColor:De.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:De.black,plotAreaGapWidth:"50",plotAreaSeriesWidth:"50",plotAreaBarWidth:"50",gridLinesVisibility:!0,gridLinesHorizontal:!0,gridLinesVertical:!1,ticksHeight:"100",ticksWidth:"100",gridLinesColor:"#ccc",xCoordinate:"None",yCoordinate:"None",dataLabels:!0,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsforMaps:!1,dataLabelPosition:"1",dataLabelSize:"12",dataLabelValueColor:De.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:De.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:qe,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:De.black,dataLabelNameFontSize:"11",dataLabelNameFontFamily:qe,dataLabelNameFontStyle:[],fillOpacity:"0.7",innerRadius:"50",cornerRadius:"0",axialGrid:!0,arcPadding:"5",axialTicks:"10",arcTransition:!0,innerRadiusForSpeedometer:"30",ticks:"3",pointerColor:De.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:De.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:De.black,opacity:"0.5",plotAreaCalculatedHigh:"#00FF00",plotAreaCalculatedLow:"#FF0000",plotAreaDataLabel:"1",plotAreaDisplayUnits:"None",plotAreaHideLineAndMarkers:!0,dataLabelsOptions:"1",xscaleposition:"1",yscaleposition:"1",numberOfBubbles:!1,totalAlias:!1,totalAliasText:"",refLineBorderThickness:"1",refLineBorderColor:De.black,flipPyramid:!1,opacityforProgressScale:"0.2",opacityforProgressGoal:"1",lineStyle:"Solid",lineWidth:"2",fitChart:!0,scaleFactor:"5",rotation:"0",intersectionLabelVisibility:!1,intersectionValueVisibility:!1,dataLabelsCoordinates:[],hideInsignificantValue:!1,sortBy:"default",chartDirection:"right",plotAreaRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},heatMap:{showHeatMap:!1,heatMapMinColor:"#FF0000",heatMapMaxColor:"#7cfc00"},marker:{markerVisibility:!0,markerSize:"1",markerShape:"Circle",lineWidth:"1.5",markerColor:De.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:De.black,annotationFontSize:"9",annotationFontFamily:qe,annotationFontStyle:[],annotationDecimalPrecision:"2",annotationDisplayUnits:"None",annotationBoxVisibility:[],annotationHideZeroValues:!0,annotationShowHiddenValues:!0,annotationSetLabelColor:"1",annotationRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},total:{totalVisibility:!1,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsCoordinates:[],totalNumberFormat:",",totalColor:De.black,totalFontSize:"9",totalFontFamily:qe,totalFontStyle:[],totalConnectorType:"None",totalDecimalPrecision:"2",totalPosition:"1",totalAlignment:"1",totalHideZeroValues:!0,totalDisplayUnits:"None",editTotalTextToggle:!1,editTotalText:"Total",showTotalLabel:!0},toolTip:{toolTipVisibility:!0,toolTipTheme:"Light",toolTipNumberFormat:",",toolTipNumberFormatProgress:",.0%",toolTipDecimalPrecision:"2",toolTipLabelText:"",toolTipDisplayUnits:"None",toolTipLabelDynamicText:""},nodes:{nodesColor:"#d9d7d7",nodesSingleColor:!1,nodesFillOpacity:"1",spacing:"15",sankeyNodeWidth:"10",sankeyChartType:"Left",curviness:"0.5",nodesBorderVisibility:!0,nodesBorderThickness:"1",nodesBorderColor:De.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:qe,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:De.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:De.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:De.black,nodesDisplayUnits:"None",percentageVisibility:!1,nodesLabelOverflow:!0},links:{linksColor:"Source",linksFillOpacity:"0.5"},bins:{binsGapWidth:"0",binsFillOpacity:"0.5",binsCalculation:"Automatic",binsCalculationValue:"3",binsBorderVisibility:!1,binsBorderThickness:"1",binsBorderColor:De.black,binsBorderOpacity:"0.5"},connector:{connectorVisibility:"2",connectorFollow:"1",connectorStepSize:"1",connectorExclude:[],connectorCustomRange:[],connectorFontSize:"11",connectorFontFamily:qe,connectorFontStyle:[],connectorKPI:"1",connectorNumberFormat:",",connectorLineThickness:"1",connectorLineColor:"#080808",connectorMarkerColor:De.black,connectorFontColor:De.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:De.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:qe,footerNoteFontStyle:[],footerNoteFontColor:De.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:De.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:De.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:qe,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:De.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:qe,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:De.black,pointerValueDecimalPrecision:"2",displayUnits:"None"},text:{textFontFamily:qe,textSpacing:"5",textRotation:90},colorScale:{showColor:"1",startColor:"#c1d8f3",endColor:"#4c6ba5",division1:"#c1d8f3",division2:"#b3cbed",division3:"#a4bfe8",division4:"#96b2e2",division5:"#88a6dc",division6:"#7999d7",division7:"#6b8dd1",division8:"#5c80cb",division9:"#4e74c6",division10:"#4c6ba5"},customScaling:{warningTextDummyNode:!1,customScalingtoggle:!1,division1:"#b3b3b3",share1:"",division2:"#b3b3b3",share2:"",division3:"#b3b3b3",share3:"",division4:"#b3b3b3",share4:"",division5:"#b3b3b3",share5:"",division6:"#b3b3b3",share6:"",division7:"#b3b3b3",share7:"",division8:"#b3b3b3",share8:"",division9:"#b3b3b3",share9:"",division10:"#b3b3b3",share10:""},colorScaleForMaps:{defaultColor:"#808080",showColorForMaps:"1",startColorForMaps:"#c1d8f3",endColorForMaps:"#4c6ba5"},pointerValue:{showPointerValue:!1,pointerValueNumberFormat:",",pointerValueDecimalPrecision:"2",connectorKPIforSpeedometer:"1",kpiAlias:!1,kpiAliasText:"",pointerValueDisplayUnits:"None",pointerValueFontSize:"11",pointerValueFontFamily:qe,pointerValueFontStyle:[],pointerValueColor:De.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:De.black,bubbleBorderColor:De.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:De.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:De.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:qe,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:De.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:qe,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:De.black,dataTableAxisLabel:!0,dataTableLegends:!0,disableLegendIcon:!0,legendsWrapText:!1},dataTableOuterBorder:{borderButtonVisibility:!0,lineStyle:"solid",lineColor:"#d9d9d9",lineWidth:"1"},dataTableInnerBorder:{verticalBorderLineButton:!0,verticalBorderLineStyle:"solid",verticalBorderLineColor:"#d9d9d9",verticalBorderLineWidth:"1",horizontalBorderLineButton:!0,horizontalBorderLineStyle:"solid",horizontalBorderLineColor:"#d9d9d9",horizontalBorderLineWidth:"1"},chartPadding:{paddingArrayLTRB:[0,0,0,0]},statisticalTest:{zTest:!1,runZTest:[],zTestInputData:[]},cjsOptions:{cjsTension:0,cjsBorderRadius:0},animation:{animationEnabled:!1,animationDuration:1500,animationEffect:"easeCubicOut"}},Ht={top:0,right:0,bottom:0,left:0};var le=(t=>(t.WaterfallChart="WaterfallChart",t.StackLineChart="StackLineChart",t.NormalizedStackLineChart="NormalizedStackLineChart",t.LineChart="LineChart",t.ColumnChart="ColumnChart",t.StackColumnChart="StackColumnChart",t.AreaChart="AreaChart",t.PieChart="PieChart",t.SankeyChart="SankeyChart",t.DonutChart="DonutChart",t.HorizontalBarChart="HorizontalBarChart",t.StackAreaChart="StackAreaChart",t.NormalizedStackAreaChart="NormalizedStackAreaChart",t.Treemap="Treemap",t.StackHorizontalBarChart="StackHorizontalBarChart",t.NormalizedStackColumnChart="NormalizedStackColumnChart",t.NormalizedStackHorizontalBarChart="NormalizedStackHorizontalBarChart",t.ScatterChart="ScatterChart",t.CustomColumnChart="CustomColumnChart",t.customBarChart="CustomBarChart",t.ColumnHistogramChart="ColumnHistogramChart",t.HorizontalHistogramChart="HorizontalHistogramChart",t.Maps="Maps",t.TornadoChart="TornadoChart",t.PieofPie="PieofPie",t.WordCloud="WordCloud",t.BubbleChart="BubbleChart",t.VennChart="VennChart",t.Speedometer="Speedometer",t.LayeredColumnChart="LayeredColumnChart",t.LayeredHorizontalBarChart="LayeredHorizontalBarChart",t.OrganizationChart="OrganizationChart",t.PyramidChart="PyramidChart",t.ProgressChart="ProgressChart",t.RadialBarChart="RadialBarChart",t.CombinationLine="CombinationLine",t.CombinationArea="CombinationArea",t.CombinationStackArea="CombinationStackArea",t.TornadoDefaultEntry="defaultEntry",t.DotPlot="DotPlot",t))(le||{});const si={1:"",2:T.curveLinear,3:T.curveStep},Tl=[le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart],Si=[le.PieChart,le.PieofPie,le.DonutChart,le.PyramidChart,le.OrganizationChart,le.VennChart,le.ProgressChart,le.Maps,le.WordCloud,le.SankeyChart,le.Speedometer,le.RadialBarChart];function wt(t,e,r,o,h){var n=document.createElement("div");n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.fontSize=e==null?"":e+"px",n.style.fontFamily=r??"",n.style.margin="0",n.style.padding="1px",n.style.border="none",h?(n.style.width=h+"px",n.style.whiteSpace="normal",n.style.overflowWrap="break-word"):n.style.whiteSpace="nowrap",n.innerHTML=t,document.body.appendChild(n);var l=n.getBoundingClientRect(),s=l.width,x=l.height;return o!=null?(n.style.transform=`rotate(${o}deg)`,l=n.getBoundingClientRect(),n.remove(),[s,x,l.width,l.height]):(n.remove(),[l.width,l.height])}function vl(t,e){let r=t.dataTableProperties&&t.dataTableProperties.dataTable,o=r?e*7<50?50:e*7>100?100:e*7:0;return r&&o<30&&(o=30),o}function bi(t,e,r,o,h,n,l,s,x,L,A,u,S){let b=n.dataTableProperties&&n.dataTableProperties.dataTable&&n.xAxisLabel.xAxisPosition=="0"&&!S,_=!1;//!formatOptions.plotArea.fitChart;
24
+ let g=t<200?200:S?e:t,H=e<200?200:S?t:e,D=g*.15*.8,j=Bl(l,n),K=D<j[0]+10?D:j[0]+10,J=u?gt(n.xAxisLabel.xAxisNumberFormat,s).map(p=>p):s,U=J?J[0]+"":"",V=U.length;J&&J.forEach(p=>{p=p+"";let C=p.trim()?.length||0;C>V&&(V=C,U=p.trim())});let N=wt(U,n.xAxisLabel.xAxisLabelFontSize,n.xAxisLabel.xAxisLabelFontFamily,n.xAxisLabel.xAxisLabelRotation),$=N[0]+5,X=N[3]+10,se;n.xAxisLabel.labelTextWrap?n.xAxisLabel.multiLineLabelWrap?se=n.xAxisLabel.maxXAxisLabelWidth:se=X<H*.15?X:H*.15:se=X;let re=n.xAxisTitle.xAxisTitleVisibility?n.xAxisTitle.xAxisDynamicTitleText.length!==0?wt(n.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:wt(n.xAxisTitle.xAxisTitleText,"13",qe)[1]:b?5:0;re=re>H*.1?H*.1:re;let oe=b?0:n.xAxisLabel.xAxisLabelVisibility?se:0,he=n.yAxisTitle.yAxisTitleVisibility?n.yAxisTitle.yAxisDynamicTitleText.length!==0?wt(n.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:wt(n.yAxisTitle.yAxisTitleText,"13",qe)[1]:0;he=he>g*.1?g*.1:he;const Le=r*1.1,pe=h*1.1;let ue=n.yAxisLabel.yAxisLabelVisibility?Di(Le,pe,n,!1,A)+5:vl(n,T.max(l,p=>p?.length||0)||0)+10,O=n.secondaryYAxisLabel.secondaryYAxisLabelVisibility?Di(o,x,n,!0,A):0,q=n.secondaryYAxisTitle.secondaryYAxisTitleVisibility?n.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?wt(n.secondaryYAxisTitle.secondaryYAxisTitleHTML,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:wt(n.secondaryYAxisTitle.secondaryYAxisTitleText,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;q=q>g*.1?g*.1:q;let w=n.chartTitle.chartTitleVisibility?n.chartTitle.dynamicTitleText.length!==0?wt(n.chartTitle.chartTitleHTML,void 0,void 0)[1]:wt(n.chartTitle.chartTitleText,"16",qe)[1]:0;return w=w>H*.1?H*.1:w,{width:g,height:H,isChartScrollable:_,legendMargin:K,dimensionHeightWidthArray:N,actualDimesionWidth:$,maxDimensionWidth:X,xTitle:re,xLabel:oe,yTitle:he,yLabel:ue,secondaryYLabel:O,secondaryAxisTitleWidth:q,chartTitleHeight:w}}function kl(t,e,r,o,h,n,l,s,x,L,A,u,S,b){try{const _=b??bi(t,e,r,o,h,n,l,s,x,L,A,u,S),g=S?_.xTitle+_.xLabel:_.yTitle+_.yLabel,H=n.legends.legendPosition,D=n.legends.legendVisibility,j=n.xAxisLabel.xAxisPosition=="1"&&S;let K=0,J=0;const U=L&&!S?_.secondaryYLabel+_.secondaryAxisTitleWidth:0;switch(H){case Be.none:case Be.none:J=15+U,K=g+5;break;case Be.top:J=j?g+5:15+U,K=j?5+U+_.xTitle:g+5;break;case Be.right:J=j?g+5+_.legendMargin:_.legendMargin+U+20,K=j?5+U+_.xTitle+_.legendMargin:g+5;break;case Be.bottom:J=j?g+5:15+U,K=j?5+U+_.xTitle:g+5;break;case Be.left:K=_.legendMargin+g+33,J=15+U;break;default:J=15+U,K=g+5}const V=n.chartPadding?.paddingArrayLTRB;return V&&(K+=V[0],J+=V[2]),n.dataTableProperties&&n.dataTableProperties.dataTable&&A&&!S&&(K=K+35),{left:K,right:J,yLabel:_.yLabel,yTitle:_.yTitle,xLabel:_.xLabel,xTitle:_.xTitle,dimensionHeightWidthArray:_.dimensionHeightWidthArray,chartTitleHeight:_.chartTitleHeight,legendMargin:_.legendMargin,secondaryYLabel:_.secondaryYLabel,secondaryAxisTitleWidth:_.secondaryAxisTitleWidth}}catch(_){throw _}}function Cl(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{const g=b??bi(t,e,r,o,h,n,l,s,x,L,A,u,S),D=n.legends.legendVisibility?n.legends.legendPosition:Be.none,j=_&&!S?12:0,K=S?g.yTitle+g.yLabel:g.xTitle+g.xLabel;let J=0,U=0;switch(D){case Be.none:J=g.chartTitleHeight+5,U=K+5+j;break;case Be.top:J=35+g.chartTitleHeight,U=K+j;break;case Be.right:J=g.chartTitleHeight+5,U=K+5+j;break;case Be.bottom:U=30+K+j,J=g.chartTitleHeight+5;break;case Be.left:J=g.chartTitleHeight+5,U=K+5+j;break;default:J=g.chartTitleHeight+5,U=K+5+j}n.xAxisLabel.xAxisPosition&&!S&&n.xAxisLabel.xAxisPosition=="1"&&(U=U-g.xLabel,J=J+g.xLabel),A&&!S&&(J=J+12);const V=L&&S?g.secondaryYLabel+g.secondaryAxisTitleWidth:0;V&&(J=J+V);const N=n.chartPadding?.paddingArrayLTRB;return N&&(J+=N[1],U+=N[3]),{top:J,bottom:U,chartTitleHeight:g.chartTitleHeight,xAxisRelatedMargin:K,xLabel:g.xLabel,xTitle:g.xTitle}}catch(g){throw g}}function Tt(t,e,r,o,h,n,l,s,x,L,A,u,S,b){try{const _=bi(t,e,r,o,h,n,l,s,x,L,A,u,S),g=kl(t,e,r,o,h,n,l,s,x,L,A,u,S,_),H=Cl(t,e,r,o,h,n,l,s,x,L,A,u,S,_,!0);let D,j=t-g.left-g.right,K=e-H.top-H.bottom,J,U=!1;({visibleBars:D,columnWidth:J,scrollbarVisible:U}=zl(S?K:j,n,b));const V={top:H.top,bottom:H.bottom,left:g.left,right:g.right};if(S){const N=A?30:0;V.right=V.right+N}return n.connector.connectorVisibility!="2"&&b?.chartType==le.StackColumnChart&&(V.top=V.top+20),n.connector.connectorVisibility!="2"&&b?.chartType==le.StackHorizontalBarChart&&(V.right=V.top+20),{margin:V,yLabel:g.yLabel,xLabel:g.xLabel,yTitle:g.yTitle,xTitle:g.xTitle,dimensionHeightWidthArray:g.dimensionHeightWidthArray,chartTitleHeight:g.chartTitleHeight,legendMargin:g.legendMargin,secondaryYLabel:g.secondaryYLabel,secondaryAxisTitleWidth:g.secondaryAxisTitleWidth,visibleBars:D,columnWidth:J,scrollbarVisible:U}}catch(_){throw _}}function vt(t,e,r,o){t.attr("viewBox","0 0 "+e+" "+r);const{chartAreaColor:h,chartAreaBorder:n}=o.chartArea;if(t.style("background-color",h),n){const l=o.chartArea.chartAreaBorderColor,s=o.chartArea.chartAreaBorderThickness,x=o.chartArea.chartAreaBorderStyle.toString(),L=x==="1"?"solid":x==="2"?"dashed":"dotted";t.style("outline",`${s}px ${L} ${l}`).style("outline-offset",`-${s}px`)}else t.style("outline","none").style("outline-offset",null)}const kt=(t,e)=>{let r=T.select(t.current);r.selectAll("*").remove();let o=Fi(Mi,e),h=t.current.getBoundingClientRect(),n=h.width,l=h.height;return{formatOptions:o,svg:r,width:n,height:l}},Qt=(t,e,r)=>{if(!t.dataTableProperties.dataTable)return{formatOptions:t};let o=!1;return e.forEach(h=>{h?.properties?.showInDataTable==!0&&(o=!0)}),r.forEach(h=>{h?.properties?.showInDataTable==!0&&(o=!0)}),o||(t.dataTableProperties.dataTable=!1),{formatOptions:t}};function Fi(t,e){if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const o=t[r],h=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!h||n===void 0){e[r]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const l=wi(o),s=wi(n);l&&s&&Fi(o,n)}),e}function wi(t){return Object.prototype.toString.call(t)==="[object Object]"}function Nt(t,e,r,o,h){parseFloat(t.yAxisLabel.yAxisIntervalText);let n=parseFloat(t.yAxisLabel.yAxisMaxText),l=parseFloat(t.yAxisLabel.yAxisMinText),s=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText),x=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText);if(parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText),t.yAxisLabel.yAxisIntervalsVisibility){t.xAxisLabel.xAxisPosition=="2"&&(t.xAxisLabel.xAxisPosition="0"),l=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let K=t.yAxisLabel.yAxisMaxText;n=K.length>0?parseFloat(K):r,n&&(r=n),parseFloat(t.yAxisLabel.yAxisIntervalText)<r&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else n=void 0,l=void 0;if(t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<h&&(x=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),s=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):h,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(s=void 0,x=void 0),t.secondaryYAxisLabel.secondaryYAxisSyncWithPrimaryLabel){s=void 0,x=void 0;const K=n!==void 0&&!Number.isNaN(n)?n:r,J=Math.max(K,h);r=J,h=J,n!==void 0&&!Number.isNaN(n)&&(n=J)}let L=e?_e(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,A=r?_e(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,u=o?_e(o,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=h?_e(h,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,b=n?_e(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,_=l?_e(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,g=s?_e(s,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,H=x?_e(x,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,D=L<A||L===A?r:e;if(l){let K=_<A?r:l;D=D<K?K:D}if(n){let K=b>L?n:e;D=D<K?K:D}n&&l&&(D=b>_?n:l);let j=u<S?h:o;if(x){let K=H<S?h:x;j=j<K?K:j}if(s){let K=g>S?s:h;j=j<K?K:j}return s&&x&&(j=g>H?s:x),{maxNumberForPrimaryAxis:D,maxNumberForSecondaryAxis:j,customYaxisMaxValue:r,secondaryCustomYaxisMaxValue:h}}function _e(t,e,r,o,h){try{let n,l="",s=o,x;if(e==="Auto")return Ml(t);switch(e!=Ja.none&&(e==Ja.thousands&&(n=1e3,l="K"),e==Ja.millions&&(n=1e6,l="M"),e==Ja.billions&&(n=1e9,l="B"),t=t/n),h&&t<0&&(t=-t),r){case ha.percentage:return x=`.${s}%`,T.format(x)(t);case ha.general:return x=`.${s}f`,T.format(x)(t)+l;case ha.scientific:let L=Number(s);return x=`.${L==0?1:(L+1).toString()}n`,T.format(x)(t)+l;case ha.currency_USD:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"$"+T.format(x)(t)+l;case ha.currency_CAD:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"C$"+T.format(x)(t)+l;case ha.currency_EUR:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"€"+T.format(x)(t)+l;case ha.currency_CHF:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"CHF"+T.format(x)(t)+l;case ha.currency_UK:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"£"+T.format(x)(t)+l;case ha.currency_INR:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"₹"+T.format(x)(t)+l;case ha.commaSeparated:return x=`,.${s}f`,T.format(x)(t)+l;default:return x=".2f",T.format(x)(t)+l}}catch(n){throw n}}function Ml(t){if(t==null||isNaN(t))return"-";const e=Math.abs(t);if(e>=1e9)return T.format(".2s")(t).replace("G","B");if(e>=1e6)return T.format(".2s")(t);if(e>=1e3)return T.format(".2s")(t);if(e>=1){const r=T.format(".2f")(t);return+r===Math.floor(t)?T.format(".0f")(t):r}else return e>=.01?T.format(".2f")(t):e>0?T.format(".2e")(t):"0"}function Di(t,e,r,o,h){try{{let n,l,s=o?r.secondaryYAxisLabel.secondaryYAxisDisplayUnits:r.yAxisLabel.yAxisDisplayUnits,x=o?r.secondaryYAxisLabel.secondaryYAxisNumberFormat:r.yAxisLabel.yAxisNumberFormat,L=o?r.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:r.yAxisLabel.yAxisLabelDecimalPrecision,A=o?r.secondaryYAxisLabel.secondaryYAxisLabelFontSize:r.yAxisLabel.yAxisLabelFontSize,u=o?r.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:r.yAxisLabel.yAxisLabelFontFamily;if(s!="None")return n=_e(Math.floor(t)||Math.floor(e),s,x,L??"2").toString(),l=wt(n,A,u)[0],l<30?30:l+5;try{return n=_e(Math.floor(t)||Math.floor(e),s,x,L??"2").toString(),h&&(n="-100%"),l=wt(n,A,u)[0],l<30?30:l+5}catch{}}}catch(n){throw n}}function Ct(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){throw r}}function mt(t,e,r,o,h,n,l){try{let s=l??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",s+"-clip").append("rect").attr("width",o).attr("height",r>0?h-r:h),t.append("rect").attr("width",o).attr("height",r>0?h-r:h).attr("stroke",e.plotArea.plotAreaBorder&&!Si.includes(n)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==De.white&&!Si.includes(n)?e.plotArea.plotAreaColor:"none")}catch(s){throw s}}function Sl(t,e){const r=t.yPosition,o=t.yPosition+t.height,h=e.yPosition,n=e.yPosition+e.height;return r<n&&o>h}function st(t,e,r,o,h,n,l,s,x){try{let L=o.yAxisLabel.yAxisIntervalsVisibility,A=!1,u=L?parseFloat(o.yAxisLabel.yAxisIntervalText):void 0,S=[],b;if(h.chartType===le.TornadoChart){const g=Math.max(Math.abs(e),Math.abs(t)),H=l||g,D=n||e;if(u&&u>0){for(let j=D;j<=H+1e-6;j+=u)S.push(parseFloat(j.toFixed(6)));b=S.length}else{A=!0;const j=6,J=(H-D)/j;for(let U=0;U<=j;U++){const V=D+U*J;S.push(parseFloat(V.toFixed(6)))}b=s?x/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:A}}if(!l&&t>0){const H=(t-e)*.05;t=t+H}if(u&&u!==0&&u!==void 0){let g=n||n==0?n:e,H=l||l==0?l:t;g<0?b=Math.floor((H-g)/u):b=Math.floor(H/u);let D=18;(l||l==0)&&(t=l);let j=n||n==0?n:e<0?Math.round(e):0;if(S.push(j),b>100){let K="Tick count cannot exceed more than 100.";g<0?u=(H-j)/100:u=H/100}if(b=b<100?b:100,b>D)for(let K=0;K<parseInt(b)&&(j+=u,parseFloat(j.toFixed(5))<=t);K++)S.push(j);else for(let K=0;K<D&&(j+=u,j<=t);K++)S.push(j)}else{A=!0;let g=wt((l||h.yMaxLeft).toString(),o.yAxisLabel.yAxisLabelFontSize,o.yAxisLabel.yAxisLabelFontFamily,0);S=Vi(n||h.yMinLeft,t,s?x:r,s?g[1]:g[0]),b=s?x/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:A}}catch(L){throw L}}function Vi(t,e,r,o=80){const h=e-t;if(!isFinite(h)||Math.abs(h)<1e-12)return[Number(t.toFixed(12))];const n=h<10?10:Math.max(2,Math.floor(r/o)),l=h/n,s=Math.pow(10,Math.floor(Math.log10(l))),x=[1,1.5,2,2.5,5,10];let L=x.map(_=>_*s).find(_=>Math.ceil(h/_)<=n);L||(L=x.at(-1)*s);const A=Math.floor(t/L)*L,u=Math.ceil(e/L)*L,S=Math.round((u-A)/L),b=new Array(S+1);for(let _=0;_<=S;_++)b[_]=Number((A+_*L).toFixed(12));return b}function Gt(t,e,r,o,h,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==De.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(h);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==De.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(l){throw l}}function oi(t,e,r,o,h,n,l){let s=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${l},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==De.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const x=t.append("g").call(h).attr("transform",`translate(${l},0)`);x.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==De.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",s.includes("Italic")?"Italic":"").style("text-decoration",s.includes("Underline")?"Underline":"").style("font-weight",s.includes("Bold")?"Bold":"").attr("visibility",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),x.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",e.secondaryYAxisLabel.secondaryYAxisWidth),x.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",e.plotArea.fitChart?"1":"0").append("text").attr("transform","rotate(90)").attr("text-anchor","start").attr("class","DisplayUnit").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor).style("font-size",parseFloat(e.secondaryYAxisLabel.secondaryYAxisLabelFontSize)*.8).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle).attr("visibility",e.secondaryYAxisLabel.secondaryYAxisDisplayUnitsLabel==!1?"hidden":"visible").text("("+e.secondaryYAxisLabel.secondaryYAxisDisplayUnits+")")}function Lt(t,e){try{let r=[],o=e/30<t.length?Math.round(e/30):t.length;if(o>=t.length)return r=t,r;let h=Math.round(t.length/o);(t.length-1)%h!=0&&(t.length-1)%(h+1)==0&&(h=h+1),r.push(t[0]);let n;for(let l=1;l<t.length-1;l++){const s=l*h;if(s>t.length)break;r.push(t[s]),n=s}if(!r.includes(t[t.length-1])){let l=n>=Math.round(t.length-t.length*.02);r.push(t[t.length-1])}return r=r.filter(l=>l)}catch(r){throw r}}function qt(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{let g=e.chartType!==le.ColumnHistogramChart?Lt(b,u):[],H=[],D=s[3]+10;e.chartType!=le.ColumnHistogramChart?H=A?gt(o.xAxisLabel.xAxisNumberFormat,g.map(O=>O)).map(O=>O):g:g.forEach(O=>{H.push(e.formattedDimensionListMap.get(O))});let j=!o.plotArea.fitChart&&(e.chartType==le.AreaChart||e.chartType==le.StackAreaChart||e.chartType==le.NormalizedStackAreaChart);t||(t=t);let K=o.xAxisLabel.xAxisLabelFontStyle,J="rotate("+-o.xAxisLabel.xAxisLabelRotation+")";o.dataTableProperties&&o.dataTableProperties.dataTable&&Tl.includes(e.chartType)&&o.xAxisLabel.xAxisPosition!="1"&&(o.xAxisLabel.xAxisLabelVisibility=!1);let U=o.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const V=t.append("g").attr("id","x-axis");V.append("rect").attr("transform",`translate(1,${U==="0"?h>0?S-h:S:U==="1"?-r:n(0)})`).attr("height",r).attr("width",u).attr("fill",o.xAxisLabel.xAxisLabelVisibility&&o.xAxisLabel.xAxisBackgroundColor?o.xAxisLabel.xAxisBackgroundColor!==De.white?o.xAxisLabel.xAxisBackgroundColor:"none":o.chartArea.chartAreaColor);const N=V.append("g").attr("transform",`translate(0,${U=="0"?h>0?S-h:S:U=="1"?0:n(0)})`).call(l);let $=U==="1"?"5":"0",X;o.xAxisLabel.labelTextWrap?o.xAxisLabel.multiLineLabelWrap?X=o.xAxisLabel.maxXAxisLabelWidth:X=D<x*.15?D:x*.15:X=o.xAxisLabel.xAxisLabelRotation==0?L:D;const se=typeof _.step=="function"?_.step():L,re=parseInt(o.xAxisLabel.xAxisLabelFontSize)*1.2,oe=Math.floor(se/re),he=o.xAxisLabel.xAxisLabelRotation==0;let Le=N.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(X)).style("height",se+"px").attr("transform",(O,q)=>`rotate(${U==="1"?-o.xAxisLabel.xAxisLabelRotation:o.xAxisLabel.xAxisLabelRotation!=0?180-o.xAxisLabel.xAxisLabelRotation:0}) translate (${o.xAxisLabel.xAxisLabelRotation!=0?$+`, -${q==0&&j?15:se/2}`:-X/2+" , "+(U==="1"?"-15":"8")})`);he||Le.style("overflow","visible"),Ni()==="safari"&&Le.attr("width",o.xAxisLabel.labelTextWrap?D<x*.125?D:x*.125:r).attr("height","20px");let ue=Le.append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",he?"center":"end").style("align-items",he?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("transform",Ni()==="safari"||U==="1"?"":o.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(o.xAxisLabel.labelTextWrap&&!o.xAxisLabel.multiLineLabelWrap||!o.xAxisLabel.labelTextWrap)&&ue.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),o.xAxisLabel.labelTextWrap&&o.xAxisLabel.multiLineLabelWrap&&ue.style("-webkit-line-clamp",oe.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),ue.style("text-align",o.xAxisLabel.xAxisLabelRotation!=0?"start":"center").style("user-select","none").style("margin",0).style("padding","0 1px").style("font-family",o.xAxisLabel.xAxisLabelFontFamily).style("color",o.xAxisLabel.xAxisLabelColor).style("font-size",o.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",K.includes("Italic")?"Italic":"").style("text-decoration",K.includes("Underline")?"Underline":"").style("font-weight",K.includes("Bold")?"Bold":"").style("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===le.ColumnHistogramChart?ue.attr("title",(O,q)=>_e(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((O,q)=>_e(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)):ue.attr("title",(O,q)=>(""+H[q]).trim()).html((O,q)=>(""+H[q]).trim()),N.selectAll("text").style("visibility",(o.xAxisLabel.xAxisLabelVisibility,"hidden")),N.selectAll("line").style("stroke",o.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility||o.plotArea.gridLinesVertical?"visible":"hidden"),N.select(".domain").style("stroke",o.xAxisLabel.xAxisColor).attr("stroke-width",o.xAxisLabel.xAxisWidth?o.xAxisLabel.xAxisWidth:o.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").raise(),t}catch(g){throw g}}function Ni(){let t="";try{const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1:t="edge";break;case(e.indexOf("opr")>-1&&!!window.opr):t="opera";break;case(e.indexOf("chrome")>-1&&!!window.chrome):t="chrome";break;case e.indexOf("trident")>-1:t="ie";break;case e.indexOf("firefox")>-1:t="firefox";break;case(e.indexOf("safari")>-1||e.indexOf("applewebkit")>-1):t="safari";break;default:t="other";break}}catch(e){throw e}finally{return t}}const Pi={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},Fl=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const r=Math.floor(e-25569),o=new Date(r*86400*1e3);return Number.isNaN(o.getTime())?null:{day:o.getUTCDate(),month:o.getUTCMonth(),year:o.getUTCFullYear()}},wl=t=>String(t%100).padStart(2,"0"),Dl=(t,e,r,o)=>{const h=Pi.short[e],n=Pi.long[e],l=String(t).padStart(2,"0"),s=String(e+1).padStart(2,"0"),x=wl(r),L=String(r);switch(o){case"Month":return n;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${L}`;case"Year":return L;case"Default":return`${l}-${h}-${L}`;case"DD-MM-YYYY":return`${l}-${s}-${L}`;case"MM-DD-YYYY":return`${s}-${l}-${L}`;case"DD-MM":return`${l}-${s}`;case"YYYY-MM-DD":return`${L}-${s}-${l}`;case"YYYY-MM":return`${L}-${s}`;case"YYYY":return L;case"MM-YYYY":return`${s}-${L}`;case"MMM-YY":return`${h}-${x}`;case"YY-MMM":return`${x}-${h}`;case"MMMM-YY":return`${n}-${x}`;case"MMMM-YYYY":return`${n}-${L}`;case"DD-MMM":return`${l}-${h}`;case"DD-MMM-YY":return`${l}-${h}-${x}`;case"DD-MMM-YYYY":return`${l}-${h}-${L}`;default:return`${l}-${h}-${L}`}},gt=(t,e)=>{try{return e.map(r=>{const o=Fl(r);if(!o)return r;const{day:h,month:n,year:l}=o;return Dl(h,n,l,t)})}catch(r){throw r}};function za(t,e,r){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let o=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(r).enter().filter(n=>n.isVisible).append("g").attr("class","seriesLabels").attr("transform",n=>`translate(${n.xPosition}, ${n.yPosition})`).append("foreignObject").attr("width",n=>n.width).attr("height",n=>n.height).append("xhtml:div").style("display","flex").style("align-items","center").style("justify-content","center").style("width","100%").style("height","100%").append("xhtml:div").style("width","fit-content").style("height","100%").style("padding-left","5px").style("padding-right","5px").style("border-radius","4px").style("background-color",t.seriesLabel.seriesLabelBackgroundColor).style("font-size",t.seriesLabel.seriesLabelFontSize+"px").style("font-family",t.seriesLabel.seriesLabelFontFamily).style("font-style",o.includes("Italic")?"italic":"").style("text-decoration",o.includes("Underline")?"underline":"").style("font-weight",o.includes("Bold")?"bold":"").style("color","black").text(n=>n.seriesValue)}}function Vl(t,e,r,o,h,n){const l=r.xAxisLabel.xAxisPosition!="1"?e.left-20-h:5;return t?`rotate(-90) translate(-${e.top+o},${l})`:`translate(${e.left},${e.top+o+(r?.xAxisLabel?.xAxisPosition=="1"?0:t?n:h)})`}function Mt(t,e,r,o,h,n,l,s,x,L,A){try{let u=r.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",Vl(e,o,t,A,h,x)).attr("class","xAxisTitle").attr("width",e?A:L).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?u.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):u.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){throw u}}function St(t,e,r,o,h,n,l,s,x,L,A){try{let u=r>0?t-r:t,S=h.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",o?n.left:`-${n.top+u}`).attr("y",o?n.top+u+s:n.left-l-s).attr("class","yAxisTitle").attr("transform",o?"":"rotate(-90)").attr("width",o?x:u).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?S.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):S.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),h}catch(u){throw u}}function Ut(t,e,r,o,h,n,l,s,x,L=!1){let A=t.append("foreignObject").attr("visibility",e&&o.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",L?`${r.left}`:`-${r.top+(h>0?n-h:n)}`).attr("y",L?`${r.top-s-x-2}`:`${r.left+l+s-2}`).attr("class","yAxisTitleSecondary").attr("transform",L?"rotate(0)":"rotate(-90)").attr("width",L?l:h>0?n-h:n).attr("height",x+"px");o.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?A.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleHTML?o.secondaryYAxisTitle.secondaryYAxisTitleHTML:o.secondaryYAxisTitle.secondaryYAxisTitleText):A.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","3px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size",o.secondaryYAxisTitle.secondaryYAxisTitleFontSize+"px").style("font-family",o.secondaryYAxisTitle.secondaryYAxisTitleFontFamily).style("font-style",o.secondaryYAxisTitle.secondaryYAxisTitleFontStyle).attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleText)}function Ft(t,e,r,o){let h=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r-4).attr("height",o+"px");const n=x=>{const L=document.createElement("div");return L.innerHTML=x,L.textContent||L.innerText||""},s=!!e.chartTitle.chartTitleHTML?n(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?h.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",s).style("white-space","pre").style("text-overflow","ellipsis").html(e.chartTitle.chartTitleHTML?e.chartTitle.chartTitleHTML:e.chartTitle.chartTitleText):h.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow","hidden").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",e.chartTitle.chartTitleFontFamily).attr("title",e.chartTitle.chartTitleText).html(e.chartTitle.chartTitleText)}function Ot(t){if(t.line.interpolationType=="1")return T.curveLinear;if(t.line.interpolationType=="2"&&t.line.smoothType=="1")return T.curveMonotoneX;if(t.line.interpolationType=="2"&&t.line.smoothType=="2")return T.curveCardinal.tension(parseFloat(t.line.cardinalTension));if(t.line.interpolationType=="3"&&t.line.stepPosition=="1")return T.curveStepBefore;if(t.line.interpolationType=="3"&&t.line.stepPosition=="2")return T.curveStep;if(t.line.interpolationType=="3"&&t.line.stepPosition=="3")return T.curveStepAfter}function Nl(t){const e=t.indexOf(" - ");return e==-1?pi.default:t.slice(e+3)}const La=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function $a(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Rt(t,e,r){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:o,minVal:h,maxVal:n}=e.annotation.annotationRangeFilter;return t.filter(l=>{const s=r(l);switch(o){case"lt":return s<=n;case"gt":return s>=h;case"in":return s>=h&&s<=n;case"not-in":return s<h||s>n;default:return!0}})}function Da(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J,U,V,N){try{const $=L===le.TornadoChart;let X=new Map,se=x.annotation.annotationType??"1",re=x.annotation.annotationPosition.toString()!="4"?x.annotation.annotationPosition:null,oe=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const he=x.annotation.connectorType?.toLowerCase()==="curve";if(x.annotation.annotationVisibility){let Le=[se=="1"?"connector":""],pe=[],ue=n.annotation(),O=x.annotation.connectorType,q=x.annotation.annotationVisibility,w=x.annotation.annotationFontStyle,p=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates)),C=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";p=gi(p,x,L);let c=[],d=[];switch(p.length!=0&&p.forEach(a=>{a.dx=a.dx*u/a.width,a.dy=a.dy*A/a.height,a.width=u,a.height=A}),q){case"2":t.forEach(a=>{a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"3":t.forEach(a=>{a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"4":t.forEach(a=>{a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})}),t.forEach(a=>{a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"1":for(let a=0;a<t[0].data.length;a++)t.forEach(m=>{m.data[a]&&pe.push({Dimension:m.data[a].dimension,Measure:m.data[a].value,Legend:m.data[a].legend,LabelPosition:re||m.properties.annotationPosition,Labelcolor:m.properties[oe],hoverText:La(m,N),Axis:m.properties.axis,LegendUniqueId:m.properties.legendUniqueId})});break;case"5":break;case"6":t.forEach(a=>{switch(a.properties.annotation.toString()){case"1":for(let P=0;P<t[0].data.length;P++)a.data[P]&&pe.push({Dimension:a.data[P].dimension,Measure:a.data[P].value,Legend:a.data[P].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"2":break;case"3":a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"4":a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"5":a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId}),a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;pe.forEach((a,m)=>{i<a.Measure&&(i=a.Measure)});let y=i*.1;pe.forEach((a,m)=>{let P={note:{label:a.Measure>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":_e(L===le.TornadoChart?Math.abs(a.Measure):a.Measure,x.annotation.annotationDisplayUnits||x.plotArea.plotAreaDisplayUnits,x.annotation.annotationNumberFormat,x.annotation.annotationDecimalPrecision),align:V&&L!==le.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":L===le.TornadoChart?"end":"middle"},data:V?{y:$?Nl(a.Legend):a.Dimension,x:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure}:{x:a.Dimension,y:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure},dx:0,dy:0,connector:{end:C,curve:si[x.annotation.connectorCurve],points:he?$a(0,0):[[0,0],[0,0]]},disable:Le,subject:{height:15,width:15},color:a.Labelcolor,type:ci(n,parseFloat(se)),height:A,width:u};if(V){let ie=a.Axis===at.primary?r:o;(Lt(b,_).includes(a.Dimension)||L===le.TornadoChart)&&!l.includes(a.Legend)&&ie(a.Measure)<=S&&ie(a.Measure)>=0&&c.push(P)}else Lt(b,S).includes(a.Dimension)&&!l.includes(a.Legend)&&(a.Axis==at.primary?r(a.Measure)<=_&&r(a.Measure)>=0:o(a.Measure)<=_&&o(a.Measure)>=0)&&c.push(P)}),x.annotation.annotationHideZeroValues&&(c=c.filter(a=>V?a.data.x.measure!==0:a.data.y.measure!==0)),c=Rt(c,x,a=>V?a.data.x.measure:a.data.y.measure),p.length===0?(p=c,X=new Map(p.map(a=>[a.data.legendUniqueId,{measure:V?a.data.x.measure:a.data.y.measure,dimension:V?a.data.y:a.data.x,legendUniqueId:a.data.legendUniqueId,dx:a.dx,dy:a.dy,connectorPoints:a.connector?.points||[],isVisible:a.data.isVisible??!0,width:a.width,height:a.height}]))):X=new Map(p.map(a=>[a.legendUniqueId,a])),c.forEach(a=>{const m=a.data.legendUniqueId;if(p.length!=0){const P=X.get(m);P&&(a.dx=P.dx,a.dy=P.dy,a.data.isVisible=P.isVisible??!0,P?.connectorPoints&&P.connectorPoints.length>=(he?3:2)?a.connector.points=P.connectorPoints:a.connector.points=he?$a(a.dx,a.dy):[[0,0],[0,0]])}d.push(a)}),ue.editMode(x.annotation.annotationDraggable&&J).accessors({x:function(a){if(V){let m=a.x.axis===at.primary?r:o,P=a.x.axis;return Ii(x,a.x.measure?a.x.measure:0,a.position,m,y,void 0,L,U,P)}else if(L===le.ColumnChart){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=j(m);return P!=null?e(a.x)+P-(K-j.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==at.primary)return Xa(a.y.measure,parseFloat(a.position),r,y,a.prevValue,L);if(V){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=j&&L!==le.DotPlot?j(m):0;return $?j(a.y)+j.bandwidth()/2:j?e(a.y)+P-(K-j.bandwidth())/2-5:e(a.y)-5}else return Xa(a.y.measure,parseFloat(a.position),o,y,a.prevValue,L)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,p.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(f.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","block"),m.data.isVisible=!0)})),d.forEach(m=>{(m.data?.legendUniqueId==a.data.legendUniqueId||m.legendUniqueId==a.data.legendUniqueId)&&(m.dx=a._dx*u/m.width,m.dy=a._dy*A/m.height,m.connectorPoints=a.connector?.points?.map(P=>[...P])||[])}),D){const m=d.map(P=>({legendUniqueId:P.data?.legendUniqueId||P.legendUniqueId,dx:P.dx,dy:P.dy,connectorPoints:P.connectorPoints||[],isVisible:(P.data?.isVisible||P.isVisible)??!0,width:P.width,height:P.height}));D(m)}f.selectAll(".connector").attr("hoverId",m=>m.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]),f.selectAll(`.connector-${C}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),f.selectAll(".note-line").attr("hoverId",m=>m.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]).filter(m=>m._dx==0&&m._dy==0).remove(),f.selectAll(".annotation-note-label").filter(m=>m.data&&m.data.isVisible).style("display","block")}).on("noteclick",function(a){x.annotation.annotationDraggable&&J&&(a.data.isVisible=!1,p.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(f.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","none"),m.data.isVisible=!1)}),f.selectAll(".annotation-note-label").filter(m=>m.data&&!m.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>r.invert(a.y)}).notePadding(0).annotations(d),x.plotArea.fitChart&&H.selectAll(".annotation-group").remove();let f=Li(H,x,h,w,ue,C,V);if(x.animation?.animationEnabled){const a=x.animation.animationDuration,m=Xe[x.animation.animationEffect],P=ue.accessors(),ie=L===le.LineChart,Q=L===le.DotPlot,Ae=(ge,we=0)=>{const fe=P.x(ge.data),ae=P.y(ge.data);return`translate(${fe+we}, ${ae})`};if(Q)f.selectAll(".annotation").attr("opacity",0).attr("transform",ge=>Ae(ge,-15)).transition().duration(a).ease(m).attr("opacity",1).attr("transform",ge=>Ae(ge));else if(ie){const ge=e.range?e.range():[0,1],we=Math.min(ge[0],ge[1]),fe=Math.max(ge[0],ge[1])-we,ae=(ke,ce=100)=>{for(let me=0;me<=ce;me++){const Ve=me/ce;if((m??T.easeLinear)(Ve)>=ke)return Ve}return 1};f.selectAll(".annotation").attr("opacity",0).each(function(ke){const ce=P.x(ke.data)??we,me=fe>0?Math.max(0,Math.min(1,(ce-we)/fe)):0,Ve=ae(me)*a;T.select(this).transition().delay(Ve).duration(0).attr("opacity",1)})}else f.selectAll(".annotation").attr("transform",function(ge){if(V){const we=r?r(0):0,fe=P.y(ge.data);return`translate(${we}, ${fe})`}else{const we=P.x(ge.data),fe=ge.data?.y?.axis===at.primary?r:o??r,ae=fe?fe(0):0;return`translate(${we}, ${ae})`}}).transition().duration(a).ease(m).attr("transform",function(ge){const we=P.x(ge.data),fe=P.y(ge.data);return`translate(${we}, ${fe})`})}}}catch($){throw $}}function Pl(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J,U){try{let V=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let N=[V=="1"?"connector":""],$=[],X=new Map,se=n.annotation(),re=u.annotation.connectorType,oe=u.annotation.annotationVisibility,he=u.annotation.annotationFontStyle,Le=[],pe=[],ue=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const O=u.annotation.connectorType?.toLowerCase()==="curve";let q=JSON.parse(JSON.stringify(u.plotArea.dataLabelsCoordinates));q=gi(q,u,le.CustomColumnChart);let w=[],p=[];q.length!=0&&q.forEach(i=>{i.dx=i.dx*b/i.width,i.dy=i.dy*S/i.height,i.width=b,i.height=S});for(let i=0;i<t.length;i++)t.forEach(y=>{y.properties.type&&y.properties.type!=le.ColumnChart&&!pe.includes(y.properties.type)&&pe.push(y.properties.type)});switch(oe){case"2":t.forEach((i,y)=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(f=>$.push(f[0]));break;case le.StackAreaChart:s.forEach(f=>$.push(f[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case le.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"4":t.forEach((i,y)=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(f=>$.push(f[0]));break;case le.StackAreaChart:s.forEach(f=>$.push(f[0]));break}}),t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case le.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"1":t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:i.data.forEach(a=>$.push({...a,alias:i.properties?.alias}));break;case le.StackColumnChart:let y=l.findIndex(a=>a.key===i.properties.legend);y!==-1&&l[y].forEach(a=>$.push(a));break;case le.StackAreaChart:let f=s.findIndex(a=>a.key===i.properties.legend);f!==-1&&s[f].forEach(a=>$.push(a));break}});break;case"5":break;case"6":t.forEach((i,y)=>{let f=i.properties.annotation.toString();switch(i.properties.type){case le.ColumnChart:switch(f){case"1":for(let P=0;P<t[y].data.length;P++)$.push(i.data[P]);break;case"2":break;case"3":$.push(i.data[0]);break;case"4":$.push(i.data[i.data.length-1]);break;case"5":$.push(i.data[0]),$.push(i.data[i.data.length-1]);break}break;case le.AreaChart:case le.LineChart:switch(f){case"1":for(let P=0;P<t[y].data.length;P++)$.push({dimension:i.data[P].dimension,value:i.data[P].value,legend:i.data[P].legend,labelPosition:i.data[P].labelPosition,labelColor:i.data[P].labelColor,axis:i.data[P].axis,type:i.properties.type,alias:i.properties?.alias});break;case"2":break;case"3":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias});break;case"4":$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break;case"5":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias}),$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break}break;case le.StackColumnChart:const a=l.findIndex(P=>P.key===i.properties.legend);a!==-1&&l[a].forEach((P,ie)=>{switch(String(l[a].individualAnnotationVisibility)){case"1":$.push(l[a][ie]);break;case"2":break;case"3":let Q=l[a][0];$.find(fe=>fe.key==Q.key)||$.push(Q);break;case"4":let Ae=l[a][l[0].length-1];$.find(fe=>fe.key==Ae.key)||$.push(Ae);break;case"5":let ge=l[a][0],we=l[a][l[0].length-1];if(!$.find(fe=>fe.key==ge.key||fe.key==we.key)){$.push(l[a][0]),$.push(l[a][l[0].length-1]);break}}});break;case le.StackAreaChart:const m=s.findIndex(P=>P.key===i.properties.legend);m!=-1&&s[m].forEach((P,ie)=>{switch(String(s[m].individualAnnotationVisibility)){case"1":$.push(s[m][ie]);break;case"2":break;case"3":let Q=s[m][0];$.find(fe=>fe.key==Q.key)||$.push(Q);break;case"4":let Ae=s[m][s[0].length-1];$.find(fe=>fe.key==Ae.key)||$.push(Ae);break;case"5":let ge=s[m][0],we=s[m][s[0].length-1];if(!$.find(fe=>fe.key==ge.key||fe.key==we.key)){$.push(ge),$.push(we);break}}});break}});break}let C=0;$.forEach((i,y)=>{C<i.value&&(C=i.value)});let c=C*.1;$.forEach((i,y)=>{let f={note:{label:i.value||i.value==0?i.value>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i.value/1e9)+"B":_e(i.value,u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision):i[1]-i[0]>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i[1]-i[0]/1e9)+"B":_e(i[1]-i[0],u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision),align:"middle"},data:{x:i.dimension&&i.legend?{dimension:i.dimension,legend:i.legend,type:i.type,axis:i.axis||i.data.axis}:{dimension:i.data.dimension,legend:i.key,type:i.data.type,stacklegend:i.data.legend,axis:i.data.axis},y:i.value||i.value==0?i.value:i.data.type!=le.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0],prevValue:i[0]>=0?i[0]:i[1],position:parseInt(i.labelPosition)?parseInt(i.labelPosition):parseInt(i.data.labelPosition),type:i.type,currentLegend:i.legend?.includes("~$~")?i.legend.split("~$~")[1]:i.key?.includes("~$~")?i.key.split("~$~")[1]:i.legend??i.key,isVisible:!0,hoverId:i?.alias?.replaceAll(" ","-"),legendUniqueId:i.legendUniqueId+"~$~"+(i.dimension??i.data.dimension)+"~$~"+(i.value||i.value==0?i.value:i.data.type!=le.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0])},dx:0,dy:0,connector:{end:ue,curve:si[u.annotation.connectorCurve],points:O?$a(0,0):[[0,0],[0,0]]},disable:N,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:ci(n,parseFloat(V)),height:S,width:b};i.legend&&i.dimension?!x.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==at.primary?r(i.value)<=H&&r(i.value)>=0:o(i.value)<=H&&o(i.value)>=0)&&w.push(f):!x.includes(i.key)&&(i.data.axis==at.primary?r(i[1])<=H&&r(i[1])>=0:o(i[1])<=H&&o(i[1])>=0)&&w.push(f)}),u.annotation.annotationHideZeroValues&&(w=w.filter(i=>i.data.y!==0)),w=Rt(w,u,i=>i.data.y),q.length===0?(q=w,X=new Map(q.map(i=>[i.data.legendUniqueId,{measure:i.data.y,dimension:i.data.x.dimension,legendUniqueId:i.data.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connector?.points||[],isVisible:i.data.isVisible??!0,width:i.width,height:i.height}]))):X=new Map(q.map(i=>[i.legendUniqueId,i])),w.forEach(i=>{const y=i.data.legendUniqueId;if(q.length!=0){const f=X.get(y);f&&(i.dx=f.dx,i.dy=f.dy,i.data.isVisible=f.isVisible??!0,f?.connectorPoints&&f.connectorPoints.length>=(O?3:2)?i.connector.points=f.connectorPoints:i.connector.points=O?$a(i.dx,i.dy):[[0,0],[0,0]],u.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&p.push(i)}),se.editMode(u.annotation.annotationDraggable&&U).accessors({x:function(i){const y=i.x.type||i.type;if(pe.includes(y))switch(y){case le.StackColumnChart:return e(i.x.dimension)+J(i.x.stacklegend)-(A-J.bandwidth())/2;case le.StackAreaChart:case le.LineChart:case le.AreaChart:return e(i.x.dimension)}else{if(i.x.legend){const f=i.legendUniqueId.includes("~$~")?i.legendUniqueId.split("~$~")[0]:i.legendUniqueId;return e(i.x.dimension)+J(f)-(A-J.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const y=i.type??i.x.type;return i.x.axis==at.primary?Xa(i.y,parseFloat(i.position),r,c,i.prevValue,y):Xa(i.y,parseFloat(i.position),o,c,i.prevValue,y)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,q.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(f=>f.data.x.dimension==i.data.x.dimension&&f.data.x.legend==i.data.x.legend&&f.data.x.type==i.data.x.type&&f.data.prevValue==i.data.prevValue).attr("display","block"),y.data.isVisible=!0)})),p.forEach(y=>{(y.data?.legendUniqueId==i.data.legendUniqueId||y.legendUniqueId==i.data.legendUniqueId)&&(y.dx=i._dx*b/y.width,y.dy=i._dy*S/y.height,y.connectorPoints=i.connector?.points?.map(f=>[...f])||[])}),K){const y=p.map(f=>({legendUniqueId:f.data?.legendUniqueId||f.legendUniqueId,dx:f.dx,dy:f.dy,connectorPoints:f.connector.points||f.connectorPoints||[],isVisible:(f.data?.isVisible||f.isVisible)??!0,width:f.width,height:f.height}));K(y)}d.selectAll(".connector").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[u.annotation.connectorStyle.toLowerCase()]),d.selectAll(`.connector-${ue}`).attr("fill",u.annotation.connectorColor||"#ccc").style("stroke",u.annotation.connectorColor||"#ccc"),d.selectAll(".note-line").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[u.annotation.connectorStyle.toLowerCase()]).filter(y=>y._dx==0&&y._dy==0).remove(),d.selectAll(".annotation-note-label").filter(y=>y.data&&y.data.isVisible).style("display","block")}).on("noteclick",function(i){u.annotation.annotationDraggable&&U&&(i.data.isVisible=!1,q.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(f=>f.data.x.dimension==i.data.x.dimension&&f.data.x.legend==i.data.x.legend&&f.data.x.type==i.data.x.type&&f.data.prevValue==i.data.prevValue).attr("display","none"),y.data.isVisible=!1)}),d.selectAll(".annotation-note-label").filter(y=>y.data&&!y.data.isVisible).style("display","none"))}).accessorsInverse({x:i=>e.invert(i.x),y:i=>i.x.axis==at.primary?r.invert(i.y):o.invert(i.y)}).notePadding(0).annotations(p),u.plotArea.fitChart||j.selectAll(".annotation-group").remove();let d=Li(j,u,h,he,se,ue,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=Xe[u.animation.animationEffect],f=se.accessors();d.selectAll(".annotation").attr("transform",function(a){const m=f.x(a.data),P=a.data.type||a.type,Q=(a.data?.x?.axis||a.data?.axis)===at.primary?r:o;let Ae;return P===le.StackColumnChart||P===le.StackAreaChart?Ae=Q(a.data.prevValue??0):Ae=Q(0),`translate(${m}, ${Ae})`}).transition().duration(i).ease(y).attr("transform",function(a){const m=f.x(a.data),P=f.y(a.data);return`translate(${m}, ${P})`})}}}catch(V){throw V}}const gi=(t,e,r)=>{try{let o=[le.PieChart,le.DonutChart].includes(r)?"plotArea":"annotation";return t=e[o].annotationDraggable&&!!1?t??[]:[],t}catch(o){throw o}},ci=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},Xa=(t,e,r,o,h,n)=>{try{let l=[le.LineChart,le.StackLineChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.NormalizedStackLineChart,le.StackAreaChart];switch(h||(h=0),e){case 1:let s;switch(n){case le.LineChart:case le.HorizontalBarChart:case le.ColumnChart:case le.AreaChart:case le.StackAreaChart:s=t<0?r(t)+7:r(t)-15;break;case le.StackHorizontalBarChart:case le.NormalizedStackLineChart:case le.StackLineChart:case le.NormalizedStackAreaChart:case le.StackAreaChart:case le.StackColumnChart:s=t<0?r(t)+5:r(t)-15;break;case le.TornadoChart:s=r(t)+r.bandwidth()/2;break;default:s=t<0?r(h)+5:r(t)-15}return s;case 2:return l.includes(n)?r(t):t===0?n==="stack"?"":r(0)-15:r(h+(t-h)/2);case 3:return l.includes(n)?t===-1||t<0?r(t)-10:r(t)+10:n.includes("stack")?t===-1&&h===0?r(0)+10:t===1&&h!==0?r(h)-10:h<0?r(h)+10:h===0&&t<0?r(0)+10:h===0&&t>0?r(0)-10:r(h)-10:t<0?r(0)+10:r(0)-10}}catch(l){throw l}},ea=(t,e,r,o,h,n)=>{try{const l=n?.DataTableData??[];let s=[],x=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){t.dataTableProperties.dataTableAxisLabel?x=Ai(h[0],void 0,t):x=0;const L=[...o,...l];t.xAxisLabel.xAxisLabelVisibility=!1;const u=!t.dataTableProperties.disableLegendIcon?35:0;let S=e+r-u;L.forEach((b,_)=>{if(b?.properties?.showInDataTable??!0){let g={data:b.data.filter(H=>h.includes(H.dimension)),properties:{legend:b.properties.alias,color:b.properties.color,markerColor:b.properties.markerColor,markerShape:b.properties.markerShape,lineStyle:b.properties.lineStyle,height:Ai(b.properties.alias.includes("~$~")?b.properties.alias.split("~$~")[1]:b.properties.alias,S,t)}};x+=g.properties.height,s.push(g)}})}else x=0,s=[];return s.length==0&&(x=0,s=[],t.dataTableProperties.dataTable=!1),{dataTable:s,dataTableHeight:x}}catch{}},Ai=(t,e,r)=>{try{let o=20,h=wt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily)[0];return o=wt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily,void 0,h>e&&!r.dataTableProperties.legendsWrapText?e:void 0)[1],o}catch(o){throw o}};function ta(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J,U){try{let V=function(f,a,m,P){a===0&&f.append("foreignObject").attr("x",-J.left).attr("y",he).attr("class","blankClass").attr("width",J.left).attr("height",y).append("xhtml:div").style("width",J.left).style("height",`${y}px`).style("border-width",O?`0px 0px ${N.dataTableAxisLabel?w:0}px 0px`:"0px 0px 0px 0px").style("border-style",O?`solid ${p} ${p} solid`:"solid solid solid solid").style("border-color",O?`black ${q} ${q} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const Q=f.append("foreignObject").attr("x",-J.left).attr("y",he+ue).attr("width",J.left).attr("height",P).append("xhtml:div").style("display","flex").style("justify-content","center").style("align-items","center").attr("class","parentClass").style("flex-wrap","wrap").style("flex-direction","row").style("pointer-events","auto").style("width",oe).style("height",`${P}px`).style("padding-left",N.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>ka(S,a,void 0,X,se,"width")).style("border-style",()=>ka(S,a,void 0,X,se,"style")).style("border-color",()=>ka(S,a,void 0,X,se,"color"));if(!N.disableLegendIcon)switch(u){case le.ColumnChart:case le.StackColumnChart:case le.NormalizedStackColumnChart:Q.append("xhtml:div").style("height","10px").style("width","15px").style("background",m.properties.color).style("border-radius","1px");break;case le.LineChart:case le.StackLineChart:case le.NormalizedStackLineChart:Bi(m,Q,S);break;case le.AreaChart:case le.StackAreaChart:case le.NormalizedStackAreaChart:Wi(m,Q,S);break}const Ae=m.properties.legend,ge=S?.legends?.legendColorMode=="1"?m?.properties?.color:S?.legends?.legendSelectedUnicolor,we=Q.append("xhtml:div").style("max-width",oe).attr("class","legendsColumn").style("text-align","left").style("vertical-align","middle").call(d).style("padding-left","5px").style("white-space","normal").style("overflow-wrap","break-word").style("color",ge??"black").style("width",N.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",Ae).text(Ae);N.legendsWrapText&&we.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const N=S.dataTableProperties,$=N.dataTableFontStyle,X=g.length,se=o.length,re=D[0]?D[0]:0,oe=typeof l.step=="function"?l.step():h,he=U-A,Le=2;let pe=20,ue=0;const O=S.dataTableOuterBorder.borderButtonVisibility,q=S.dataTableOuterBorder.lineColor,w=S.dataTableOuterBorder.lineWidth,p=S.dataTableOuterBorder.lineStyle,C=f=>f===0?oe+Le+re/2:f===X-1?oe+Le-re/2:oe,c=f=>_e(u.includes("100stack")?f.TooltipMeasure/f.TotalMeasure:f.TooltipMeasure||f.value,N.dataTableDisplayUnits,N.dataTableNumberFormat,N.dataTableDecimalPrecision),d=f=>f.style("font-size",N.dataTableFontSize+"px").style("font-family",N.dataTableFontFamily).style("font-style",$.includes("Italic")?"Italic":"").style("text-decoration",$.includes("Underline")?"Underline":"").style("font-weight",$.includes("Bold")?"Bold":"");T.selectAll("#dataTableG"+K).remove();const i=r.append("g").attr("id","dataTableG"+K);let y=0;N.dataTableAxisLabel&&(y=Ai(g[0],void 0,S),pe=y),o.forEach((f,a)=>{ue+=!N.dataTableAxisLabel&&a===0?0:pe,pe=f.properties.height,N.dataTableLegends&&V(i,a,f,pe);const m=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+K+" .foreignObject").data(()=>f.data).enter().filter(P=>l(P.dimension)).append("g").attr("fill",De.transparent).attr("transform",(P,ie)=>`translate(${ie===0?0:l(P.dimension)-oe/2},0)`);a===0&&N.dataTableAxisLabel&&m.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",he).attr("id",(P,ie)=>ie).attr("width",(P,ie)=>C(ie)).attr("height",`${y}px`).append("xhtml:div").style("width",(P,ie)=>C(ie)).style("height",`${y}px`).style("border-width",(P,ie)=>ka(S,ie,void 0,X,se,"width","colHeaders")).style("border-style",(P,ie)=>ka(S,ie,void 0,X,se,"style","colHeaders")).style("border-color",(P,ie)=>ka(S,ie,void 0,X,se,"color","colHeaders")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-left","3px").call(d).style("color",S.xAxisLabel.xAxisLabelColor??"black").attr("title",P=>j.get(Array.isArray(P.dimension)?P.dimension[0]:P.dimension)).text(P=>j.get(Array.isArray(P.dimension)?P.dimension[0]:P.dimension)),m.append("foreignObject").attr("x",0).attr("y",he+ue).attr("width",(P,ie)=>C(ie)).attr("height",pe).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(P,ie)=>C(ie)).style("height",`${pe}px`).style("line-height",`${pe}px`).style("border-width",(P,ie)=>ka(S,a,ie,X,se,"width")).style("border-style",(P,ie)=>ka(S,a,ie,X,se,"style")).style("border-color",(P,ie)=>ka(S,a,ie,X,se,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(d).style("color",N.dataTableLabelColor).attr("title",P=>c(P)).text(P=>c(P))})}catch(V){throw V}}function ka(t,e,r,o,h,n,l){try{const s=t.dataTableOuterBorder,x=t.dataTableInnerBorder,L=s.borderButtonVisibility,A=x.horizontalBorderLineButton,u=x.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,b={w:s.lineWidth,s:s.lineStyle,c:s.lineColor},_={w:x.horizontalBorderLineWidth,s:x.horizontalBorderLineStyle,c:x.horizontalBorderLineColor},g={w:x.verticalBorderLineWidth,s:x.verticalBorderLineStyle,c:x.verticalBorderLineColor},H={w:"0",s:"solid",c:"black"},D=L?b:H,j=A?_:H,K=u?g:H,J=o-1,U=h-1;let V=H,N=H,$=H,X=H;switch(l?(V=D,$=j,X=e===0?D:H,N=e===J?D:K):r===void 0?(X=D,N=H,V=e===0&&!S?D:H,$=e===U?D:j):(V=e===0&&!S?D:H,$=e===U?D:j,X=r===0?K:H,N=r===J?D:K),n){case"width":return`${V.w}px ${N.w}px ${$.w}px ${X.w}px`;case"style":return`${V.s} ${N.s} ${$.s} ${X.s}`;case"color":return`${V.c} ${N.c} ${$.c} ${X.c}`}}catch(s){throw s}}function pt(t,e,r){let o=[];for(let h=0;h<t.length;h++){const n=t[h];let l={},s=0,x=0,L=0;for(let A=0;A<e.length;A++){let u=e[A].data.find(S=>S.dimension===t[h])?.value||0;l[e[A].properties.legend]=u,s=s+(r?Math.abs(u):u),x+=u>0?u:0,L+=u}l.total=s,l.dimension=n,l.absoluteTotal=x,l.displayTotal=L,o.push(l)}return o}function aa(t,e,r,o,h,n,l,s){try{let x=r.seriesLabel.seriesLabelApplySeries,L=r.seriesLabel.seriesLabelPosition,A=[],u=o[0].legend,S=wt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily);return o.forEach(b=>{let _=!1;if(x=="1"?_=!0:_=b.properties.seriesLabelVisibility,_){let g={},H=L=="Right"?b.data[b.data.length-1]:b.data[0],D=s?H.value>0?H[1]:H[0]:H.value;b.properties.axis==at.primary||!h?g.yPosition=e(D):n&&h&&(g.yPosition=h(D)),(g.yPosition<0||g.yPosition>l)&&(_=!1),g.yPosition=g.yPosition-S[1]/2,g.isVisible=_,g.seriesValue=b.properties.alias,g.height=S[1],g.width=S[0];let j=!1;A.length>0&&A.some(K=>{j||(j=Sl(K,g))}),_&&!j&&A.push(g)}else return}),u="",A.forEach(b=>{b.seriesValue.length>u.length&&(u=b.seriesValue)}),S=wt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,A.forEach(b=>{b.height=S[1],b.width=S[0],b.xPosition=L=="Right"?t+(n?10:0)-S[0]:5}),{labelArray:A,heightWidth:S}}catch(x){throw x}}function Va(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J){try{let U=x.annotation.annotationType??"1";if(x.annotation.annotationVisibility){let V=[U=="1"?"connector":""],N=[],$=new Map,X=n.annotation(),se=x.annotation.connectorType,re=x.annotation.annotationVisibility,oe=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",he=x.annotation.annotationFontStyle,Le=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";const pe=x.annotation.connectorType?.toLowerCase()==="curve";let ue=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates));ue=gi(ue,x,L);let O=[],q=[];switch(ue.length!=0&&ue.forEach(c=>{c.dx=c.dx*u/c.width,c.dy=c.dy*A/c.height,c.width=u,c.height=A}),re){case"2":t.forEach(c=>N.push(c[0]));break;case"3":t.forEach(c=>N.push(c[c.length-1]));break;case"4":t.forEach(c=>N.push(c[0])),t.forEach(c=>N.push(c[c.length-1]));break;case"1":for(let c=0;c<t[0].length;c++)t.forEach(d=>N.push(d[c]));break;case"5":break;case"6":t.forEach(c=>{switch(c[0]?.properties?.annotation?.toString()){case"1":for(let i=0;i<t[0].length;i++)N.push(c[i]);break;case"2":break;case"3":N.push(c[0]);break;case"4":N.push(c[t[0].length-1]);break;case"5":N.push(c[0]),N.push(c[t[0].length-1]);break}});break}let w=0;N.forEach((c,d)=>{w<c.Measure&&(w=c.Measure)});let p=w*.1;x.annotation.annotationHideZeroValues&&(N=N.filter(c=>(c[1]<0&&c[0]<0?c[0]-c[1]:c[1]===0&&c[0]<0?c[1]+c[0]:c[1]-c[0])!==0)),N.forEach((c,d)=>{let i={note:{label:c[1]-c[0]>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(c[1]-c[0]/1e9)+"B":_e(c[1]<0&&c[0]<0?c[0]-c[1]:c[1]===0&&c[0]<0?c[1]+c[0]:c[1]-c[0],x.annotation.annotationDisplayUnits||x.plotArea.plotAreaDisplayUnits,x.annotation.annotationNumberFormat,x.annotation.annotationDecimalPrecision),align:J?c.data.labelPosition==2?"middle":"start":"middle"},data:J?{y:c.data.dimension,x:c[1]>0?c[1]:c[0],prevValue:c[0]>=0?c[0]:c[1],position:x.annotation.annotationPosition=="4"?c.data.labelPosition:JSON.parse(x.annotation.annotationPosition),currentLegend:c.key.includes("~$~")?c.key.split("~$~")[1]:c.key,isVisible:!0,hoverId:c.properties.alias?Wa(c.properties.alias):Wa(c.key),legendUniqueId:c.properties.legendUniqueId+"~$~"+c.data.dimension+"~$~"+(c.key.includes("~$~")?c.key.split("~$~")[1]:c.key)+"~$~"+(c[1]>0?c[1]:c[0])}:{x:c.data.dimension,y:c[1]>0?c[1]:c[0],prevValue:c[0]>=0?c[0]:c[1],position:x.annotation.annotationPosition=="4"?c.data.labelPosition:JSON.parse(x.annotation.annotationPosition),currentLegend:c.key.includes("~$~")?c.key.split("~$~")[1]:c.key,isVisible:!0,hoverId:c.properties?.alias?Wa(c.properties.alias):Wa(c.key),legendUniqueId:c.properties.legendUniqueId+"~$~"+c.data.dimension+"~$~"+(c.key.includes("~$~")?c.key.split("~$~")[1]:c.key)+"~$~"+(c[1]>0?c[1]:c[0])},dx:0,dy:0,connector:{end:Le,curve:si[x.annotation.connectorCurve],points:pe?$a(0,0):[[0,0],[0,0]]},disable:V,subject:{height:15,width:15},color:c.properties&&c.properties[oe]?c.properties[oe]:c.data.labelColor,type:ci(n,parseFloat(U)),height:A,width:u};b.includes(c.data.dimension)&&Il(_,S,J,c,r)&&O.push(i)}),O=Rt(O,x,c=>J?c.data.x-c.data.prevValue:c.data.y-c.data.prevValue),ue.length===0?(ue=O,$=new Map(ue.map(c=>[c.data.legendUniqueId,{measure:J?c.data.x:c.data.y,dimension:J?c.data.y:c.data.x,legendUniqueId:c.data.legendUniqueId,dx:c.dx,dy:c.dy,connectorPoints:c.connector?.points||[],isVisible:c.data.isVisible??!0,width:c.width,height:c.height}]))):$=new Map(ue.map(c=>[c.legendUniqueId,c])),O.forEach(c=>{const d=c.data.legendUniqueId;if(ue.length!=0){const i=$.get(d);i&&(c.dx=i.dx,c.dy=i.dy,c.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(pe?3:2)?c.connector.points=i.connectorPoints:c.connector.points=pe?$a(c.dx,c.dy):[[0,0],[0,0]])}q.push(c)}),X.editMode(x.annotation.annotationDraggable&&K).accessors({x:function(c){return J?Ii(x,c.x,parseFloat(c.position),r,p,c.prevValue,L):e(c.x)+e.bandwidth()/2},y:function(c){return J?e(c.y)+e.bandwidth()/2:Xa(c.y,parseFloat(c.position),r,p,c.prevValue,L)}}).on("dragend",function(c){if(c.data.isVisible||(c.data.isVisible=!0,ue.forEach(d=>{d.data.x==c.data.x&&d.data.y==c.data.y&&(C.selectAll(".annotation-note-label").filter(i=>i.data.x==c.data.x&&i.data.y==c.data.y).attr("display","block"),d.data.isVisible=!0)})),q.forEach(d=>{(d.data?.legendUniqueId==c.data.legendUniqueId||d.legendUniqueId==c.data.legendUniqueId)&&(d.dx=c._dx*u/d.width,d.dy=c._dy*A/d.height,d.connectorPoints=c.connector?.points?.map(i=>[...i])||[])}),D){const d=q.map(i=>({legendUniqueId:i.data?.legendUniqueId||i.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connectorPoints||[],isVisible:(i.data?.isVisible||i.isVisible)??!0,width:i.width,height:i.height}));D(d)}C.selectAll(".connector").attr("hoverId",d=>d.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]),C.selectAll(`.connector-${Le}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),C.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]).filter(d=>d._dx==0&&d._dy==0).remove(),C.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block")}).on("noteclick",function(c){x.annotation.annotationDraggable&&K&&(c.data.isVisible=!1,ue.forEach(d=>{d.data.x==c.data.x&&d.data.y==c.data.y&&(C.selectAll(".annotation-note-label").filter(i=>i.data.x==c.data.x&&i.data.y==c.data.y).attr("display","none"),d.data.isVisible=!1)}),C.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"))}).accessorsInverse({x:c=>e.invert(c.x),y:c=>r.invert(c.y)}).notePadding(0).annotations(q),H.selectAll(".annotation-group").remove();let C=Li(H,x,h,he,X,Le,J);if(x.animation?.animationEnabled){const c=x.animation.animationDuration,d=Xe[x.animation.animationEffect],i=X.accessors();if(L===le.StackLineChart||L===le.NormalizedStackLineChart){const f=e.range?e.range():[0,1],a=Math.min(f[0],f[1]),m=Math.max(f[0],f[1])-a,P=(ie,Q=100)=>{for(let Ae=0;Ae<=Q;Ae++){const ge=Ae/Q;if((d??T.easeLinear)(ge)>=ie)return ge}return 1};C.selectAll(".annotation").attr("opacity",0).each(function(ie){const Q=i.x(ie.data)??a,Ae=m>0?Math.max(0,Math.min(1,(Q-a)/m)):0,ge=P(Ae)*c;T.select(this).transition().delay(ge).duration(0).attr("opacity",1)})}else C.selectAll(".annotation").attr("transform",function(f){if(J){const a=r?r(0):0,m=i.y(f.data);return`translate(${a}, ${m})`}else{const a=i.x(f.data),m=r?r(0):0;return`translate(${a}, ${m})`}}).transition().duration(c).ease(d).attr("transform",function(f){const a=i.x(f.data),m=i.y(f.data);return`translate(${a}, ${m})`})}}}catch(U){throw U}}function Il(t,e,r,o,h){const n=h(o[1]>0?o[1]:o[0]);return r?n>=0&&n<=e:n<=t&&n>=0}const Li=(t,e,r,o,h,n,l)=>{t.selectAll(".annotation-group").remove();let s=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.annotation.annotationColor).style("font-family",e.annotation.annotationFontFamily).style("font-size",e.annotation.annotationFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(h);return s.selectAll("rect").style("visibility","hidden"),s.selectAll(".annotation-subject").remove(),s.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.annotation.connectorStyle.toLowerCase()]).style("visibility",x=>(l?parseFloat(x.data.x)==0:parseFloat(x.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(`.connector-${n}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",x=>(l?parseFloat(x.data.x)==0:parseFloat(x.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.annotation.connectorStyle.toLowerCase()]).filter(x=>x._dx==0&&x._dy==0).remove(),s.selectAll(".connector-end").filter(x=>x.connector.end=="dot"&&x._dx==0&&x._dy==0).remove(),s.selectAll(".annotation-note-label").filter(x=>x.data&&!x.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&s.selectAll(".annotation-note-content").attr("transform",function(){const L=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(L)return`translate(${l?0:parseFloat(L[1])}, 0)`}),s.selectAll("text").style("text-anchor",x=>l&&x.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==De.white?e.annotation.annotationColor:"none"),s.selectAll("tspan").attr("hoverId",x=>x.data.hoverId?x.data.hoverId:x.data.currentLegend.replaceAll(" ","-")).style("visibility",x=>parseFloat(x.data.y)==0&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s},Ya=(t,e,r,o,h,n)=>{try{let l=t.yAxisLabel.yAxisLabelFontStyle,s="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${o})`).attr("height",r+10).attr("width",h).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==De.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const x=e.append("g").call(n).attr("transform",`translate(0,${o})`);x.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),x.selectAll("text").style("text-anchor",s=="rotate(0)"?"middle":"end").attr("dx",s=="rotate(0)"?".2em":"-.1em").attr("dy",s=="rotate(0)"?"1em":".15em").attr("transform",s).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==De.white?t.yAxisLabel.yAxisLabelColor:"none").style("font-size",t.yAxisLabel.yAxisLabelFontSize).style("font-family",t.yAxisLabel.yAxisLabelFontFamily).style("font-style",t.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",t.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),x.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.yAxisLabel.yAxisColor).attr("stroke-width",t.yAxisLabel.yAxisWidth?t.yAxisLabel.yAxisWidth:t.plotArea.plotAreaBorderThickness)}catch(l){throw l}};function El(t,e,r,o,h,n,l,s){return t?`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
25
25
  translate(${-(o(h*.01)+n)} ,${-s/2})`:`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
26
- translate(${r.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-n},${-s/2}`:-l/2+" ,2"})`}const Ua=(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H,g,G)=>{try{const V=A===re.TornadoChart;let j=t.xAxisLabel.xAxisLabelFontStyle,K=parseInt(t.xAxisLabel.xAxisPosition),Z=Lt(m,o),Y=u?gt(t.xAxisLabel.xAxisNumberFormat,Z.map(ue=>ue)).map(ue=>ue):Z;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let N;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?N=t.xAxisLabel.maxXAxisLabelWidth:N=r;let E=g.step();const z=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,q=Math.floor(E/z),ce=t.xAxisLabel.xAxisLabelRotation==0;let ne=e.append("rect").attr("id","yAxisRect").attr("transform",A===re.TornadoChart?`translate(${-N-1},0)`:`translate(${K===0?-N-5:K===1?h:s(0)+(-N-5)},0)`).attr("height",o).attr("width",A===re.TornadoChart?N:N+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==we.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const oe=e.append("g").attr("id","yAxisG").attr("transform",V?`translate(${s(0)},0)`:`translate(${K===0?0:K===1?h:s(0)},0)`).call(n);let pe=oe.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",N).attr("height",E+"px").attr("transform",Rl(V,K,t,s,x,N,r,E)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",ce?"center":"start").style("align-items",ce?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("text-align",t.xAxisLabel.xAxisLabelRotation==0?"center":"start").style("user-select","none").style("margin",0);if((t.xAxisLabel.labelTextWrap&&!t.xAxisLabel.multiLineLabelWrap||!t.xAxisLabel.labelTextWrap)&&pe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap&&pe.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"),pe.style("padding",0).style("font-family",t.xAxisLabel.xAxisLabelFontFamily).style("font-style",t.xAxisLabel.xAxisLabelFontStyle).style("color",t.xAxisLabel.xAxisLabelColor).style("font-size",t.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",j.includes("Italic")?"Italic":"").style("text-decoration",j.includes("Underline")?"Underline":"").style("font-weight",j.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(ue,O)=>Y[O]).html((ue,O)=>Y[O]),A===re.TornadoChart){if(l){const ue=e.append("g").attr("transform",`translate(${s(0)},0)`).call(l);ue.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),ue.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),ue.selectAll("text").style("visibility","hidden")}oe.selectAll("text").style("visibility","hidden")}else oe.selectAll("text").style("visibility","hidden");oe.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),oe.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(V){throw V}},Ei=(t,e,r,o,h,n,l,s,x)=>{try{n=n??0;const m=_e(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,l===re.TornadoChart),A=String(m).length,u=o(e),S=o(n),p=o(0),H=l??"",g=H.includes("stack"),G=H==="100%stackBar";switch(r){case 1:return G?e<0&&e!==-1?u-20:e===-1||e>0&&e!==1?u+10:u-10:e<0||s&&x==="positive"?u-A*5:u+5;case 2:return e===0?g?"":p+15:o(n+(e-n)/2);case 3:return g?n<0?S-A*5:n===0&&e<0?p-A*5:n===0&&e>0?p+10:S+10:e<0?p-A*5:p+10;default:return u}}catch(m){throw m}},zl=(t,e,r,o,h)=>{try{let n=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-r})`).attr("height",r).attr("width",h).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==we.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const l=e.append("g").call(o).attr("transform","translate(0,0)");l.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),l.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==we.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",n.includes("Italic")?"Italic":"").style("text-decoration",n.includes("Underline")?"Underline":"").style("font-weight",n.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),l.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(n){throw n}},Ti=(t,e)=>e*(1+t),Ri=(t,e)=>e/(1+t);function $l(t,e,r){const o=t>0?t:0,h=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,n=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,l=Array.isArray(r?.dimensionList)?r.dimensionList.length:0;let s=0,x=0,m=!1;if(l>0&&o>0){const A=o/l,u=Ri(n,A);if(u>=h||e.plotArea.fitChart)x=u,s=l,m=!1;else{const S=Ti(n,h),p=Math.floor(o/S);p<=1?(s=1,x=Ri(n,o),m=l>1):(s=p,x=h,m=s<l)}}else s=0,x=0,m=!1;return{visibleBars:s,columnWidth:x,scrollbarVisible:m}}const Ba=(t,e,r)=>Math.max(e,Math.min(r,t)),Bt=(t,e,r,o,h,n,l,s,x,m,A,u,S=!1)=>{const p=(H,g,G,V,j)=>{try{if(j&&(H=m+H),!x||!Array.isArray(x.dimensionList)||!Array.isArray(t))return;H=H==null?0:Number(H),g=g==null?0:Number(g),G=G==null?0:Number(G),m=Ba(Math.round(H),0,Math.max(0,g)),s=typeof s=="number"?s:0;const K=m,Z=K+s;let Y=x.dimensionList.slice(K,Z),N=JSON.parse(JSON.stringify(t||[]));N.forEach((xe,Ae)=>{const pe=Array.isArray(xe?.data)?xe.data:[];N[Ae].data=pe.filter(ue=>Y.includes(ue?.dimension))});const E=h?.left??0,z=h?.top??0,q=Number(n)||0,ce=Number(innerHeight)||0,ne=Number(G)||0,oe=g===0?1:g;if(S){const xe=z+(ce-ne)*(g===0?0:m)/oe;V&&typeof V.attr=="function"&&V.attr("y",xe)}else{const xe=E+(q-ne)*(g===0?0:m)/oe;V&&typeof V.attr=="function"&&V.attr("x",xe)}u(Y,N,s)}catch(K){typeof ge=="function"&&ge("ColumnChart","updateFromScrollPosition",K)}};if(l){const H=e-h.top-h.bottom,g=Math.max(0,t[0].data.length-s),G=e-8;o.append("rect").attr("id","scrollbarTrack").attr("x",S?r-8:h.left).attr("y",S?h.top:G).attr("width",S?8:n).attr("height",S?H:8).attr("fill","#ccc");const V=(S?H:n)*s/x.dimensionList.length,j=o.append("rect").attr("x",S?r-8:h.left).attr("y",S?h.top:G).attr("width",S?8:V).attr("height",S?V:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");j.call(T.drag().on("drag",K=>{if(S){const Y=(Ba(K.y,h.top,h.top+H-V)-h.top)/(H-V)*(g||1);p(Y,g,V,j,!1),j.attr("y",h.top+(H-V)*(g===0?0:m)/(g===0?1:g))}else{const Y=(Ba(K.x,h.left,h.left+n-V)-h.left)/(n-V)*(g||1);p(Y,g,V,j,!1),j.attr("x",h.left+(n-V)*(g===0?0:m)/(g===0?1:g))}})),o.on("wheel",K=>{K.preventDefault();const Y=(S?K.deltaY:K.deltaX)>0?1:-1;if(p(Y,g,V,j,!0),S){const N=h.top+(H-V)*(g===0?0:m)/(g===0?1:g);j.attr("y",N)}else{const N=h.left+(n-V)*(g===0?0:m)/(g===0?1:g);j.attr("x",N)}})}else o.on("wheel",null);p(0,0,0,null,!0)};function qa(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H){try{if(l.total.totalVisibility){const g=l.annotation.annotationVisibility!="5"?10:0;let G=l.total.annotationType??"1",V=[G=="1"?"connector":""],j=h.annotation(),K=l.total.connectorType,Z=l.total.totalFontStyle,Y=l.total.connectorType?l.total.connectorType.toLowerCase():"None";n=[];let N=[],E=Array.from(t,([q,ce])=>({Dimension:q,Measure:ce}));l.total.totalHideZeroValues&&(E=E.filter(q=>q.Measure!==0)),E.forEach((q,ce)=>{let ne={note:{label:q.Measure>=1e9&&l.total.totalNumberFormat===".2s"?Math.round(q.Measure/1e9)+"B":_e(q.Measure,l.total.totalDisplayUnits||l.plotArea.plotAreaDisplayUnits,l.total.totalNumberFormat,l.total.totalDecimalPrecision)},data:{y:q.Measure,x:q.Dimension},dx:0,dy:0,connector:{end:Y,curve:si[l.total.connectorCurve]},disable:V,subject:{height:15,width:15},color:l.total.totalColor,type:di(h,parseFloat(G)),height:x,width:m};N.push(ne)}),j.editMode(l.total.annotationDraggable&&u).accessors({x:function(q){if(!S)return e(q.x);if(q.y>=0){const ne=H?.get(q.x)??q.y;return r(ne)+25}const ce=p?.get(q.x)??q.y;return r(ce)-25},y:function(q){if(S){const ne=parseFloat(l.total.totalFontSize)||12;return l.annotation.annotationVisibility!=="5"?e(q.x)-ne-4:e(q.x)-ne/2}if(q.y>=0){const ne=H?.get(q.x)??q.y;return r(ne)-g-15}const ce=p?.get(q.x)??q.y;return r(ce)+g+5}}).on("dragend",function(q){z.selectAll(".connector").style("stroke",l.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]),z.selectAll(`.connector-${Y}`).attr("fill",l.total.connectorColor||"#ccc").style("stroke",l.total.connectorColor||"#ccc"),z.selectAll(".note-line").attr("hoverId",ce=>ce.data.currentLegend).style("stroke",l.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]).filter(ce=>ce._dx==0&&ce._dy==0).remove()}).accessorsInverse({x:q=>e.invert(q.x),y:q=>r.invert(q.y)}).notePadding(0).annotations(N);let z=Yl(A,l,o,Z,j,Y);l.animation?.animationEnabled&&z.selectAll(".annotation").each(function(q){const ce=T.select(this),oe=ce.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!oe)return;const xe=parseFloat(oe[1]),Ae=parseFloat(oe[2]);if(S){const pe=r(0);ce.attr("transform",`translate(${pe},${Ae})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${xe},${Ae})`)}else{const pe=r(0);ce.attr("transform",`translate(${xe},${pe})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${xe},${Ae})`)}})}}catch(g){throw g}}const Yl=(t,e,r,o,h,n)=>{t.selectAll(".total-annotation-group").remove();let l=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.total.totalColor).style("font-family",e.total.totalFontFamily).style("font-size",e.total.totalFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(h);return l.selectAll("rect").style("visibility","hidden"),l.selectAll(".annotation-subject").remove(),l.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.total.connectorStyle.toLowerCase()]),l.selectAll(`.connector-${n}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),l.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.total.connectorStyle.toLowerCase()]).filter(s=>s._dx==0&&s._dy==0).remove(),l.selectAll(".connector-end").filter(s=>s.connector.end=="dot"&&s._dx==0&&s._dy==0).remove(),e.total.annotationType=="1"&&l.selectAll(".annotation-note-content").attr("transform",function(){const x=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(x)return`translate(${parseFloat(x[1])}, 0)`}),l.selectAll("text").append("text").style("fill",e.total.totalColor!==we.white?e.total.totalColor:"none"),l};function Ka(t,e,r){e.clear(),r&&r.length>0&&r.forEach(o=>{e.set(o,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(o=>{o.data.forEach((h,n)=>{if(e.has(h.dimension)){let l=e.get(h.dimension)||0;l+=h.value||0,e.set(h.dimension,l)}})})}function ia(t,e,r,o=!1){const h=o&&t.xAxisLabel.xAxisPosition=="1"?-1:1,n=r>0?r:0,l=parseFloat(t.plotArea.ticksHeight)||100,s=(e-n)*l/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-s*h:0}function Pt(t,e,r=0){const o=parseFloat(t.plotArea.ticksWidth)||100,h=(e-r)*o/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-h:0}const zi={color:"defaultColor",name:"",type:"Line",axis:at.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:qe,labelColor:we.black,hideZeroValues:!1,markerShape:"Circle",lineStyle:"Solid",annotationPosition:1,markerColor:"defaultColor",areaBorderColor:"defaultColor",lineWidth:1.5,markerSize:1,opacity:.5,annotation:1,disableAnnotation:!0,disableAnnotationPosition:!0,connector:1,disableConnector:!0,measureUniqueId:"measureUniId",legendUniqueId:"uniqueLegendId",disableMarkerShape:!0,disableMarkerSize:!0,disableMarkerColor:!0,disableLineWidth:!0,disableLineStyle:!0,borderStyle:"Solid",borderWidth:2,borderRadius:0,borderColor:"black",labelFontSize:11,labelFontStyle:[],labelFont:qe,labelFontColor:"black",valueFontSize:11,valueFontStyle:[],valueFont:qe,valueFontColor:"black",backgroundColor:we.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:we.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var Qe=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(Qe||{});const Ul="11px",Bl="1.6";function At(t,e,r){return(o,h)=>{!t.current||!e.current||e.current(r(o,h))}}function ht(t,e,r){return t?.(e,r)??void 0}const ct="CommonFunctions.ts";re.ColumnChart,re.StackColumnChart,re.NormalizedStackColumnChart,re.LineChart,re.StackLineChart,re.NormalizedStackLineChart,re.AreaChart,re.StackAreaChart,re.NormalizedStackAreaChart,re.PieChart,re.PieofPie,re.DonutChart,re.PyramidChart,re.OrganizationChart,re.VennChart,re.ProgressChart,re.Maps,re.WordCloud,re.SankeyChart,re.Speedometer,re.RadialBarChart;function Dt(t,e,r,o,h,n,l,s,x,m,A,u,S,p){try{let H=l.legends.legendPosition,g=l.legends.legendAlignmentTopBottom,G=l.legends.legendAlignment;if(l.legends.legendVisibility)switch(H){case Be.none:break;case Be.right:let V=l.plotArea.fitChart?t-o-10:t-o-20;oa(e,s,h-(n+15),o+5,n+5,V,H,G,u,l,x,!1,p);break;case Be.top:oa(e,s,7,o,h-10,30,H,g,u,l,x,!1,p);break;case Be.left:let j=l.plotArea.fitChart?t-o-10:t-o-20;const K=m?m+A.bottom:0;oa(e,s,7,o+5,n+5,j-K,H,G,u,l,x,!1,p);break;case Be.bottom:oa(e,s,7,t-35,h-10,30,H,g,u,l,x,!1,p);break}}catch(H){ge(ct,"drawLegends",H)}}function Wl(t,e){try{let r=0,o=t[0];return t.forEach(h=>{if(h!==void 0){let n=h.includes("~$~")?h.split("~$~")[1]:h.includes("-")?h.slice(h.indexOf("-")+1):h,l=n.length;r<l&&(r=l,o=n)}}),Tt(o,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(r){ge(ct,"calculateMaxLegendWidth",r)}}function Ca(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H){try{let g=s.plotArea.hideZeroValues;s.plotArea.plotAreaHideLineAndMarkers===void 0&&(s.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(K=>K.data.forEach(Z=>{Z.markerShape=[re.CombinationLine,re.CombinationArea].includes(r)&&!s.plotArea.plotAreaHideLineAndMarkers?"None":K.properties.markerShape?K.properties.markerShape:"Circle",Z.currentMeasure=K.properties.currentMeasure,Z.markerColor=K.properties.markerColor?K.properties.markerColor:"Blue",Z.alias=K.properties.alias,Z.markerSize=K.properties.markerShape!="None"&&K.properties.markerSize&&K.properties.markerShape!="None"?r==="Area"?s.plotArea.plotAreaHideLineAndMarkers?K.properties.markerSize:0:K.properties.markerSize:0}));let G=t.selectAll(".lineGroup").data(e,K=>K.legend);G.enter().append("g").attr("class","parentGroup").attr("hoverId",K=>(K.properties.alias||K.properties.name||"Legend").replace(/\s+/g,"-")).merge(G).each(function(K){let Y=T.select(this).selectAll("path").data(K.data);const E=Y.enter().append("path").attr("fill",z=>z.markerColor).merge(Y).attr("d",z=>T.symbol().type($i(z.markerShape)).size(z.markerSize*50)()).attr("visibility",z=>{const q=!o(z.dimension)&&o(z.dimension)!==0,ce=s.marker.markerVisibility?Hl(e,z,r,g,n,u,S)?Vt.hidden:[re.NormalizedStackLineChart,re.CombinationLine,re.CombinationArea].includes(r)||[re.StackAreaChart,re.AreaChart,re.CombinationStackArea].includes(r)?s.plotArea.plotAreaHideLineAndMarkers?Vt.visible:Vt.hidden:Vt.visible:[re.CombinationLine,re.CombinationArea].includes(r)||["Area"].includes(r)&&s.plotArea.plotAreaHideLineAndMarkers?Vt.visible:Vt.hidden;return q?Vt.hidden:ce}).attr("transform",z=>{let q=z.axis==at.primary?h:n;const ce=o(z.dimension),ne=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?z[1]>0?q(z[1]):q(z[0]):q(z.value);return`translate(${ce},${ne})`}).on("mousemove",function(z,q){const ce=q,ne=q,oe=T.select(this.parentNode),xe=Array.isArray(ce.dimension)?ce.dimension[0]:ce.dimension,Ae=String(x.formattedDimensionListMap.get(xe)??""),pe=H?.(String(xe??""),{...q,formattedDimensionValue:Ae})??void 0;st([{key:s.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(s.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():s.xAxisTitle.xAxisTitleText,value:x.formattedDimensionListMap.get(Array.isArray(ce.dimension)?ce.dimension[0]:ce.dimension)},{key:s.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(s.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():q.properties?.currentMeasure?q.properties.currentMeasure:s.yAxisTitle.yAxisTitleText||ce.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(r)?ce[1]-ce[0]:ce.value,s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ne.alias.includes("~$~")?ne.alias.split("~$~")[1]:ne.alias}],s,z,q,pe),oe.selectAll(".halo").remove(),oe.insert("circle",":first-child").attr("class","halo").attr("cx",o(ce.dimension)).attr("cy",()=>{const ue=ce.axis===at.primary?h:n;return[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?ce[1]>0?ue(ce[1]):ue(ce[0]):ue(ce.value)}).attr("fill",ne.markerColor).attr("opacity",.5).attr("r",ne.markerSize*10),T.select(this).transition().duration(100).attr("transform",()=>{const ue=ce.axis===at.primary?h:n,O=o(ce.dimension),J=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?ce[1]>0?ue(ce[1]):ue(ce[0]):ue(ce.value);return`translate(${O},${J}) scale(1.3)`})}).on("mouseout",function(z,q){const ce=q,ne=T.select(this.parentNode);rt(),ne.selectAll(".halo").remove(),T.select(this).transition().duration(100).attr("transform",()=>{const oe=ce.axis===at.primary?h:n,xe=o(ce.dimension),Ae=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?ce[1]>0?oe(ce[1]):oe(ce[0]):oe(ce.value);return`translate(${xe},${Ae}) scale(1)`})});if(s.animation.animationEnabled){const z=s.animation.animationDuration,q=Xe[s.animation.animationEffect]??T.easeLinear;if([re.AreaChart,re.StackAreaChart,re.NormalizedStackAreaChart,re.CombinationArea,re.CombinationStackArea].includes(r)){const ne=[re.StackAreaChart,re.NormalizedStackAreaChart,re.CombinationStackArea];E.each(function(oe){const xe=oe.axis===at.primary?h:n,Ae=o(oe.dimension),pe=ne.includes(r)?oe[1]>0?xe(oe[1]):xe(oe[0]):xe(oe.value),ue=h(0);T.select(this).attr("transform",`translate(${Ae},${ue})`).transition().duration(z).ease(q).attr("transform",`translate(${Ae},${pe})`)})}else{const ne=o.range(),oe=Math.min(ne[0],ne[1]),xe=Math.max(ne[0],ne[1])-oe,Ae=(pe,ue=100)=>{for(let O=0;O<=ue;O++){const J=O/ue;if(q(J)>=pe)return J}return 1};E.attr("opacity",0).each(function(pe){const ue=o(pe.dimension)??oe,O=xe>0?Math.max(0,Math.min(1,(ue-oe)/xe)):0,J=Ae(O)*z;T.select(this).transition().delay(J).duration(0).attr("opacity",1)})}}})}catch(g){ge(ct,"lineMarkers",g)}}function $i(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 Hl=(t,e,r,o,h,n,l)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?o&&e.value==0||e.value>h.domain()[1]||e.value<h.domain()[0]:r.includes("Stack")?e.value>0?o&&e[1]==0||e[1]<n||e[1]>l:o&&e[0]==0||e[0]<n||e[0]>l:o&&e.value==0||e.value<n||e.value>l}catch(s){ge(ct,"checkVisibleConditions",s)}};function yi(t,e,r,o,h,n,l,s,x){try{let m=function(u){try{let S=T.pointer(u),p=1e99,H,g=null;for(let V=0;V<A.length;V++){let j=Math.abs(S[0]-n(A[V]));j<p&&(p=j,g=V)}let G=1e99;for(let V=0;V<h.length;V++){const j=x?h[V].data[g].value>0?h[V].data[g][1]:h[V].data[g][0]:h[V].data[g].value;let K=Math.abs(S[1]-l(j));K<G&&(G=K,H=V)}r.attr("transform",Gl(h[H],g,n,l,x)).append("circle").attr("r",h[H].properties.markerSize*2.5).attr("id","tooltip").attr("fill",h[H].properties.markerColor).text(st([{key:t.xAxisTitle.xAxisTitleText,value:h[H].data[g].dimension},{key:h[H].properties.currentMeasure?h[H].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:_e(s===re.NormalizedStackAreaChart?H===0?h[H].data[g].value:h[H].data[g].value-h[H-1].data[g].value:h[H].data[g].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:h[H].data[g].legend.includes("~$~")?h[H].data[g].legend.split("~$~")[1]:h[H].data[g].legend}],t,void 0,h[H].properties))}catch(S){ge(ct,"onHoverMarkerForAreaChartFamily.mousemove",S)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){r.style("display",null)}).on("mousemove",m).on("mouseout",function(){r.style("display","none"),rt()});let A=o}catch(m){ge(ct,"onHoverMarkerForAreaChartFamily",m)}}const Gl=(t,e,r,o,h)=>{try{const n=h?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value;return`translate(${r(t.data[e].dimension)},${o(n)})`}catch(n){ge(ct,"getCoordinates",n)}};function It(t,e,r,o,h){try{const n=document.createElement("div");Object.assign(n.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(n),n.style.transform="",n.style.width="",n.style.whiteSpace="nowrap",n.style.overflowWrap="",e!=null&&(n.style.fontSize=`${e}px`),r!=null&&(n.style.fontFamily=r),h!=null,n.textContent=t;const l=n.getBoundingClientRect(),s=l.width,x=l.height;if(o&&o!==0){n.style.transform=`rotate(${o}deg)`;const m=n.getBoundingClientRect();return n.remove(),{width:s,height:x,rotatedWidth:m.width,rotatedHeight:m.height}}return n.remove(),{width:s,height:x,rotatedWidth:0,rotatedHeight:0}}catch(n){ge(ct,"preCalculateTextDimensions",n)}}function Yi(t,e){try{if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const o=t[r],h=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!h||n===void 0){e[r]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const l=Ui(o),s=Ui(n);l&&s&&Yi(o,n)}),e}catch(r){ge(ct,"addUndefinedDefaults",r)}}function Ui(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){ge(ct,"isPlainObject",e)}}function je(t,e,r){try{let o=1,h="",n=r,l;return function(s){try{let x=s??0;if(t==="Auto")return _l(x);switch(t&&t!=="None"&&(t==="Thousands"&&(o=1e3,h="K"),t==="Millions"&&(o=1e6,h="M"),t==="Billions"&&(o=1e9,h="B"),x=x/o),e){case",.0%":return l=`.${n}%`,T.format(l)(x);case"":return l=`.${n}f`,T.format(l)(x)+h;case".2n":return l=`.${n==0?1:parseFloat(n)+1}n`,T.format(l)(x)+h;case".2$":return l=`,.${n}f`,"$"+T.format(l)(x)+h;case".2c":return l=`,.${n}f`,"C$"+T.format(l)(x)+h;case".2ē":return l=`,.${n}f`,"€"+T.format(l)(x)+h;case".2ch":return l=`,.${n}f`,"CHF"+T.format(l)(x)+h;case".2£":return l=`,.${n}f`,"£"+T.format(l)(x)+h;case".2₹":return l=`,.${n}f`,"₹"+T.format(l)(x)+h;case",":return l=`,.${n}f`,T.format(l)(x)+h;default:return l=".2f",T.format(l)(x)+h}}catch(x){ge(ct,"getNumberWithFormatFunction.inner",x)}}}catch(o){ge(ct,"getNumberWithFormatFunction",o)}}function _l(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 st(t,e,r,o,h){try{const n=o?.color??o?.markerColor??"blue",l=o?.markerShape?.toLowerCase()??"circle",s=e.toolTip.toolTipTheme==="Light",x=s?"rgba(255, 255, 255)":"#272729ff",m=s?"black":we.white,A=s?"gray":"#d1d5db",u=(E,z=6)=>{if(!E)return"";const q=E.split(" ");let ce="";for(let ne=0;ne<q.length;ne+=z)ce+=q.slice(ne,ne+z).join(" ")+"<br/>";return ce};T.selectAll(".chartTooltip").style("visibility",Vt.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),p=T.select("#chartTooltipDiv").html("").append("div").attr("class",s?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",m).style("background",x).style("border",S==="1"?"1px solid #d0d0d0":"1px solid #d4d4d4").style("border-radius",S==="1"?"0":"4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",S==="1"?"none":s?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),H=r||window.event,g=H.pageX,G=H.pageY,V=t.reduce((E,z)=>{const q=(()=>{switch(l){case"circle":return"border-radius: 50%;";case"square":return"";case"triangle":return"clip-path: polygon(50% 0%, 0% 100%, 100% 100%);";case"cross":return"clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);";case"star":return"clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);";case"diamond":return"clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);";case"wye":return"clip-path: polygon(50% 0%, 60% 40%, 100% 40%, 65% 60%, 75% 100%, 50% 75%, 25% 100%, 35% 60%, 0 40%, 40% 40%);";default:return"border-radius: 50%;"}})();return E+=`
26
+ translate(${r.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-n},${-s/2}`:-l/2+" ,2"})`}const Ua=(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H)=>{try{const D=A===le.TornadoChart;let j=t.xAxisLabel.xAxisLabelFontStyle,K=parseInt(t.xAxisLabel.xAxisPosition),J=Lt(L,o),U=u?gt(t.xAxisLabel.xAxisNumberFormat,J.map(ue=>ue)).map(ue=>ue):J;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let V;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?V=t.xAxisLabel.maxXAxisLabelWidth:V=r;let N=g.step();const $=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,X=Math.floor(N/$),se=t.xAxisLabel.xAxisLabelRotation==0;let re=e.append("rect").attr("id","yAxisRect").attr("transform",A===le.TornadoChart?`translate(${-V-1},0)`:`translate(${K===0?-V-5:K===1?h:s(0)+(-V-5)},0)`).attr("height",o).attr("width",A===le.TornadoChart?V:V+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==De.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const oe=e.append("g").attr("id","yAxisG").attr("transform",D?`translate(${s(0)},0)`:`translate(${K===0?0:K===1?h:s(0)},0)`).call(n);let pe=oe.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",V).attr("height",N+"px").attr("transform",El(D,K,t,s,x,V,r,N)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",se?"center":"start").style("align-items",se?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("text-align",t.xAxisLabel.xAxisLabelRotation==0?"center":"start").style("user-select","none").style("margin",0);if((t.xAxisLabel.labelTextWrap&&!t.xAxisLabel.multiLineLabelWrap||!t.xAxisLabel.labelTextWrap)&&pe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap&&pe.style("-webkit-line-clamp",X.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),pe.style("padding",0).style("font-family",t.xAxisLabel.xAxisLabelFontFamily).style("font-style",t.xAxisLabel.xAxisLabelFontStyle).style("color",t.xAxisLabel.xAxisLabelColor).style("font-size",t.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",j.includes("Italic")?"Italic":"").style("text-decoration",j.includes("Underline")?"Underline":"").style("font-weight",j.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(ue,O)=>U[O]).html((ue,O)=>U[O]),A===le.TornadoChart){if(l){const ue=e.append("g").attr("transform",`translate(${s(0)},0)`).call(l);ue.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),ue.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),ue.selectAll("text").style("visibility","hidden")}oe.selectAll("text").style("visibility","hidden")}else oe.selectAll("text").style("visibility","hidden");oe.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),oe.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(D){throw D}},Ii=(t,e,r,o,h,n,l,s,x)=>{try{n=n??0;const L=_e(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,l===le.TornadoChart),A=String(L).length,u=o(e),S=o(n),b=o(0),_=l??"",g=_.includes("stack"),H=_==="100%stackBar";switch(r){case 1:return H?e<0&&e!==-1?u-20:e===-1||e>0&&e!==1?u+10:u-10:e<0||s&&x==="positive"?u-A*5:u+5;case 2:return e===0?g?"":b+15:o(n+(e-n)/2);case 3:return g?n<0?S-A*5:n===0&&e<0?b-A*5:n===0&&e>0?b+10:S+10:e<0?b-A*5:b+10;default:return u}}catch(L){throw L}},Rl=(t,e,r,o,h)=>{try{let n=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-r})`).attr("height",r).attr("width",h).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==De.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const l=e.append("g").call(o).attr("transform","translate(0,0)");l.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),l.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==De.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",n.includes("Italic")?"Italic":"").style("text-decoration",n.includes("Underline")?"Underline":"").style("font-weight",n.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),l.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(n){throw n}},mi=(t,e)=>e*(1+t),Ei=(t,e)=>e/(1+t);function zl(t,e,r){const o=t>0?t:0,h=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,n=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,l=Array.isArray(r?.dimensionList)?r.dimensionList.length:0;let s=0,x=0,L=!1;if(l>0&&o>0){const A=o/l,u=Ei(n,A);if(u>=h||e.plotArea.fitChart)x=u,s=l,L=!1;else{const S=mi(n,h),b=Math.floor(o/S);b<=1?(s=1,x=Ei(n,o),L=l>1):(s=b,x=h,L=s<l)}}else s=0,x=0,L=!1;return{visibleBars:s,columnWidth:x,scrollbarVisible:L}}const Ba=(t,e,r)=>Math.max(e,Math.min(r,t)),Bt=(t,e,r,o,h,n,l,s,x,L,A,u,S=!1)=>{const b=(_,g,H,D,j)=>{try{if(j&&(_=L+_),!x||!Array.isArray(x.dimensionList)||!Array.isArray(t))return;_=_==null?0:Number(_),g=g==null?0:Number(g),H=H==null?0:Number(H),L=Ba(Math.round(_),0,Math.max(0,g)),s=typeof s=="number"?s:0;const K=L,J=K+s;let U=x.dimensionList.slice(K,J),V=JSON.parse(JSON.stringify(t||[]));V.forEach((he,Le)=>{const pe=Array.isArray(he?.data)?he.data:[];V[Le].data=pe.filter(ue=>U.includes(ue?.dimension))});const N=h?.left??0,$=h?.top??0,X=Number(n)||0,se=Number(innerHeight)||0,re=Number(H)||0,oe=g===0?1:g;if(S){const he=$+(se-re)*(g===0?0:L)/oe;D&&typeof D.attr=="function"&&D.attr("y",he)}else{const he=N+(X-re)*(g===0?0:L)/oe;D&&typeof D.attr=="function"&&D.attr("x",he)}u(U,V,s)}catch(K){typeof be=="function"&&be("ColumnChart","updateFromScrollPosition",K)}};if(l){const _=e-h.top-h.bottom,g=Math.max(0,t[0].data.length-s),H=e-8;o.append("rect").attr("id","scrollbarTrack").attr("x",S?r-8:h.left).attr("y",S?h.top:H).attr("width",S?8:n).attr("height",S?_:8).attr("fill","#ccc");const D=(S?_:n)*s/x.dimensionList.length,j=o.append("rect").attr("x",S?r-8:h.left).attr("y",S?h.top:H).attr("width",S?8:D).attr("height",S?D:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");j.call(T.drag().on("drag",K=>{if(S){const U=(Ba(K.y,h.top,h.top+_-D)-h.top)/(_-D)*(g||1);b(U,g,D,j,!1),j.attr("y",h.top+(_-D)*(g===0?0:L)/(g===0?1:g))}else{const U=(Ba(K.x,h.left,h.left+n-D)-h.left)/(n-D)*(g||1);b(U,g,D,j,!1),j.attr("x",h.left+(n-D)*(g===0?0:L)/(g===0?1:g))}})),o.on("wheel",K=>{K.preventDefault();const U=(S?K.deltaY:K.deltaX)>0?1:-1;if(b(U,g,D,j,!0),S){const V=h.top+(_-D)*(g===0?0:L)/(g===0?1:g);j.attr("y",V)}else{const V=h.left+(n-D)*(g===0?0:L)/(g===0?1:g);j.attr("x",V)}})}else o.on("wheel",null);b(0,0,0,null,!0)};function qa(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{if(l.total.totalVisibility){const g=l.annotation.annotationVisibility!="5"?10:0;let H=l.total.annotationType??"1",D=[H=="1"?"connector":""],j=h.annotation(),K=l.total.connectorType,J=l.total.totalFontStyle,U=l.total.connectorType?l.total.connectorType.toLowerCase():"None";n=[];let V=[],N=Array.from(t,([X,se])=>({Dimension:X,Measure:se}));l.total.totalHideZeroValues&&(N=N.filter(X=>X.Measure!==0)),N.forEach((X,se)=>{let re={note:{label:X.Measure>=1e9&&l.total.totalNumberFormat===".2s"?Math.round(X.Measure/1e9)+"B":_e(X.Measure,l.total.totalDisplayUnits||l.plotArea.plotAreaDisplayUnits,l.total.totalNumberFormat,l.total.totalDecimalPrecision)},data:{y:X.Measure,x:X.Dimension},dx:0,dy:0,connector:{end:U,curve:si[l.total.connectorCurve]},disable:D,subject:{height:15,width:15},color:l.total.totalColor,type:ci(h,parseFloat(H)),height:x,width:L};V.push(re)}),j.editMode(l.total.annotationDraggable&&u).accessors({x:function(X){if(!S)return e(X.x);if(X.y>=0){const re=_?.get(X.x)??X.y;return r(re)+25}const se=b?.get(X.x)??X.y;return r(se)-25},y:function(X){if(S){const re=parseFloat(l.total.totalFontSize)||12;return l.annotation.annotationVisibility!=="5"?e(X.x)-re-4:e(X.x)-re/2}if(X.y>=0){const re=_?.get(X.x)??X.y;return r(re)-g-15}const se=b?.get(X.x)??X.y;return r(se)+g+5}}).on("dragend",function(X){$.selectAll(".connector").style("stroke",l.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]),$.selectAll(`.connector-${U}`).attr("fill",l.total.connectorColor||"#ccc").style("stroke",l.total.connectorColor||"#ccc"),$.selectAll(".note-line").attr("hoverId",se=>se.data.currentLegend).style("stroke",l.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]).filter(se=>se._dx==0&&se._dy==0).remove()}).accessorsInverse({x:X=>e.invert(X.x),y:X=>r.invert(X.y)}).notePadding(0).annotations(V);let $=$l(A,l,o,J,j,U);l.animation?.animationEnabled&&$.selectAll(".annotation").each(function(X){const se=T.select(this),oe=se.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!oe)return;const he=parseFloat(oe[1]),Le=parseFloat(oe[2]);if(S){const pe=r(0);se.attr("transform",`translate(${pe},${Le})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${he},${Le})`)}else{const pe=r(0);se.attr("transform",`translate(${he},${pe})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${he},${Le})`)}})}}catch(g){throw g}}const $l=(t,e,r,o,h,n)=>{t.selectAll(".total-annotation-group").remove();let l=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.total.totalColor).style("font-family",e.total.totalFontFamily).style("font-size",e.total.totalFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(h);return l.selectAll("rect").style("visibility","hidden"),l.selectAll(".annotation-subject").remove(),l.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.total.connectorStyle.toLowerCase()]),l.selectAll(`.connector-${n}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),l.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.total.connectorStyle.toLowerCase()]).filter(s=>s._dx==0&&s._dy==0).remove(),l.selectAll(".connector-end").filter(s=>s.connector.end=="dot"&&s._dx==0&&s._dy==0).remove(),e.total.annotationType=="1"&&l.selectAll(".annotation-note-content").attr("transform",function(){const x=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(x)return`translate(${parseFloat(x[1])}, 0)`}),l.selectAll("text").append("text").style("fill",e.total.totalColor!==De.white?e.total.totalColor:"none"),l};function Ka(t,e,r){e.clear(),r&&r.length>0&&r.forEach(o=>{e.set(o,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(o=>{o.data.forEach((h,n)=>{if(e.has(h.dimension)){let l=e.get(h.dimension)||0;l+=h.value||0,e.set(h.dimension,l)}})})}function ia(t,e,r,o=!1){const h=o&&t.xAxisLabel.xAxisPosition=="1"?-1:1,n=r>0?r:0,l=parseFloat(t.plotArea.ticksHeight)||100,s=(e-n)*l/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-s*h:0}function Pt(t,e,r=0){const o=parseFloat(t.plotArea.ticksWidth)||100,h=(e-r)*o/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-h:0}const Ri={color:"defaultColor",name:"",type:"Line",axis:at.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:qe,labelColor:De.black,hideZeroValues:!1,markerShape:"Circle",lineStyle:"Solid",annotationPosition:1,markerColor:"defaultColor",areaBorderColor:"defaultColor",lineWidth:1.5,markerSize:1,opacity:.5,annotation:1,disableAnnotation:!0,disableAnnotationPosition:!0,connector:1,disableConnector:!0,measureUniqueId:"measureUniId",legendUniqueId:"uniqueLegendId",disableMarkerShape:!0,disableMarkerSize:!0,disableMarkerColor:!0,disableLineWidth:!0,disableLineStyle:!0,borderStyle:"Solid",borderWidth:2,borderRadius:0,borderColor:"black",labelFontSize:11,labelFontStyle:[],labelFont:qe,labelFontColor:"black",valueFontSize:11,valueFontStyle:[],valueFont:qe,valueFontColor:"black",backgroundColor:De.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:De.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var Qe=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(Qe||{});const Yl="11px",Ul="1.6";function At(t,e,r){return(o,h)=>{!t.current||!e.current||e.current(r(o,h))}}function ht(t,e,r){return t?.(e,r)??void 0}const ct="CommonFunctions.ts";le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.PieChart,le.PieofPie,le.DonutChart,le.PyramidChart,le.OrganizationChart,le.VennChart,le.ProgressChart,le.Maps,le.WordCloud,le.SankeyChart,le.Speedometer,le.RadialBarChart;function Dt(t,e,r,o,h,n,l,s,x,L,A,u,S,b){try{let _=l.legends.legendPosition,g=l.legends.legendAlignmentTopBottom,H=l.legends.legendAlignment;if(l.legends.legendVisibility)switch(_){case Be.none:break;case Be.right:let D=l.plotArea.fitChart?t-o-10:t-o-20;oa(e,s,h-(n+15),o+5,n+5,D,_,H,u,l,x,!1,b);break;case Be.top:oa(e,s,7,o,h-10,30,_,g,u,l,x,!1,b);break;case Be.left:let j=l.plotArea.fitChart?t-o-10:t-o-20;const K=L?L+A.bottom:0;oa(e,s,7,o+5,n+5,j-K,_,H,u,l,x,!1,b);break;case Be.bottom:oa(e,s,7,t-35,h-10,30,_,g,u,l,x,!1,b);break}}catch(_){be(ct,"drawLegends",_)}}function Bl(t,e){try{let r=0,o=t[0];return t.forEach(h=>{if(h!==void 0){let n=h.includes("~$~")?h.split("~$~")[1]:h.includes("-")?h.slice(h.indexOf("-")+1):h,l=n.length;r<l&&(r=l,o=n)}}),wt(o,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(r){be(ct,"calculateMaxLegendWidth",r)}}function Ca(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{let g=s.plotArea.hideZeroValues;s.plotArea.plotAreaHideLineAndMarkers===void 0&&(s.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(K=>K.data.forEach(J=>{J.markerShape=[le.CombinationLine,le.CombinationArea].includes(r)&&!s.plotArea.plotAreaHideLineAndMarkers?"None":K.properties.markerShape?K.properties.markerShape:"Circle",J.currentMeasure=K.properties.currentMeasure,J.markerColor=K.properties.markerColor?K.properties.markerColor:"Blue",J.alias=K.properties.alias,J.markerSize=K.properties.markerShape!="None"&&K.properties.markerSize&&K.properties.markerShape!="None"?r==="Area"?s.plotArea.plotAreaHideLineAndMarkers?K.properties.markerSize:0:K.properties.markerSize:0}));let H=t.selectAll(".lineGroup").data(e,K=>K.legend);H.enter().append("g").attr("class","parentGroup").attr("hoverId",K=>(K.properties.alias||K.properties.name||"Legend").replace(/\s+/g,"-")).merge(H).each(function(K){let U=T.select(this).selectAll("path").data(K.data);const N=U.enter().append("path").attr("fill",$=>$.markerColor).merge(U).attr("d",$=>T.symbol().type(zi($.markerShape)).size($.markerSize*50)()).attr("visibility",$=>{const X=!o($.dimension)&&o($.dimension)!==0,se=s.marker.markerVisibility?Wl(e,$,r,g,n,u,S)?Vt.hidden:[le.NormalizedStackLineChart,le.CombinationLine,le.CombinationArea].includes(r)||[le.StackAreaChart,le.AreaChart,le.CombinationStackArea].includes(r)?s.plotArea.plotAreaHideLineAndMarkers?Vt.visible:Vt.hidden:Vt.visible:[le.CombinationLine,le.CombinationArea].includes(r)||["Area"].includes(r)&&s.plotArea.plotAreaHideLineAndMarkers?Vt.visible:Vt.hidden;return X?Vt.hidden:se}).attr("transform",$=>{let X=$.axis==at.primary?h:n;const se=o($.dimension),re=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?$[1]>0?X($[1]):X($[0]):X($.value);return`translate(${se},${re})`}).on("mousemove",function($,X){const se=X,re=X,oe=T.select(this.parentNode),he=Array.isArray(se.dimension)?se.dimension[0]:se.dimension,Le=String(x.formattedDimensionListMap.get(he)??""),pe=_?.(String(he??""),{...X,formattedDimensionValue:Le})??void 0;ot([{key:s.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(s.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():s.xAxisTitle.xAxisTitleText,value:x.formattedDimensionListMap.get(Array.isArray(se.dimension)?se.dimension[0]:se.dimension)},{key:s.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(s.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():X.properties?.currentMeasure?X.properties.currentMeasure:s.yAxisTitle.yAxisTitleText||se.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(r)?se[1]-se[0]:se.value,s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:re.alias.includes("~$~")?re.alias.split("~$~")[1]:re.alias}],s,$,X,pe),oe.selectAll(".halo").remove(),oe.insert("circle",":first-child").attr("class","halo").attr("cx",o(se.dimension)).attr("cy",()=>{const ue=se.axis===at.primary?h:n;return[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?se[1]>0?ue(se[1]):ue(se[0]):ue(se.value)}).attr("fill",re.markerColor).attr("opacity",.5).attr("r",re.markerSize*10),T.select(this).transition().duration(100).attr("transform",()=>{const ue=se.axis===at.primary?h:n,O=o(se.dimension),q=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?se[1]>0?ue(se[1]):ue(se[0]):ue(se.value);return`translate(${O},${q}) scale(1.3)`})}).on("mouseout",function($,X){const se=X,re=T.select(this.parentNode);rt(),re.selectAll(".halo").remove(),T.select(this).transition().duration(100).attr("transform",()=>{const oe=se.axis===at.primary?h:n,he=o(se.dimension),Le=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?se[1]>0?oe(se[1]):oe(se[0]):oe(se.value);return`translate(${he},${Le}) scale(1)`})});if(s.animation.animationEnabled){const $=s.animation.animationDuration,X=Xe[s.animation.animationEffect]??T.easeLinear;if([le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationArea,le.CombinationStackArea].includes(r)){const re=[le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationStackArea];N.each(function(oe){const he=oe.axis===at.primary?h:n,Le=o(oe.dimension),pe=re.includes(r)?oe[1]>0?he(oe[1]):he(oe[0]):he(oe.value),ue=h(0);T.select(this).attr("transform",`translate(${Le},${ue})`).transition().duration($).ease(X).attr("transform",`translate(${Le},${pe})`)})}else{const re=o.range(),oe=Math.min(re[0],re[1]),he=Math.max(re[0],re[1])-oe,Le=(pe,ue=100)=>{for(let O=0;O<=ue;O++){const q=O/ue;if(X(q)>=pe)return q}return 1};N.attr("opacity",0).each(function(pe){const ue=o(pe.dimension)??oe,O=he>0?Math.max(0,Math.min(1,(ue-oe)/he)):0,q=Le(O)*$;T.select(this).transition().delay(q).duration(0).attr("opacity",1)})}}})}catch(g){be(ct,"lineMarkers",g)}}function zi(t){return t=="Square"?T.symbolSquare:t=="Circle"?T.symbolCircle:t=="Cross"?T.symbolCross:t=="Triangle"?T.symbolTriangle:t=="Star"?T.symbolStar:t=="Diamond"?T.symbolDiamond:t=="Wye"?T.symbolWye:T.symbolCircle}const Wl=(t,e,r,o,h,n,l)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?o&&e.value==0||e.value>h.domain()[1]||e.value<h.domain()[0]:r.includes("Stack")?e.value>0?o&&e[1]==0||e[1]<n||e[1]>l:o&&e[0]==0||e[0]<n||e[0]>l:o&&e.value==0||e.value<n||e.value>l}catch(s){be(ct,"checkVisibleConditions",s)}};function di(t,e,r,o,h,n,l,s,x){try{let L=function(u){try{let S=T.pointer(u),b=1e99,_,g=null;for(let D=0;D<A.length;D++){let j=Math.abs(S[0]-n(A[D]));j<b&&(b=j,g=D)}let H=1e99;for(let D=0;D<h.length;D++){const j=x?h[D].data[g].value>0?h[D].data[g][1]:h[D].data[g][0]:h[D].data[g].value;let K=Math.abs(S[1]-l(j));K<H&&(H=K,_=D)}r.attr("transform",Hl(h[_],g,n,l,x)).append("circle").attr("r",h[_].properties.markerSize*2.5).attr("id","tooltip").attr("fill",h[_].properties.markerColor).text(ot([{key:t.xAxisTitle.xAxisTitleText,value:h[_].data[g].dimension},{key:h[_].properties.currentMeasure?h[_].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:_e(s===le.NormalizedStackAreaChart?_===0?h[_].data[g].value:h[_].data[g].value-h[_-1].data[g].value:h[_].data[g].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:h[_].data[g].legend.includes("~$~")?h[_].data[g].legend.split("~$~")[1]:h[_].data[g].legend}],t,void 0,h[_].properties))}catch(S){be(ct,"onHoverMarkerForAreaChartFamily.mousemove",S)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){r.style("display",null)}).on("mousemove",L).on("mouseout",function(){r.style("display","none"),rt()});let A=o}catch(L){be(ct,"onHoverMarkerForAreaChartFamily",L)}}const Hl=(t,e,r,o,h)=>{try{const n=h?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value;return`translate(${r(t.data[e].dimension)},${o(n)})`}catch(n){be(ct,"getCoordinates",n)}};function It(t,e,r,o,h){try{const n=document.createElement("div");Object.assign(n.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(n),n.style.transform="",n.style.width="",n.style.whiteSpace="nowrap",n.style.overflowWrap="",e!=null&&(n.style.fontSize=`${e}px`),r!=null&&(n.style.fontFamily=r),h!=null,n.textContent=t;const l=n.getBoundingClientRect(),s=l.width,x=l.height;if(o&&o!==0){n.style.transform=`rotate(${o}deg)`;const L=n.getBoundingClientRect();return n.remove(),{width:s,height:x,rotatedWidth:L.width,rotatedHeight:L.height}}return n.remove(),{width:s,height:x,rotatedWidth:0,rotatedHeight:0}}catch(n){be(ct,"preCalculateTextDimensions",n)}}function $i(t,e){try{if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const o=t[r],h=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!h||n===void 0){e[r]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const l=Yi(o),s=Yi(n);l&&s&&$i(o,n)}),e}catch(r){be(ct,"addUndefinedDefaults",r)}}function Yi(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){be(ct,"isPlainObject",e)}}function je(t,e,r){try{let o=1,h="",n=r,l;return function(s){try{let x=s??0;if(t==="Auto")return Gl(x);switch(t&&t!=="None"&&(t==="Thousands"&&(o=1e3,h="K"),t==="Millions"&&(o=1e6,h="M"),t==="Billions"&&(o=1e9,h="B"),x=x/o),e){case",.0%":return l=`.${n}%`,T.format(l)(x);case"":return l=`.${n}f`,T.format(l)(x)+h;case".2n":return l=`.${n==0?1:parseFloat(n)+1}n`,T.format(l)(x)+h;case".2$":return l=`,.${n}f`,"$"+T.format(l)(x)+h;case".2c":return l=`,.${n}f`,"C$"+T.format(l)(x)+h;case".2ē":return l=`,.${n}f`,"€"+T.format(l)(x)+h;case".2ch":return l=`,.${n}f`,"CHF"+T.format(l)(x)+h;case".2£":return l=`,.${n}f`,"£"+T.format(l)(x)+h;case".2₹":return l=`,.${n}f`,"₹"+T.format(l)(x)+h;case",":return l=`,.${n}f`,T.format(l)(x)+h;default:return l=".2f",T.format(l)(x)+h}}catch(x){be(ct,"getNumberWithFormatFunction.inner",x)}}}catch(o){be(ct,"getNumberWithFormatFunction",o)}}function Gl(t){if(t==null)return"0";let e=Math.abs(t);return e>=1e9?(t/1e9).toFixed(2)+"B":e>=1e6?(t/1e6).toFixed(2)+"M":e>=1e3?(t/1e3).toFixed(2)+"K":t.toFixed(2)}function ot(t,e,r,o,h){try{const n=o?.color??o?.markerColor??"blue",l=o?.markerShape?.toLowerCase()??"circle",s=e.toolTip.toolTipTheme==="Light",x=s?"rgba(255, 255, 255)":"#272729ff",L=s?"black":De.white,A=s?"gray":"#d1d5db",u=(N,$=6)=>{if(!N)return"";const X=N.split(" ");let se="";for(let re=0;re<X.length;re+=$)se+=X.slice(re,re+$).join(" ")+"<br/>";return se};T.selectAll(".chartTooltip").style("visibility",Vt.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),b=T.select("#chartTooltipDiv").html("").append("div").attr("class",s?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",L).style("background",x).style("border",S==="1"?"1px solid #d0d0d0":"1px solid #d4d4d4").style("border-radius",S==="1"?"0":"4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",S==="1"?"none":s?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),_=r||window.event,g=_.pageX,H=_.pageY,D=t.reduce((N,$)=>{const X=(()=>{switch(l){case"circle":return"border-radius: 50%;";case"square":return"";case"triangle":return"clip-path: polygon(50% 0%, 0% 100%, 100% 100%);";case"cross":return"clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);";case"star":return"clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);";case"diamond":return"clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);";case"wye":return"clip-path: polygon(50% 0%, 60% 40%, 100% 40%, 65% 60%, 75% 100%, 50% 75%, 25% 100%, 35% 60%, 0 40%, 40% 40%);";default:return"border-radius: 50%;"}})();return N+=`
27
27
  <div style="
28
28
  display:flex;
29
29
  align-items:flex-start;
@@ -52,7 +52,7 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),K=V<j[0]+10?V:j[0]+
52
52
  color:${A};
53
53
  white-space:nowrap;
54
54
  ">
55
- ${z.key||""}
55
+ ${$.key||""}
56
56
  </span>
57
57
  </div>
58
58
 
@@ -60,126 +60,126 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),K=V<j[0]+10?V:j[0]+
60
60
  <div style="
61
61
  font-size:11px;
62
62
  font-weight:bold;
63
- color:${m};
63
+ color:${L};
64
64
  text-align:right;
65
65
  max-width:200px;
66
66
  word-break:break-word;
67
67
  line-height:1.4;
68
68
  ">
69
- ${u(String(z.value),6)}
69
+ ${u(String($.value),6)}
70
70
  </div>
71
71
 
72
72
  </div>
73
- `,E},"");p.html(h?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${Ul}; color:${m}; line-height:${Bl};">${h}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${V}</div>`);const j=p.node(),K=j.offsetWidth,Z=j.offsetHeight;let Y=g+15,N=G+15;Y+K>window.innerWidth&&(Y=g-K-10),N+Z>window.innerHeight&&(N=G-Z-10),p.style("left",`${Y}px`).style("top",`${N}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(n){console.error("Tooltip Error:",n)}}function rt(){try{T.select("#chartTooltipDiv").html("").style("visibility",Vt.hidden)}catch(t){ge(ct,"hideTooltipOnMouseOut",t)}}const _t=(t,e,r,o)=>{try{let n=T.select(t.current).append("foreignObject").attr("visibility",o.chartTitle.chartTitleVisibility?Vt.visible:Vt.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r).attr("height",e+"px");o.chartTitle.dynamicTitleText.length!==0?n.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",Vt.visible).style("line-height","1.3em").html(o.chartTitle.chartTitleHTML?o.chartTitle.chartTitleHTML:o.chartTitle.chartTitleText):n.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",Vt.visible).style("line-height","1.3em").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",o.chartTitle.chartTitleFontFamily).attr("title",o.chartTitle.chartTitleText).html(o.chartTitle.chartTitleText)}catch(h){ge(ct,"drawChartTitle",h)}},Bi=(t,e)=>{try{return t.reduce((r,o)=>{const h=typeof o=="string"?o:e&&typeof o=="object"&&o[e]||"";return h.length>r.length?h:r},"")}catch(r){ge(ct,"findStringWithLongestLength",r)}},oa=(t,e,r,o,h,n,l,s,x,m,A,u=!1,S)=>{try{if(m.legends.legendVisibility){let H="",g="";l==Be.left||l==Be.right?(g="column",H=s==Fa.top?"start":s==Fa.middle?"center":"end"):(g="row",H=s==wa.start?"start":s==wa.middle?"center":"end");var p=t.append("foreignObject").attr("x",r).attr("y",o).style("pointer-events","auto").attr("width",h+"px").attr("height",n+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+A).attr("class","legendsBoxWrapper").style("width",h+"px").style("display","flex").style("height",n-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+H).style("flex-direction",g).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",g).style("flex-wrap","nowrap").style("padding-left","3px");(l==Be.top||l==Be.bottom)&&p.style("flex-direction","row"),e.forEach((V,j)=>{let K=p.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(V?.properties)}).on("mousemove",function(){if(m.legends.onHoverEffect){const E=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${E}"]`).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 E=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${E}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(l==Be.top||l==Be.bottom)&&K.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let Z;if(!x){let E=V.properties.type;E==re.ColumnChart||E==re.StackColumnChart?Z=nt.rectangle:E==re.LineChart||E==re.StackLineChart?Z=nt.line:(E==re.AreaChart||E==re.StackAreaChart)&&(Z=nt.areaWithLine)}(x||Z)==nt.circle?jl(V,K):(x||Z)==nt.hollowCircle?Jl(V,K):(x||Z)==nt.line?Wi(V,K,m):(x||Z)==nt.areaWithLine?Hi(V,K,m):(x||Z)==nt.rectangle&&Zl(V,K);let Y=u&&(l==Be.bottom||l==Be.top)&&j!=e.length-1?" |":"",N=u?m.legends.legendSelectedUnicolor:m.legends.legendColorMode==Tl.multiColor?V.properties.color?V.properties.color:we.black:m.legends.legendSelectedUnicolor;K.append("div").style("margin-left","5px").style("color",N).style("background",V.properties.axis==at.secondary&&m.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(u?m.legends.legendFontSize:V.properties.fontSize)+"px").style("font-family",u?m.legends.legendFontFamily:V.properties.fontFamily).style("font-style",()=>(u?m.legends.legendFontStyle:V.properties.fontStyle).includes(se.italic)?se.italic:"").style("text-decoration",()=>(u?m.legends.legendFontStyle:V.properties.fontStyle).includes(se.underline)?se.underline:"").style("font-weight",()=>(u?m.legends.legendFontStyle:V.properties.fontStyle).includes(se.bold)?se.bold:"").style("white-space","nowrap").attr("title",u?V.legendDisplay+" : "+V.actualValue:V.properties.alias).html(u?V.legendDisplay+" : "+V.actualValue+Y:V.properties.alias)})}}catch(H){ge(ct,"legendsWithScroll",H)}};function jl(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(r){ge(ct,"getCircleShape",r)}}function Jl(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("border",`3px solid ${t.properties.Color??t.properties.color}`)}catch(r){ge(ct,"getHollowCircleShape",r)}}function Wi(t,e,r){try{const o=t.properties?.lineStyle?.toLowerCase()||"solid";let h=e.append("div").style("height","2px").style("width",o=="dashed"?"25px":"20px").style("background",we.transparent).style("position","relative").style("border-top",o=="none"?"unset":o=="dotted"?"2px dotted "+t.properties.color:o=="dashed"?"2px dashed "+t.properties.color:"2px solid "+t.properties.color);if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":h.append("div").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-6)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","4.5").style("fill",t.properties.markerColor);break;case"square":h.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-2px, -7px)").style("height","8px").style("width","8px").style("top","2px").style("left","9px").style("background",t.properties.markerColor);break;case"triangle":h.append("div").style("position","absolute").style("transform","translate(5px, -6.5px)").style("border-left","6px solid transparent").style("border-right","6px solid transparent").style("border-bottom",`10px solid ${t.properties.markerColor}`);break;case"cross":h.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-5px, -3px)").style("height","4px").style("width","10px").style("background",t.properties.markerColor).append("div").style("height","10px").style("width","4px").style("background",t.properties.markerColor).style("position","relative").style("top","-3px").style("left","3px");break;case"diamond":h.append("div").style("height","7px").style("width","7px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-4px").style("left","7px").style("position","absolute");break;case"star":h.append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-bottom",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-6.5px").style("left","7px").style("transform","rotate(0deg)").append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-top",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","2px").style("left","-4px").style("transform","rotate(360deg)");break;case"wye":h.append("div").style("height","6.5px").style("width","3px").style("background",t.properties.markerColor).style("position","absolute").style("left","10px").style("top","-3.5px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":default:break}}catch(o){ge(ct,"getLineShape",o)}}function Hi(t,e,r){try{let o=e.append("div").style("height","10px").style("width","15px").style("background",t.properties.color).style("display","flex").style("flex-direction","column").style("border-radius","1px");if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.color).style("position","relative").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-5)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","2.5").style("fill",t.properties.markerColor);break;case"square":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-4px, -3.5px)").style("height","5px").style("width","5px").style("top","2px").style("left","9px").style("background",t.properties.markerColor).style("border-radius","1px");break;case"triangle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("transform","translate(5px, -3.5px)").style("border-left","3px solid transparent").style("border-right","3px solid transparent").style("border-bottom",`7px solid ${t.properties.markerColor}`);break;case"cross":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-3px, -2px)").style("height","4px").style("width","7px").style("background",t.properties.markerColor).append("div").style("height","6px").style("width","3px").style("background",t.properties.markerColor).style("position","relative").style("top","-1px").style("left","2px");break;case"diamond":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4px").style("width","4px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-1px").style("left","5px").style("position","absolute");break;case"star":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-bottom",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-3px").style("left","6px").style("transform","rotate(0deg)").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-top",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","0.5px").style("left","-2px").style("transform","rotate(360deg)");break;case"wye":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4.5px").style("width","2px").style("background",t.properties.markerColor).style("position","absolute").style("left","6.5px").style("top","-0.5px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor);break;default:break}o.append("div").style("height","20%").style("width","100%").style("background","white"),o.append("div").style("height","60%").style("width","100%").style("background",t.properties.color).style("border-radius","1px")}catch(o){ge(ct,"getAreaShape",o)}}function Zl(t,e){try{e.append("div").style("height","10px").style("width","15px").style("border-style",t).style("border-width",t).style("border-color",t).style("background",t.properties.color).style("border-radius","1px")}catch(r){ge(ct,"getReactShape",r)}}const jt=(t,e,r,o)=>{try{let h=t.current;h.setAttribute("viewBox",`0 0 ${e} ${r}`);const{chartAreaColor:n,chartAreaBorder:l}=o.chartArea;if(h.style.backgroundColor=n,l){let x=o.chartArea.chartAreaBorderColor,m=o.chartArea.chartAreaBorderThickness+"px",A=et(o.chartArea.chartAreaBorderStyle),u=A==1?"solid":A==2?"dashed":"dotted";h.style.outline=`${m} ${u} ${x}`,h.style.outlineOffset=`-${m}`}else h.style.outline="unset"}catch(h){ge(ct,"initSvg",h)}},la=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){ge(ct,"initChartArea",r)}},Jt=(t,e)=>{try{let r=T.select(t.current);r.selectAll("*").remove();let o=Yi(Fi,e),h=t.current.getBoundingClientRect(),n=h.width,l=h.height;return{chartFormatOptions:o,svg:r,width:n,height:l}}catch(r){ge(ct,"firstFunctionBeforeRender",r)}},Na=(t,e,r,o,h,n=!1)=>{try{let l=t.legends.legendPosition;l=t.legends.legendVisibility?t.legends.legendPosition:Be.none;let s=e*.15*.8,x=n?o[0]:s<o[0]+15?s:o[0]+15,m=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?It(t.chartTitle.chartTitleHTML,void 0,void 0).height:It(t.chartTitle.chartTitleText,16,qe).height:5;switch(l){case Be.none:h.top=m+10,h.bottom=15,h.right=15,h.left=15;break;case Be.top:h.top=m+50,h.bottom=15,h.right=15,h.left=15;break;case Be.right:h.right=x+50,h.top=m+15,h.bottom=15,h.left=15;break;case Be.bottom:h.bottom=45,h.top=m+15,h.right=15,h.left=15;break;case Be.left:h.left=x+50,h.top=m+15,h.bottom=15,h.right=15}let A=r-h.top-h.bottom,u=e-h.left-h.right;return{margins:h,innerHeight:A,innerWidth:u,legendListWidth:x,chartTitleHeight:m}}catch(l){ge(ct,"marginCalculationsForChartsWithoutAxis",l)}},Pa=(t,e,r,o,h,n,l,s,x,m,A=!0,u)=>{try{let S=t.legends.legendPosition,p=t.total.totalPosition,H=t.total.totalAlignment,g=t.total.totalVisibility&&A,G=t.legends.legendAlignmentTopBottom,V=t.legends.legendAlignment;switch(S){case Be.none:break;case Be.right:oa(e,r,o-n-25,l+5+(g&&p==va.top&&H==$t.end?10:0),n+15,h-l-10-(g?p==va.top&&H==$t.end?10:p==va.bottom&&H==$t.start?25:0:0),S,V,m,t,s,!1,u);break;case Be.top:oa(e,r,5,l+5,o-10,30,S,G,m,t,s,!1,u);break;case Be.left:oa(e,r,5,x.top+(g&&p==va.top&&H==$t.start?10:0),n+15,h-l-10-(g?p==va.top&&H==$t.start?10:p==va.bottom&&H==$t.start?25:0:0),S,V,m,t,s,!1,u);break;case Be.bottom:oa(e,r,5,h-35,o-10,30,S,G,m,t,s,!1,u);break}}catch(S){ge(ct,"initLegendListWithTotalValueAllowance",S)}},Ia=(t,e,r="legend")=>{try{let o=It(Bi(e,r),et(t.legends.legendFontSize),t.legends.legendFontFamily);return[o.width,o.height]}catch(o){ge(ct,"calculateLegendsMaxPossibleWidth",o)}},Qa=(t,e,r,o=!1)=>{try{let h=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?It(t.chartTitle.chartTitleHTML,void 0,void 0).height:It(t.chartTitle.chartTitleText,16,qe).height:5,n={top:t.chartTitle.chartTitleVisibility?h:20,bottom:o&&t.colorScale.showColor==ga.colorTheme?40:20,left:20,right:20};return innerHeight=e-n.top-n.bottom,innerWidth=r-n.left-n.right,{margins:n,chartTitleHeight:h,innerHeight,innerWidth}}catch(h){ge(ct,"marginCalculationsForChartsWithoutLegends",h)}},et=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const r=parseFloat(e);return isNaN(r)?t:r}catch(e){ge(ct,"convertStringToNumber",e)}};function bt(t,e,r=!1){try{return t.map(o=>{let h;o.properties?h={...zi,...o.properties}:h={...zi,legend:o.legend,currentLegend:o.legend,alias:o.legend,name:o.legend};const n=e&&e.length!==0?e.map(l=>{const s=o.data.find(x=>x.dimension===l);return s?{...s}:{dimension:l,legend:o.legend,value:0}}):o.data.map(l=>({...l}));return{...o,properties:h,data:r?o.data:n}})}catch(o){ge(ct,"generalizedChartData",o)}}const ui=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){ge(ct,"getJQuerySelector",e)}},hi=(t,e,r,o,h,n,l)=>{try{let s=t-e,x=n-h,m=parseInt(l.connector.connectorKPI),A,u;switch(m){case 1:if(A=`.${r}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return T.format(A)(t);s=Math.abs(s);break;case 3:return A=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(A)(t):(s=Math.round(t/e*100-100)/100,u=T.format(A)(s),u);case 2:return h.toString().length!==4&&(x=NaN),A=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(A)(t):(s=Math.pow(t/e,1/x)-1,u=T.format(A)(s),u)}if(e==0)return"N/A";{let S,p="",H=l.connector.connectorDisplayUnits;switch(H!="None"&&H!=null&&(H=="Thousands"&&(S=1e3,p="K"),H=="Millions"&&(S=1e6,p="M"),H=="Billions"&&(S=1e9,p="B"),s=s/S),isNaN(s)&&(s=0),o){case",.0%":return A=`.${r}%`,T.format(A)(s);case"":return A=`.${r}f`,T.format(A)(s)+p;case".2n":return A=`.${r}n`,T.format(A)(s)+p;case".2$":return A=`,.${r}f`,"$"+T.format(A)(s)+p;case".2c":return A=`,.${r}f`,"C$"+T.format(A)(s)+p;case".2ē":return A=`,.${r}f`,"€"+T.format(A)(s)+p;case".2ch":return A=`,.${r}f`,"CHF"+T.format(A)(s)+p;case",":return A=`,.${r}f`,T.format(A)(s)+p;case".2£":return A=`,.${r}f`,"£"+T.format(A)(s)+p;case".2₹":return A=`,.${r}f`,"₹"+T.format(A)(s)+p;default:return A=".2f",T.format(A)(s)+p}}}catch{}},Wa=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function Xl(t,e,r){try{let o=function(n){const l=n.split(" - ");return l.length>1?l[0]:n};const h=new Map;return e?.LegendList?.forEach(n=>{h.set(r?o(n?.name):n.measureUniqueId,n)}),t.map(n=>({...n,properties:h.get(r?o(n.legend):n.properties.measureUniqueId)??n.properties})).filter(n=>n.data[0].value!==0)}catch{return t}}const ql=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const m=crypto.randomUUID();let A=0,u=!1;const S=re.ColumnChart,p=Te.useRef(),H=Te.useRef(l);H.current=l;const g=Te.useRef(s);g.current=s;const G=Te.useRef(x);G.current=x;const V=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let Z=!1;const Y=!1;let N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,E=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,q=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me,te,ke,ee,De=[],Ve=0,Ye=0;const ie=new Map;let ye={dimensionList:j,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(R){ge("Columnchart","createColumnChart",R)}},[e]);const Pe=()=>{({formatOptions:e,svg:L,width:i,height:y}=Ct(p,e)),{formatOptions:e}=Qt(e,V,r.DataTableData??[]),Me(),{maxNumberForPrimaryAxis:b,maxNumberForSecondaryAxis:k}=Nt(e,ye.yMinLeft,ye.yMaxLeft,ye.yMinRight,ye.yMaxRight),{margin:ce,yLabel:ne,xLabel:oe,yTitle:xe,xTitle:Ae,dimensionHeightWidthArray:pe,chartTitleHeight:ue,secondaryAxisTitleWidth:O,legendMargin:J,secondaryYLabel:F,visibleBars:Ye,columnWidth:A,scrollbarVisible:u}=vt(i,y,b,k,ye.yMaxLeft,e,ye.legendList,ye.dimensionList,ye.yMaxRight,Z,Y,t,!1,ye),le(ce),{dataTable:f,dataTableHeight:a}=ea(e,ne,xe,V,ye.dimensionList,r),kt(L,i,y,e),P=Mt(L,ce),mt(P,e,a,d,c,S,m),Ce(),he(),Gt(P,e,a,ne,me,c),Z&&ci(P,e,a,F,ke,c,d),St(e,K,L,ce,oe,y,Ae,ye.chartType,ne,d,c),Ft(c,e,a,K,L,ce,xe,ne),Ut(L,Z,ce,e,a,c,d,F,O),wt(L,e,i,ue),Dt(y,L,pe,ue,i,J,e,V,m,a,ce,nt.rectangle,S,n),Bt(V,y,i,L,ce,d,u,Ye,ye,Ve,!1,B)},Me=()=>{const R=[],v=[];let w=[],D=-1/0,I=1/0,W=-1/0,C=1/0,M=1/0,_=-1/0;V.forEach(X=>{v.push(X.properties.legendUniqueId),_=-1/0,M=1/0,X.data.forEach($=>{R.push($),X.properties.axis==="Secondary"?(Z=!0,W=Math.max(W,$.value),C=Math.min(C,$.value)):(D=Math.max(D,$.value),I=Math.min(I,$.value)),_=Math.max(_,$.value),M=Math.min(M,$.value)}),X.properties.setColorScale&&ie.set(X.properties.legendUniqueId,T.scaleSequential().domain([M,_]).interpolator(ii.interpolateRgb(X.properties.startColor,X.properties.endColor)))}),ye.chartData=R,ye.legendList=v,ye.yMaxLeft=D,ye.yMinLeft=I>0?0:I,ye.yMaxRight=W,ye.yMinRight=C,w=t?gt(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList).map(X=>X):ye.dimensionList,ye.dimensionList.forEach((X,$)=>{ye.formattedDimensionListMap.set(X,w[$])}),De=JSON.parse(JSON.stringify(V)),ee=ye.dimensionList,e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0)},Ce=()=>{let R=ot(E||ye.yMaxLeft,ye.yMinLeft,c,e,ye,N,E).yAxisLabelArray;ye.yMaxLeft=R[R.length-1],ye.yMinLeft=R[0],ae=T.scaleLinear().domain([ye.yMinLeft>=0?N!==void 0&&!Number.isNaN(N)?N:0:ye.yMinLeft<0?ye.yMinLeft*1.1:ye.yMinLeft*.9,ye.yMaxLeft<=0?0:E!==void 0&&!Number.isNaN(E)?E:ye.yMaxLeft*1.1]).range([a>0?c-a:c,0]),Z&&(Q=T.scaleLinear().domain([ye.yMinRight>=0?(z||z==0)&&!Number.isNaN(z)?z:0:(z||z==0)&&!Number.isNaN(z)?z:ye.yMinRight*1.1,ye.yMaxRight<=0?q||0:q||ye.yMaxRight*1.1]).range([a>0?c-a:c,0])),Fe=[0,d],ve()},ve=()=>{Le=T.scaleBand().domain(ye.legendList).range([0,A]).paddingInner(ye.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),be=T.scalePoint().domain(ee).range(Fe).padding(.5)},he=()=>{{let R=ot(E||ye.yMaxLeft,ye.yMinLeft,c,e,ye,N,E);me=T.axisLeft(ae).tickFormat(v=>_e(v,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,d)).tickValues(R.autoLabelFlag?void 0:R.yAxisLabelArray).ticks(R.customTickValue).tickPadding(8).tickSizeOuter(0)}if(Z){let R=oi(q||Q.domain()[1],Q.domain()[0],e,c);ke=T.axisRight(Q).tickFormat(v=>_e(v,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(R.autoLabelFlag?void 0:R.secondaryYAxisLabelArray).ticks(R.secondaryCustomTickValue??c/30).tickSize(Pt(e,d)).tickPadding(8).tickSizeOuter(0)}},fe=()=>{te=(parseInt(e.xAxisLabel.xAxisPosition)==1?T.axisTop(be):T.axisBottom(be)).tickSize(ia(e,c,a)).tickSizeOuter(0).tickValues(Lt(ee,d))},de=R=>{R.forEach(v=>{v.data.forEach(w=>{w.hideZero=v.properties.hideZeroValues,w.axis=v.properties.axis,w.legendUniqueId=v.properties.legendUniqueId})}),ee.forEach(v=>{P.append("rect").attr("id",`dim-background-${v}`).attr("class","dimension-background").attr("x",be(v)-be.step()/2).attr("width",be.step()).attr("y",0).attr("height",c).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),R.forEach(v=>{let w=P.selectAll(".parentGroup").data([v],M=>M.properties.legendUniqueId);w=w.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(w);let D=w.selectAll(".column-group").data(v.data,M=>M.legend+M.dimension),I=D.enter().append("g").attr("class","column-group").attr("hoverId",(v.properties.alias||v.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",M=>`translate(${be(M.dimension)-A/2}, 0)`);D.attr("transform",M=>`translate(${be(M.dimension)-A/2}, 0)`),I.merge(D).attr("transform",M=>`translate(${be(M.dimension)-A/2}, 0)`);const W=I.append("rect").attr("x",M=>Le(M.legendUniqueId)).attr("width",Le.bandwidth()).attr("y",M=>(v.properties.axis===at.primary?ae:Q)(0)).attr("height",0).attr("fill",M=>ie.get(v.properties.legendUniqueId)?.(M.value)??v.properties.color).attr("stroke-dasharray",M=>v.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",M=>`${v.properties.stackBorderWidth}px`).attr("stroke",M=>v.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?v.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",M=>M.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>v.properties.legendUniqueId).attr(Qe.DimValue,M=>Array.isArray(M.dimension)?String(M.dimension[0]):String(M.dimension));(e.animation.animationEnabled?W.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):W).attr("y",M=>{const _=v.properties.axis===at.primary?ae:Q;return M.value>0?_(M.value):_(0)}).attr("height",M=>{const _=v.properties.axis===at.primary?ae:Q;return Math.abs(_(M.value)-_(0))}),I.merge(D).on("mousemove",(M,_)=>{(v.properties.alias||v.properties.name||"Legend").replace(/ /g,"-");const X=Array.isArray(_.dimension)?_.dimension[0]:_.dimension,$=String(ye.formattedDimensionListMap.get(X)??X??""),Se=ht(H.current,String(X??""),{...v.properties,formattedDimensionValue:$});st([{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:$},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():_.properties?.currentMeasure?_.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||_.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(S)?_[1]-_[0]:_.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:v.properties.alias}],e,M,v.properties,Se)}).on("mouseout",(M,_)=>{(v.properties.alias||v.properties.name||"Legend").replace(/ /g,"-"),rt()}),I.merge(D).on("click",At(G,g,(M,_)=>({seriesId:v.properties.legendUniqueId,dimValue:Array.isArray(_.dimension)?String(_.dimension[0]):String(_.dimension),legendUniqueId:v.properties.legendUniqueId,seriesDisplayName:v.properties.alias||v.properties.name||""}))),D.exit().remove()}),P.selectAll(".parentGroup").raise()},le=R=>{d=i-R.left-R.right,c=y-R.bottom-R.top},B=(R,v,w)=>{De=v,ee=R,Ye=w,U()},U=()=>{ve(),fe(),qt(P,ye,oe,e,a,ae,te,pe,y,A,t,d,c,ee,be),de(De),Da(V,be,ae,Q,ce,dt,[],[],e,S,y,i,d,ee,c,m,L,h,Le,A,o),ta(e.plotArea.fitChart,L,P,f,A,ae,be,Le,void 0,void 0,a,S,e,ne,xe,ye.dimensionList,d,Fe,ye.formattedDimensionListMap,m,ce,c)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:p,id:m,style:{width:"100%",height:"100%"}})})},Kl=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID();let A=0,u=!1,S=[];const p=re.CustomColumnChart,H=Te.useRef(),g=Te.useRef(l);g.current=l;const G=Te.useRef(s);G.current=s;const V=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let Z=!1;const Y=!1;let N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,E=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,q=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me=[],te=[],ke=[],ee=[],De=[],Ve=[],Ye=[],ie=[],ye,Pe,Me,Ce=new Map,ve,he=[],fe=[],de=0,le,B={dimensionList:j,chartType:p,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{U()}catch(Re){ge("CustomColumnchart","createCustomColumnChart",Re)}},[e]);const U=()=>{({formatOptions:e,svg:L,width:i,height:y}=Ct(H,e)),R(),{formatOptions:e}=Qt(e,V,r.DataTableData??[]),tt(),{maxNumberForPrimaryAxis:b,maxNumberForSecondaryAxis:k}=Nt(e,B.yMinLeft,B.yMaxLeft,B.yMinRight,B.yMaxRight),{margin:ce,yLabel:ne,xLabel:oe,yTitle:xe,xTitle:Ae,dimensionHeightWidthArray:pe,chartTitleHeight:ue,secondaryAxisTitleWidth:O,legendMargin:J,secondaryYLabel:F,visibleBars:le,columnWidth:A,scrollbarVisible:u}=vt(i,y,b,k,B.yMaxLeft,e,B.legendList,B.dimensionList,B.yMaxRight,Z,Y,t,!1,B),ze(ce),{dataTable:f,dataTableHeight:a}=ea(e,ne,xe,V,B.dimensionList,r),kt(L,i,y,e),P=Mt(L,ce),mt(P,e,a,d,c,p,m),w(),I(),Gt(P,e,a,ne,ye,c),Z&&ci(P,e,a,F,Me,c,d),St(e,K,L,ce,oe,y,Ae,B.chartType,ne,d,c),Ft(c,e,a,K,L,ce,xe,ne),Ut(L,Z,ce,e,a,c,d,F,O),wt(L,e,i,ue),Dt(y,L,pe,ue,i,J,e,V,m,a,ce,null,p,n),Bt(V,y,i,L,ce,d,u,le,B,de,!1,Ie)},R=()=>{const Re=[];let He=[],it=-1/0,Je=1/0,Ze=-1/0,Ge=1/0,Ee=[];V.forEach((Ne,Ue)=>{[re.StackColumnChart,re.StackAreaChart].includes(Ne.properties.type)?re.StackColumnChart===Ne.properties.type&&(Re.includes(re.StackColumnChart)||Re.push(re.StackColumnChart)):(Ee.push(Ne),Ne.properties.type!==re.LineChart&&Ne.properties.type!==re.AreaChart&&Re.push(Ne.properties.legendUniqueId)),Ne.properties.axis==="Secondary"&&(te.push(Ne),Ne.properties.type==re.StackColumnChart&&Ve.push(Ne),Ne.properties.type==re.StackAreaChart&&De.push(Ne)),Ne.properties.axis===at.primary&&(me.push(Ne),Ne.properties.type==re.StackColumnChart&&ee.push(Ne),Ne.properties.type==re.StackAreaChart&&ke.push(Ne)),Ne.data=Ne.data.map(xt=>{const Ke={...xt,type:Ne.properties.type,axis:Ne.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ne.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ne.properties.labelColor,legendUniqueId:Ne.properties.legendUniqueId};return Ke.axis==="Secondary"?(Z=!0,Ze=Math.max(Ze,Ke.value),Ge=Math.min(Ge,Ke.value)):(it=Math.max(it,Ke.value),Je=Math.min(Je,Ke.value)),Ke})}),he=JSON.parse(JSON.stringify(V)),B.chartData=Ee,B.legendList=Re,B.yMaxLeft=it,B.yMinLeft=Je>0?0:Je,B.yMaxRight=Ze,B.yMinRight=Ge,He=t?gt(e.xAxisLabel.xAxisNumberFormat,B.dimensionList).map(Ne=>Ne):B.dimensionList,B.dimensionList.forEach((Ne,Ue)=>{B.formattedDimensionListMap.set(Ne,He[Ue])}),e.plotArea.fitChart?ve=B.dimensionList:ve=B.dimensionList.slice(de,de+le),e.plotArea.hideZeroValues&&(B.hideZeroValues=!0),v(ke,ee,De,Ve,V)},v=(Re,He,it,Je,Ze)=>{const Ge=pt(ve,Re,!1),Ee=pt(ve,it,!1),Ne=pt(ve,He,!1),Ue=pt(ve,Je,!1);fe=[];const xt=[];if(Re.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ge,data:Re})}),it.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ee,data:it})}),He.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ne,data:He})}),Je.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ue,data:Je})}),xt.push(...B.chartData),Ze.length){const Ke=[];Ze.forEach(pi=>{Ke.push(...xt.filter(cl=>cl.properties?.type===pi.properties.type&&cl.properties.legend===pi.legend))}),fe.push(...Ke)}else fe.push(...xt)},w=()=>{ae=T.scaleLinear().domain([B.yMinLeft>=0?N!==void 0&&!Number.isNaN(N)?N:0:B.yMinLeft<0?B.yMinLeft*1.1:B.yMinLeft*.9,B.yMaxLeft<=0?0:E!==void 0&&!Number.isNaN(E)?E:B.yMaxLeft*1.1]).range([a>0?c-a:c,0]),Z&&(Q=T.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?(q||q==0)&&!Number.isNaN(q)?q:0:(q||q==0)&&!Number.isNaN(q)?q:B.yMaxRight*1.1]).range([a>0?c-a:c,0])),Fe=[0,d]},D=()=>{Le=T.scaleBand().domain(B.legendList).range([0,A]).paddingInner(B.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),be=T.scalePoint().domain(ve).range(Fe).padding(.5)},I=()=>{{let Re=ot(E||B.yMaxLeft,B.yMinLeft,c,e,B,N,E);ye=T.axisLeft(ae).tickFormat(He=>_e(He,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,d)).tickValues(Re.autoLabelFlag?void 0:Re.yAxisLabelArray).ticks(Re.customTickValue).tickPadding(8).tickSizeOuter(0)}if(Z){let Re=ot(E||B.yMaxRight,B.yMinRight,c,e,B,N,E);Me=T.axisRight(Q).tickFormat(He=>_e(He,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Re.autoLabelFlag?void 0:Re.yAxisLabelArray).ticks(Re.customTickValue).tickSize(Pt(e,d)).tickPadding(8).tickSizeOuter(0)}},W=()=>{Pe=T.axisBottom(be).tickSize(ia(e,c,a,!0)).tickSizeOuter(0).tickValues(Lt(ve,d))},C=Re=>{Re.forEach(Je=>{switch(Je.properties.type){default:case re.ColumnChart:M(Je);break;case re.LineChart:break;case re.AreaChart:break;case re.StackColumnChart:Ye=ut(Je),Se();break;case re.StackAreaChart:ie=ut(Je),$(Je);break}});const He=he.filter(Je=>Je.properties.type===re.LineChart);He.length&&_(He);const it=he.filter(Je=>Je.properties.type===re.AreaChart);it.length&&X(it),P.selectAll(".parentGroup").raise()},M=Re=>{let He=P.selectAll(".parentGroup").data([Re],Ee=>Ee.properties?.legendUniqueId);He=He.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(He);let it=He.selectAll(".column-group").data(Re.data,Ee=>Ee.legendUniqueId),Je=it.enter().append("g").attr("class","column-group").attr("hoverId",Ee=>(Re.properties.alias||Re.properties.name).includes("-")?(Re.properties.alias||Re.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(Re.properties.alias||Re.properties.name).replace(/ /g,"-")).attr("transform",Ee=>`translate(${be(Ee.dimension)}, 0)`);Je.merge(it).attr("transform",Ee=>`translate(${be(Ee.dimension)-A/2}, 0)`);const Ze=Je.append("rect").attr("x",Ee=>Le(Ee.legendUniqueId)).attr("width",Le.bandwidth()).attr("y",Ee=>(Re.properties.axis===at.primary?ae:Q)(0)).attr("height",0).attr("fill",Re.properties.color).attr("stroke-dasharray",Ee=>Re.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ee=>`${Re.properties.stackBorderWidth}px`).attr("stroke",Ee=>Re.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Re.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",Ee=>Ee.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>Re.properties.legendUniqueId).attr(Qe.DimValue,Ee=>Array.isArray(Ee.dimension)?String(Ee.dimension[0]):String(Ee.dimension)).on("mousemove",(Ee,Ne)=>{st([{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(Ne.dimension)?Ne.dimension[0]:Ne.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(p)?Ne[1]-Ne[0]:Ne.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.legend.includes("~$~")?Ne.legend.split("~$~")[1]:Ne.legend}],e,Ee,V.filter(Ue=>Ue.legend===Ne.legend)[0].properties,(()=>{const Ue=Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension,xt=V.filter(Ke=>Ke.legend===Ne.legend)[0].properties;return ht(x,String(Ue??""),{...xt,formattedDimensionValue:String(B.formattedDimensionListMap.get(Ue)??Ue??"")})})())}).on("mouseout",rt).on("click",At(G,g,(Ee,Ne)=>({seriesId:Re.properties.legendUniqueId,dimValue:Array.isArray(Ne.dimension)?String(Ne.dimension[0]):String(Ne.dimension),legendUniqueId:Re.properties.legendUniqueId,seriesDisplayName:Re.properties.alias||Re.properties.name||""})));(e.animation.animationEnabled?Ze.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ze).attr("y",Ee=>{const Ne=Re.properties.axis===at.primary?ae:Q;return Ee.value>0?Ne(Ee.value):Ne(0)}).attr("height",Ee=>{const Ne=Re.properties.axis===at.primary?ae:Q;return Math.abs(Ne(Ee.value)-Ne(0))}),it.exit().remove()},_=Re=>{Re.forEach(Ge=>{Ge.data.forEach(Ee=>{Ee.hideZero=Ge.properties.hideZeroValues,Ee.axis=Ge.properties.axis,Ee.legendUniqueId=Ge.properties.legendUniqueId})});const He=T.line().x(Ge=>be(Ge.dimension)?be(Ge.dimension):null).y(Ge=>Ge.axis==at.primary?ae(Ge.value):Q(Ge.value)).defined(Ge=>e?.plotArea?.hideZeroValues?!!Ge.value:!0).curve(Ot(e));let it=P.selectAll(".lines.parentGroup").data([1]);it=it.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(it);let Je=it.selectAll(".line-group").data(Re,Ge=>Ge.properties.legendUniqueId),Ze=Je.enter().append("g").attr("class","line-group");Ze.attr("hoverId",Ge=>(Ge.properties.alias||Ge.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),Ze.merge(Je).select("path").attr("d",Ge=>He(Ge.data)).attr("stroke",Ge=>Ge.properties.color!==we.white?Ge.properties.color:"none").attr("stroke-dasharray",Ge=>{switch(Ge.properties.lineStyle){case yt.dotted:return"0,3";case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",Ge=>Ge.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",Ge=>Ge.properties.lineStyle!=="None"?Ge.properties.lineWidth:"0"),e.animation.animationEnabled&&Ze.merge(Je).select("path").each(function(){const Ge=T.select(this),Ee=this.getTotalLength();Ge.attr("stroke-dasharray",Ee+" "+Ee).attr("stroke-dashoffset",Ee),Ge.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),Je.exit().remove(),Ca(it,Re,re.CombinationLine,be,ae,Q,null,e,B,q,z,N,E,!1,x)},X=Re=>{Re.forEach(Ue=>{Ue.data.forEach(xt=>{xt.hideZero=Ue.properties.hideZeroValues,xt.axis=Ue.properties.axis,xt.legendUniqueId=Ue.properties.legendUniqueId})});const He=T.area().x(Ue=>be(Ue.dimension)?be(Ue.dimension):null).y0(Ue=>ae(0)).y1(Ue=>ae(Ue.value)).defined(Ue=>Ue.hideZero?!!Ue.value:!0).curve(Ot(e)),it=T.area().x(Ue=>be(Ue.dimension)?be(Ue.dimension):null).y0(()=>ae(0)).y1(()=>ae(0)).defined(Ue=>Ue.hideZero?!!Ue.value:!0).curve(Ot(e)),Je=e.animation.animationEnabled;let Ze=P.selectAll(".areas.parentGroup").data([1]),Ge=P.append("g").attr("class","focusClass");Ze=Ze.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(Ze);let Ee=Ze.selectAll(".area-group").data(Re,Ue=>Ue.legend),Ne=Ee.enter().append("g").attr("class","area-group");Ne.append("path").attr("hoverId",Ue=>(Ue.properties.alias||Ue.properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ue=>Ue.properties.color!==we.white?Ue.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",Ue=>Je?it(Ue.data):He(Ue.data)).each(function(Ue){Je&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",He(Ue.data))}),Ee.select("path").attr("d",Ue=>He(Ue.data)),Ne.merge(Ee).select("path").attr("stroke",Ue=>Ue.properties.areaBorderColor!==we.white?Ue.properties.areaBorderColor:"none").attr("stroke-dasharray",Ue=>{switch(Ue.properties.lineStyle){case"dotted":return"0,3";case"dashed":return ba;default:return""}}).attr("stroke-linecap",Ue=>Ue.properties.lineStyle==="dotted"?sa.round:"").attr("stroke-width",Ue=>Ue.properties.lineStyle!=="None"&&e.plotArea.plotAreaHideLineAndMarkers?Ue.properties.lineWidth:"0"),yi(e,Ze,Ge,ve,Re,be,ae,p),Ee.exit().remove(),Ca(Ze,Re,re.CombinationArea,be,ae,Q,null,e,B,q,z,N,E)},$=Re=>{Re.data.forEach(Ne=>{Ne.data.forEach(Ue=>{Ue.hideZero=Ne.properties.hideZeroValues,Ue.axis=Ne.properties.axis,Ue.legendUniqueId=Ne.properties.legendUniqueId})});const He=T.area().x(Ne=>be(Ne.data.dimension)?be(Ne.data.dimension):null).y0(Ne=>Ne.data.axis===at.primary?ae(Ne[0]):Q(Ne[0])).y1(Ne=>Ne.data.axis===at.primary?ae(Ne[1]):Q(Ne[1])).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(Ot(e)),it=T.area().x(Ne=>be(Ne.data.dimension)?be(Ne.data.dimension):null).y0(()=>ae(0)).y1(()=>ae(0)).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(Ot(e)),Je=e.animation.animationEnabled;let Ze=P.selectAll(".parentGroup").data([ie]);P.append("g").attr("class","focusClass"),Ze=Ze.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(Ze);let Ge=Ze.selectAll(".area-group").data(Ne=>Ne),Ee=Ge.enter().append("g").attr("class",Ne=>"area-group "+Ne.key.replace(/ /g,"-"));Ee.append("path").attr("hoverId",Ne=>(Re.data.filter(Ue=>Ue.legend===Ne.key)[0].properties.alias||Re.data.filter(Ue=>Ue.legend===Ne.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ne=>Ne.color!==we.white?Ne.color:"none").attr("d",Ne=>Je?it(Ne):He(Ne)).each(function(Ne){Je&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",He(Ne))}),Ge.select("path").attr("d",Ne=>He(Ne)),Ee.merge(Ge).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ne=>Ne.color!==we.white?Ne.color:"none").attr("stroke-dasharray",(Ne,Ue)=>V[Ue].properties.lineStyle==="dotted"?"0,3":V[Ue].properties.lineStyle==="dashed"?ba:"").attr("stroke-linecap",(Ne,Ue)=>V[Ue].properties.lineStyle==="dotted"?sa.round:"").attr("stroke-width",(Ne,Ue)=>V[Ue].properties.lineStyle!=="None"?V[Ue].properties.lineWidth:"0"),Ge.exit().remove(),Ca(Ze,Re.data,re.CombinationStackArea,be,ae,Q,null,e,B,q,z,N,E)},Se=()=>{let Re=P.selectAll(".parentGroup").data([Ye]);Re=Re.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(Re);let He=Re.selectAll(".stackcolumns-group").data(Ee=>Ee);He=He.enter().append("g").attr("class",Ee=>"stackcolumns-group ").merge(He);let Je=He.selectAll("rect").data(Ee=>Ee);Je.attr("y",Ee=>Ee.data.axis===at.primary?ae(Ee[1]):Q(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?E&&Ee[1]>E?ae(Ee[0])-ae(E):ae(Ee[0])-ae(Ee[1]):q&&Ee[1]>q?Q(Ee[0])-Q(q):Q(Ee[0])-Q(Ee[1]));const Ze=Je.enter().append("rect").attr("transform",Ee=>`translate(${be(Ee.data.dimension)-A/2},0)`).attr("y",Ee=>Ee.data.axis===at.primary?ae(0):Q(0)).attr("height",0);Ze.merge(Je).attr("hoverId",Ee=>Ee.alias.includes("~$~")?Ee.alias.split("~$~")[1].replace(/ /g,"-"):Ee.alias.replace(/ /g,"-")).attr("x",Ee=>Le(re.StackColumnChart)).attr("width",Le.bandwidth()).attr("fill",(Ee,Ne,Ue)=>{const xt=Array.from(V).findIndex(Ke=>Ke.legend===Ee.key);return V[xt]?.properties?.color||"gray"}).attr("stroke",(Ee,Ne,Ue)=>{const xt=Array.from(V).findIndex(pi=>pi.legend===Ee.key),Ke=V[xt]?.properties;return Ke?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Ke.stackBorderColor:"none"}).attr("stroke-dasharray",(Ee,Ne,Ue)=>{const xt=Array.from(V).findIndex(Ke=>Ke.legend===Ee.key);return V[xt]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ee,Ne,Ue)=>{const xt=Array.from(V).findIndex(Ke=>Ke.legend===Ee.key);return(V[xt]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ee,Ne)=>{st([{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(Ne.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:_e(Ne.data[Ne.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.key.includes("~$~")?Ne.key.split("~$~")[1]:Ne.key}],e,Ee,V.filter(Ue=>Ue.legend===Ne.key)[0].properties,(()=>{const Ue=V.filter(xt=>xt.legend===Ne.key)[0].properties;return ht(x,String(Ne.data.dimension??""),{...Ue,formattedDimensionValue:String(B.formattedDimensionListMap.get(Ne.data.dimension)??Ne.data.dimension??"")})})())}).on("mouseout",rt).attr(Qe.SeriesId,Ee=>Ee.key??"").attr(Qe.DimValue,Ee=>Array.isArray(Ee.data.dimension)?String(Ee.data.dimension[0]):String(Ee.data.dimension)).on("click",At(G,g,(Ee,Ne)=>({seriesId:Ne.key??"",dimValue:Array.isArray(Ne.data.dimension)?String(Ne.data.dimension[0]):String(Ne.data.dimension),legendUniqueId:Ne.key??"",seriesDisplayName:Ne.alias||Ne.key||""}))),(e.animation.animationEnabled?Ze.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ze).attr("y",Ee=>Ee.data.axis===at.primary?ae(Ee[1]):Q(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?E&&Ee[1]>E?ae(Ee[0])-ae(E):ae(Ee[0])-ae(Ee[1]):q&&Ee[1]>q?Q(Ee[0])-Q(q):Q(Ee[0])-Q(Ee[1])),He.exit().remove()},ze=Re=>{d=i-Re.left-Re.right,c=y-Re.bottom-Re.top},Ie=(Re,He,it)=>{he=He,ve=Re,le=it,Oe(r,Ce,ve),v(ke,ee,De,Ve,He),he=JSON.parse(JSON.stringify(fe)),he.forEach((Je,Ze)=>{Je.properties.type===re.StackColumnChart||Je.properties.type===re.StackAreaChart?Je.data.forEach((Ge,Ee)=>he[Ze].data[Ee].data=Ge.data.filter(Ne=>ve.includes(Ne.dimension))):he[Ze].data=Je.data.filter(Ge=>ve.includes(Ge.dimension))}),lt()};function Oe(Re,He,it){He.clear(),it&&it.length>0&&it.forEach(Je=>{He.set(Je,0)}),Re.ChartData&&Re.ChartData.length>0&&Re.ChartData.forEach(Je=>{Je.properties.type.includes("Stack")&&Je.data.forEach((Ze,Ge)=>{if(He.has(Ze.dimension)){let Ee=He.get(Ze.dimension)||0;Ee+=Ze.value||0,He.set(Ze.dimension,Ee)}})})}const lt=()=>{D(),W(),C(he),qt(P,B,oe,e,a,ae,Pe,pe,y,A,t,d,c,ve,be);const Re=()=>{Il(he,be,ae,Q,ce,dt,Ye,ie,[],[],A,e,y,i,d,ve,c,m,L,h,Le,o),qa(Ce,be,ae,ce,dt,[],e,p,y,i,L,o)};ta(e.plotArea.fitChart,L,P,f,A,ae,be,Le,void 0,void 0,a,p,e,ne,xe,B.dimensionList,d,Fe,B.formattedDimensionListMap,m,ce,c),L.selectAll(".annotation-group").remove(),Re()},ut=Re=>{let He=Re.data.map(Je=>Je.legend);S=T.stack().keys(He).offset(T.stackOffsetNone)(Re.stackData),Re.data.forEach((Je,Ze)=>Je.data.forEach((Ge,Ee)=>{Ge[0]=S[Ze][Ee][0],Ge[1]=S[Ze][Ee][1]}));let it=e.annotation.annotationSetLabelColor;return S.forEach((Je,Ze)=>{Je.forEach(Ge=>{Ge.key=Je.key,Ge.alias=Re.data[Ze].properties.alias,Je.alias=Re.data[Ze].properties.alias,Je.color=JSON.parse(JSON.stringify(Re.data[Ze].properties.color)),Je.individualAnnotationVisibility=JSON.parse(JSON.stringify(Re.data[Ze].properties.annotation)),Ge.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?Re.data[Ze].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),Ge.data.labelColor=it=="2"?JSON.parse(JSON.stringify(Re.data[Ze].properties.color)):JSON.parse(JSON.stringify(Re.data[Ze].properties.labelColor)),Ge.hideZero=JSON.parse(JSON.stringify(Re.data[Ze].properties.hideZeroValues)),Ge.data.axis=JSON.parse(JSON.stringify(Re.data[Ze].properties.axis)),Ge.data.color=JSON.parse(JSON.stringify(Re.data[Ze].properties.color)),Ge.data.legend=Re.properties.type,Ge.data.type=JSON.parse(JSON.stringify(Re.data[Ze].properties.type))})}),S},tt=()=>{if(me.length>0){const He=(ee.length>0?pt(ve,ee,!1):pt(ve,ke,!1)).map(it=>it.total);B.yMaxLeft=Math.max(B.yMaxLeft,...He),B.yMinLeft=Math.min(B.yMinLeft,...He)}if(te.length>0){const He=(Ve.length>0?pt(ve,Ve,!1):pt(ve,De,!1)).map(it=>it.total);B.yMaxRight=Math.max(B.yMaxRight,...He),B.yMinRight=Math.min(B.yMinRight,...He)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:H,id:m,style:{width:"100%",height:"100%"}})})},Ql=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID();let A=0;const u=re.LayeredColumnChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1,j=!1,K=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText),e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText);let N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le=[];const Fe=new Map;let me=0,te=2,ke=!1,ee={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{De()}catch(fe){ge("LayeredColumnchart","createLayeredColumnChart",fe)}},[e]);const De=()=>{({formatOptions:e,svg:i,width:b,height:k}=Ct(S,e)),Ve(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ee.yMinLeft,ee.yMaxLeft,ee.yMinRight,ee.yMaxRight),{margin:N,yLabel:E,xLabel:z,yTitle:q,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:oe,secondaryAxisTitleWidth:xe,legendMargin:Ae,secondaryYLabel:pe,visibleBars:te,columnWidth:A,scrollbarVisible:ke}=vt(b,k,ue,O,ee.yMaxLeft,e,ee.legendList,ee.dimensionList,ee.yMaxRight,j,K,t,!1,ee),Ce(N),{dataTable:d,dataTableHeight:c}=ea(e,E,q,g,ee.dimensionList,r),kt(i,b,k,e),y=Mt(i,N),mt(y,e,c,J,F,u,m),Ye(),ye(),Gt(y,e,c,E,ae,F),St(e,V,i,N,z,k,ce,ee.chartType,E,J,F),Ft(F,e,c,V,i,N,q,E),Ut(i,j,N,e,c,F,J,pe,xe),wt(i,e,b,oe),Dt(k,i,ne,oe,b,Ae,e,g,m,c,N,nt.rectangle,u,n),Bt(g,k,b,i,N,J,ke,te,ee,me,!1,he)},Ve=()=>{const fe=[],de=[];let le=[],B=-1/0,U=1/0,R=-1/0,v=1/0,w=-1/0,D=1/0;g.forEach(I=>{de.push(I.properties.legendUniqueId),w=-1/0,D=1/0,I.data.forEach(W=>{fe.push(W),w=Math.max(w,W.value),D=Math.min(D,W.value),B=Math.max(B,W.value),U=Math.min(U,W.value)}),I.properties.setColorScale&&Fe.set(I.properties.legendUniqueId,T.scaleSequential().domain([D,w]).interpolator(T.interpolateRgb(I.properties.startColor,I.properties.endColor)))}),ee.chartData=fe,ee.legendList=de,ee.yMaxLeft=B,ee.yMinLeft=U>0?0:U,ee.yMaxRight=R,ee.yMinRight=v,le=t?gt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList).map(I=>I):ee.dimensionList,ee.dimensionList.forEach((I,W)=>{ee.formattedDimensionListMap.set(I,le[W])}),Le=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?be=ee.dimensionList:be=ee.dimensionList.slice(me,me+te),e.plotArea.hideZeroValues&&(ee.hideZeroValues=!0)},Ye=()=>{let fe=ot(Y||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,Y).yAxisLabelArray;ee.yMaxLeft=fe[fe.length-1],ee.yMinLeft=fe[0],f=T.scaleLinear().domain([ee.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:0:ee.yMinLeft<0?ee.yMinLeft*1.1:ee.yMinLeft*.9,ee.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:ee.yMaxLeft*1.1]).range([c>0?F-c:F,0]),P=[0,J]},ie=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(ee.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),L=T.scalePoint().domain(be).range(P).padding(.5)},ye=()=>{Pe();{let fe=ot(Y||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,Y);ae=T.axisLeft(f).tickFormat(de=>_e(de,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,J)).tickValues(fe.autoLabelFlag?void 0:fe.yAxisLabelArray).ticks(fe.customTickValue).tickPadding(8).tickSizeOuter(0)}},Pe=()=>{Q=T.axisBottom(L).tickSize(ia(e,F,c)).tickSizeOuter(0).tickValues(Lt(be,J))},Me=fe=>{fe.forEach(de=>{de.data.forEach(le=>{le.hideZero=de.properties.hideZeroValues,le.properties=de.properties,le.axis=de.properties.axis})}),fe.forEach((de,le)=>{let B=y.selectAll(`.parentGroup-${de.properties.legendUniqueId}`).data([de],D=>D.properties.legendUniqueId);B=B.enter().append("g").attr("class",`column parentGroup parentGroup-${de.properties.legendUniqueId}`).attr("clip-path",`url(#${m}-clip)`).merge(B);let U=B.selectAll(".column-group").data(de.data,D=>D.dimension+"_"+de.properties.legendUniqueId),R=U.enter().append("g").attr("class","column-group").attr("hoverId",(de.properties.alias||de.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",D=>le===0?`translate(${L(D.dimension)-A/2}, 0)`:`translate(${L(D.dimension)-A/(2+le*2)}, 0)`);U.attr("transform",D=>le===0?`translate(${L(D.dimension)-A/2}, 0)`:`translate(${L(D.dimension)-A/(2+le*2)}, 0)`),R.merge(U).attr("transform",D=>le===0?`translate(${L(D.dimension)-A/2}, 0)`:`translate(${L(D.dimension)-A/(2+le*2)}, 0)`);const v=R.append("rect").attr("x",()=>0).attr("width",le===0?A:A/2+le*2).attr("y",D=>(de.properties.axis===at.primary?f:a)(0)).attr("height",0).attr("fill",D=>Fe.get(de.properties.legendUniqueId)?.(D.value)??de.properties.color).attr("stroke-dasharray",()=>de.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${de.properties.stackBorderWidth}px`).attr("stroke",()=>de.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?de.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",D=>D.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>de.properties.legendUniqueId).attr(Qe.DimValue,D=>Array.isArray(D.dimension)?String(D.dimension[0]):String(D.dimension));(e.animation.animationEnabled?v.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):v).attr("y",D=>{const I=de.properties.axis===at.primary?f:a;return D.value>0?I(D.value):I(0)}).attr("height",D=>{const I=de.properties.axis===at.primary?f:a;return Math.abs(I(D.value)-I(0))}),U.select("rect").transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("y",D=>{const I=de.properties.axis===at.primary?f:a;return D.value>0?I(D.value):I(0)}).attr("height",D=>{const I=de.properties.axis===at.primary?f:a;return Math.abs(I(D.value)-I(0))}),R.merge(U).on("mousemove",(D,I)=>{st([{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(Array.isArray(I.dimension)?I.dimension[0]:I.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():I.properties?.currentMeasure?I.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||I.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(u)?I[1]-I[0]:I.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:I.properties.alias}],e,D,I.properties,(()=>{const C=Array.isArray(I.dimension)?I.dimension[0]:I.dimension;return ht(x,String(C??""),{...I.properties,formattedDimensionValue:String(ee.formattedDimensionListMap.get(C)??C??"")})})());let W=(de.properties.alias||de.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),T.selectAll('[hoverId="'+W+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(D,I)=>{let W=(de.properties.alias||de.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+W+'"]').classed("highlight",!1).classed("unhighlight",!1),rt()}),R.merge(U).on("click",At(H,p,(D,I)=>({seriesId:de.properties.legendUniqueId,dimValue:Array.isArray(I.dimension)?String(I.dimension[0]):String(I.dimension),legendUniqueId:de.properties.legendUniqueId,seriesDisplayName:de.properties.alias||de.properties.name||""}))),U.exit().remove()}),y.selectAll(".parentGroup").raise()},Ce=fe=>{J=b-fe.left-fe.right,F=k-fe.bottom-fe.top},ve=()=>{ie(),Pe(),qt(y,ee,z,e,c,f,Q,ne,k,A,t,J,F,be,L),Me(Le),Da(g,L,f,void 0,N,dt,[],[],e,u,k,b,J,be,F,m,i,h,void 0,A,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,d,A,f,L,void 0,void 0,void 0,c,re.ColumnChart,e,E,q,ee.dimensionList,J,P,ee.formattedDimensionListMap,m,N,F))},he=(fe,de,le)=>{Le=de,be=fe,te=le,ve()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Ol=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const m=crypto.randomUUID();let A=0,u=!1;const S=re.StackColumnChart,p=Te.useRef(),H=Te.useRef(s);H.current=s;const g=Te.useRef(x);g.current=x;const G=r.DimensionList,V=(bt(r.ChartData,r.DimensionList)||[]).reverse(),j=!1,K=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText),e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText);let N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P;const ae=new Map;let Q,be,Le,Fe=[],me=0,te,ke=[],ee=new Map;const De=!1;let Ve={dimensionList:G,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ye()}catch(v){ge("StackStackColumnchart","createStackColumnChart",v)}},[e]);const Ye=()=>{({formatOptions:e,svg:i,width:b,height:k}=Ct(p,e)),ie(),{formatOptions:e}=Qt(e,V,r.DataTableData??[]),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,Ve.yMinLeft,Ve.yMaxLeft,Ve.yMinRight,Ve.yMaxRight),{margin:N,yLabel:E,xLabel:z,yTitle:q,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:oe,secondaryAxisTitleWidth:xe,legendMargin:Ae,secondaryYLabel:pe,visibleBars:te,columnWidth:A,scrollbarVisible:u}=vt(b,k,ue,O,Ve.yMaxLeft,e,Ve.legendList,Ve.dimensionList,Ve.yMaxRight,K,De,t,!1,Ve),he(N),{dataTable:d,dataTableHeight:c}=ea(e,E,q,V,Ve.dimensionList,r),kt(i,b,k,e),y=Mt(i,N),mt(y,e,c,J,F,S,m),ye(),Me(),Gt(y,e,c,E,Q,F),St(e,j,i,N,z,k,ce,Ve.chartType,E,J,F),Ft(F,e,c,j,i,N,q,E),Ut(i,K,N,e,c,F,J,pe,xe),wt(i,e,b,oe),Dt(k,i,ne,oe,b,Ae,e,[...V].reverse(),m,c,N,nt.rectangle,S,n),Bt(V,k,b,i,N,J,u,te,Ve,me,!1,fe)},ie=()=>{const v=[],w=[];let D=-1/0,I=1/0;V.forEach(($,Se)=>{const ze=`${Se}~$~${$.properties.legend}`;$.properties.legend=ze,w.push(ze),D=-1/0,I=1/0;for(const Ie of $.data)D=Math.max(D,Ie.value),I=Math.min(I,Ie.value),v.push(Ie);$.properties.setColorScale&&ae.set($.properties.legendUniqueId,T.scaleSequential().domain([I,D]).interpolator(ii.interpolateRgb($.properties.startColor,$.properties.endColor)))}),Ve.chartData=v,Ve.legendList=w,Fe=JSON.parse(JSON.stringify(V));let W=pt(Ve.dimensionList,V,De);Le=Ve.dimensionList;const C=T.stack().keys(Ve.legendList).offset(T.stackOffsetDiverging)(W);le();let M=1/0,_=-1/0;for(const $ of C)for(const[Se,ze]of $)M=Math.min(M,Se),_=Math.max(_,ze);Ve.yMinLeft=M>0?0:M,Ve.yMaxLeft=_;let X=t?gt(e.xAxisLabel.xAxisNumberFormat,Ve.dimensionList).map($=>$):Ve.dimensionList;Ve.dimensionList.forEach(($,Se)=>{Ve.formattedDimensionListMap.set($,X[Se])}),e.plotArea.hideZeroValues&&(Ve.hideZeroValues=!0)},ye=()=>{f=T.scaleLinear().domain([Ve.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:0:Ve.yMinLeft<0?Ve.yMinLeft*1.1:Ve.yMinLeft*.9,Ve.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:Ve.yMaxLeft*1.1]).range([c>0?F-c:F,0]),P=[0,J]},Pe=()=>{L=T.scalePoint().domain(Le).range([0,J]).padding(.5)},Me=()=>{{const v=ot(Y||Ve.yMaxLeft,Ve.yMinLeft,F,e,Ve,Z,Y);Q=T.axisLeft(f).tickFormat(w=>_e(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,J)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ce=()=>{be=T.axisBottom(L).tickSize(ia(e,F,c,!0)).tickSizeOuter(0).tickValues(Lt(Le,J))},ve=v=>{v.forEach(X=>{X.data.forEach($=>{$.hideZero=X.properties.hideZeroValues,$.axis=X.properties.axis})}),Le.forEach(X=>{y.append("rect").attr("id",`dim-background-${X}`).attr("class","dimension-background").attr("x",L(X)-L.step()/2).attr("width",L.step()).attr("y",0).attr("height",F).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let w=y.selectAll(".parentGroup").data([ke]);w=w.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(w);let D=w.selectAll(".column-group").data(X=>X);D=D.enter().append("g").attr("class",X=>"column-group "+X.key.replace(/ /g,"-")).attr("hoverId",X=>X[0]?.properties.alias?Wa(X[0]?.properties.alias):Wa(X.key)).merge(D);let W=D.selectAll("rect").data(X=>X);const C=(X,$)=>{const Se=Array.from(D.nodes()).indexOf(X[$].parentNode);return{props:V[Se]?.properties,groupIndex:Se}},M=W.enter().append("rect").merge(W).attr("x",X=>L(X.data.dimension)-A/2).attr("width",A).attr("y",X=>f(0)).attr("height",0).attr("fill",(X,$,Se)=>{const{props:ze}=C(Se,$);return ae.get(ze.legendUniqueId)?.(X.data[X.key])??ze?.color??"gray"}).attr("stroke",(X,$,Se)=>{const{props:ze}=C(Se,$);return ze?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ze.stackBorderColor:"none"}).attr("stroke-dasharray",(X,$,Se)=>{const{props:ze}=C(Se,$);return ze?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(X,$,Se)=>{const{props:ze}=C(Se,$);return(ze?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(X,$,Se)=>{const{props:ze}=C(Se,$);return X.data[X.key]==0&&ze?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,X=>X.key??"").attr(Qe.DimValue,X=>Array.isArray(X.data.dimension)?String(X.data.dimension[0]):String(X.data.dimension)).on("mousemove",(X,$)=>{const Se=String(Ve.formattedDimensionListMap.get($.data.dimension)??$.data.dimension??""),ze=ht(l,String($.data.dimension??""),{...$.properties,formattedDimensionValue:Se});st([{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($.data.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:_e($.data[$.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:$.properties.alias}],e,X,$.properties,ze)}).on("mouseout",(X,$)=>{rt()}).on("click",At(g,H,(X,$)=>({seriesId:$.key??"",dimValue:Array.isArray($.data.dimension)?String($.data.dimension[0]):String($.data.dimension),legendUniqueId:$.key??"",seriesDisplayName:$.properties?.alias||$.key||""})));(e.animation.animationEnabled?M.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):M).attr("y",X=>X[1]>=X[0]?f(X[1]):f(X[0])).attr("height",X=>Math.abs(f(X[0])-f(X[1]))),D.exit().remove(),y.selectAll(".parentGroup").raise()},he=v=>{J=b-v.left-v.right,F=k-v.bottom-v.top},fe=(v,w,D)=>{Fe=w,Le=v,te=D,Ka(r,ee,Le),de()},de=()=>{Pe(),Ce(),qt(y,Ve,z,e,c,f,be,ne,k,A,t,J,F,Le,L),le();const v=new Map;Le.forEach((w,D)=>{let I=0;ke.forEach(W=>{const C=W[D]?.[0]??0;C<I&&(I=C)}),v.set(w,I)}),ve(Fe),Va(ke,L,f,a,N,dt,[],[],e,S,k,b,J,Le,F,m,i,h,c,o),qa(ee,L,f,N,dt,[],e,S,k,b,i,o,!1,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,d,A,f,L,void 0,void 0,void 0,c,S,e,E,q,Le,J,P,Ve.formattedDimensionListMap,m,N,F)),B()},le=()=>{let v=pt(Le,Fe,De);ke=T.stack().keys(Ve.legendList).offset(T.stackOffsetDiverging)(v),Fe.forEach((D,I)=>D.data.forEach((W,C)=>{W[0]=ke[I][C][0],W[1]=ke[I][C][1]}));let w=e.annotation.annotationSetLabelColor;ke.forEach((D,I)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(V[I].properties.color)),W.data.labelPosition=V[I].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(V[I].properties.color)):V[I].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(V[I].properties.hideZeroValues)),W.properties=V[I].properties}))},B=()=>{try{const v=e?.connector,w=Number(v?.connectorVisibility);if(!v||w===2)return;let D,I=[];w===1?D=1:w===3&&(Number(v.connectorFollow)===1?D=Number(v.connectorStepSize)||void 0:Number(v.connectorFollow)===2&&(I=v.connectorExclude??[],D=1));const W=(I||[]).map($=>String($).split("-")[0]),C=(ke[0]??[]).map(($,Se)=>({Dimension:$.data.dimension,Total:$.data.total,CustomTotal:$.data.total,Index:Se})),M=[],_=[];let X=[];if(D){if(D===1)M.push(...C);else for(const $ of C)$.Index%D===0&&M.push($);for(let $=D;$<C.length;$+=D){const Se=Math.min($+D,C.length);let ze=C[$]?.Total??Number.NEGATIVE_INFINITY;for(let Ie=$;Ie<Se;Ie++)C[Ie].Total>ze&&(ze=C[Ie].Total);Number.isFinite(ze)&&_.push(ze)}X=M.slice(1)}else{const $=v.connectorCustomRange??[],Se=new Map;C.forEach(ze=>Se.set(String(ze.Dimension),ze.Index));for(const ze of $){if(!ze?.from||!ze?.to)continue;const Ie=Se.get(String(ze.from)),Oe=Se.get(String(ze.to));if(Ie!=null&&Oe!=null){M.push(C[Ie]);const lt=Math.min(Ie,Oe),ut=Math.max(Ie,Oe);let tt=C[lt]?.Total??Number.NEGATIVE_INFINITY;for(let Re=lt;Re<=ut;Re++)C[Re].Total>tt&&(tt=C[Re].Total);Number.isFinite(tt)&&_.push(tt)}}for(const ze of $){if(!ze?.from||!ze?.to)continue;const Ie=Se.get(String(ze.to));Ie!=null&&X.push(C[Ie])}}y.selectAll("defs > #arrow").remove(),y.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",v.connectorMarkerColor!==we.white?v.connectorMarkerColor:"none"),U(M,_,X,D,W),R(M,_,X,D,W)}catch{}},U=(v,w,D,I,W)=>{try{const C=v.filter(($,Se)=>I!=null?Se<v.length-1:Se<v.length);let M=y.selectAll("path.connector-path").data(C,$=>String($.Dimension));M.exit().remove(),M.enter().append("path").attr("class","connector-path").style("shape-rendering","crispEdges").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",($,Se)=>e.total.totalVisibility?`M ${L($.Dimension)+L.bandwidth()/2+5}, ${f($.Total)-25} V ${-35+Math.min(f(w[Se]),f(D[Se].Total),f($.Total))} H ${L(D[Se].Dimension)+L.bandwidth()/2-10} V ${-27+f(D[Se].Total)}`:`M ${L($.Dimension)+L.bandwidth()/2+5}, ${f($.Total)-5} V ${-30+Math.min(f(D[Se].Total),f($.Total))} H ${L(D[Se].Dimension)+L.bandwidth()/2-10} V ${-10+f(D[Se].Total)}`).style("stroke",e.connector.connectorLineColor!==we.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",$=>W.includes($.Dimension)||$.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},R=(v,w,D,I,W)=>{try{let C,M=e.connector.connectorFontStyle,_=e.connector.connectorNumberFormat,X=J/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(_=".2s");const $=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Se=Ti($,A),ze=Se*(typeof L.padding=="function"?L.padding():0),Ie=v.map((tt,Re)=>({d:tt,i:Re})).filter(tt=>I!=null?tt.i<v.length-1:tt.i<v.length);let Oe=y.selectAll("text.connector-text").data(Ie,tt=>String(tt.d.Dimension));Oe.exit().remove(),Oe.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(Oe).attr("x",tt=>{const Re=tt.d,He=tt.i,it=D[He];return L(it.Dimension)-Se*I/2}).attr("y",tt=>{const Re=tt.d,He=tt.i,it=w[He],Je=D[He],Ze=Math.min(f(Je?.Total??0),f(Re.Total));return e.total.totalVisibility?X<8?-40+Ze:-41+Ze:X<8?-35+Ze:-40+Ze}).style("text-anchor","middle").text(tt=>{const Re=tt.d,He=tt.i;return D[He]?(Re.CustomTotal==0&&D[He].CustomTotal!=0&&(Re.CustomTotal=1),hi(D[He].Total,Re.Total,parseInt(e.connector.connectorDecimalPrecision),_,parseInt(Re.Dimension),parseInt(D[He].Dimension),e)):""}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==we.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",M.includes("Italic")?"Italic":"").style("text-decoration",M.includes("Underline")?"Underline":"").style("font-weight",M.includes("Bold")?"Bold":"").style("visibility",tt=>{const Re=tt.d;return W.includes(Re.Dimension)||Re.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible"}).raise()}catch{}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:p,id:m,style:{width:"100%",height:"100%"}})})},er=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID();let A=0;const u=re.NormalizedStackColumnChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList).reverse(),G=r.DimensionList,V=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y,N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O=!1,J,F,b,k,d,c,i,y,f,a,L,P;const ae=new Map;let Q,be,Le,Fe=[],me=0,te=0,ke=[];const ee=!0;let De={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ve()}catch(le){ge("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",le)}},[e]);const Ve=()=>{({formatOptions:e,svg:i,width:b,height:k}=Ct(S,e)),Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,De.yMinLeft,De.yMaxLeft,De.yMinRight,De.yMaxRight),{margin:Y,yLabel:N,xLabel:E,yTitle:z,xTitle:q,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:oe,legendMargin:xe,secondaryYLabel:Ae,visibleBars:te,columnWidth:A,scrollbarVisible:O}=vt(b,k,pe,ue,De.yMaxLeft,e,De.legendList,De.dimensionList,De.yMaxRight,j,ee,t,!1,De),ve(Y),{dataTable:d,dataTableHeight:c}=ea(e,N,z,g,De.dimensionList,r),kt(i,b,k,e),y=Mt(i,Y),mt(y,e,c,J,F,u),ie(),Pe(),Gt(y,e,c,N,Q,F),St(e,V,i,Y,E,k,q,De.chartType,N,J,F),Ft(F,e,c,V,i,Y,z,N),Ut(i,j,Y,e,c,F,J,Ae,oe),wt(i,e,b,ne),Dt(k,i,ce,ne,b,xe,e,[...g].reverse(),m,c,Y,nt.rectangle,u,n),Bt(g,k,b,i,Y,J,O,te,De,me,!1,he)},Ye=()=>{const le=[],B=[];let U=-1/0,R=1/0;g.forEach((W,C)=>{const M=`${C}~$~${W.properties.legend}`;W.properties.legend=M,B.push(M),U=-1/0,R=1/0;for(const _ of W.data)U=Math.max(U,_.value),R=Math.min(R,_.value),le.push(_);W.properties.setColorScale&&ae.set(W.properties.legendUniqueId,T.scaleSequential().domain([R,U]).interpolator(T.interpolateRgb(W.properties.startColor,W.properties.endColor)))}),De.chartData=le,De.legendList=B,Fe=JSON.parse(JSON.stringify(g));let v=pt(De.dimensionList,g,ee);Le=De.dimensionList;const w=T.stack().keys(De.legendList).offset(T.stackOffsetDiverging)(v);de();let D=1/0;for(const W of w)for(const[C]of W)D=Math.min(D,C);De.yMinLeft=D>0?0:D,De.yMaxLeft=1;let I=t?gt(e.xAxisLabel.xAxisNumberFormat,De.dimensionList).map(W=>W):De.dimensionList;De.dimensionList.forEach((W,C)=>{De.formattedDimensionListMap.set(W,I[C])}),e.plotArea.hideZeroValues&&(De.hideZeroValues=!0)},ie=()=>{let le=ot(Z||De.yMaxLeft,De.yMinLeft,F,e,De,K,Z).yAxisLabelArray;if(De.yMaxLeft=le[le.length-1],De.yMinLeft=le[0],f=T.scaleLinear().domain([De.yMinLeft<0?-1:0,1]).range([c>0?F-c:F,0]),P=[0,J],e.seriesLabel.seriesLabelVisibility){let B=aa(J,f,e,Fe,void 0,j,F,!0);B.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&B.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?P=[0,J-B.heightWidth[0]]:P=[B.heightWidth[0],J]}},ye=()=>{L=T.scalePoint().domain(Le).range(P).padding(.5)},Pe=()=>{Q=T.axisLeft(f).tickSize(Pt(e,J)).ticks(c>0?(F-c)/80:F/80,"%").tickPadding(8).tickSizeOuter(0)},Me=()=>{be=T.axisBottom(L).tickSize(ia(e,F,c,!0)).tickSizeOuter(0).tickValues(Lt(Le,J))},Ce=le=>{ke.forEach((C,M)=>C.forEach((_,X)=>{le[M].data[X]&&le[M].data[X][0]!==void 0&&le[M].data[X][1]!==void 0&&(le[M].data[X][0]=_[0]=_.data.total===0?0:_[0]/_.data.total,le[M].data[X][1]=_[1]=_.data.total===0?0:_[1]/_.data.total)})),le.forEach(C=>{C.data.forEach(M=>{M.hideZero=C.properties.hideZeroValues,M.axis=C.properties.axis})}),Le.forEach(C=>{y.append("rect").attr("id",`dim-background-${C}`).attr("class","dimension-background").attr("x",L(C)-L.step()/2).attr("width",L.step()).attr("y",0).attr("height",F).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let B=y.selectAll(".parentGroup").data([ke]);B=B.enter().append("g").attr("class","columns parentGroup").merge(B);let U=B.selectAll(".column-group").data(C=>C);U=U.enter().append("g").attr("class",C=>"column-group "+C.key.replace(/ /g,"-")).attr("hoverId",C=>(le[C.index].properties.alias||le[C.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(U);let v=U.selectAll("rect").data(C=>C);const w=(C,M)=>{const _=Array.from(U.nodes()).indexOf(C[M].parentNode);return{props:g[_]?.properties,groupIndex:_}},D=v.enter().append("rect").attr("x",C=>L(C.data.dimension)-A/2).attr("width",A).attr("y",f(0)).attr("height",0).attr("fill",(C,M,_)=>{const{props:X}=w(_,M);return ae.get(X.legendUniqueId)?.(C.data[C.key])??X?.color??"gray"}).attr("stroke",(C,M,_)=>{const{props:X}=w(_,M);return X?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?X.stackBorderColor:"none"}).attr("stroke-dasharray",(C,M,_)=>{const{props:X}=w(_,M);return X?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(C,M,_)=>{const{props:X}=w(_,M);return(X?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(C,M,_)=>{const{props:X}=w(_,M);return C.data[C.key]===0&&X?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,C=>C.key??"").attr(Qe.DimValue,C=>Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension)),I=e.animation.animationEnabled;(C=>I?C.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):C)(D).attr("y",C=>C[1]>=C[0]?f(C[1]):f(C[0])).attr("height",C=>Math.abs(f(C[0])-f(C[1]))),D.merge(v).on("mousemove",(C,M)=>{st([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:De.formattedDimensionListMap.get(M.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e(M[1]-M[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,C,M.properties,ht(x,String(M.data.dimension??""),{...M.properties,formattedDimensionValue:String(De.formattedDimensionListMap.get(M.data.dimension)??M.data.dimension??"")}))}).on("mouseout",(C,M)=>{rt()}).on("click",At(H,p,(C,M)=>({seriesId:M.key??"",dimValue:Array.isArray(M.data.dimension)?String(M.data.dimension[0]):String(M.data.dimension),legendUniqueId:M.key??"",seriesDisplayName:M.properties?.alias||M.key||""}))),U.exit().remove(),y.selectAll(".parentGroup").raise()},ve=le=>{J=b-le.left-le.right,F=k-le.bottom-le.top},he=(le,B,U)=>{Fe=B,Le=le,te=U,fe()},fe=()=>{ye(),Me(),de(),qt(y,De,E,e,c,f,be,ce,k,A,t,J,F,Le,L),Ce(Fe),Va(ke,L,f,a,Y,dt,[],[],e,u,k,b,J,Le,F,m,i,h,c,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,d,L.bandwidth(),f,L,void 0,void 0,void 0,c,u,e,N,z,De.dimensionList,J,P,De.formattedDimensionListMap,m,Y,F))},de=()=>{let le=pt(Le,Fe,ee);ke=T.stack().keys(De.legendList).offset(T.stackOffsetDiverging)(le),Fe.forEach((U,R)=>U.data.forEach((v,w)=>{v[0]=ke[R][w][0],v[1]=ke[R][w][1]}));let B=e.annotation.annotationSetLabelColor;ke.forEach((U,R)=>U.forEach(v=>{v.key=U.key,U.color=JSON.parse(JSON.stringify(g[R].properties.color)),U.individualAnnotationVisibility=JSON.parse(JSON.stringify(g[R].properties.individualAnnotationVisibility)),v.data.labelPosition=g[R].properties.dataLabelPosition,v.data.labelColor=B=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,v.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues)),v.properties=g[R].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},ma="ChartsWithoutAxisFunctions.ts";function Gi(t,e,r){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:o,minVal:h,maxVal:n}=e.plotArea.plotAreaRangeFilter;return t.filter(l=>{const s=r(l);switch(o){case"lt":return s<=n;case"gt":return s>=h;case"in":return s>=h&&s<=n;case"not-in":return s<h||s>n;default:return!0}})}function _i(t,e,r,o,h,n){try{o.xAxisLabel.xAxisDateFormat=o.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":o.xAxisLabel.xAxisDateFormat;let l={top:0,left:0,right:0,bottom:0},s=t*.15*.8,x=n[0],m=s<x+10?s:x+10,A=o.plotArea.numberOfBubbles?20:0;const u=je(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(h).toString();let p=Tt(u,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,o.xAxisLabel.xAxisLabelRotation)[3]+10,H=o.xAxisTitle.xAxisTitleVisibility?o.xAxisTitle.xAxisDynamicTitleText.length!==0?It(o.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:It(o.xAxisTitle.xAxisTitleText,13,qe).height:0;H=H>e*.1?e*.1:H;let g=o.xAxisLabel.xAxisLabelVisibility?p:0,G=o.yAxisTitle.yAxisTitleVisibility?o.yAxisTitle.yAxisDynamicTitleText.length!==0?It(o.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:It(o.yAxisTitle.yAxisTitleText,13,qe).height:0;G=G>t*.1?t*.1:G;let V=o.yAxisLabel.yAxisLabelVisibility?It(je(o.yAxisLabel.yAxisDisplayUnits,o.yAxisLabel.yAxisNumberFormat,o.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString(),et(o.yAxisLabel.yAxisLabelFontSize),o.yAxisLabel.yAxisLabelFontFamily,o.yAxisLabel.yAxisLabelRotation).width+10:0,j=o.chartTitle.chartTitleVisibility?o.chartTitle.dynamicTitleText.length!==0?It(o.chartTitle.chartTitleHTML,void 0,void 0).height:It(o.chartTitle.chartTitleText,16,qe).height:0;j=j>e*.1?e*.1:j;let K=o.legends.legendPosition,Z=o.legends.legendVisibility,Y=!1;switch(Z||(K="None"),K){case Be.none:l.top=j+5,l.bottom=H+g+5+A,l.right=15,l.left=G+V+5;break;case Be.top:l.top=40+j,l.bottom=H+g+5+A,l.right=15,l.left=G+V+5;break;case Be.right:l.right=m+35,l.top=j+5,l.bottom=H+g+5+A,l.left=G+V+5;break;case Be.bottom:l.bottom=40+g+H+A,l.top=j+5,l.right=15,l.left=G+V+5;break;case Be.left:l.left=m+G+V+33,l.top=j+5,l.bottom=H+g+5+A,l.right=15}o.xAxisLabel.xAxisPosition&&o.xAxisLabel.xAxisPosition=="1"&&(l.bottom=l.bottom-g,l.top=l.top+g);let N=o.chartPadding.paddingArrayLTRB;N&&(l.top+=N[1],l.bottom+=N[3],l.right+=N[2],l.left+=N[0]);let E=e-l.top-l.bottom,z=t-l.left-l.right;return{margins:l,yLabel:V,xLabel:g,yTitle:G,xTitle:H,chartTitleHeight:j,legendMargin:m,innerHeight:E,innerWidth:z}}catch(l){fa(ma,"marginCalculationForBubbleScatter",l)}}function ji(t,e,r){try{let o=parseFloat(t.yAxisLabel.yAxisIntervalText),h=parseFloat(t.yAxisLabel.yAxisMaxText),n=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){n=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let u=t.yAxisLabel.yAxisMaxText;h=u.length>0?parseFloat(u):r,h&&(r=h)}else h=r,n=e,o=void 0;let l=e?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString().length:0,x=h?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(h).toString().length:0,m=n?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString().length:0,A=l<s?r:e;if(n){let u=m<s?r:n;A=A<u?u:A}if(h){let u=x>l?h:e;A=A<u?u:A}return h&&n&&(A=x>m?h:n),{longestMeasure:A,customYaxisIntervalValue:o,customYaxisMaxValue:h,customYaxisMinValue:n}}catch(o){fa(ma,"customYscaleLabelFormatting",o)}}function Ji(t,e,r){try{let o=parseFloat(t.xAxisLabel.xAxisIntervalText),h=parseFloat(t.xAxisLabel.xAxisMaxText),n=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){n=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let u=t.xAxisLabel.xAxisMaxText.toString();h=u.length>0?parseFloat(u):r,h&&(r=h)}else h=r,n=e,o=void 0;let l=e?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(r).toString().length:0,x=h?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(h).toString().length:0,m=n?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n).toString().length:0,A=l<s?r:e;if(n){let u=m<s?r:n;A=A<u?u:A}if(h){let u=x>l?h:e;A=A<u?u:A}return h&&n&&(A=x>m?h:n),{longestDimension:A,customXaxisIntervalValue:o,customXaxisMaxValue:h,customXaxisMinValue:n}}catch(o){fa(ma,"customXscaleLabelFormatting",o)}}function Zi(t,e,r,o,h,n,l,s,x,m,A){try{let u=t.xAxisLabel.xAxisPosition,S=!0,H=r.append("foreignObject").attr("visibility",e?t.yAxisTitle.yAxisTitleVisibility?"visible":"hidden":t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",!t.plotArea.fitChart&&S?`translate(${o.left},${o.top+A+(t?.xAxisLabel?.xAxisPosition=="1"?0:h)})`:!t.plotArea.fitChart&&!1?`translate(${o.left},${n-l-5})`:`translate(${o.left},${o.top+A+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:h:s=="tornado"?h+5:x+5)})`).attr("class","xAxisTitle").attr("width",m).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?H.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):H.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","5px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){fa(ma,"setXaxistitle",u)}}function Xi(t,e,r,o,h,n,l,s){try{let x=r>0?t-r:t,m=h.append("foreignObject").attr("visibility",o?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${n.top+x}`).attr("y",n.left-l-s+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",x).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?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),h}catch(x){fa(ma,"yAxistitle",x)}}function qi(t,e,r,o,h,n){try{let l=parseFloat(o.yAxisLabel.yAxisIntervalText),s=[],x;if(l&&l!==0&&l!==void 0){let m=h||h==0?h:e,A=n||n==0?n:t;m<0?x=Math.floor((A-m)/l):x=Math.floor(A/l);let u=18;(n||n==0)&&(t=n);let S=h||h==0?h:e<0?Math.round(e):0;if(s.push(S),x>100){let p="Tick count cannot exceed more than 100.";m<0?l=(A-S)/100:l=A/100}if(x=x<100?x:100,x>u)for(let p=0;p<parseInt(x)&&(S+=l,parseFloat(S.toFixed(5))<=t);p++)s.push(S);else for(let p=0;p<u&&(S+=l,S<=t);p++)s.push(S)}else x=r/60;return{yAxisLabelArray:s,customTickValue:x}}catch(l){fa(ma,"responsiveYaxisLabel",l)}}function xi(t,e,r,o,h,n,l,s){try{let x=!0,m=parseFloat(o.xAxisLabel.xAxisIntervalText),A=[],u;if(m&&m!==0&&m!==void 0){let S=h||h==0?h:e,p=n||n==0?n:t;S<0?u=Math.floor((p-S)/m):u=Math.floor(p/m);let H=18;(n||n==0)&&(t=n);let g=h||h==0?h:e<0?Math.round(e):0;if(A.push(g),x=!1,u>100){let G="Tick count cannot exceed more than 100.";S<0?m=(p-g)/100:m=p/100}if(u=u<100?u:100,u>H)for(let G=0;G<parseInt(u)&&(g+=m,parseFloat(g.toFixed(5))<=t);G++)A.push(g);else for(let G=0;G<H&&(g+=m,g<=t);G++)A.push(g)}else{const S=je(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisDateFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n||t).toString();let p=Tt(S,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,0);A=Ai(h||e,n||t,s?l:r,p[0]),u=r/30}return{xAxisLabelArray:A,customTickValue:u,autoLabelFlag:x}}catch(x){fa(ma,"responsiveXaxisLabel",x)}}function Ki(t,e,r,o,h,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==we.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(h);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==we.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes(se.italic)?se.italic:"").style("text-decoration",l.includes(se.underline)?se.underline:"").style("font-weight",l.includes(se.bold)?se.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(l){fa(ma,"initYaxis",l)}}function Qi(t,e,r,o,h,n,l,s,x){try{let m=e.xAxisLabel.xAxisLabelFontStyle,A=e.xAxisLabel.xAxisPosition,u=e.xAxisLabel.xAxisLabelRotation;u=parseInt(u),t.append("rect").attr("transform",`translate(1,${A==="0"?r>0?n-r:n:A==="1"?-o:x(0)})`).attr("height",o).attr("width",l).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==we.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${A==="0"?n:A==="1"?0:x(0)})`).call(h);let p=A==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(o)).style("height","20px").attr("transform",(g,G)=>`rotate(${A==="1"?-u:u!=0?180-u:0}) translate (${u!=0?p+", -5":-o/2+" , "+(A==="1"?"-15":"8")})`).append("xhtml:h3").style("transform",A==="1"?"":u!=0?"rotate(180deg)":"0").style("white-space","pre").style("text-overflow","ellipsis").style("text-align",u!=0?"start":"center").style("user-select","none").style("margin",0).style("padding",0).style("overflow","hidden").style("font-family",e.xAxisLabel.xAxisLabelFontFamily).style("color",e.xAxisLabel.xAxisLabelColor).style("font-size",e.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",m.includes(se.italic)?se.italic:"").style("text-decoration",m.includes(se.underline)?se.underline:"").style("font-weight",m.includes(se.bold)?se.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(g,G)=>je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(g)).html((g,G)=>je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(g)),S.selectAll("text").style("visibility",(e.xAxisLabel.xAxisLabelVisibility,"hidden")),S.selectAll("line").style("stroke",e.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",e.xAxisLabel.xAxisLabelVisibility||e.plotArea.gridLinesVertical?"visible":"hidden"),S.select(".domain").style("stroke",e.xAxisLabel.xAxisColor).attr("stroke-width",e.xAxisLabel.xAxisWidth?e.xAxisLabel.xAxisWidth:e.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges")}catch(m){fa(ma,"initXaxis",m)}}function Oi(t,e,r,o,h,n,l,s,x,m,A){try{if(!r.annotation.annotationVisibility)return;const u=r.plotArea.annotationType??"1",S=[u==="1"?"connector":""],p=r.plotArea.connectorType?.toLowerCase()??"none",H=u==="5",g=r.plotArea.rotation??0,G=h===re.PieChart?1.06:1.1,V={1:"",2:T.curveLinear,3:T.curveStep},j=(O,J)=>[[0,0],[O/2,J/2],[O,J]],K={solid:"unset",dotted:"2,2",dashed:"6,4"};let Z=t.annotation(),Y=JSON.parse(JSON.stringify(r.plotArea.dataLabelsCoordinates||[]));Y=Y.map(O=>({dx:O.dx??0,dy:O.dy??0,ratioDistance:O.ratioDistance,ratioAngle:O.ratioAngle,connectorPoints:O.connectorPoints||O.connector?.points||[],radius:O.radius??x,data:O.data,width:n,height:l}));const N=e.reduce((O,J)=>O+(J?.data?.data?.[0]?.value??0),0),E=N===0?1:N,z=(O,J)=>{const F=O.data.data[0].value,b=(O.x0+O.x1)/2,k=O.x1-O.x0;return{note:{title:r.plotArea.dataLabelName?O.data.legend:"",label:r.plotArea.dataLabelValue&&F!==0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(F/E)*100).toFixed(et(r.plotArea.dataLabelDecimalPrecision))+"%":je(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(F):"",align:"middle",wrap:1e3},data:{x:{legend:O.data.legend},y:{value:F},midAngle:b,isVisible:!0,hoverId:O?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:O.data.legend,dx:0,dy:0,connector:{end:p,curve:V[r.plotArea.connectorCurve],points:H?j(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:tr(t,u),color:r.plotArea.connectorColor??"#ccc",width:n,height:l,index:J}};let q=e.filter(O=>O.x1-O.x0>1e-4).map(z);const ce=O=>(O.data.y?.value??0)!==0;q=q.filter(ce),q=Rt(q,r,O=>O.data.y.value);let ne=new Map(Y.map(O=>[O.data?.x?.legend,O])),oe=[];q.forEach(O=>{const J=O.data.x.legend,F=ne.get(J);if(F){if(F.ratioDistance!=null&&F.ratioAngle!=null){const b=F.ratioDistance*x;O.dx=Math.cos(F.ratioAngle)*b,O.dy=Math.sin(F.ratioAngle)*b}else{const b=x/(F.radius||x);O.dx=F.dx*b,O.dy=F.dy*b}O.data.isVisible=F.data?.isVisible??!0,F.connectorPoints?.length>=(H?3:2)?O.connector.points=F.connectorPoints:O.connector.points=H?j(O.dx,O.dy):[[0,0],[0,0]]}oe.push(O)}),Z.editMode(r.plotArea.annotationDraggable&&m).accessors({x(O){return Math.cos(O.midAngle-Math.PI/2)*(x-x*.35)},y(O){return Math.sin(O.midAngle-Math.PI/2)*(x-x*.35)}}).on("dragend",function(O){oe.forEach(F=>{if(F.data.x.legend===O.data.x.legend){const b=O._dx,k=O._dy,d=Math.sqrt(b*b+k*k),c=Math.atan2(k,b);F.dx=b,F.dy=k,F.ratioDistance=d/x,F.ratioAngle=c,F.width=n,F.height=l,F.connectorPoints=O.connector?.points||[]}});const J=oe.map(F=>({data:{x:F.data.x,isVisible:F.data.isVisible??!0},dx:F.dx,dy:F.dy,ratioDistance:F.ratioDistance,ratioAngle:F.ratioAngle,connectorPoints:F.connectorPoints||[],width:n,height:l,radius:x}));A&&A(J)}).annotations(oe);const xe=s.append("g").attr("class","annotation-group parentGroup").attr("transform",o).call(Z),Ae=r.plotArea.dataLabelNameFontStyle??[];xe.selectAll(".annotation-note-title").style("font-family",r.plotArea.dataLabelNameFontFamily).style("font-size",`${r.plotArea.dataLabelNameFontSize}px`).style("font-style",Ae.includes("Italic")?"italic":"").style("text-decoration",Ae.includes("Underline")?"underline":"").style("font-weight",Ae.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelNameColor??"#000");const pe=r.plotArea.dataLabelValueFontStyle??[];if(xe.selectAll(".annotation-note-label").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("font-style",pe.includes("Italic")?"italic":"").style("text-decoration",pe.includes("Underline")?"underline":"").style("font-weight",pe.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelValueColor??"#000"),r.plotArea.plotAreaAbsoluteValue&&xe.selectAll(".annotation-note-label").each(function(O){const J=T.select(this),F=T.format(".2s")(Math.abs(O.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",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("fill",r.plotArea.dataLabelValueColor??"#000").text(F)}),p==="diamond"){const O=r.plotArea.connectorColor??"#ccc",J=5;xe.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",O).style("stroke",O)})}if(xe.selectAll("rect,.annotation-subject").remove(),r.animation?.animationEnabled){const O=r.animation.animationDuration,J=Xe[r.animation.animationEffect],F=xe.selectAll(".annotation-note-label");F.interrupt().style("opacity",0),setTimeout(()=>{F.transition().delay((b,k)=>k*30).duration(O).ease(J).style("opacity",1)},50)}const ue=r.plotArea.connectorColor??"#ccc";xe.selectAll(".connector").style("stroke",ue).attr("hoverId",O=>O.data.hoverId).attr("stroke-dasharray",K[r.plotArea.connectorStyle?.toLowerCase()]),xe.selectAll(".connector-end").attr("hoverId",O=>O.data.hoverId).style("fill",ue).style("stroke",ue),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=>r.plotArea.hideInsignificantValue&&O.data.x1-O.data.x0<.09).style("visibility","hidden")}catch(u){throw u}}const tr=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},el=(t,e,r,o,h,n,l,s,x,m)=>{try{if(r.plotArea.numberOfBubbles){let A=e=="Bottom"?o-55:o-25;t.append("foreignObject").attr("transform",`translate(${n.left},${A})`).attr("width",h).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",we.black).style("font-size","12px ").style("text-overflow","ellipsis").html((r.plotArea.totalAlias?r.plotArea.totalAliasText:"Total count : ")+m)}}catch(A){fa(ma,"setnumberOfBubbles",A)}};function fa(t,e,r){console.error(`[${t}] [${e}]`,r)}const ar=({isDateType:t,formatOptions:e,data:r})=>{const o=crypto.randomUUID(),h=0,n=re.ColumnHistogramChart,l=Te.useRef(),s=r.ChartData,x=r.DimensionList,m=!1,A=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,p=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,H=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,g=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,G,V,j,K,Z,Y,N,E,z,q,ce,ne,oe,xe,Ae,pe=[],ue=[],O,J,F,b,k,d,c,i,y,f,a,L,P,ae=[],Q=0;const be=2;let Le={dimensionList:x,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Fe()}catch(Me){ge("Columnchart","createColumnChart",Me)}},[e]);const Fe=()=>{({formatOptions:e,svg:k,width:O,height:J}=Ct(l,e)),me(),{maxNumberForPrimaryAxis:ce,maxNumberForSecondaryAxis:ne}=Nt(e,Le.yMinLeft,Le.yMaxLeft,Le.yMinRight,Le.yMaxRight),{margin:G,yLabel:V,xLabel:j,yTitle:K,xTitle:Z,dimensionHeightWidthArray:Y,chartTitleHeight:N,secondaryAxisTitleWidth:E,legendMargin:z,secondaryYLabel:q}=vt(O,J,ce,ne,Le.yMaxLeft,e,Le.legendList,Le.dimensionList,Le.yMaxRight,A,u,t),ie(G),{dataTable:F,dataTableHeight:b}=ea(e,V,K,s,Le.dimensionList),kt(k,O,J,e),d=Mt(k,G),mt(d,e,b,oe,xe,n),te(),ee(),De(),Gt(d,e,b,V,a,xe),ye(s,J,k,G,oe),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,k,d,F,h,c,i,y,void 0,void 0,b,n,e,V,K,Le.dimensionList,oe,f,Le.formattedDimensionListMap,o,G,xe)),St(e,m,k,G,j,J,Z,Le.chartType,V,oe,xe),Ft(xe,e,b,m,k,G,K,V),Ut(k,A,G,e,b,xe,oe,q,E),wt(k,e,O,N),Dt(J,k,Y,N,O,z,e,s,o,b,G,nt.rectangle)},me=()=>{const Me=[],Ce=[];let ve=[],he=-1/0,fe=1/0;s.forEach(B=>{Ce.push(B.legend),B.data.forEach(U=>{Me.push(U),he=Math.max(he,U.value),fe=Math.min(fe,U.value)})}),Le.chartData=Me,Le.legendList=Ce,Le.yMaxLeft=he,Le.yMinLeft=fe>0?0:fe,ae=JSON.parse(JSON.stringify(s)),ae.forEach(B=>B.data.forEach(U=>ve.push(U.value)));let de=S||S==0?S:0,le=p||p==0?p:ae[0]?.data?.length;Le.yMaxLeft=parseFloat((de+"").length>(le+"").length?de+"":le+""),Le.xMax=T.max(ve),Le.xMin=T.min(ve)},te=()=>{switch(e.bins.binsCalculation){case"Automatic":Ae=oe/50;break;case"Number of Bins":ke(!1);break;case"Bin Width":ke(!0)}},ke=Me=>{ae.forEach(fe=>fe.data.sort(function(de,le){return de.value-le.value}));let Ce=Le.xMax-Le.xMin,ve;Me?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ve=Ce/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ve=Ce/parseFloat(e.bins.binsCalculationValue));let he=Le.xMin;if(Me)for(pe=[he];he<Le.xMax;)he+=ve,pe.push(he);else for(pe=[he];Math.round(he)<Math.round(Le.xMax);)he+=ve,pe.push(Math.round(he))},ee=()=>{i=T.scaleLinear().domain([Le.xMin,Le.xMax]).range([0,oe]);const Me=pe.length>0?pe:i.ticks(Ae);let Ce=T.bin().value(he=>he).domain(i.domain()).thresholds(Me);ae.forEach(he=>{let fe=Ce(he.data.map(de=>de.value));ue.push(fe)}),ae.forEach((he,fe)=>ue[fe].forEach(de=>{de.name=he.properties.legend,de.color=he.properties.color,de.opacity=he.properties.opacity}));let ve=[];ue.forEach(he=>he.forEach(fe=>ve.push(fe.length))),Le.yMaxLeft=T.max(ve),Le.yMinLeft=T.min(ve),c=T.scaleLinear().range([xe,0]).domain([S||S==0?S:0,p||p==0?p:Le.yMaxLeft+.2*Le.yMaxLeft])},De=()=>{Ve();{let Me=ot(Le.yMaxLeft,Le.yMinLeft,xe,e,Le,S,p,!1,oe);a=T.axisLeft(c).tickFormat(Ce=>_e(Ce,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,oe)).tickValues(Me.autoLabelFlag?void 0:Me.yAxisLabelArray).ticks(Me.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ve=()=>{let Me=parseInt(e.xAxisLabel.xAxisPosition);xi(Le.xMax,Le.xMin,oe,e,H,g,xe,!1).xAxisLabelArray.shift(),L=(Me==1?T.axisTop(i):T.axisBottom(i)).tickFormat(ve=>_e(ve,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(ia(e,xe,b)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?L.ticks(Ae):L.tickValues(pe).ticks(oe/50)},Ye=Me=>{const Ce=e.animation.animationEnabled,ve=d.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(ue).enter().append("g").selectAll("rect").data(fe=>fe).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",1).attr("transform",function(fe){return"translate("+i(fe.x0)+","+xe+")"}).attr("width",function(fe){return i(fe.x1)-i(fe.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(fe.x1)-i(fe.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",fe=>fe.color!==we.white?fe.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(fe,de)=>{st([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:`${de.x0}-${de.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():de.properties?.currentMeasure?de.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:_e(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(de.length/ae[0].data.length):de.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,fe)}).on("mouseout",rt);(Ce?ve.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):ve).attr("transform",function(fe){return"translate("+i(fe.x0)+","+(c(fe.length)>0?c(fe.length):0)+")"}).attr("height",function(fe){return xe-c(fe.length)}),d.selectAll(".parentGroup").raise()},ie=Me=>{oe=O-Me.left-Me.right,xe=J-Me.bottom-Me.top},ye=(Me,Ce,ve,he,fe)=>{if(!e.plotArea.fitChart){const de=Me[0].data.length-be,le=Ce-20;P=Le.dimensionList.slice(Q,Q+be),ae=JSON.parse(JSON.stringify(Me)),ae.forEach((R,v)=>ae[v].data=R.data.filter(w=>P.includes(w.dimension))),ve.append("rect").attr("x",he.left).attr("y",le).attr("width",fe).attr("height",8).attr("fill","#ddd").attr("rx",4);const B=fe*be/Le.dimensionList.length,U=ve.append("rect").attr("x",he.left).attr("y",le).attr("width",B).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",R=>{let v=Math.min(Math.max(R.x,he.left),he.left+fe-B);U.attr("x",v),Q=Math.round((v-he.left)/(fe-B)*de),P=Le.dimensionList.slice(Q,Q+be),ae=JSON.parse(JSON.stringify(Me)),ae.forEach((w,D)=>ae[D].data=w.data.filter(I=>P.includes(I.dimension))),Ve(),Pe()}));ve.on("wheel",R=>{R.preventDefault();const v=Math.abs(R.deltaX)>Math.abs(R.deltaY)?R.deltaX:R.deltaY;Q+=v>0?1:-1,Q=Math.max(0,Math.min(Q,de));const w=he.left+(fe-B)*Q/de;U.attr("x",w),ae=JSON.parse(JSON.stringify(Me)),ae.forEach((D,I)=>ae[I].data=D.data.filter(W=>P.includes(W.dimension))),Ve(),Pe()})}Pe()},Pe=()=>{qt(d,Le,j,e,b,c,L,Y,J,h,t,oe,xe,P,i),Ye()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:o,style:{width:"100%",height:"100%"}})})},ir=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const m=crypto.randomUUID(),A=0,u=re.LineChart,S=Te.useRef(),p=Te.useRef(s);p.current=s;const H=Te.useRef(x);H.current=x;const g=bt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1;let j=!1;const K=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,E=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b=!1,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me,te,ke,ee=[],De=0,Ve=0,Ye=0,ie={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ye()}catch(U){ge("Linechart","createLineChart",U)}},[e]);const ye=()=>{({formatOptions:e,svg:a,width:c,height:i}=Ct(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:F}=Nt(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:z,yLabel:q,xLabel:ce,yTitle:ne,xTitle:oe,dimensionHeightWidthArray:xe,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:Ve,columnWidth:Ye,scrollbarVisible:b}=vt(c,i,J,F,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,K,t,!1,ie),le(z),{dataTable:y,dataTableHeight:f}=ea(e,q,ne,g,ie.dimensionList,r),kt(a,c,i,e),L=Mt(a,z),mt(L,e,f,k,d,u,m),Me(),he(),Gt(L,e,f,q,Fe,d),j&&ci(L,e,f,O,te,d,k),St(e,V,a,z,ce,i,oe,ie.chartType,q,k,d),Ft(d,e,f,V,a,z,ne,q),j&&Ut(a,j,z,e,f,d,k,O,pe),wt(a,e,c,Ae),Dt(i,a,xe,Ae,c,ue,e,g,m,f,z,nt.line,u,n),Bt(g,i,c,a,z,k,b,Ve,ie,De,!1,Ce)},Pe=()=>{const U=[],R=[];let v=[],w=-1/0,D=1/0,I=-1/0,W=1/0;e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0),g.forEach(C=>{R.push(C.properties.alias?C.properties.alias:C.legend),C.data.forEach(M=>{U.push(M),C.properties.axis==="Secondary"?(j=!0,I=Math.max(I,M.value),W=Math.min(W,M.value)):(w=Math.max(w,M.value),D=Math.min(D,M.value))})}),ie.chartData=U,ie.legendList=R,ie.yMaxLeft=w,ie.yMinLeft=D,ie.yMaxRight=I,ie.yMinRight=W,v=t?gt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(C=>C):ie.dimensionList,ie.dimensionList.forEach((C,M)=>{ie.formattedDimensionListMap.set(C,v[M])}),ee=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ke=ie.dimensionList:ke=ie.dimensionList.slice(De,De+Ve)},Me=()=>{let U=ot(Y||ie.yMaxLeft,ie.yMinLeft,d,e,ie,Z,Y).yAxisLabelArray;if(ie.yMaxLeft=U[U.length-1],ie.yMinLeft=U[0],P=T.scaleLinear().domain([ie.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:ie.yMinLeft*.9:ie.yMinLeft<0?ie.yMinLeft*1.1:ie.yMinLeft*.9,ie.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:ie.yMaxLeft*1.1]).range([f>0?d-f:d,0]),j&&(ae=T.scaleLinear().domain([ie.yMinRight>=0?(N||N==0)&&!Number.isNaN(N)?N:0:(N||N==0)&&!Number.isNaN(N)?N:ie.yMinRight*1.1,ie.yMaxRight<=0?E||0:E||ie.yMaxRight*1.1]).range([f>0?d-f:d,0])),be=[0,k],e.seriesLabel.seriesLabelVisibility){let R=aa(k,P,e,ee,ae,j,d,!1);R.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Le=R.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?be=[0,k-R.heightWidth[0]]:be=[R.heightWidth[0],k]}},Ce=(U,R,v)=>{ee=R,ke=U,Ve=v,B()},ve=()=>{Q=T.scalePoint().domain(ke).range(be).padding(.5)},he=()=>{{let U=ot(Y||ie.yMaxLeft,ie.yMinLeft,d,e,ie,Z,Y);Fe=T.axisLeft(P).tickFormat(R=>_e(R,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,k,Le)).tickValues(U.autoLabelFlag?void 0:U.yAxisLabelArray).ticks(U.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let U=oi(E||ae.domain()[1],ae.domain()[0],e,d);te=T.axisRight(ae).tickFormat(R=>_e(R,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(U.autoLabelFlag?void 0:U.secondaryYAxisLabelArray).ticks(U.secondaryCustomTickValue).tickSize(Pt(e,k,Le)).tickPadding(8).tickSizeOuter(0)}},fe=()=>{me=T.axisBottom(Q).tickSize(ia(e,d,f,!0)).tickSizeOuter(0).tickValues(Lt(ke,k))},de=U=>{const R=[...U].reverse();R.forEach(M=>{M.data.forEach(_=>{_.hideZero=M.properties.hideZeroValues,_.axis=M.properties.axis})});const v=T.line().x(M=>{const _=Q(M.dimension);return _??0}).y(M=>M.axis===at.primary?P(M.value):ae(M.value)).defined(M=>M.hideZero||ie.hideZeroValues?!!M.value:!0).curve(Ot(e)),w=e.animation.animationEnabled,D=M=>w?M.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):M;let I=L.selectAll(".parentGroup").data([R]);I=I.enter().append("g").attr("class","lines parentGroup").merge(I);let W=I.selectAll(".line-group").data(M=>M),C=W.enter().append("g").attr("class","line-group");C.append("path").attr("class","visibleLine").attr("fill","none"),C.merge(W).each(function(M){const X=T.select(this).selectAll("path.visibleLine").data([M]).join("path").attr("class","visibleLine").attr("d",$=>v($.data)).attr("stroke",$=>$.properties.color!==we.white?$.properties.color:"none").attr("stroke-dasharray",$=>{const Se=parseInt($.properties.lineWidth);switch($.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",$=>$.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",$=>$.properties.lineStyle!=="None"?$.properties.lineWidth:0).attr("hoverId",(M.properties.alias||M.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${m}-clip)`).attr("d",$=>v($.data)).attr(Qe.SeriesId,$=>$.properties.legendUniqueId).attr(Qe.DimValue,$=>$.properties.alias||$.properties.name||"").on("click",At(H,p,($,Se)=>({seriesId:Se.properties.legendUniqueId,dimValue:Se.properties.alias||Se.properties.name||"",legendUniqueId:Se.properties.legendUniqueId,seriesDisplayName:Se.properties.alias||Se.properties.name||""})));w&&X.each(function(){const $=T.select(this),Se=this.getTotalLength();$.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se),D($).attr("stroke-dashoffset",0)})}),W.exit().remove(),Ca(I,R,"None",Q,P,ae,null,e,ie,E,N,Z,Y,!1,l),L.selectAll(".parentGroup").raise()},le=U=>{k=c-U.left-U.right,d=i-U.bottom-U.top},B=()=>{ve(),fe(),qt(L,ie,ce,e,f,P,me,xe,i,k/ke.length,t,k,d,ke,Q),de(ee),Da(g,Q,P,ae,z,dt,[],[],e,u,i,c,k,ke,d,m,a,h,void 0,void 0,o);let U=aa(k,P,e,ee,ae,j,d,!1).labelArray;za(e,L,U),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,a,L,y,A,P,Q,void 0,void 0,void 0,f,u,e,q,ne,ie.dimensionList,k,be,ie.formattedDimensionListMap,m,z,d))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},lr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID(),A=0,u=re.StackLineChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=r.DimensionList,G=(bt(r.ChartData,r.DimensionList)||[]).reverse(),V=!1,j=new Map,K=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,E=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me,te=[],ke=0,ee=2,De=!1,Ve=0,Ye=[];const ie=!1;let ye={dimensionList:g,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(v){ge("StackLinechart","createStackLineChart",v)}},[e]);const Pe=()=>{({formatOptions:e,svg:f,width:d,height:c}=Ct(S,e)),Me(),{formatOptions:e}=Qt(e,G,r.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:F}=Nt(e,ye.yMinLeft,ye.yMaxLeft,ye.yMinRight,ye.yMaxRight),{margin:z,yLabel:q,xLabel:ce,yTitle:ne,xTitle:oe,dimensionHeightWidthArray:xe,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:ee,columnWidth:Ve,scrollbarVisible:De}=vt(d,c,J,F,ye.yMaxLeft,e,ye.legendList,ye.dimensionList,ye.yMaxRight,K,ie,t,!1,ye),le(z),{dataTable:i,dataTableHeight:y}=ea(e,q,ne,G,ye.dimensionList,r),kt(f,d,c,e),a=Mt(f,z),mt(a,e,y,b,k,u,m),Ce(),he(),Gt(a,e,y,q,Le,k),St(e,V,f,z,ce,c,oe,ye.chartType,q,b,k),Ft(k,e,y,V,f,z,ne,q),Ut(f,K,z,e,y,k,b,O,pe),wt(f,e,d,Ae),Dt(c,f,xe,Ae,d,ue,e,[...G].reverse(),m,y,z,nt.line,u,n),Bt(G,c,d,f,z,b,De,ee,ye,ke,!1,R),qa(j,ae,L,z,dt,[],e,u,c,d,f,o)},Me=()=>{const v=[],w=[];e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0),G.forEach((_,X)=>{const $=`${X}~$~${_.properties.alias?_.properties.alias:_.legend}`;_.properties.legend=$,w.push($);for(const Se of _.data)v.push(Se)}),ye.chartData=v,ye.legendList=w,te=JSON.parse(JSON.stringify(G));let D=pt(ye.dimensionList,G,ie);e.plotArea.fitChart?me=ye.dimensionList:(me=ye.dimensionList.slice(ke,ke+ee),te.forEach((_,X)=>te[X].data=_.data.filter($=>me.includes($.dimension))));const I=T.stack().keys(ye.legendList).offset(T.stackOffsetDiverging)(D);U();let W=1/0,C=-1/0;for(const _ of I)for(const[X,$]of _)W=Math.min(W,X),C=Math.max(C,$);ye.yMinLeft=W>0?0:W,ye.yMaxLeft=C;let M=t?gt(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList).map(_=>_):ye.dimensionList;ye.dimensionList.forEach((_,X)=>{ye.formattedDimensionListMap.set(_,M[X])})},Ce=()=>{let v=ot(Y||ye.yMaxLeft,ye.yMinLeft,k,e,ye,Z,Y).yAxisLabelArray;if(ye.yMaxLeft=v[v.length-1],ye.yMinLeft=v[0],L=T.scaleLinear().domain([ye.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:0:ye.yMinLeft<0?ye.yMinLeft*1.1:ye.yMinLeft*.9,ye.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:ye.yMaxLeft*1.1]).range([y>0?k-y:k,0]),Q=[0,b],e.seriesLabel.seriesLabelVisibility){let w=aa(b,L,e,te,void 0,K,k,!0);w.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(be=w.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,b-w.heightWidth[0]]:Q=[w.heightWidth[0],b]}ve()},ve=()=>{ae=T.scalePoint().domain(me).range(Q).padding(.5)},he=()=>{fe();{let v=ot(Y||ye.yMaxLeft,ye.yMinLeft,k,e,ye,Z,Y);Le=T.axisLeft(L).tickFormat(w=>_e(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,b,be)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},fe=()=>{Fe=T.axisBottom(ae).tickSize(ia(e,k,y,!0)).tickSizeOuter(0).tickValues(Lt(me,b))},de=v=>{v.forEach(C=>{C.data.forEach(M=>{M.hideZero=C.properties.hideZeroValues,M.axis=C.properties.axis})});const w=T.line().x(C=>ae(C.data.dimension)?ae(C.data.dimension):null).y(C=>C[1]>0?L(C[1]):L(C[0])).defined(C=>{const M=C;return M.hideZero||ye.hideZeroValues?M.data[M.key]:!0}).curve(Ot(e));let D=a.selectAll(".parentGroup").data([Ye]);D=D.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(D);let I=D.selectAll(".line-group").data(C=>C);const W=I.enter().append("g").attr("class",C=>"line-group "+C.key.replace(/ /g,"-"));W.append("path").attr("class","line").attr("fill","none"),W.merge(I).each(function(C,M){const _=T.select(this),X=_.selectAll("path.visibleLine").data([C]).join("path").attr("class","visibleLine").attr("hoverId",ze=>(G[M]?.properties?.alias||G[M]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",w(C)).attr("stroke",C.color!==we.white?C.color:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(G[M].properties.lineWidth.toString());switch(G[M].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",G[M].properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",G[M].properties.lineStyle!==yt.none?G[M].properties.lineWidth:0).attr("fill","none").attr(Qe.SeriesId,G[M].properties.legendUniqueId).attr(Qe.DimValue,G[M].properties.alias||G[M].properties.name||"").on("click",At(H,p,()=>({seriesId:G[M].properties.legendUniqueId,dimValue:G[M].properties.alias||G[M].properties.name||"",legendUniqueId:G[M].properties.legendUniqueId,seriesDisplayName:G[M].properties.alias||G[M].properties.name||""}))),$=e.animation.animationEnabled,Se=X.node().getTotalLength();$?X.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0):X.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",0),_.selectAll("path.hoverLine").data([C]).join("path").attr("class","hoverLine").attr("d",w(C)).attr("stroke",we.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(){f.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),f.selectAll('[hoverId="'+ui(G[M].properties.alias||G[M].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){f.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),I.exit().remove(),Ca(D,v,u,ae,L,P,null,e,ye,E,N,Z,Y,!1,x)},le=v=>{b=d-v.left-v.right,k=c-v.bottom-v.top},B=()=>{ve(),fe(),qt(a,ye,ce,e,y,L,Fe,xe,c,A,t,b,k,me,ae),U(),de(te),Va(Ye,ae,L,P,z,dt,[],[],e,u,c,d,b,me,k,m,f,h,y,o);let v=aa(b,L,e,te,void 0,K,k,!0).labelArray;za(e,a,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,L,ae,void 0,void 0,void 0,y,re.LineChart,e,q,ne,ye.dimensionList,b,Q,ye.formattedDimensionListMap,m,z,k))},U=()=>{let v=pt(me,te,ie);Ye=T.stack().keys(ye.legendList).offset(T.stackOffsetDiverging)(v),te.forEach((D,I)=>D.data.forEach((W,C)=>{W[0]=Ye[I][C][0],W[1]=Ye[I][C][1]}));let w=e.annotation.annotationSetLabelColor;Ye.forEach((D,I)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(G[I].properties.color)),D.individualAnnotationVisibility=JSON.parse(JSON.stringify(G[I].properties.individualAnnotationVisibility)),W.data.labelPosition=G[I].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(G[I].properties.color)):G[I].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(G[I].properties.hideZeroValues)),W.properties=G[I].properties}))},R=(v,w,D)=>{te=w,me=v,ee=D,Ka(r,j,me),B()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},rr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID(),A=0,u=re.NormalizedStackLineChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],G=r.DimensionList,V=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me=[],te=0,ke,ee=0,De=!1,Ve=[];const Ye=!0;let ie={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ye()}catch(v){ge("NormalizedLinechart","createNormalizedLinechart",v)}},[e]);const ye=()=>{({formatOptions:e,svg:y,width:k,height:d}=Ct(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:E,yLabel:z,xLabel:q,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:oe,chartTitleHeight:xe,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:ee,scrollbarVisible:De}=vt(k,d,O,J,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,Ye,t,!1,ie),le(E),{dataTable:c,dataTableHeight:i}=ea(e,z,ce,g,ie.dimensionList,r),kt(y,k,d,e),f=Mt(y,E),mt(f,e,i,F,b,u,m),Me(),he(),Gt(f,e,i,z,be,b),St(e,V,y,E,q,d,ne,ie.chartType,z,F,b),Ft(b,e,i,V,y,E,ce,z),Ut(y,j,E,e,i,b,F,ue,Ae),wt(y,e,k,xe),Dt(d,y,oe,xe,k,pe,e,[...g].reverse(),m,i,E,nt.line,u,n),Bt(g,d,k,y,E,F,De,ke,ie,te,!1,B)},Pe=()=>{const v=[],w=[];e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0,g.forEach(M=>{M.data=M.data.filter(_=>_.value!==0)})),g.forEach((M,_)=>{const X=`${_}~$~${M.properties.legend}`;M.properties.legend=X,w.push(X);for(const $ of M.data)v.push($)}),ie.chartData=v,ie.legendList=w,me=JSON.parse(JSON.stringify(g)),Fe=ie.dimensionList;const D=pt(ie.dimensionList,g,Ye),I=T.stack().keys(ie.legendList).offset(T.stackOffsetDiverging)(D);R();let W=1/0;for(const M of I)for(const[_]of M)W=Math.min(W,_);ie.yMinLeft=W>0?0:W,ie.yMaxLeft=1;const C=t?gt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(M=>M):ie.dimensionList;ie.formattedDimensionListMap=new Map(ie.dimensionList.map((M,_)=>[M,C[_]]))},Me=()=>{if(a=T.scaleLinear().domain([ie.yMinLeft<0?-1:0,1]).range([i>0?b-i:b,0]),ae=[0,F],e.seriesLabel.seriesLabelVisibility){ve(Ve,me);let v=aa(F,a,e,me,void 0,j,b,!0);v.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Q=v.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ae=[0,F-v.heightWidth[0]]:ae=[v.heightWidth[0],F]}},Ce=()=>{P=T.scalePoint().domain(Fe).range(ae).padding(.5)};function ve(v,w){v.forEach((D,I)=>D.forEach((W,C)=>{w[I]&&w[I].data[C]&&(w[I].data[C][0]=W[0]=W.data.total===0?0:W[0]/W.data.total,w[I].data[C][1]=W[1]=W.data.total===0?0:W[1]/W.data.total)}))}const he=()=>{be=T.axisLeft(a).tickSize(Pt(e,F,Q)).ticks(i>0?(b-i)/80:b/80,"%").tickPadding(8).tickSizeOuter(0)},fe=()=>{Le=T.axisBottom(P).tickSize(ia(e,b,i,!0)).tickSizeOuter(0).tickValues(Lt(Fe,F))},de=v=>{ve(Ve,me),v.forEach(C=>{C.data.forEach(M=>{M.hideZero=C.properties.hideZeroValues,M.axis=C.properties.axis})});const w=T.line().x(C=>P(C.data.dimension)?P(C.data.dimension):null).y(C=>C[1]>0?a(C[1]):a(C[0])).curve(Ot(e));let D=f.selectAll(".parentGroup").data([Ve]);D=D.enter().append("g").attr("class","lines parentGroup").merge(D);let I=D.selectAll(".line-group").data(C=>C),W=I.enter().append("g").attr("class",C=>"line-group "+C.key.replace(/ /g,"-"));W.attr("hoverId",C=>(v[C.index]?.properties?.alias||v[C.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),W.merge(I).each(function(C,M){const _=T.select(this),X=_.selectAll("path.visibleLine").data([C]).join("path").attr("class","visibleLine").attr("d",w(C)).attr("stroke",C.color!==we.white?C.color:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[M].properties.lineWidth.toString());switch(g[M].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",g[M].properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",g[M].properties.lineStyle!==yt.none?g[M].properties.lineWidth:0).attr("fill","none").attr(Qe.SeriesId,g[M].properties.legendUniqueId).attr(Qe.DimValue,g[M].properties.alias||g[M].properties.name||"").on("click",At(H,p,()=>({seriesId:g[M].properties.legendUniqueId,dimValue:g[M].properties.alias||g[M].properties.name||"",legendUniqueId:g[M].properties.legendUniqueId,seriesDisplayName:g[M].properties.alias||g[M].properties.name||""}))),$=e.animation.animationEnabled,Se=X.node().getTotalLength();$?X.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0):X.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",0),_.selectAll("path.hoverLine").data([C]).join("path").attr("class","hoverLine").attr("d",w(C)).attr("stroke",we.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(ze,Ie){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),y.selectAll('[hoverId="'+ui(v[Ie.index]?.properties?.alias||v[Ie.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(ze,Ie){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),y.selectAll('[hoverId="'+ui(v[Ie.index]?.properties?.alias||Ie[Ie.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),I.exit().remove(),Ca(D,v,u,P,a,L,null,e,ie,N,Y,K,Z,!0,x)},le=v=>{F=k-v.left-v.right,b=d-v.bottom-v.top},B=(v,w,D)=>{me=w,Fe=v,ke=D,U()},U=()=>{Ce(),R(),fe(),qt(f,ie,q,e,i,a,Le,oe,d,A,t,F,b,Fe,P),de(me),Va(Ve,P,a,L,E,dt,[],[],e,u,d,k,F,Fe,b,m,y,h,i,o);let v=aa(F,a,e,me,void 0,j,b,!0).labelArray;za(e,f,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,c,A,a,P,void 0,void 0,void 0,i,re.LineChart,e,z,ce,ie.dimensionList,F,ae,ie.formattedDimensionListMap,m,E,b))},R=()=>{let v=pt(Fe,me,Ye);Ve=T.stack().keys(ie.legendList).offset(T.stackOffsetDiverging)(v),me.forEach((D,I)=>D.data.forEach((W,C)=>{W[0]=Ve[I][C][0],W[1]=Ve[I][C][1]}));let w=e.annotation.annotationSetLabelColor;Ve.forEach((D,I)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(g[I].properties.color)),W.data.labelPosition=g[I].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(g[I].properties.color)):g[I].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(g[I].properties.hideZeroValues)),W.properties=g[I].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},nr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const m=crypto.randomUUID();let A=0;const u=re.HorizontalBarChart,S=Te.useRef(),p=Te.useRef(s);p.current=s;const H=Te.useRef(x);H.current=x;const g=bt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!0;let j=!1;const K=!1,Z=new Map;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,E=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k=new Map,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me,te,ke,ee=[],De=0,Ve=2,Ye=!1,ie={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ye()}catch(U){ge("HorizontalBarchart","createHorizontalBarChart",U)}},[e]);const ye=()=>{({formatOptions:e,svg:a,width:i,height:y}=Ct(S,e)),Pe(),{maxNumberForPrimaryAxis:F,maxNumberForSecondaryAxis:b}=Nt(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:q,yLabel:ce,xLabel:ne,yTitle:oe,xTitle:xe,dimensionHeightWidthArray:Ae,chartTitleHeight:pe,secondaryAxisTitleWidth:ue,legendMargin:O,secondaryYLabel:J,visibleBars:Ve,columnWidth:A,scrollbarVisible:Ye}=vt(i,y,F,b,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,K,t,V,ie),de(q),kt(a,i,y,e),L=Mt(a,q),mt(L,e,f,d,c,u,m),Me(),ve(),Ya(e,L,ce,c,d,Fe),j&&zl(e,L,J,me,d),St(e,V,a,q,ne,y,xe,ie.chartType,ce,d,c),Ft(c,e,f,V,a,q,oe,ce,d),Ut(a,j,q,e,f,c,d,J,ue,V),wt(a,e,i,pe),Dt(y,a,Ae,pe,i,O,e,g,m,f,q,nt.rectangle,u,n),Bt(g,y,i,a,q,d,Ye,Ve,ie,De,!1,le,V)},Pe=()=>{const U=[],R=[];let v=[],w=-1/0,D=1/0,I=-1/0,W=1/0,C=1/0,M=-1/0;g.forEach(_=>{R.push(_.properties.legendUniqueId),M=-1/0,C=1/0,_.data.forEach(X=>{U.push(X),_.properties.axis==="Secondary"?(j=!0,I=Math.max(I,X.value),W=Math.min(W,X.value)):(w=Math.max(w,X.value),D=Math.min(D,X.value)),M=Math.max(M,X.value),C=Math.min(C,X.value)}),_.properties.setColorScale&&Z.set(_.properties.legendUniqueId,T.scaleSequential().domain([C,M]).interpolator(ii.interpolateRgb(_.properties.startColor,_.properties.endColor)))}),ie.chartData=U,ie.legendList=R,ie.yMaxLeft=w,ie.yMinLeft=D>0?0:D,ie.yMaxRight=I,ie.yMinRight=W,v=t?gt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(_=>_):ie.dimensionList,ie.dimensionList.forEach((_,X)=>{ie.formattedDimensionListMap.set(_,v[X])}),ee=JSON.parse(JSON.stringify(g)),ke=ie.dimensionList,e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0)},Me=()=>{let U=ot(ie.yMaxLeft,ie.yMinLeft,c,e,ie,Y,N,V,d).yAxisLabelArray;ie.yMaxLeft=U[U.length-1],ie.yMinLeft=U[0],Q=T.scaleLinear().domain([ie.yMinLeft>=0?Y!==void 0&&!Number.isNaN(Y)?Y:0:ie.yMinLeft<0?ie.yMinLeft*1.1:ie.yMinLeft*.9,ie.yMaxLeft<=0?0:N!==void 0&&!Number.isNaN(N)?N:ie.yMaxLeft*1.1]).range([0,d]),j&&(be=T.scaleLinear().domain([ie.yMinRight>=0?(E||E==0)&&!Number.isNaN(E)?E:0:(E||E==0)&&!Number.isNaN(E)?E:ie.yMinRight*1.1,ie.yMaxRight<=0?z||0:z||ie.yMaxRight*1.1]).range([0,d])),Le=[c,0]},Ce=()=>{ae=T.scaleBand().domain(ie.legendList).range([0,A]).paddingInner(ie.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),P=T.scalePoint().domain(ke).range(Le).padding(.5)},ve=()=>{{let U=ot(N||ie.yMaxLeft,ie.yMinLeft,c,e,ie,Y,N,V,d);Fe=T.axisBottom(Q).tickFormat(R=>_e(R,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-c:0).tickValues(U.autoLabelFlag?void 0:U.yAxisLabelArray).ticks(U.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let U=oi(z||be.domain()[1],be.domain()[0],e,d);me=T.axisTop(be).tickFormat(R=>_e(R,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(U.autoLabelFlag?void 0:U.secondaryYAxisLabelArray).ticks(U.secondaryCustomTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-c:0).tickPadding(8).tickSizeOuter(0)}},he=()=>{te=T.axisLeft(P).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*d*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(ke,c))},fe=U=>{U.forEach(R=>{R.data.forEach(v=>{v.hideZero=R.properties.hideZeroValues,v.axis=R.properties.axis,v.legendUniqueId=R.properties.legendUniqueId})}),ke.forEach(R=>{L.append("rect").attr("id",`dim-background-${R}`).attr("class","dimension-background").attr("y",P(R)-A/2).attr("height",A).attr("x",0).attr("width",d).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),U.forEach(R=>{let v=L.selectAll(".parentGroup").data([R],C=>C.properties.legendUniqueId);v=v.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(v);let w=v.selectAll(".column-group").data(R.data.map(C=>({...C,properties:R.properties})),C=>C.legend+C.dimension),D=w.enter().append("g").attr("class","column-group").attr("hoverId",(R.properties.alias||R.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",C=>`translate(0, ${P(C.dimension)-A/2})`);w.attr("transform",C=>`translate(0, ${P(C.dimension)-A/2})`),D.merge(w).attr("transform",C=>`translate(0, ${P(C.dimension)-A/2})`);const I=D.append("rect").attr("y",C=>ae(C.legendUniqueId)).attr("height",ae.bandwidth()).attr("x",C=>{const M=R.properties.axis===at.primary?Q:be;return C.value>=0,M(0)}).attr("width",0).attr("fill",C=>Z.get(R.properties.legendUniqueId)?.(C.value)??R.properties.color).attr("stroke-dasharray",C=>C.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",C=>`${C.properties.stackBorderWidth}px`).attr("stroke",C=>R.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?R.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(Qe.SeriesId,()=>R.properties.legendUniqueId).attr(Qe.DimValue,C=>Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension));(e.animation.animationEnabled?I.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):I).attr("x",C=>{const M=R.properties.axis===at.primary?Q:be;return C.value>=0?M(0):M(C.value)}).attr("width",C=>{const M=R.properties.axis===at.primary?Q:be,_=R.properties.axis===at.primary?N:z;return C.value>=0?_&&C.value>_?M(_)-M(0):M(C.value)-M(0):Math.abs(M(0)-M(C.value))}),D.merge(w).on("mousemove",(C,M)=>{(R.properties.alias||R.properties.name||"Legend").replace(/ /g,"-");const _=Array.isArray(M.dimension)?M.dimension[0]:M.dimension,X=String(ie.formattedDimensionListMap.get(_)??_??""),$=ht(l,String(_??""),{...R.properties,formattedDimensionValue:X});st([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ie.formattedDimensionListMap.get(Array.isArray(M.dimension)?M.dimension[0]:M.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(u)?M[1]-M[0]:M.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,C,R.properties,$)}).on("mouseout",(C,M)=>{(R.properties.alias||R.properties.name||"Legend").replace(/ /g,"-"),rt()}).on("click",At(H,p,(C,M)=>({seriesId:R.properties.legendUniqueId,dimValue:Array.isArray(M.dimension)?String(M.dimension[0]):String(M.dimension),legendUniqueId:R.properties.legendUniqueId,seriesDisplayName:R.properties.alias||R.properties.name||""}))),w.exit().remove()}),L.selectAll(".parentGroup").raise()},de=U=>{d=i-U.left-U.right,c=y-U.bottom-U.top},le=(U,R,v)=>{ee=R,ke=U,Ve=v,Ka(r,k,ke),e.xAxisLabel.hideZeroValues&&(ke=ke.filter(w=>k.get(w)!==0)),B()},B=()=>{Ce(),he(),Ua(e,L,ne,c,d,te,me,Q,ie.yMaxLeft,ke,u,t,i,Ae,A,P),fe(ee),Da(ee,P,Q,be,q,dt,[],[],e,u,y,i,d,ke,c,m,a,h,ae,A,o,!1,V)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},sr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID();let A=0;const u=re.StackHorizontalBarChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse(),G=r.DimensionList,V=!0,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y,N,E,z,q,ce,ne,oe,xe,Ae,pe,ue;const O=new Map;let J,F,b,k,d,c,i,y,f,a,L,P,ae=[],Q=0,be=2,Le=!1,Fe=[];const me=!1;let te=new Map,ke={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ee()}catch(B){ge("StackStackHorizontalBarchart","createStackHorizontalBarChart",B)}},[e]);const ee=()=>{({formatOptions:e,svg:d,width:b,height:k}=Ct(S,e)),De(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,ke.yMinLeft,ke.yMaxLeft,ke.yMinRight,ke.yMaxRight),{margin:Y,yLabel:N,xLabel:E,yTitle:z,xTitle:q,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:oe,legendMargin:xe,secondaryYLabel:Ae,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(b,k,pe,ue,ke.yMaxLeft,e,ke.legendList,ke.dimensionList,ke.yMaxRight,j,me,t,V,ke),Me(Y),kt(d,b,k,e),c=Mt(d,Y),mt(c,e,0,J,F,u,m),Ve(),ie(),Ya(e,c,N,F,J,a),St(e,V,d,Y,E,k,q,ke.chartType,N,J,F),Ft(F,e,0,V,d,Y,z,N,b),wt(d,e,b,ne),Dt(k,d,ce,ne,b,xe,e,[...g].reverse(),m,0,Y,nt.rectangle,u,n),Bt(g,k,b,d,Y,J,Le,be,ke,Q,!1,Ce,V)},De=()=>{const B=[],U=[];let R=-1/0,v=1/0;g.forEach((M,_)=>{const X=`${_}~$~${M.properties.legend}`;M.properties.legend=X,U.push(X),R=-1/0,v=1/0;for(const $ of M.data)R=Math.max(R,$.value),v=Math.min(v,$.value),B.push($);M.properties.setColorScale&&O.set(M.properties.legendUniqueId,T.scaleSequential().domain([v,R]).interpolator(T.interpolateRgb(M.properties.startColor,M.properties.endColor)))}),ke.chartData=B,ke.legendList=U,ae=JSON.parse(JSON.stringify(g));let w=pt(ke.dimensionList,g,me);e.plotArea.fitChart?P=ke.dimensionList:(P=ke.dimensionList.slice(Q,Q+be),ae.forEach((M,_)=>ae[_].data=M.data.filter(X=>P.includes(X.dimension))));const D=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(w);he();let I=1/0,W=-1/0;for(const M of D)for(const[_,X]of M)I=Math.min(I,_),W=Math.max(W,X);ke.yMinLeft=I>0?0:I,ke.yMaxLeft=W;let C=t?gt(e.xAxisLabel.xAxisNumberFormat,ke.dimensionList).map(M=>M):ke.dimensionList;ke.dimensionList.forEach((M,_)=>{ke.formattedDimensionListMap.set(M,C[_])}),e.plotArea.hideZeroValues&&(ke.hideZeroValues=!0)},Ve=()=>{let B=ot(ke.yMaxLeft,ke.yMinLeft,F,e,ke,K,Z,V,J).yAxisLabelArray;ke.yMaxLeft=B[B.length-1],ke.yMinLeft=B[0],i=T.scaleLinear().domain([ke.yMinLeft>=0?K!==void 0&&!Number.isNaN(K)?K:0:ke.yMinLeft<0?ke.yMinLeft*1.1:ke.yMinLeft*.9,ke.yMaxLeft<=0?0:Z!==void 0&&!Number.isNaN(Z)?Z:ke.yMaxLeft*1.1]).range([0,J]),f=[F,0]},Ye=()=>{y=T.scalePoint().domain(P).range(f).padding(.5)},ie=()=>{{let B=ot(Z||ke.yMaxLeft,ke.yMinLeft,F,e,ke,K,Z,V,J);a=T.axisBottom(i).tickFormat(U=>_e(U,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-F:0).tickValues(B.autoLabelFlag?void 0:B.yAxisLabelArray).ticks(B.customTickValue).tickPadding(8).tickSizeOuter(0)}},ye=()=>{L=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*J*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,F))},Pe=B=>{B.forEach(C=>{C.data.forEach(M=>{M.hideZero=C.properties.hideZeroValues,M.axis=C.properties.axis})}),P.forEach(C=>{c.append("rect").attr("id",`dim-background-${C}`).attr("class","dimension-background").attr("y",y(C)-A/2).attr("height",A).attr("x",0).attr("width",J).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let U=c.selectAll(".parentGroup").data([Fe]);U=U.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(U);let R=U.selectAll(".column-group").data(C=>C);R=R.enter().append("g").attr("class",C=>"column-group "+C.key.replace(/ /g,"-")).attr("hoverId",C=>(B[C.index].properties.alias||B[C.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(R);let w=R.selectAll("rect").data(C=>C);const D=(C,M)=>{const _=Array.from(R.nodes()).indexOf(C[M].parentNode);return{props:g[_]?.properties,groupIndex:_}},I=w.enter().append("rect").merge(w).attr("y",C=>y(C.data.dimension)-A/2).attr("height",A).attr("fill",(C,M,_)=>{const{props:X}=D(_,M);return O.get(X.legendUniqueId)?.(C.data[C.key])??X?.color??"gray"}).attr("stroke",(C,M,_)=>{const X=D(_,M).props;return X?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?X.stackBorderColor:"none"}).attr("stroke-dasharray",(C,M,_)=>D(_,M).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(C,M,_)=>(D(_,M).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",C=>Math.min(i(C[0]),i(C[1]))).attr("width",0).attr("visibility",(C,M,_)=>{const X=D(_,M).props;return C.data[C.key]===0&&X?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,C=>C.key??"").attr(Qe.DimValue,C=>Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension)).on("mousemove",(C,M)=>{const _=M.data.dimension;st([{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(_)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e(M.data[M.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,C,M.properties,ht(x,String(_??""),{...M.properties,formattedDimensionValue:String(ke.formattedDimensionListMap.get(_)??_??"")}))}).on("mouseout",(C,M)=>{M.data.dimension,rt()}).on("click",At(H,p,(C,M)=>({seriesId:M.key,dimValue:Array.isArray(M.data.dimension)?String(M.data.dimension[0]):String(M.data.dimension),legendUniqueId:M.key,seriesDisplayName:M.properties?.alias||M.properties?.name||""})));I.attr("x",C=>i(0)),(e.animation.animationEnabled?I.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):I).attr("x",C=>Math.min(i(C[0]),i(C[1]))).attr("width",C=>Math.abs(i(C[1])-i(C[0]))),R.exit().remove(),c.selectAll(".parentGroup").raise()},Me=B=>{J=b-B.left-B.right,F=k-B.bottom-B.top},Ce=(B,U,R)=>{ae=U,P=B,be=R,Ka(r,te,P),he(),ve()},ve=()=>{Ye(),ye(),Ua(e,c,E,F,J,L,void 0,i,ke.yMaxLeft,P,u,t,b,ce,A,y);const B=new Map;P.forEach((U,R)=>{let v=0;Fe.forEach(w=>{const D=w[R]?.[0]??0;D<v&&(v=D)}),B.set(U,v)}),Pe(ae),Va(Fe,y,i,void 0,Y,dt,[],[],e,u,k,b,J,P,F,m,d,h,0,o,V),qa(te,y,i,Y,dt,[],e,u,k,b,d,o,V,B),fe(),c.selectAll(".connectors").raise()},he=()=>{let B=pt(P,ae,me);Fe=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(B),ae.forEach((R,v)=>R.data.forEach((w,D)=>{w[0]=Fe[v][D][0],w[1]=Fe[v][D][1]}));let U=e.annotation.annotationSetLabelColor;Fe.forEach((R,v)=>R.forEach(w=>{w.key=R.key,R.color=JSON.parse(JSON.stringify(g[v].properties.color)),w.data.labelPosition=g[v].properties.dataLabelPosition,w.data.labelColor=U=="2"?JSON.parse(JSON.stringify(g[v].properties.color)):g[v].properties.labelColor,w.hideZero=JSON.parse(JSON.stringify(g[v].properties.hideZeroValues)),w.properties=g[v].properties}))},fe=()=>{try{const B=Number(e.connector?.connectorVisibility);if(!e.connector||B===2)return;const U=[],R=[],v=[];let w;const D=[];if(B===1)w=1;else if(B===3){const $=Number(e.connector.connectorFollow);$===1?w=Number(e.connector.connectorStepSize):$===2&&((e.connector.connectorExclude||[]).forEach(Se=>v.push(Se)),w=1)}const I=[],W=[],C=[],M=e.connector?.connectorCustomRange||[];v.forEach($=>{const Se=$.split("-");Se.length&&I.push(Se[0])});const X=(Fe?.[0]||[]).map(($,Se)=>({Dimension:$.data.dimension,Total:$.data.total,CustomTotal:$.data.total-(C[Se]??0),Index:Se}));if(w!=null){for(let $=0;$<X.length;$++)(w===1||$%w===0&&w!==1)&&U.push(X[$]);for(let $=w;$<X.length;$+=w){const Se=Math.min($+w,X.length);let ze=-1/0;for(let Ie=$;Ie<Se;Ie++)X[Ie].Total>ze&&(ze=X[Ie].Total);ze!==-1/0&&D.push(ze)}for(let $=1;$<U.length;$++)R.push(U[$])}else{const $=[];(M||[]).forEach(Se=>{if(Se?.from&&Se?.to){const ze=X.some(Oe=>Oe.Dimension===Se.from),Ie=X.some(Oe=>Oe.Dimension===Se.to);ze&&Ie&&$.push({from:Se.from,to:Se.to})}}),$.forEach(Se=>{const ze=X.findIndex(Oe=>Oe.Dimension===Se.from),Ie=X.findIndex(Oe=>Oe.Dimension===Se.to);if(ze>=0&&Ie>=0){const Oe=Math.min(ze,Ie),lt=Math.max(ze,Ie);U.push(X[Oe]);let ut=X[Oe]?.Total??-1/0;for(let tt=Oe;tt<=lt;tt++)X[tt].Total>ut&&(ut=X[tt].Total);ut!==-1/0&&D.push(ut),R.push(X[lt])}})}c.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!==we.white?e.connector.connectorMarkerColor:"none"),de(U,D,R,w,I),le(U,D,R,w,I)}catch(B){console.error(B)}},de=(B,U,R,v,w)=>{try{const D=y.bandwidth()??0,I=c.selectAll(".connector-paths").data([0]),W=I.enter().append("g").attr("class","connector-paths connectors").merge(I),C=B.filter((X,$)=>v!=null?$<B.length-1:$<B.length),M=W.selectAll("path.connector-path").data(C,(X,$)=>X?.Dimension??$);M.exit().remove(),M.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",(X,$)=>{const Se=R?.[$]??{Total:0,Dimension:X.Dimension},ze=X?.Total??0,Ie=typeof Se.Total=="number"?i(Se.Total):0,Oe=typeof ze=="number"?i(ze):0,lt=Math.max(Ie,Oe);return e.total.totalVisibility?`M ${Oe+50},
74
- ${y(X.Dimension)+D/2-5}
73
+ `,N},"");b.html(h?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${Yl}; color:${L}; line-height:${Ul};">${h}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${D}</div>`);const j=b.node(),K=j.offsetWidth,J=j.offsetHeight;let U=g+15,V=H+15;U+K>window.innerWidth&&(U=g-K-10),V+J>window.innerHeight&&(V=H-J-10),b.style("left",`${U}px`).style("top",`${V}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(n){console.error("Tooltip Error:",n)}}function rt(){try{T.select("#chartTooltipDiv").html("").style("visibility",Vt.hidden)}catch(t){be(ct,"hideTooltipOnMouseOut",t)}}const _t=(t,e,r,o)=>{try{let n=T.select(t.current).append("foreignObject").attr("visibility",o.chartTitle.chartTitleVisibility?Vt.visible:Vt.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r).attr("height",e+"px");o.chartTitle.dynamicTitleText.length!==0?n.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",Vt.visible).style("line-height","1.3em").html(o.chartTitle.chartTitleHTML?o.chartTitle.chartTitleHTML:o.chartTitle.chartTitleText):n.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",Vt.visible).style("line-height","1.3em").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",o.chartTitle.chartTitleFontFamily).attr("title",o.chartTitle.chartTitleText).html(o.chartTitle.chartTitleText)}catch(h){be(ct,"drawChartTitle",h)}},Ui=(t,e)=>{try{return t.reduce((r,o)=>{const h=typeof o=="string"?o:e&&typeof o=="object"&&o[e]||"";return h.length>r.length?h:r},"")}catch(r){be(ct,"findStringWithLongestLength",r)}},oa=(t,e,r,o,h,n,l,s,x,L,A,u=!1,S)=>{try{if(L.legends.legendVisibility){let _="",g="";l==Be.left||l==Be.right?(g="column",_=s==Fa.top?"start":s==Fa.middle?"center":"end"):(g="row",_=s==wa.start?"start":s==wa.middle?"center":"end");var b=t.append("foreignObject").attr("x",r).attr("y",o).style("pointer-events","auto").attr("width",h+"px").attr("height",n+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+A).attr("class","legendsBoxWrapper").style("width",h+"px").style("display","flex").style("height",n-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+_).style("flex-direction",g).style("outline-offset","-"+L.legends.legendBorderThickness+"px").style("outline",L.legends.legendBorder?`${L.legends.legendBorderThickness+"px solid"+L.legends.legendBorderColor}`:"none").append("div").attr("class","scrollbar").style("display","flex").style("flex-direction",g).style("flex-wrap","nowrap").style("padding-left","3px");(l==Be.top||l==Be.bottom)&&b.style("flex-direction","row"),e.forEach((D,j)=>{let K=b.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("width","fit-content").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("dblclick",function(){S(D?.properties)}).on("mousemove",function(){if(L.legends.onHoverEffect){const N=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${N}"]`).classed("highlight",!0).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!0)}}).on("mouseout",function(){if(L.legends.onHoverEffect){const N=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${N}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(l==Be.top||l==Be.bottom)&&K.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let J;if(!x){let N=D.properties.type;N==le.ColumnChart||N==le.StackColumnChart?J=nt.rectangle:N==le.LineChart||N==le.StackLineChart?J=nt.line:(N==le.AreaChart||N==le.StackAreaChart)&&(J=nt.areaWithLine)}(x||J)==nt.circle?_l(D,K):(x||J)==nt.hollowCircle?jl(D,K):(x||J)==nt.line?Bi(D,K,L):(x||J)==nt.areaWithLine?Wi(D,K,L):(x||J)==nt.rectangle&&Jl(D,K);let U=u&&(l==Be.bottom||l==Be.top)&&j!=e.length-1?" |":"",V=u?L.legends.legendSelectedUnicolor:L.legends.legendColorMode==fl.multiColor?D.properties.color?D.properties.color:De.black:L.legends.legendSelectedUnicolor;K.append("div").style("margin-left","5px").style("color",V).style("background",D.properties.axis==at.secondary&&L.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(u?L.legends.legendFontSize:D.properties.fontSize)+"px").style("font-family",u?L.legends.legendFontFamily:D.properties.fontFamily).style("font-style",()=>(u?L.legends.legendFontStyle:D.properties.fontStyle).includes(ne.italic)?ne.italic:"").style("text-decoration",()=>(u?L.legends.legendFontStyle:D.properties.fontStyle).includes(ne.underline)?ne.underline:"").style("font-weight",()=>(u?L.legends.legendFontStyle:D.properties.fontStyle).includes(ne.bold)?ne.bold:"").style("white-space","nowrap").attr("title",u?D.legendDisplay+" : "+D.actualValue:D.properties.alias).html(u?D.legendDisplay+" : "+D.actualValue+U:D.properties.alias)})}}catch(_){be(ct,"legendsWithScroll",_)}};function _l(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(r){be(ct,"getCircleShape",r)}}function jl(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("border",`3px solid ${t.properties.Color??t.properties.color}`)}catch(r){be(ct,"getHollowCircleShape",r)}}function Bi(t,e,r){try{const o=t.properties?.lineStyle?.toLowerCase()||"solid";let h=e.append("div").style("height","2px").style("width",o=="dashed"?"25px":"20px").style("background",De.transparent).style("position","relative").style("border-top",o=="none"?"unset":o=="dotted"?"2px dotted "+t.properties.color:o=="dashed"?"2px dashed "+t.properties.color:"2px solid "+t.properties.color);if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":h.append("div").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-6)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","4.5").style("fill",t.properties.markerColor);break;case"square":h.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-2px, -7px)").style("height","8px").style("width","8px").style("top","2px").style("left","9px").style("background",t.properties.markerColor);break;case"triangle":h.append("div").style("position","absolute").style("transform","translate(5px, -6.5px)").style("border-left","6px solid transparent").style("border-right","6px solid transparent").style("border-bottom",`10px solid ${t.properties.markerColor}`);break;case"cross":h.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-5px, -3px)").style("height","4px").style("width","10px").style("background",t.properties.markerColor).append("div").style("height","10px").style("width","4px").style("background",t.properties.markerColor).style("position","relative").style("top","-3px").style("left","3px");break;case"diamond":h.append("div").style("height","7px").style("width","7px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-4px").style("left","7px").style("position","absolute");break;case"star":h.append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-bottom",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-6.5px").style("left","7px").style("transform","rotate(0deg)").append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-top",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","2px").style("left","-4px").style("transform","rotate(360deg)");break;case"wye":h.append("div").style("height","6.5px").style("width","3px").style("background",t.properties.markerColor).style("position","absolute").style("left","10px").style("top","-3.5px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":default:break}}catch(o){be(ct,"getLineShape",o)}}function Wi(t,e,r){try{let o=e.append("div").style("height","10px").style("width","15px").style("background",t.properties.color).style("display","flex").style("flex-direction","column").style("border-radius","1px");if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.color).style("position","relative").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-5)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","2.5").style("fill",t.properties.markerColor);break;case"square":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-4px, -3.5px)").style("height","5px").style("width","5px").style("top","2px").style("left","9px").style("background",t.properties.markerColor).style("border-radius","1px");break;case"triangle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("transform","translate(5px, -3.5px)").style("border-left","3px solid transparent").style("border-right","3px solid transparent").style("border-bottom",`7px solid ${t.properties.markerColor}`);break;case"cross":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-3px, -2px)").style("height","4px").style("width","7px").style("background",t.properties.markerColor).append("div").style("height","6px").style("width","3px").style("background",t.properties.markerColor).style("position","relative").style("top","-1px").style("left","2px");break;case"diamond":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4px").style("width","4px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-1px").style("left","5px").style("position","absolute");break;case"star":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-bottom",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-3px").style("left","6px").style("transform","rotate(0deg)").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-top",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","0.5px").style("left","-2px").style("transform","rotate(360deg)");break;case"wye":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4.5px").style("width","2px").style("background",t.properties.markerColor).style("position","absolute").style("left","6.5px").style("top","-0.5px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor);break;default:break}o.append("div").style("height","20%").style("width","100%").style("background","white"),o.append("div").style("height","60%").style("width","100%").style("background",t.properties.color).style("border-radius","1px")}catch(o){be(ct,"getAreaShape",o)}}function Jl(t,e){try{e.append("div").style("height","10px").style("width","15px").style("border-style",t).style("border-width",t).style("border-color",t).style("background",t.properties.color).style("border-radius","1px")}catch(r){be(ct,"getReactShape",r)}}const jt=(t,e,r,o)=>{try{let h=t.current;h.setAttribute("viewBox",`0 0 ${e} ${r}`);const{chartAreaColor:n,chartAreaBorder:l}=o.chartArea;if(h.style.backgroundColor=n,l){let x=o.chartArea.chartAreaBorderColor,L=o.chartArea.chartAreaBorderThickness+"px",A=et(o.chartArea.chartAreaBorderStyle),u=A==1?"solid":A==2?"dashed":"dotted";h.style.outline=`${L} ${u} ${x}`,h.style.outlineOffset=`-${L}`}else h.style.outline="unset"}catch(h){be(ct,"initSvg",h)}},la=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){be(ct,"initChartArea",r)}},Jt=(t,e)=>{try{let r=T.select(t.current);r.selectAll("*").remove();let o=$i(Mi,e),h=t.current.getBoundingClientRect(),n=h.width,l=h.height;return{chartFormatOptions:o,svg:r,width:n,height:l}}catch(r){be(ct,"firstFunctionBeforeRender",r)}},Na=(t,e,r,o,h,n=!1)=>{try{let l=t.legends.legendPosition;l=t.legends.legendVisibility?t.legends.legendPosition:Be.none;let s=e*.15*.8,x=n?o[0]:s<o[0]+15?s:o[0]+15,L=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?It(t.chartTitle.chartTitleHTML,void 0,void 0).height:It(t.chartTitle.chartTitleText,16,qe).height:5;switch(l){case Be.none:h.top=L+10,h.bottom=15,h.right=15,h.left=15;break;case Be.top:h.top=L+50,h.bottom=15,h.right=15,h.left=15;break;case Be.right:h.right=x+50,h.top=L+15,h.bottom=15,h.left=15;break;case Be.bottom:h.bottom=45,h.top=L+15,h.right=15,h.left=15;break;case Be.left:h.left=x+50,h.top=L+15,h.bottom=15,h.right=15}let A=r-h.top-h.bottom,u=e-h.left-h.right;return{margins:h,innerHeight:A,innerWidth:u,legendListWidth:x,chartTitleHeight:L}}catch(l){be(ct,"marginCalculationsForChartsWithoutAxis",l)}},Pa=(t,e,r,o,h,n,l,s,x,L,A=!0,u)=>{try{let S=t.legends.legendPosition,b=t.total.totalPosition,_=t.total.totalAlignment,g=t.total.totalVisibility&&A,H=t.legends.legendAlignmentTopBottom,D=t.legends.legendAlignment;switch(S){case Be.none:break;case Be.right:oa(e,r,o-n-25,l+5+(g&&b==va.top&&_==$t.end?10:0),n+15,h-l-10-(g?b==va.top&&_==$t.end?10:b==va.bottom&&_==$t.start?25:0:0),S,D,L,t,s,!1,u);break;case Be.top:oa(e,r,5,l+5,o-10,30,S,H,L,t,s,!1,u);break;case Be.left:oa(e,r,5,x.top+(g&&b==va.top&&_==$t.start?10:0),n+15,h-l-10-(g?b==va.top&&_==$t.start?10:b==va.bottom&&_==$t.start?25:0:0),S,D,L,t,s,!1,u);break;case Be.bottom:oa(e,r,5,h-35,o-10,30,S,H,L,t,s,!1,u);break}}catch(S){be(ct,"initLegendListWithTotalValueAllowance",S)}},Ia=(t,e,r="legend")=>{try{let o=It(Ui(e,r),et(t.legends.legendFontSize),t.legends.legendFontFamily);return[o.width,o.height]}catch(o){be(ct,"calculateLegendsMaxPossibleWidth",o)}},Qa=(t,e,r,o=!1)=>{try{let h=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?It(t.chartTitle.chartTitleHTML,void 0,void 0).height:It(t.chartTitle.chartTitleText,16,qe).height:5,n={top:t.chartTitle.chartTitleVisibility?h:20,bottom:o&&t.colorScale.showColor==ga.colorTheme?40:20,left:20,right:20};return innerHeight=e-n.top-n.bottom,innerWidth=r-n.left-n.right,{margins:n,chartTitleHeight:h,innerHeight,innerWidth}}catch(h){be(ct,"marginCalculationsForChartsWithoutLegends",h)}},et=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const r=parseFloat(e);return isNaN(r)?t:r}catch(e){be(ct,"convertStringToNumber",e)}};function bt(t,e,r=!1){try{return t.map(o=>{let h;o.properties?h={...Ri,...o.properties}:h={...Ri,legend:o.legend,currentLegend:o.legend,alias:o.legend,name:o.legend};const n=e&&e.length!==0?e.map(l=>{const s=o.data.find(x=>x.dimension===l);return s?{...s}:{dimension:l,legend:o.legend,value:0}}):o.data.map(l=>({...l}));return{...o,properties:h,data:r?o.data:n}})}catch(o){be(ct,"generalizedChartData",o)}}const yi=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){be(ct,"getJQuerySelector",e)}},ui=(t,e,r,o,h,n,l)=>{try{let s=t-e,x=n-h,L=parseInt(l.connector.connectorKPI),A,u;switch(L){case 1:if(A=`.${r}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return T.format(A)(t);s=Math.abs(s);break;case 3:return A=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(A)(t):(s=Math.round(t/e*100-100)/100,u=T.format(A)(s),u);case 2:return h.toString().length!==4&&(x=NaN),A=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(A)(t):(s=Math.pow(t/e,1/x)-1,u=T.format(A)(s),u)}if(e==0)return"N/A";{let S,b="",_=l.connector.connectorDisplayUnits;switch(_!="None"&&_!=null&&(_=="Thousands"&&(S=1e3,b="K"),_=="Millions"&&(S=1e6,b="M"),_=="Billions"&&(S=1e9,b="B"),s=s/S),isNaN(s)&&(s=0),o){case",.0%":return A=`.${r}%`,T.format(A)(s);case"":return A=`.${r}f`,T.format(A)(s)+b;case".2n":return A=`.${r}n`,T.format(A)(s)+b;case".2$":return A=`,.${r}f`,"$"+T.format(A)(s)+b;case".2c":return A=`,.${r}f`,"C$"+T.format(A)(s)+b;case".2ē":return A=`,.${r}f`,"€"+T.format(A)(s)+b;case".2ch":return A=`,.${r}f`,"CHF"+T.format(A)(s)+b;case",":return A=`,.${r}f`,T.format(A)(s)+b;case".2£":return A=`,.${r}f`,"£"+T.format(A)(s)+b;case".2₹":return A=`,.${r}f`,"₹"+T.format(A)(s)+b;default:return A=".2f",T.format(A)(s)+b}}}catch{}},Wa=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function Zl(t,e,r){try{let o=function(n){const l=n.split(" - ");return l.length>1?l[0]:n};const h=new Map;return e?.LegendList?.forEach(n=>{h.set(r?o(n?.name):n.measureUniqueId,n)}),t.map(n=>({...n,properties:h.get(r?o(n.legend):n.properties.measureUniqueId)??n.properties})).filter(n=>n.data[0].value!==0)}catch{return t}}const Xl=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID();let A=0,u=!1;const S=le.ColumnChart,b=Te.useRef(),_=Te.useRef(l);_.current=l;const g=Te.useRef(s);g.current=s;const H=Te.useRef(x);H.current=x;const D=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let J=!1;const U=!1;let V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,X=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce,me=[],Ve=0,Ye=0;const te=new Map;let de={dimensionList:j,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(I){be("Columnchart","createColumnChart",I)}},[e]);const Pe=()=>{({formatOptions:e,svg:m,width:i,height:y}=kt(b,e)),{formatOptions:e}=Qt(e,D,r.DataTableData??[]),Ce(),{maxNumberForPrimaryAxis:p,maxNumberForSecondaryAxis:C,customYaxisMaxValue:N,secondaryCustomYaxisMaxValue:X}=Nt(e,de.yMinLeft,de.yMaxLeft,de.yMinRight,de.yMaxRight),{margin:se,yLabel:re,xLabel:oe,yTitle:he,xTitle:Le,dimensionHeightWidthArray:pe,chartTitleHeight:ue,secondaryAxisTitleWidth:O,legendMargin:q,secondaryYLabel:w,visibleBars:Ye,columnWidth:A,scrollbarVisible:u}=Tt(i,y,p,C,de.yMaxLeft,e,de.legendList,de.dimensionList,de.yMaxRight,J,U,t,!1,de),ee(se),{dataTable:f,dataTableHeight:a}=ea(e,re,he,D,de.dimensionList,r),vt(m,i,y,e),P=Ct(m,se),mt(P,e,a,c,d,S,L),Me(),xe(),Gt(P,e,a,re,fe,d),J&&oi(P,e,a,w,ke,d,c),Mt(e,K,m,se,oe,y,Le,de.chartType,re,c,d),St(d,e,a,K,m,se,he,re),Ut(m,J,se,e,a,d,c,w,O),Ft(m,e,i,ue),Dt(y,m,pe,ue,i,q,e,D,L,a,se,nt.rectangle,S,n),Bt(D,y,i,m,se,c,u,Ye,de,Ve,!1,Y)},Ce=()=>{const I=[],v=[];let F=[],z=-1/0,R=1/0,E=-1/0,k=1/0,M=1/0,G=-1/0;D.forEach(Z=>{v.push(Z.properties.legendUniqueId),G=-1/0,M=1/0,Z.data.forEach(B=>{I.push(B),Z.properties.axis==="Secondary"?(J=!0,E=Math.max(E,B.value),k=Math.min(k,B.value)):(z=Math.max(z,B.value),R=Math.min(R,B.value)),G=Math.max(G,B.value),M=Math.min(M,B.value)}),Z.properties.setColorScale&&te.set(Z.properties.legendUniqueId,T.scaleSequential().domain([M,G]).interpolator(ii.interpolateRgb(Z.properties.startColor,Z.properties.endColor)))}),de.chartData=I,de.legendList=v,de.yMaxLeft=z,de.yMinLeft=R>0?0:R,de.yMaxRight=E,de.yMinRight=k>0?0:k,F=t?gt(e.xAxisLabel.xAxisNumberFormat,de.dimensionList).map(Z=>Z):de.dimensionList,de.dimensionList.forEach((Z,B)=>{de.formattedDimensionListMap.set(Z,F[B])}),me=JSON.parse(JSON.stringify(D)),ce=de.dimensionList,e.plotArea.hideZeroValues&&(de.hideZeroValues=!0)},Me=()=>{let I=st(N||de.yMaxLeft,de.yMinLeft,d,e,de,V,N).yAxisLabelArray;if(de.yMaxLeft=I[I.length-1],de.yMinLeft=I[0],ie=T.scaleLinear().domain([de.yMinLeft>=0?V!==void 0&&!Number.isNaN(V)?V:0:de.yMinLeft<0?de.yMinLeft*1.1:de.yMinLeft*.9,de.yMaxLeft<=0?0:N!==void 0&&!Number.isNaN(N)?N:de.yMaxLeft*1.1]).range([a>0?d-a:d,0]),J){let v=st(X||de.yMaxRight,de.yMinRight,d,e,de,$,X).yAxisLabelArray;de.yMaxRight=v[v.length-1],de.yMinRight=v[0],Q=T.scaleLinear().domain([de.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:de.yMinRight*1.1,de.yMaxRight<=0?X||0:X||de.yMaxRight*1.1]).range([a>0?d-a:d,0])}we=[0,c],ve()},ve=()=>{ge=T.scaleBand().domain(de.legendList).range([0,A]).paddingInner(de.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),Ae=T.scalePoint().domain(ce).range(we).padding(.5)},xe=()=>{{let I=st(N||de.yMaxLeft,de.yMinLeft,d,e,de,V,N);fe=T.axisLeft(ie).tickFormat(v=>_e(v,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,c)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(J){let I=st(X||de.yMaxRight,$||de.yMinRight,d,e,de,$,X);ke=T.axisRight(Q).tickFormat(v=>_e(v,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??d/30).tickSize(Pt(e,c)).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{ae=(parseInt(e.xAxisLabel.xAxisPosition)==1?T.axisTop(Ae):T.axisBottom(Ae)).tickSize(ia(e,d,a)).tickSizeOuter(0).tickValues(Lt(ce,c))},ye=I=>{I.forEach(v=>{v.data.forEach(F=>{F.hideZero=v.properties.hideZeroValues,F.axis=v.properties.axis,F.legendUniqueId=v.properties.legendUniqueId})}),ce.forEach(v=>{P.append("rect").attr("id",`dim-background-${v}`).attr("class","dimension-background").attr("x",Ae(v)-Ae.step()/2).attr("width",Ae.step()).attr("y",0).attr("height",d).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),I.forEach(v=>{let F=P.selectAll(".parentGroup").data([v],M=>M.properties.legendUniqueId);F=F.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(F);let z=F.selectAll(".column-group").data(v.data,M=>M.legend+M.dimension),R=z.enter().append("g").attr("class","column-group").attr("hoverId",(v.properties.alias||v.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",M=>`translate(${Ae(M.dimension)-A/2}, 0)`);z.attr("transform",M=>`translate(${Ae(M.dimension)-A/2}, 0)`),R.merge(z).attr("transform",M=>`translate(${Ae(M.dimension)-A/2}, 0)`);const E=R.append("rect").attr("x",M=>ge(M.legendUniqueId)).attr("width",ge.bandwidth()).attr("y",M=>(v.properties.axis===at.primary?ie:Q)(0)).attr("height",0).attr("fill",M=>te.get(v.properties.legendUniqueId)?.(M.value)??v.properties.color).attr("stroke-dasharray",M=>v.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",M=>`${v.properties.stackBorderWidth}px`).attr("stroke",M=>v.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?v.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",M=>M.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>v.properties.legendUniqueId).attr(Qe.DimValue,M=>Array.isArray(M.dimension)?String(M.dimension[0]):String(M.dimension));(e.animation.animationEnabled?E.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):E).attr("y",M=>{const G=v.properties.axis===at.primary?ie:Q;return M.value>0?G(M.value):G(0)}).attr("height",M=>{const G=v.properties.axis===at.primary?ie:Q;return Math.abs(G(M.value)-G(0))}),R.merge(z).on("mousemove",(M,G)=>{(v.properties.alias||v.properties.name||"Legend").replace(/ /g,"-");const Z=Array.isArray(G.dimension)?G.dimension[0]:G.dimension,B=String(de.formattedDimensionListMap.get(Z)??Z??""),Se=ht(_.current,String(Z??""),{...v.properties,formattedDimensionValue:B});ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:B},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():G.properties?.currentMeasure?G.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||G.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(S)?G[1]-G[0]:G.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:v.properties.alias}],e,M,v.properties,Se)}).on("mouseout",(M,G)=>{(v.properties.alias||v.properties.name||"Legend").replace(/ /g,"-"),rt()}),R.merge(z).on("click",At(H,g,(M,G)=>({seriesId:v.properties.legendUniqueId,dimValue:Array.isArray(G.dimension)?String(G.dimension[0]):String(G.dimension),legendUniqueId:v.properties.legendUniqueId,seriesDisplayName:v.properties.alias||v.properties.name||""}))),z.exit().remove()}),P.selectAll(".parentGroup").raise()},ee=I=>{c=i-I.left-I.right,d=y-I.bottom-I.top},Y=(I,v,F)=>{me=v,ce=I,Ye=F,W()},W=()=>{ve(),Fe(),qt(P,de,oe,e,a,ie,ae,pe,y,A,t,c,d,ce,Ae),ye(me),Da(D,Ae,ie,Q,se,dt,[],[],e,S,y,i,c,ce,d,L,m,h,ge,A,o),ta(e.plotArea.fitChart,m,P,f,A,ie,Ae,ge,void 0,void 0,a,S,e,re,he,de.dimensionList,c,we,de.formattedDimensionListMap,L,se,d)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:b,id:L,style:{width:"100%",height:"100%"}})})},ql=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0,u=!1,S=[];const b=le.CustomColumnChart,_=Te.useRef(),g=Te.useRef(l);g.current=l;const H=Te.useRef(s);H.current=s;const D=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let J=!1;const U=!1;let V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,X=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe=[],ae=[],ke=[],ce=[],me=[],Ve=[],Ye=[],te=[],de,Pe,Ce,Me=new Map,ve,xe=[],Fe=[],ye=0,ee,Y={dimensionList:j,chartType:b,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{W()}catch(Re){be("CustomColumnchart","createCustomColumnChart",Re)}},[e]);const W=()=>{({formatOptions:e,svg:m,width:i,height:y}=kt(_,e)),I(),{formatOptions:e}=Qt(e,D,r.DataTableData??[]),tt(),{maxNumberForPrimaryAxis:p,maxNumberForSecondaryAxis:C,customYaxisMaxValue:N,secondaryCustomYaxisMaxValue:X}=Nt(e,Y.yMinLeft,Y.yMaxLeft,Y.yMinRight,Y.yMaxRight),{margin:se,yLabel:re,xLabel:oe,yTitle:he,xTitle:Le,dimensionHeightWidthArray:pe,chartTitleHeight:ue,secondaryAxisTitleWidth:O,legendMargin:q,secondaryYLabel:w,visibleBars:ee,columnWidth:A,scrollbarVisible:u}=Tt(i,y,p,C,Y.yMaxLeft,e,Y.legendList,Y.dimensionList,Y.yMaxRight,J,U,t,!1,Y),ze(se),{dataTable:f,dataTableHeight:a}=ea(e,re,he,D,Y.dimensionList,r),vt(m,i,y,e),P=Ct(m,se),mt(P,e,a,c,d,b,L),F(),R(),Gt(P,e,a,re,de,d),J&&oi(P,e,a,w,Ce,d,c),Mt(e,K,m,se,oe,y,Le,Y.chartType,re,c,d),St(d,e,a,K,m,se,he,re),Ut(m,J,se,e,a,d,c,w,O),Ft(m,e,i,ue),Dt(y,m,pe,ue,i,q,e,D,L,a,se,null,b,n),Bt(D,y,i,m,se,c,u,ee,Y,ye,!1,Ie)},I=()=>{const Re=[];let He=[],it=-1/0,Je=1/0,Ze=-1/0,Ge=1/0,Ee=[];D.forEach((Ne,Ue)=>{[le.StackColumnChart,le.StackAreaChart].includes(Ne.properties.type)?le.StackColumnChart===Ne.properties.type&&(Re.includes(le.StackColumnChart)||Re.push(le.StackColumnChart)):(Ee.push(Ne),Ne.properties.type!==le.LineChart&&Ne.properties.type!==le.AreaChart&&Re.push(Ne.properties.legendUniqueId)),Ne.properties.axis==="Secondary"&&(ae.push(Ne),Ne.properties.type==le.StackColumnChart&&Ve.push(Ne),Ne.properties.type==le.StackAreaChart&&me.push(Ne)),Ne.properties.axis===at.primary&&(fe.push(Ne),Ne.properties.type==le.StackColumnChart&&ce.push(Ne),Ne.properties.type==le.StackAreaChart&&ke.push(Ne)),Ne.data=Ne.data.map(xt=>{const Ke={...xt,type:Ne.properties.type,axis:Ne.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ne.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ne.properties.labelColor,legendUniqueId:Ne.properties.legendUniqueId};return Ke.axis==="Secondary"?(J=!0,Ze=Math.max(Ze,Ke.value),Ge=Math.min(Ge,Ke.value)):(it=Math.max(it,Ke.value),Je=Math.min(Je,Ke.value)),Ke})}),xe=JSON.parse(JSON.stringify(D)),Y.chartData=Ee,Y.legendList=Re,Y.yMaxLeft=it,Y.yMinLeft=Je>0?0:Je,Y.yMaxRight=Ze,Y.yMinRight=Ge>0?0:Ge,He=t?gt(e.xAxisLabel.xAxisNumberFormat,Y.dimensionList).map(Ne=>Ne):Y.dimensionList,Y.dimensionList.forEach((Ne,Ue)=>{Y.formattedDimensionListMap.set(Ne,He[Ue])}),e.plotArea.fitChart?ve=Y.dimensionList:ve=Y.dimensionList.slice(ye,ye+ee),e.plotArea.hideZeroValues&&(Y.hideZeroValues=!0),v(ke,ce,me,Ve,D)},v=(Re,He,it,Je,Ze)=>{const Ge=pt(ve,Re,!1),Ee=pt(ve,it,!1),Ne=pt(ve,He,!1),Ue=pt(ve,Je,!1);Fe=[];const xt=[];if(Re.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ge,data:Re})}),it.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ee,data:it})}),He.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ne,data:He})}),Je.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ue,data:Je})}),xt.push(...Y.chartData),Ze.length){const Ke=[];Ze.forEach(xi=>{Ke.push(...xt.filter(ol=>ol.properties?.type===xi.properties.type&&ol.properties.legend===xi.legend))}),Fe.push(...Ke)}else Fe.push(...xt)},F=()=>{ie=T.scaleLinear().domain([Y.yMinLeft>=0?V!==void 0&&!Number.isNaN(V)?V:0:Y.yMinLeft<0?Y.yMinLeft*1.1:Y.yMinLeft*.9,Y.yMaxLeft<=0?0:N!==void 0&&!Number.isNaN(N)?N:Y.yMaxLeft*1.1]).range([a>0?d-a:d,0]),J&&(Q=T.scaleLinear().domain([Y.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:Y.yMinRight*1.1,Y.yMaxRight<=0?(X||X==0)&&!Number.isNaN(X)?X:0:(X||X==0)&&!Number.isNaN(X)?X:Y.yMaxRight*1.1]).range([a>0?d-a:d,0])),we=[0,c]},z=()=>{ge=T.scaleBand().domain(Y.legendList).range([0,A]).paddingInner(Y.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),Ae=T.scalePoint().domain(ve).range(we).padding(.5)},R=()=>{{let Re=st(N||Y.yMaxLeft,Y.yMinLeft,d,e,Y,V,N);de=T.axisLeft(ie).tickFormat(He=>_e(He,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,c)).tickValues(Re.autoLabelFlag?void 0:Re.yAxisLabelArray).ticks(Re.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(J){let Re=st(N||Y.yMaxRight,Y.yMinRight,d,e,Y,V,N);Ce=T.axisRight(Q).tickFormat(He=>_e(He,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Re.autoLabelFlag?void 0:Re.yAxisLabelArray).ticks(Re.customTickValue??d/30).tickSize(Pt(e,c)).tickPadding(8).tickSizeOuter(0)}},E=()=>{Pe=T.axisBottom(Ae).tickSize(ia(e,d,a,!0)).tickSizeOuter(0).tickValues(Lt(ve,c))},k=Re=>{Re.forEach(Je=>{switch(Je.properties.type){default:case le.ColumnChart:M(Je);break;case le.LineChart:break;case le.AreaChart:break;case le.StackColumnChart:Ye=ut(Je),Se();break;case le.StackAreaChart:te=ut(Je),B(Je);break}});const He=xe.filter(Je=>Je.properties.type===le.LineChart);He.length&&G(He);const it=xe.filter(Je=>Je.properties.type===le.AreaChart);it.length&&Z(it),P.selectAll(".parentGroup").raise()},M=Re=>{let He=P.selectAll(".parentGroup").data([Re],Ee=>Ee.properties?.legendUniqueId);He=He.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(He);let it=He.selectAll(".column-group").data(Re.data,Ee=>Ee.legendUniqueId),Je=it.enter().append("g").attr("class","column-group").attr("hoverId",Ee=>(Re.properties.alias||Re.properties.name).includes("-")?(Re.properties.alias||Re.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(Re.properties.alias||Re.properties.name).replace(/ /g,"-")).attr("transform",Ee=>`translate(${Ae(Ee.dimension)}, 0)`);Je.merge(it).attr("transform",Ee=>`translate(${Ae(Ee.dimension)-A/2}, 0)`);const Ze=Je.append("rect").attr("x",Ee=>ge(Ee.legendUniqueId)).attr("width",ge.bandwidth()).attr("y",Ee=>(Re.properties.axis===at.primary?ie:Q)(0)).attr("height",0).attr("fill",Re.properties.color).attr("stroke-dasharray",Ee=>Re.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ee=>`${Re.properties.stackBorderWidth}px`).attr("stroke",Ee=>Re.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Re.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",Ee=>Ee.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>Re.properties.legendUniqueId).attr(Qe.DimValue,Ee=>Array.isArray(Ee.dimension)?String(Ee.dimension[0]):String(Ee.dimension)).on("mousemove",(Ee,Ne)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Y.formattedDimensionListMap.get(Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(b)?Ne[1]-Ne[0]:Ne.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.legend.includes("~$~")?Ne.legend.split("~$~")[1]:Ne.legend}],e,Ee,D.filter(Ue=>Ue.legend===Ne.legend)[0].properties,(()=>{const Ue=Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension,xt=D.filter(Ke=>Ke.legend===Ne.legend)[0].properties;return ht(x,String(Ue??""),{...xt,formattedDimensionValue:String(Y.formattedDimensionListMap.get(Ue)??Ue??"")})})())}).on("mouseout",rt).on("click",At(H,g,(Ee,Ne)=>({seriesId:Re.properties.legendUniqueId,dimValue:Array.isArray(Ne.dimension)?String(Ne.dimension[0]):String(Ne.dimension),legendUniqueId:Re.properties.legendUniqueId,seriesDisplayName:Re.properties.alias||Re.properties.name||""})));(e.animation.animationEnabled?Ze.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ze).attr("y",Ee=>{const Ne=Re.properties.axis===at.primary?ie:Q;return Ee.value>0?Ne(Ee.value):Ne(0)}).attr("height",Ee=>{const Ne=Re.properties.axis===at.primary?ie:Q;return Math.abs(Ne(Ee.value)-Ne(0))}),it.exit().remove()},G=Re=>{Re.forEach(Ge=>{Ge.data.forEach(Ee=>{Ee.hideZero=Ge.properties.hideZeroValues,Ee.axis=Ge.properties.axis,Ee.legendUniqueId=Ge.properties.legendUniqueId})});const He=T.line().x(Ge=>Ae(Ge.dimension)?Ae(Ge.dimension):null).y(Ge=>Ge.axis==at.primary?ie(Ge.value):Q(Ge.value)).defined(Ge=>e?.plotArea?.hideZeroValues?!!Ge.value:!0).curve(Ot(e));let it=P.selectAll(".lines.parentGroup").data([1]);it=it.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(it);let Je=it.selectAll(".line-group").data(Re,Ge=>Ge.properties.legendUniqueId),Ze=Je.enter().append("g").attr("class","line-group");Ze.attr("hoverId",Ge=>(Ge.properties.alias||Ge.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),Ze.merge(Je).select("path").attr("d",Ge=>He(Ge.data)).attr("stroke",Ge=>Ge.properties.color!==De.white?Ge.properties.color:"none").attr("stroke-dasharray",Ge=>{switch(Ge.properties.lineStyle){case yt.dotted:return"0,3";case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",Ge=>Ge.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",Ge=>Ge.properties.lineStyle!=="None"?Ge.properties.lineWidth:"0"),e.animation.animationEnabled&&Ze.merge(Je).select("path").each(function(){const Ge=T.select(this),Ee=this.getTotalLength();Ge.attr("stroke-dasharray",Ee+" "+Ee).attr("stroke-dashoffset",Ee),Ge.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),Je.exit().remove(),Ca(it,Re,le.CombinationLine,Ae,ie,Q,null,e,Y,X,$,V,N,!1,x)},Z=Re=>{Re.forEach(Ue=>{Ue.data.forEach(xt=>{xt.hideZero=Ue.properties.hideZeroValues,xt.axis=Ue.properties.axis,xt.legendUniqueId=Ue.properties.legendUniqueId})});const He=T.area().x(Ue=>Ae(Ue.dimension)?Ae(Ue.dimension):null).y0(Ue=>ie(0)).y1(Ue=>ie(Ue.value)).defined(Ue=>Ue.hideZero?!!Ue.value:!0).curve(Ot(e)),it=T.area().x(Ue=>Ae(Ue.dimension)?Ae(Ue.dimension):null).y0(()=>ie(0)).y1(()=>ie(0)).defined(Ue=>Ue.hideZero?!!Ue.value:!0).curve(Ot(e)),Je=e.animation.animationEnabled;let Ze=P.selectAll(".areas.parentGroup").data([1]),Ge=P.append("g").attr("class","focusClass");Ze=Ze.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(Ze);let Ee=Ze.selectAll(".area-group").data(Re,Ue=>Ue.legend),Ne=Ee.enter().append("g").attr("class","area-group");Ne.append("path").attr("hoverId",Ue=>(Ue.properties.alias||Ue.properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ue=>Ue.properties.color!==De.white?Ue.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",Ue=>Je?it(Ue.data):He(Ue.data)).each(function(Ue){Je&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",He(Ue.data))}),Ee.select("path").attr("d",Ue=>He(Ue.data)),Ne.merge(Ee).select("path").attr("stroke",Ue=>Ue.properties.areaBorderColor!==De.white?Ue.properties.areaBorderColor:"none").attr("stroke-dasharray",Ue=>{switch(Ue.properties.lineStyle){case"dotted":return"0,3";case"dashed":return ba;default:return""}}).attr("stroke-linecap",Ue=>Ue.properties.lineStyle==="dotted"?sa.round:"").attr("stroke-width",Ue=>Ue.properties.lineStyle!=="None"&&e.plotArea.plotAreaHideLineAndMarkers?Ue.properties.lineWidth:"0"),di(e,Ze,Ge,ve,Re,Ae,ie,b),Ee.exit().remove(),Ca(Ze,Re,le.CombinationArea,Ae,ie,Q,null,e,Y,X,$,V,N)},B=Re=>{Re.data.forEach(Ne=>{Ne.data.forEach(Ue=>{Ue.hideZero=Ne.properties.hideZeroValues,Ue.axis=Ne.properties.axis,Ue.legendUniqueId=Ne.properties.legendUniqueId})});const He=T.area().x(Ne=>Ae(Ne.data.dimension)?Ae(Ne.data.dimension):null).y0(Ne=>Ne.data.axis===at.primary?ie(Ne[0]):Q(Ne[0])).y1(Ne=>Ne.data.axis===at.primary?ie(Ne[1]):Q(Ne[1])).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(Ot(e)),it=T.area().x(Ne=>Ae(Ne.data.dimension)?Ae(Ne.data.dimension):null).y0(()=>ie(0)).y1(()=>ie(0)).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(Ot(e)),Je=e.animation.animationEnabled;let Ze=P.selectAll(".parentGroup").data([te]);P.append("g").attr("class","focusClass"),Ze=Ze.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(Ze);let Ge=Ze.selectAll(".area-group").data(Ne=>Ne),Ee=Ge.enter().append("g").attr("class",Ne=>"area-group "+Ne.key.replace(/ /g,"-"));Ee.append("path").attr("hoverId",Ne=>(Re.data.filter(Ue=>Ue.legend===Ne.key)[0].properties.alias||Re.data.filter(Ue=>Ue.legend===Ne.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ne=>Ne.color!==De.white?Ne.color:"none").attr("d",Ne=>Je?it(Ne):He(Ne)).each(function(Ne){Je&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",He(Ne))}),Ge.select("path").attr("d",Ne=>He(Ne)),Ee.merge(Ge).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ne=>Ne.color!==De.white?Ne.color:"none").attr("stroke-dasharray",(Ne,Ue)=>D[Ue].properties.lineStyle==="dotted"?"0,3":D[Ue].properties.lineStyle==="dashed"?ba:"").attr("stroke-linecap",(Ne,Ue)=>D[Ue].properties.lineStyle==="dotted"?sa.round:"").attr("stroke-width",(Ne,Ue)=>D[Ue].properties.lineStyle!=="None"?D[Ue].properties.lineWidth:"0"),Ge.exit().remove(),Ca(Ze,Re.data,le.CombinationStackArea,Ae,ie,Q,null,e,Y,X,$,V,N)},Se=()=>{let Re=P.selectAll(".parentGroup").data([Ye]);Re=Re.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(Re);let He=Re.selectAll(".stackcolumns-group").data(Ee=>Ee);He=He.enter().append("g").attr("class",Ee=>"stackcolumns-group ").merge(He);let Je=He.selectAll("rect").data(Ee=>Ee);Je.attr("y",Ee=>Ee.data.axis===at.primary?ie(Ee[1]):Q(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?N&&Ee[1]>N?ie(Ee[0])-ie(N):ie(Ee[0])-ie(Ee[1]):X&&Ee[1]>X?Q(Ee[0])-Q(X):Q(Ee[0])-Q(Ee[1]));const Ze=Je.enter().append("rect").attr("transform",Ee=>`translate(${Ae(Ee.data.dimension)-A/2},0)`).attr("y",Ee=>Ee.data.axis===at.primary?ie(0):Q(0)).attr("height",0);Ze.merge(Je).attr("hoverId",Ee=>Ee.alias.includes("~$~")?Ee.alias.split("~$~")[1].replace(/ /g,"-"):Ee.alias.replace(/ /g,"-")).attr("x",Ee=>ge(le.StackColumnChart)).attr("width",ge.bandwidth()).attr("fill",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(Ke=>Ke.legend===Ee.key);return D[xt]?.properties?.color||"gray"}).attr("stroke",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(xi=>xi.legend===Ee.key),Ke=D[xt]?.properties;return Ke?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Ke.stackBorderColor:"none"}).attr("stroke-dasharray",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(Ke=>Ke.legend===Ee.key);return D[xt]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(Ke=>Ke.legend===Ee.key);return(D[xt]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ee,Ne)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Y.formattedDimensionListMap.get(Ne.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:_e(Ne.data[Ne.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.key.includes("~$~")?Ne.key.split("~$~")[1]:Ne.key}],e,Ee,D.filter(Ue=>Ue.legend===Ne.key)[0].properties,(()=>{const Ue=D.filter(xt=>xt.legend===Ne.key)[0].properties;return ht(x,String(Ne.data.dimension??""),{...Ue,formattedDimensionValue:String(Y.formattedDimensionListMap.get(Ne.data.dimension)??Ne.data.dimension??"")})})())}).on("mouseout",rt).attr(Qe.SeriesId,Ee=>Ee.key??"").attr(Qe.DimValue,Ee=>Array.isArray(Ee.data.dimension)?String(Ee.data.dimension[0]):String(Ee.data.dimension)).on("click",At(H,g,(Ee,Ne)=>({seriesId:Ne.key??"",dimValue:Array.isArray(Ne.data.dimension)?String(Ne.data.dimension[0]):String(Ne.data.dimension),legendUniqueId:Ne.key??"",seriesDisplayName:Ne.alias||Ne.key||""}))),(e.animation.animationEnabled?Ze.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ze).attr("y",Ee=>Ee.data.axis===at.primary?ie(Ee[1]):Q(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?N&&Ee[1]>N?ie(Ee[0])-ie(N):ie(Ee[0])-ie(Ee[1]):X&&Ee[1]>X?Q(Ee[0])-Q(X):Q(Ee[0])-Q(Ee[1])),He.exit().remove()},ze=Re=>{c=i-Re.left-Re.right,d=y-Re.bottom-Re.top},Ie=(Re,He,it)=>{xe=He,ve=Re,ee=it,Oe(r,Me,ve),v(ke,ce,me,Ve,He),xe=JSON.parse(JSON.stringify(Fe)),xe.forEach((Je,Ze)=>{Je.properties.type===le.StackColumnChart||Je.properties.type===le.StackAreaChart?Je.data.forEach((Ge,Ee)=>xe[Ze].data[Ee].data=Ge.data.filter(Ne=>ve.includes(Ne.dimension))):xe[Ze].data=Je.data.filter(Ge=>ve.includes(Ge.dimension))}),lt()};function Oe(Re,He,it){He.clear(),it&&it.length>0&&it.forEach(Je=>{He.set(Je,0)}),Re.ChartData&&Re.ChartData.length>0&&Re.ChartData.forEach(Je=>{Je.properties.type.includes("Stack")&&Je.data.forEach((Ze,Ge)=>{if(He.has(Ze.dimension)){let Ee=He.get(Ze.dimension)||0;Ee+=Ze.value||0,He.set(Ze.dimension,Ee)}})})}const lt=()=>{z(),E(),k(xe),qt(P,Y,oe,e,a,ie,Pe,pe,y,A,t,c,d,ve,Ae);const Re=()=>{Pl(xe,Ae,ie,Q,se,dt,Ye,te,[],[],A,e,y,i,c,ve,d,L,m,h,ge,o),qa(Me,Ae,ie,se,dt,[],e,b,y,i,m,o)};ta(e.plotArea.fitChart,m,P,f,A,ie,Ae,ge,void 0,void 0,a,b,e,re,he,Y.dimensionList,c,we,Y.formattedDimensionListMap,L,se,d),m.selectAll(".annotation-group").remove(),Re()},ut=Re=>{let He=Re.data.map(Je=>Je.legend);S=T.stack().keys(He).offset(T.stackOffsetNone)(Re.stackData),Re.data.forEach((Je,Ze)=>Je.data.forEach((Ge,Ee)=>{Ge[0]=S[Ze][Ee][0],Ge[1]=S[Ze][Ee][1]}));let it=e.annotation.annotationSetLabelColor;return S.forEach((Je,Ze)=>{Je.forEach(Ge=>{Ge.key=Je.key,Ge.alias=Re.data[Ze].properties.alias,Je.alias=Re.data[Ze].properties.alias,Je.color=JSON.parse(JSON.stringify(Re.data[Ze].properties.color)),Je.individualAnnotationVisibility=JSON.parse(JSON.stringify(Re.data[Ze].properties.annotation)),Ge.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?Re.data[Ze].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),Ge.data.labelColor=it=="2"?JSON.parse(JSON.stringify(Re.data[Ze].properties.color)):JSON.parse(JSON.stringify(Re.data[Ze].properties.labelColor)),Ge.hideZero=JSON.parse(JSON.stringify(Re.data[Ze].properties.hideZeroValues)),Ge.data.axis=JSON.parse(JSON.stringify(Re.data[Ze].properties.axis)),Ge.data.color=JSON.parse(JSON.stringify(Re.data[Ze].properties.color)),Ge.data.legend=Re.properties.type,Ge.data.type=JSON.parse(JSON.stringify(Re.data[Ze].properties.type))})}),S},tt=()=>{if(fe.length>0){const He=(ce.length>0?pt(ve,ce,!1):pt(ve,ke,!1)).map(it=>it.total);Y.yMaxLeft=Math.max(Y.yMaxLeft,...He),Y.yMinLeft=Math.min(Y.yMinLeft,...He)}if(ae.length>0){const He=(Ve.length>0?pt(ve,Ve,!1):pt(ve,me,!1)).map(it=>it.total);Y.yMaxRight=Math.max(Y.yMaxRight,...He),Y.yMinRight=Math.min(Y.yMinRight,...He)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:_,id:L,style:{width:"100%",height:"100%"}})})},Kl=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.LayeredColumnChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1,j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText);let V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we=[];const fe=new Map;let ae=0,ke=2,ce=!1,me={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ve()}catch(ye){be("LayeredColumnchart","createLayeredColumnChart",ye)}},[e]);const Ve=()=>{({formatOptions:e,svg:y,width:C,height:c}=kt(S,e)),Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:q,customYaxisMaxValue:U,secondaryCustomYaxisMaxValue:V}=Nt(e,me.yMinLeft,me.yMaxLeft,me.yMinRight,me.yMaxRight),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:A,scrollbarVisible:ce}=Tt(C,c,O,q,me.yMaxLeft,e,me.legendList,me.dimensionList,me.yMaxRight,j,K,t,!1,me),ve(N),{dataTable:d,dataTableHeight:i}=ea(e,$,se,g,me.dimensionList,r),vt(y,C,c,e),f=Ct(y,N),mt(f,e,i,w,p,u,L),te(),Pe(),Gt(f,e,i,$,Q,p),Mt(e,D,y,N,X,c,re,me.chartType,$,w,p),St(p,e,i,D,y,N,se,$),Ut(y,j,N,e,i,p,w,ue,Le),Ft(y,e,C,he),Dt(c,y,oe,he,C,pe,e,g,L,i,N,nt.rectangle,u,n),Bt(g,c,C,y,N,w,ce,ke,me,ae,!1,Fe)},Ye=()=>{const ye=[],ee=[];let Y=[],W=-1/0,I=1/0,v=-1/0,F=1/0,z=-1/0,R=1/0;g.forEach(E=>{ee.push(E.properties.legendUniqueId),z=-1/0,R=1/0,E.data.forEach(k=>{ye.push(k),z=Math.max(z,k.value),R=Math.min(R,k.value),W=Math.max(W,k.value),I=Math.min(I,k.value)}),E.properties.setColorScale&&fe.set(E.properties.legendUniqueId,T.scaleSequential().domain([R,z]).interpolator(T.interpolateRgb(E.properties.startColor,E.properties.endColor)))}),me.chartData=ye,me.legendList=ee,me.yMaxLeft=W,me.yMinLeft=I>0?0:I,me.yMaxRight=v,me.yMinRight=F>0?0:F,Y=t?gt(e.xAxisLabel.xAxisNumberFormat,me.dimensionList).map(E=>E):me.dimensionList,me.dimensionList.forEach((E,k)=>{me.formattedDimensionListMap.set(E,Y[k])}),we=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ge=me.dimensionList:ge=me.dimensionList.slice(ae,ae+ke),e.plotArea.hideZeroValues&&(me.hideZeroValues=!0)},te=()=>{let ye=st(U||me.yMaxLeft,me.yMinLeft,p,e,me,J,U).yAxisLabelArray;me.yMaxLeft=ye[ye.length-1],me.yMinLeft=ye[0],a=T.scaleLinear().domain([me.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:me.yMinLeft<0?me.yMinLeft*1.1:me.yMinLeft*.9,me.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:me.yMaxLeft*1.1]).range([i>0?p-i:p,0]),ie=[0,w]},de=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(me.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),P=T.scalePoint().domain(ge).range(ie).padding(.5)},Pe=()=>{Ce();{let ye=st(U||me.yMaxLeft,me.yMinLeft,p,e,me,J,U);Q=T.axisLeft(a).tickFormat(ee=>_e(ee,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,w)).tickValues(ye.autoLabelFlag?void 0:ye.yAxisLabelArray).ticks(ye.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ce=()=>{Ae=T.axisBottom(P).tickSize(ia(e,p,i)).tickSizeOuter(0).tickValues(Lt(ge,w))},Me=ye=>{ye.forEach(ee=>{ee.data.forEach(Y=>{Y.hideZero=ee.properties.hideZeroValues,Y.properties=ee.properties,Y.axis=ee.properties.axis})}),ye.forEach((ee,Y)=>{let W=f.selectAll(`.parentGroup-${ee.properties.legendUniqueId}`).data([ee],R=>R.properties.legendUniqueId);W=W.enter().append("g").attr("class",`column parentGroup parentGroup-${ee.properties.legendUniqueId}`).attr("clip-path",`url(#${L}-clip)`).merge(W);let I=W.selectAll(".column-group").data(ee.data,R=>R.dimension+"_"+ee.properties.legendUniqueId),v=I.enter().append("g").attr("class","column-group").attr("hoverId",(ee.properties.alias||ee.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",R=>Y===0?`translate(${P(R.dimension)-A/2}, 0)`:`translate(${P(R.dimension)-A/(2+Y*2)}, 0)`);I.attr("transform",R=>Y===0?`translate(${P(R.dimension)-A/2}, 0)`:`translate(${P(R.dimension)-A/(2+Y*2)}, 0)`),v.merge(I).attr("transform",R=>Y===0?`translate(${P(R.dimension)-A/2}, 0)`:`translate(${P(R.dimension)-A/(2+Y*2)}, 0)`);const F=v.append("rect").attr("x",()=>0).attr("width",Y===0?A:A/2+Y*2).attr("y",R=>(ee.properties.axis===at.primary?a:m)(0)).attr("height",0).attr("fill",R=>fe.get(ee.properties.legendUniqueId)?.(R.value)??ee.properties.color).attr("stroke-dasharray",()=>ee.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${ee.properties.stackBorderWidth}px`).attr("stroke",()=>ee.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ee.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",R=>R.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>ee.properties.legendUniqueId).attr(Qe.DimValue,R=>Array.isArray(R.dimension)?String(R.dimension[0]):String(R.dimension));(e.animation.animationEnabled?F.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):F).attr("y",R=>{const E=ee.properties.axis===at.primary?a:m;return R.value>0?E(R.value):E(0)}).attr("height",R=>{const E=ee.properties.axis===at.primary?a:m;return Math.abs(E(R.value)-E(0))}),I.select("rect").transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("y",R=>{const E=ee.properties.axis===at.primary?a:m;return R.value>0?E(R.value):E(0)}).attr("height",R=>{const E=ee.properties.axis===at.primary?a:m;return Math.abs(E(R.value)-E(0))}),v.merge(I).on("mousemove",(R,E)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:me.formattedDimensionListMap.get(Array.isArray(E.dimension)?E.dimension[0]:E.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():E.properties?.currentMeasure?E.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||E.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?E[1]-E[0]:E.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:E.properties.alias}],e,R,E.properties,(()=>{const M=Array.isArray(E.dimension)?E.dimension[0]:E.dimension;return ht(x,String(M??""),{...E.properties,formattedDimensionValue:String(me.formattedDimensionListMap.get(M)??M??"")})})());let k=(ee.properties.alias||ee.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),T.selectAll('[hoverId="'+k+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(R,E)=>{let k=(ee.properties.alias||ee.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+k+'"]').classed("highlight",!1).classed("unhighlight",!1),rt()}),v.merge(I).on("click",At(_,b,(R,E)=>({seriesId:ee.properties.legendUniqueId,dimValue:Array.isArray(E.dimension)?String(E.dimension[0]):String(E.dimension),legendUniqueId:ee.properties.legendUniqueId,seriesDisplayName:ee.properties.alias||ee.properties.name||""}))),I.exit().remove()}),f.selectAll(".parentGroup").raise()},ve=ye=>{w=C-ye.left-ye.right,p=c-ye.bottom-ye.top},xe=()=>{de(),Ce(),qt(f,me,X,e,i,a,Ae,oe,c,A,t,w,p,ge,P),Me(we),Da(g,P,a,void 0,N,dt,[],[],e,u,c,C,w,ge,p,L,y,h,void 0,A,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,d,A,a,P,void 0,void 0,void 0,i,le.ColumnChart,e,$,se,me.dimensionList,w,ie,me.formattedDimensionListMap,L,N,p))},Fe=(ye,ee,Y)=>{we=ee,ge=ye,ke=Y,xe()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},Ql=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID();let A=0,u=!1;const S=le.StackColumnChart,b=Te.useRef(),_=Te.useRef(s);_.current=s;const g=Te.useRef(x);g.current=x;const H=r.DimensionList,D=(bt(r.ChartData,r.DimensionList)||[]).reverse(),j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText),e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText);let V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P;const ie=new Map;let Q,Ae,ge,we=[],fe=0,ae,ke=[],ce=new Map;const me=!1;let Ve={dimensionList:H,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ye()}catch(v){be("StackStackColumnchart","createStackColumnChart",v)}},[e]);const Ye=()=>{({formatOptions:e,svg:i,width:p,height:C}=kt(b,e)),te(),{formatOptions:e}=Qt(e,D,r.DataTableData??[]),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,Ve.yMinLeft,Ve.yMaxLeft,Ve.yMinRight,Ve.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe,visibleBars:ae,columnWidth:A,scrollbarVisible:u}=Tt(p,C,ue,O,Ve.yMaxLeft,e,Ve.legendList,Ve.dimensionList,Ve.yMaxRight,K,me,t,!1,Ve),xe(V),{dataTable:c,dataTableHeight:d}=ea(e,N,X,D,Ve.dimensionList,r),vt(i,p,C,e),y=Ct(i,V),mt(y,e,d,q,w,S,L),de(),Ce(),Gt(y,e,d,N,Q,w),Mt(e,j,i,V,$,C,se,Ve.chartType,N,q,w),St(w,e,d,j,i,V,X,N),Ut(i,K,V,e,d,w,q,pe,he),Ft(i,e,p,oe),Dt(C,i,re,oe,p,Le,e,[...D].reverse(),L,d,V,nt.rectangle,S,n),Bt(D,C,p,i,V,q,u,ae,Ve,fe,!1,Fe)},te=()=>{const v=[],F=[];let z=-1/0,R=1/0;D.forEach((B,Se)=>{const ze=`${Se}~$~${B.properties.legend}`;B.properties.legend=ze,F.push(ze),z=-1/0,R=1/0;for(const Ie of B.data)z=Math.max(z,Ie.value),R=Math.min(R,Ie.value),v.push(Ie);B.properties.setColorScale&&ie.set(B.properties.legendUniqueId,T.scaleSequential().domain([R,z]).interpolator(ii.interpolateRgb(B.properties.startColor,B.properties.endColor)))}),Ve.chartData=v,Ve.legendList=F,we=JSON.parse(JSON.stringify(D));let E=pt(Ve.dimensionList,D,me);ge=Ve.dimensionList;const k=T.stack().keys(Ve.legendList).offset(T.stackOffsetDiverging)(E);ee();let M=1/0,G=-1/0;for(const B of k)for(const[Se,ze]of B)M=Math.min(M,Se),G=Math.max(G,ze);Ve.yMinLeft=M>0?0:M,Ve.yMaxLeft=G;let Z=t?gt(e.xAxisLabel.xAxisNumberFormat,Ve.dimensionList).map(B=>B):Ve.dimensionList;Ve.dimensionList.forEach((B,Se)=>{Ve.formattedDimensionListMap.set(B,Z[Se])}),e.plotArea.hideZeroValues&&(Ve.hideZeroValues=!0)},de=()=>{f=T.scaleLinear().domain([Ve.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:Ve.yMinLeft<0?Ve.yMinLeft*1.1:Ve.yMinLeft*.9,Ve.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:Ve.yMaxLeft*1.1]).range([d>0?w-d:w,0]),P=[0,q]},Pe=()=>{m=T.scalePoint().domain(ge).range([0,q]).padding(.5)},Ce=()=>{{const v=st(U||Ve.yMaxLeft,Ve.yMinLeft,w,e,Ve,J,U);Q=T.axisLeft(f).tickFormat(F=>_e(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,q)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},Me=()=>{Ae=T.axisBottom(m).tickSize(ia(e,w,d,!0)).tickSizeOuter(0).tickValues(Lt(ge,q))},ve=v=>{v.forEach(Z=>{Z.data.forEach(B=>{B.hideZero=Z.properties.hideZeroValues,B.axis=Z.properties.axis})}),ge.forEach(Z=>{y.append("rect").attr("id",`dim-background-${Z}`).attr("class","dimension-background").attr("x",m(Z)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",w).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let F=y.selectAll(".parentGroup").data([ke]);F=F.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(F);let z=F.selectAll(".column-group").data(Z=>Z);z=z.enter().append("g").attr("class",Z=>"column-group "+Z.key.replace(/ /g,"-")).attr("hoverId",Z=>Z[0]?.properties.alias?Wa(Z[0]?.properties.alias):Wa(Z.key)).merge(z);let E=z.selectAll("rect").data(Z=>Z);const k=(Z,B)=>{const Se=Array.from(z.nodes()).indexOf(Z[B].parentNode);return{props:D[Se]?.properties,groupIndex:Se}},M=E.enter().append("rect").merge(E).attr("x",Z=>m(Z.data.dimension)-A/2).attr("width",A).attr("y",Z=>f(0)).attr("height",0).attr("fill",(Z,B,Se)=>{const{props:ze}=k(Se,B);return ie.get(ze.legendUniqueId)?.(Z.data[Z.key])??ze?.color??"gray"}).attr("stroke",(Z,B,Se)=>{const{props:ze}=k(Se,B);return ze?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ze.stackBorderColor:"none"}).attr("stroke-dasharray",(Z,B,Se)=>{const{props:ze}=k(Se,B);return ze?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Z,B,Se)=>{const{props:ze}=k(Se,B);return(ze?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(Z,B,Se)=>{const{props:ze}=k(Se,B);return Z.data[Z.key]==0&&ze?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,Z=>Z.key??"").attr(Qe.DimValue,Z=>Array.isArray(Z.data.dimension)?String(Z.data.dimension[0]):String(Z.data.dimension)).on("mousemove",(Z,B)=>{const Se=String(Ve.formattedDimensionListMap.get(B.data.dimension)??B.data.dimension??""),ze=ht(l,String(B.data.dimension??""),{...B.properties,formattedDimensionValue:Se});ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Ve.formattedDimensionListMap.get(B.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():B.properties?.currentMeasure?B.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||B.value,value:_e(B.data[B.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:B.properties.alias}],e,Z,B.properties,ze)}).on("mouseout",(Z,B)=>{rt()}).on("click",At(g,_,(Z,B)=>({seriesId:B.key??"",dimValue:Array.isArray(B.data.dimension)?String(B.data.dimension[0]):String(B.data.dimension),legendUniqueId:B.key??"",seriesDisplayName:B.properties?.alias||B.key||""})));(e.animation.animationEnabled?M.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):M).attr("y",Z=>Z[1]>=Z[0]?f(Z[1]):f(Z[0])).attr("height",Z=>Math.abs(f(Z[0])-f(Z[1]))),z.exit().remove(),y.selectAll(".parentGroup").raise()},xe=v=>{q=p-v.left-v.right,w=C-v.bottom-v.top},Fe=(v,F,z)=>{we=F,ge=v,ae=z,Ka(r,ce,ge),ye()},ye=()=>{Pe(),Me(),qt(y,Ve,$,e,d,f,Ae,re,C,A,t,q,w,ge,m),ee();const v=new Map;ge.forEach((F,z)=>{let R=0;ke.forEach(E=>{const k=E[z]?.[0]??0;k<R&&(R=k)}),v.set(F,R)}),ve(we),Va(ke,m,f,a,V,dt,[],[],e,S,C,p,q,ge,w,L,i,h,d,o),qa(ce,m,f,V,dt,[],e,S,C,p,i,o,!1,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,c,A,f,m,void 0,void 0,void 0,d,S,e,N,X,ge,q,P,Ve.formattedDimensionListMap,L,V,w)),Y()},ee=()=>{let v=pt(ge,we,me);ke=T.stack().keys(Ve.legendList).offset(T.stackOffsetDiverging)(v),we.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=ke[R][k][0],E[1]=ke[R][k][1]}));let F=e.annotation.annotationSetLabelColor;ke.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(D[R].properties.color)),E.data.labelPosition=D[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(D[R].properties.color)):D[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(D[R].properties.hideZeroValues)),E.properties=D[R].properties}))},Y=()=>{try{const v=e?.connector,F=Number(v?.connectorVisibility);if(!v||F===2)return;let z,R=[];F===1?z=1:F===3&&(Number(v.connectorFollow)===1?z=Number(v.connectorStepSize)||void 0:Number(v.connectorFollow)===2&&(R=v.connectorExclude??[],z=1));const E=(R||[]).map(B=>String(B).split("-")[0]),k=(ke[0]??[]).map((B,Se)=>({Dimension:B.data.dimension,Total:B.data.total,CustomTotal:B.data.total,Index:Se})),M=[],G=[];let Z=[];if(z){if(z===1)M.push(...k);else for(const B of k)B.Index%z===0&&M.push(B);for(let B=z;B<k.length;B+=z){const Se=Math.min(B+z,k.length);let ze=k[B]?.Total??Number.NEGATIVE_INFINITY;for(let Ie=B;Ie<Se;Ie++)k[Ie].Total>ze&&(ze=k[Ie].Total);Number.isFinite(ze)&&G.push(ze)}Z=M.slice(1)}else{const B=v.connectorCustomRange??[],Se=new Map;k.forEach(ze=>Se.set(String(ze.Dimension),ze.Index));for(const ze of B){if(!ze?.from||!ze?.to)continue;const Ie=Se.get(String(ze.from)),Oe=Se.get(String(ze.to));if(Ie!=null&&Oe!=null){M.push(k[Ie]);const lt=Math.min(Ie,Oe),ut=Math.max(Ie,Oe);let tt=k[lt]?.Total??Number.NEGATIVE_INFINITY;for(let Re=lt;Re<=ut;Re++)k[Re].Total>tt&&(tt=k[Re].Total);Number.isFinite(tt)&&G.push(tt)}}for(const ze of B){if(!ze?.from||!ze?.to)continue;const Ie=Se.get(String(ze.to));Ie!=null&&Z.push(k[Ie])}}y.selectAll("defs > #arrow").remove(),y.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",v.connectorMarkerColor!==De.white?v.connectorMarkerColor:"none"),W(M,G,Z,z,E),I(M,G,Z,z,E)}catch{}},W=(v,F,z,R,E)=>{try{const k=v.filter((B,Se)=>R!=null?Se<v.length-1:Se<v.length);let M=y.selectAll("path.connector-path").data(k,B=>String(B.Dimension));M.exit().remove(),M.enter().append("path").attr("class","connector-path").style("shape-rendering","crispEdges").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",(B,Se)=>e.total.totalVisibility?`M ${m(B.Dimension)+m.bandwidth()/2+5}, ${f(B.Total)-25} V ${-35+Math.min(f(F[Se]),f(z[Se].Total),f(B.Total))} H ${m(z[Se].Dimension)+m.bandwidth()/2-10} V ${-27+f(z[Se].Total)}`:`M ${m(B.Dimension)+m.bandwidth()/2+5}, ${f(B.Total)-5} V ${-30+Math.min(f(z[Se].Total),f(B.Total))} H ${m(z[Se].Dimension)+m.bandwidth()/2-10} V ${-10+f(z[Se].Total)}`).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",B=>E.includes(B.Dimension)||B.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},I=(v,F,z,R,E)=>{try{let k,M=e.connector.connectorFontStyle,G=e.connector.connectorNumberFormat,Z=q/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(G=".2s");const B=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Se=mi(B,A),ze=Se*(typeof m.padding=="function"?m.padding():0),Ie=v.map((tt,Re)=>({d:tt,i:Re})).filter(tt=>R!=null?tt.i<v.length-1:tt.i<v.length);let Oe=y.selectAll("text.connector-text").data(Ie,tt=>String(tt.d.Dimension));Oe.exit().remove(),Oe.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(Oe).attr("x",tt=>{const Re=tt.d,He=tt.i,it=z[He];return m(it.Dimension)-Se*R/2}).attr("y",tt=>{const Re=tt.d,He=tt.i,it=F[He],Je=z[He],Ze=Math.min(f(Je?.Total??0),f(Re.Total));return e.total.totalVisibility?Z<8?-40+Ze:-41+Ze:Z<8?-35+Ze:-40+Ze}).style("text-anchor","middle").text(tt=>{const Re=tt.d,He=tt.i;return z[He]?(Re.CustomTotal==0&&z[He].CustomTotal!=0&&(Re.CustomTotal=1),ui(z[He].Total,Re.Total,parseInt(e.connector.connectorDecimalPrecision),G,parseInt(Re.Dimension),parseInt(z[He].Dimension),e)):""}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",M.includes("Italic")?"Italic":"").style("text-decoration",M.includes("Underline")?"Underline":"").style("font-weight",M.includes("Bold")?"Bold":"").style("visibility",tt=>{const Re=tt.d;return E.includes(Re.Dimension)||Re.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible"}).raise()}catch{}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:b,id:L,style:{width:"100%",height:"100%"}})})},Ol=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.NormalizedStackColumnChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList).reverse(),H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U,V,N,$,X,se,re,oe,he,Le,pe,ue,O=!1,q,w,p,C,c,d,i,y,f,a,m,P;const ie=new Map;let Q,Ae,ge,we=[],fe=0,ae=0,ke=[];const ce=!0;let me={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ve()}catch(ee){be("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",ee)}},[e]);const Ve=()=>{({formatOptions:e,svg:i,width:p,height:C}=kt(S,e)),Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,me.yMinLeft,me.yMaxLeft,me.yMinRight,me.yMaxRight),{margin:U,yLabel:V,xLabel:N,yTitle:$,xTitle:X,dimensionHeightWidthArray:se,chartTitleHeight:re,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Le,visibleBars:ae,columnWidth:A,scrollbarVisible:O}=Tt(p,C,pe,ue,me.yMaxLeft,e,me.legendList,me.dimensionList,me.yMaxRight,j,ce,t,!1,me),ve(U),{dataTable:c,dataTableHeight:d}=ea(e,V,$,g,me.dimensionList,r),vt(i,p,C,e),y=Ct(i,U),mt(y,e,d,q,w,u),te(),Pe(),Gt(y,e,d,V,Q,w),Mt(e,D,i,U,N,C,X,me.chartType,V,q,w),St(w,e,d,D,i,U,$,V),Ut(i,j,U,e,d,w,q,Le,oe),Ft(i,e,p,re),Dt(C,i,se,re,p,he,e,[...g].reverse(),L,d,U,nt.rectangle,u,n),Bt(g,C,p,i,U,q,O,ae,me,fe,!1,xe)},Ye=()=>{const ee=[],Y=[];let W=-1/0,I=1/0;g.forEach((E,k)=>{const M=`${k}~$~${E.properties.legend}`;E.properties.legend=M,Y.push(M),W=-1/0,I=1/0;for(const G of E.data)W=Math.max(W,G.value),I=Math.min(I,G.value),ee.push(G);E.properties.setColorScale&&ie.set(E.properties.legendUniqueId,T.scaleSequential().domain([I,W]).interpolator(T.interpolateRgb(E.properties.startColor,E.properties.endColor)))}),me.chartData=ee,me.legendList=Y,we=JSON.parse(JSON.stringify(g));let v=pt(me.dimensionList,g,ce);ge=me.dimensionList;const F=T.stack().keys(me.legendList).offset(T.stackOffsetDiverging)(v);ye();let z=1/0;for(const E of F)for(const[k]of E)z=Math.min(z,k);me.yMinLeft=z>0?0:z,me.yMaxLeft=1;let R=t?gt(e.xAxisLabel.xAxisNumberFormat,me.dimensionList).map(E=>E):me.dimensionList;me.dimensionList.forEach((E,k)=>{me.formattedDimensionListMap.set(E,R[k])}),e.plotArea.hideZeroValues&&(me.hideZeroValues=!0)},te=()=>{let ee=st(J||me.yMaxLeft,me.yMinLeft,w,e,me,K,J).yAxisLabelArray;if(me.yMaxLeft=ee[ee.length-1],me.yMinLeft=ee[0],f=T.scaleLinear().domain([me.yMinLeft<0?-1:0,1]).range([d>0?w-d:w,0]),P=[0,q],e.seriesLabel.seriesLabelVisibility){let Y=aa(q,f,e,we,void 0,j,w,!0);Y.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&Y.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?P=[0,q-Y.heightWidth[0]]:P=[Y.heightWidth[0],q]}},de=()=>{m=T.scalePoint().domain(ge).range(P).padding(.5)},Pe=()=>{Q=T.axisLeft(f).tickSize(Pt(e,q)).ticks(d>0?(w-d)/80:w/80,"%").tickPadding(8).tickSizeOuter(0)},Ce=()=>{Ae=T.axisBottom(m).tickSize(ia(e,w,d,!0)).tickSizeOuter(0).tickValues(Lt(ge,q))},Me=ee=>{ke.forEach((k,M)=>k.forEach((G,Z)=>{ee[M].data[Z]&&ee[M].data[Z][0]!==void 0&&ee[M].data[Z][1]!==void 0&&(ee[M].data[Z][0]=G[0]=G.data.total===0?0:G[0]/G.data.total,ee[M].data[Z][1]=G[1]=G.data.total===0?0:G[1]/G.data.total)})),ee.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})}),ge.forEach(k=>{y.append("rect").attr("id",`dim-background-${k}`).attr("class","dimension-background").attr("x",m(k)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",w).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Y=y.selectAll(".parentGroup").data([ke]);Y=Y.enter().append("g").attr("class","columns parentGroup").merge(Y);let W=Y.selectAll(".column-group").data(k=>k);W=W.enter().append("g").attr("class",k=>"column-group "+k.key.replace(/ /g,"-")).attr("hoverId",k=>(ee[k.index].properties.alias||ee[k.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(W);let v=W.selectAll("rect").data(k=>k);const F=(k,M)=>{const G=Array.from(W.nodes()).indexOf(k[M].parentNode);return{props:g[G]?.properties,groupIndex:G}},z=v.enter().append("rect").attr("x",k=>m(k.data.dimension)-A/2).attr("width",A).attr("y",f(0)).attr("height",0).attr("fill",(k,M,G)=>{const{props:Z}=F(G,M);return ie.get(Z.legendUniqueId)?.(k.data[k.key])??Z?.color??"gray"}).attr("stroke",(k,M,G)=>{const{props:Z}=F(G,M);return Z?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?Z.stackBorderColor:"none"}).attr("stroke-dasharray",(k,M,G)=>{const{props:Z}=F(G,M);return Z?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(k,M,G)=>{const{props:Z}=F(G,M);return(Z?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(k,M,G)=>{const{props:Z}=F(G,M);return k.data[k.key]===0&&Z?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,k=>k.key??"").attr(Qe.DimValue,k=>Array.isArray(k.data.dimension)?String(k.data.dimension[0]):String(k.data.dimension)),R=e.animation.animationEnabled;(k=>R?k.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):k)(z).attr("y",k=>k[1]>=k[0]?f(k[1]):f(k[0])).attr("height",k=>Math.abs(f(k[0])-f(k[1]))),z.merge(v).on("mousemove",(k,M)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:me.formattedDimensionListMap.get(M.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e(M[1]-M[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,k,M.properties,ht(x,String(M.data.dimension??""),{...M.properties,formattedDimensionValue:String(me.formattedDimensionListMap.get(M.data.dimension)??M.data.dimension??"")}))}).on("mouseout",(k,M)=>{rt()}).on("click",At(_,b,(k,M)=>({seriesId:M.key??"",dimValue:Array.isArray(M.data.dimension)?String(M.data.dimension[0]):String(M.data.dimension),legendUniqueId:M.key??"",seriesDisplayName:M.properties?.alias||M.key||""}))),W.exit().remove(),y.selectAll(".parentGroup").raise()},ve=ee=>{q=p-ee.left-ee.right,w=C-ee.bottom-ee.top},xe=(ee,Y,W)=>{we=Y,ge=ee,ae=W,Fe()},Fe=()=>{de(),Ce(),ye(),qt(y,me,N,e,d,f,Ae,se,C,A,t,q,w,ge,m),Me(we),Va(ke,m,f,a,U,dt,[],[],e,u,C,p,q,ge,w,L,i,h,d,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,c,m.bandwidth(),f,m,void 0,void 0,void 0,d,u,e,V,$,me.dimensionList,q,P,me.formattedDimensionListMap,L,U,w))},ye=()=>{let ee=pt(ge,we,ce);ke=T.stack().keys(me.legendList).offset(T.stackOffsetDiverging)(ee),we.forEach((W,I)=>W.data.forEach((v,F)=>{v[0]=ke[I][F][0],v[1]=ke[I][F][1]}));let Y=e.annotation.annotationSetLabelColor;ke.forEach((W,I)=>W.forEach(v=>{v.key=W.key,W.color=JSON.parse(JSON.stringify(g[I].properties.color)),W.individualAnnotationVisibility=JSON.parse(JSON.stringify(g[I].properties.individualAnnotationVisibility)),v.data.labelPosition=g[I].properties.dataLabelPosition,v.data.labelColor=Y=="2"?JSON.parse(JSON.stringify(g[I].properties.color)):g[I].properties.labelColor,v.hideZero=JSON.parse(JSON.stringify(g[I].properties.hideZeroValues)),v.properties=g[I].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},ma="ChartsWithoutAxisFunctions.ts";function Hi(t,e,r){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:o,minVal:h,maxVal:n}=e.plotArea.plotAreaRangeFilter;return t.filter(l=>{const s=r(l);switch(o){case"lt":return s<=n;case"gt":return s>=h;case"in":return s>=h&&s<=n;case"not-in":return s<h||s>n;default:return!0}})}function Gi(t,e,r,o,h,n){try{o.xAxisLabel.xAxisDateFormat=o.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":o.xAxisLabel.xAxisDateFormat;let l={top:0,left:0,right:0,bottom:0},s=t*.15*.8,x=n[0],L=s<x+10?s:x+10,A=o.plotArea.numberOfBubbles?20:0;const u=je(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(h).toString();let b=wt(u,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,o.xAxisLabel.xAxisLabelRotation)[3]+10,_=o.xAxisTitle.xAxisTitleVisibility?o.xAxisTitle.xAxisDynamicTitleText.length!==0?It(o.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:It(o.xAxisTitle.xAxisTitleText,13,qe).height:0;_=_>e*.1?e*.1:_;let g=o.xAxisLabel.xAxisLabelVisibility?b:0,H=o.yAxisTitle.yAxisTitleVisibility?o.yAxisTitle.yAxisDynamicTitleText.length!==0?It(o.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:It(o.yAxisTitle.yAxisTitleText,13,qe).height:0;H=H>t*.1?t*.1:H;let D=o.yAxisLabel.yAxisLabelVisibility?It(je(o.yAxisLabel.yAxisDisplayUnits,o.yAxisLabel.yAxisNumberFormat,o.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString(),et(o.yAxisLabel.yAxisLabelFontSize),o.yAxisLabel.yAxisLabelFontFamily,o.yAxisLabel.yAxisLabelRotation).width+10:0,j=o.chartTitle.chartTitleVisibility?o.chartTitle.dynamicTitleText.length!==0?It(o.chartTitle.chartTitleHTML,void 0,void 0).height:It(o.chartTitle.chartTitleText,16,qe).height:0;j=j>e*.1?e*.1:j;let K=o.legends.legendPosition,J=o.legends.legendVisibility,U=!1;switch(J||(K="None"),K){case Be.none:l.top=j+5,l.bottom=_+g+5+A,l.right=15,l.left=H+D+5;break;case Be.top:l.top=40+j,l.bottom=_+g+5+A,l.right=15,l.left=H+D+5;break;case Be.right:l.right=L+35,l.top=j+5,l.bottom=_+g+5+A,l.left=H+D+5;break;case Be.bottom:l.bottom=40+g+_+A,l.top=j+5,l.right=15,l.left=H+D+5;break;case Be.left:l.left=L+H+D+33,l.top=j+5,l.bottom=_+g+5+A,l.right=15}o.xAxisLabel.xAxisPosition&&o.xAxisLabel.xAxisPosition=="1"&&(l.bottom=l.bottom-g,l.top=l.top+g);let V=o.chartPadding.paddingArrayLTRB;V&&(l.top+=V[1],l.bottom+=V[3],l.right+=V[2],l.left+=V[0]);let N=e-l.top-l.bottom,$=t-l.left-l.right;return{margins:l,yLabel:D,xLabel:g,yTitle:H,xTitle:_,chartTitleHeight:j,legendMargin:L,innerHeight:N,innerWidth:$}}catch(l){fa(ma,"marginCalculationForBubbleScatter",l)}}function _i(t,e,r){try{let o=parseFloat(t.yAxisLabel.yAxisIntervalText),h=parseFloat(t.yAxisLabel.yAxisMaxText),n=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){n=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let u=t.yAxisLabel.yAxisMaxText;h=u.length>0?parseFloat(u):r,h&&(r=h)}else h=r,n=e,o=void 0;let l=e?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString().length:0,x=h?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(h).toString().length:0,L=n?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString().length:0,A=l<s?r:e;if(n){let u=L<s?r:n;A=A<u?u:A}if(h){let u=x>l?h:e;A=A<u?u:A}return h&&n&&(A=x>L?h:n),{longestMeasure:A,customYaxisIntervalValue:o,customYaxisMaxValue:h,customYaxisMinValue:n}}catch(o){fa(ma,"customYscaleLabelFormatting",o)}}function ji(t,e,r){try{let o=parseFloat(t.xAxisLabel.xAxisIntervalText),h=parseFloat(t.xAxisLabel.xAxisMaxText),n=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){n=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let u=t.xAxisLabel.xAxisMaxText.toString();h=u.length>0?parseFloat(u):r,h&&(r=h)}else h=r,n=e,o=void 0;let l=e?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(r).toString().length:0,x=h?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(h).toString().length:0,L=n?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n).toString().length:0,A=l<s?r:e;if(n){let u=L<s?r:n;A=A<u?u:A}if(h){let u=x>l?h:e;A=A<u?u:A}return h&&n&&(A=x>L?h:n),{longestDimension:A,customXaxisIntervalValue:o,customXaxisMaxValue:h,customXaxisMinValue:n}}catch(o){fa(ma,"customXscaleLabelFormatting",o)}}function Ji(t,e,r,o,h,n,l,s,x,L,A){try{let u=t.xAxisLabel.xAxisPosition,S=!0,_=r.append("foreignObject").attr("visibility",e?t.yAxisTitle.yAxisTitleVisibility?"visible":"hidden":t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",!t.plotArea.fitChart&&S?`translate(${o.left},${o.top+A+(t?.xAxisLabel?.xAxisPosition=="1"?0:h)})`:!t.plotArea.fitChart&&!1?`translate(${o.left},${n-l-5})`:`translate(${o.left},${o.top+A+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:h:s=="tornado"?h+5:x+5)})`).attr("class","xAxisTitle").attr("width",L).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?_.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):_.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","5px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){fa(ma,"setXaxistitle",u)}}function Zi(t,e,r,o,h,n,l,s){try{let x=r>0?t-r:t,L=h.append("foreignObject").attr("visibility",o?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${n.top+x}`).attr("y",n.left-l-s+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",x).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?L.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):L.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),h}catch(x){fa(ma,"yAxistitle",x)}}function Xi(t,e,r,o,h,n){try{let l=parseFloat(o.yAxisLabel.yAxisIntervalText),s=[],x;if(l&&l!==0&&l!==void 0){let L=h||h==0?h:e,A=n||n==0?n:t;L<0?x=Math.floor((A-L)/l):x=Math.floor(A/l);let u=18;(n||n==0)&&(t=n);let S=h||h==0?h:e<0?Math.round(e):0;if(s.push(S),x>100){let b="Tick count cannot exceed more than 100.";L<0?l=(A-S)/100:l=A/100}if(x=x<100?x:100,x>u)for(let b=0;b<parseInt(x)&&(S+=l,parseFloat(S.toFixed(5))<=t);b++)s.push(S);else for(let b=0;b<u&&(S+=l,S<=t);b++)s.push(S)}else x=r/60;return{yAxisLabelArray:s,customTickValue:x}}catch(l){fa(ma,"responsiveYaxisLabel",l)}}function hi(t,e,r,o,h,n,l,s){try{let x=!0,L=parseFloat(o.xAxisLabel.xAxisIntervalText),A=[],u;if(L&&L!==0&&L!==void 0){let S=h||h==0?h:e,b=n||n==0?n:t;S<0?u=Math.floor((b-S)/L):u=Math.floor(b/L);let _=18;(n||n==0)&&(t=n);let g=h||h==0?h:e<0?Math.round(e):0;if(A.push(g),x=!1,u>100){let H="Tick count cannot exceed more than 100.";S<0?L=(b-g)/100:L=b/100}if(u=u<100?u:100,u>_)for(let H=0;H<parseInt(u)&&(g+=L,parseFloat(g.toFixed(5))<=t);H++)A.push(g);else for(let H=0;H<_&&(g+=L,g<=t);H++)A.push(g)}else{const S=je(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisDateFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n||t).toString();let b=wt(S,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,0);A=Vi(h||e,n||t,s?l:r,b[0]),u=r/30}return{xAxisLabelArray:A,customTickValue:u,autoLabelFlag:x}}catch(x){fa(ma,"responsiveXaxisLabel",x)}}function qi(t,e,r,o,h,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==De.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(h);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==De.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes(ne.italic)?ne.italic:"").style("text-decoration",l.includes(ne.underline)?ne.underline:"").style("font-weight",l.includes(ne.bold)?ne.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(l){fa(ma,"initYaxis",l)}}function Ki(t,e,r,o,h,n,l,s,x){try{let L=e.xAxisLabel.xAxisLabelFontStyle,A=e.xAxisLabel.xAxisPosition,u=e.xAxisLabel.xAxisLabelRotation;u=parseInt(u),t.append("rect").attr("transform",`translate(1,${A==="0"?r>0?n-r:n:A==="1"?-o:x(0)})`).attr("height",o).attr("width",l).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==De.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${A==="0"?n:A==="1"?0:x(0)})`).call(h);let b=A==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(o)).style("height","20px").attr("transform",(g,H)=>`rotate(${A==="1"?-u:u!=0?180-u:0}) translate (${u!=0?b+", -5":-o/2+" , "+(A==="1"?"-15":"8")})`).append("xhtml:h3").style("transform",A==="1"?"":u!=0?"rotate(180deg)":"0").style("white-space","pre").style("text-overflow","ellipsis").style("text-align",u!=0?"start":"center").style("user-select","none").style("margin",0).style("padding",0).style("overflow","hidden").style("font-family",e.xAxisLabel.xAxisLabelFontFamily).style("color",e.xAxisLabel.xAxisLabelColor).style("font-size",e.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",L.includes(ne.italic)?ne.italic:"").style("text-decoration",L.includes(ne.underline)?ne.underline:"").style("font-weight",L.includes(ne.bold)?ne.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(g,H)=>je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(g)).html((g,H)=>je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(g)),S.selectAll("text").style("visibility",(e.xAxisLabel.xAxisLabelVisibility,"hidden")),S.selectAll("line").style("stroke",e.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",e.xAxisLabel.xAxisLabelVisibility||e.plotArea.gridLinesVertical?"visible":"hidden"),S.select(".domain").style("stroke",e.xAxisLabel.xAxisColor).attr("stroke-width",e.xAxisLabel.xAxisWidth?e.xAxisLabel.xAxisWidth:e.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges")}catch(L){fa(ma,"initXaxis",L)}}function Qi(t,e,r,o,h,n,l,s,x,L,A){try{if(!r.annotation.annotationVisibility)return;const u=r.plotArea.annotationType??"1",S=[u==="1"?"connector":""],b=r.plotArea.connectorType?.toLowerCase()??"none",_=u==="5",g=r.plotArea.rotation??0,H=h===le.PieChart?1.06:1.1,D={1:"",2:T.curveLinear,3:T.curveStep},j=(O,q)=>[[0,0],[O/2,q/2],[O,q]],K={solid:"unset",dotted:"2,2",dashed:"6,4"};let J=t.annotation(),U=JSON.parse(JSON.stringify(r.plotArea.dataLabelsCoordinates||[]));U=U.map(O=>({dx:O.dx??0,dy:O.dy??0,ratioDistance:O.ratioDistance,ratioAngle:O.ratioAngle,connectorPoints:O.connectorPoints||O.connector?.points||[],radius:O.radius??x,data:O.data,width:n,height:l}));const V=e.reduce((O,q)=>O+(q?.data?.data?.[0]?.value??0),0),N=V===0?1:V,$=(O,q)=>{const w=O.data.data[0].value,p=(O.x0+O.x1)/2,C=O.x1-O.x0;return{note:{title:r.plotArea.dataLabelName?O.data.legend:"",label:r.plotArea.dataLabelValue&&w!==0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(w/N)*100).toFixed(et(r.plotArea.dataLabelDecimalPrecision))+"%":je(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(w):"",align:"middle",wrap:1e3},data:{x:{legend:O.data.legend},y:{value:w},midAngle:p,isVisible:!0,hoverId:O?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:O.data.legend,dx:0,dy:0,connector:{end:b,curve:D[r.plotArea.connectorCurve],points:_?j(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:er(t,u),color:r.plotArea.connectorColor??"#ccc",width:n,height:l,index:q}};let X=e.filter(O=>O.x1-O.x0>1e-4).map($);const se=O=>(O.data.y?.value??0)!==0;X=X.filter(se),X=Rt(X,r,O=>O.data.y.value);let re=new Map(U.map(O=>[O.data?.x?.legend,O])),oe=[];X.forEach(O=>{const q=O.data.x.legend,w=re.get(q);if(w){if(w.ratioDistance!=null&&w.ratioAngle!=null){const p=w.ratioDistance*x;O.dx=Math.cos(w.ratioAngle)*p,O.dy=Math.sin(w.ratioAngle)*p}else{const p=x/(w.radius||x);O.dx=w.dx*p,O.dy=w.dy*p}O.data.isVisible=w.data?.isVisible??!0,w.connectorPoints?.length>=(_?3:2)?O.connector.points=w.connectorPoints:O.connector.points=_?j(O.dx,O.dy):[[0,0],[0,0]]}oe.push(O)}),J.editMode(r.plotArea.annotationDraggable&&L).accessors({x(O){return Math.cos(O.midAngle-Math.PI/2)*(x-x*.35)},y(O){return Math.sin(O.midAngle-Math.PI/2)*(x-x*.35)}}).on("dragend",function(O){oe.forEach(w=>{if(w.data.x.legend===O.data.x.legend){const p=O._dx,C=O._dy,c=Math.sqrt(p*p+C*C),d=Math.atan2(C,p);w.dx=p,w.dy=C,w.ratioDistance=c/x,w.ratioAngle=d,w.width=n,w.height=l,w.connectorPoints=O.connector?.points||[]}});const q=oe.map(w=>({data:{x:w.data.x,isVisible:w.data.isVisible??!0},dx:w.dx,dy:w.dy,ratioDistance:w.ratioDistance,ratioAngle:w.ratioAngle,connectorPoints:w.connectorPoints||[],width:n,height:l,radius:x}));A&&A(q)}).annotations(oe);const he=s.append("g").attr("class","annotation-group parentGroup").attr("transform",o).call(J),Le=r.plotArea.dataLabelNameFontStyle??[];he.selectAll(".annotation-note-title").style("font-family",r.plotArea.dataLabelNameFontFamily).style("font-size",`${r.plotArea.dataLabelNameFontSize}px`).style("font-style",Le.includes("Italic")?"italic":"").style("text-decoration",Le.includes("Underline")?"underline":"").style("font-weight",Le.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelNameColor??"#000");const pe=r.plotArea.dataLabelValueFontStyle??[];if(he.selectAll(".annotation-note-label").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("font-style",pe.includes("Italic")?"italic":"").style("text-decoration",pe.includes("Underline")?"underline":"").style("font-weight",pe.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelValueColor??"#000"),r.plotArea.plotAreaAbsoluteValue&&he.selectAll(".annotation-note-label").each(function(O){const q=T.select(this),w=T.format(".2s")(Math.abs(O.data.y.value));q.append("tspan").attr("x",q.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("fill",r.plotArea.dataLabelValueColor??"#000").text(w)}),b==="diamond"){const O=r.plotArea.connectorColor??"#ccc",q=5;he.selectAll(".annotation-connector").each(function(){T.select(this).select("path.connector").empty()||T.select(this).append("polygon").attr("class","connector-end connector-diamond").attr("points",`0,${-q} ${q},0 0,${q} ${-q},0`).style("fill",O).style("stroke",O)})}if(he.selectAll("rect,.annotation-subject").remove(),r.animation?.animationEnabled){const O=r.animation.animationDuration,q=Xe[r.animation.animationEffect],w=he.selectAll(".annotation-note-label");w.interrupt().style("opacity",0),setTimeout(()=>{w.transition().delay((p,C)=>C*30).duration(O).ease(q).style("opacity",1)},50)}const ue=r.plotArea.connectorColor??"#ccc";he.selectAll(".connector").style("stroke",ue).attr("hoverId",O=>O.data.hoverId).attr("stroke-dasharray",K[r.plotArea.connectorStyle?.toLowerCase()]),he.selectAll(".connector-end").attr("hoverId",O=>O.data.hoverId).style("fill",ue).style("stroke",ue),he.selectAll(".annotation-note-title").attr("hoverId",O=>O.data.hoverId),he.selectAll(".annotation-note-label").attr("hoverId",O=>O.data.hoverId).filter(O=>!O.data.isVisible).style("display","none"),he.selectAll(".annotation-note-label").filter(O=>r.plotArea.hideInsignificantValue&&O.data.x1-O.data.x0<.09).style("visibility","hidden")}catch(u){throw u}}const er=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},Oi=(t,e,r,o,h,n,l,s,x,L)=>{try{if(r.plotArea.numberOfBubbles){let A=e=="Bottom"?o-55:o-25;t.append("foreignObject").attr("transform",`translate(${n.left},${A})`).attr("width",h).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",De.black).style("font-size","12px ").style("text-overflow","ellipsis").html((r.plotArea.totalAlias?r.plotArea.totalAliasText:"Total count : ")+L)}}catch(A){fa(ma,"setnumberOfBubbles",A)}};function fa(t,e,r){console.error(`[${t}] [${e}]`,r)}const tr=({isDateType:t,formatOptions:e,data:r})=>{const o=crypto.randomUUID(),h=0,n=le.ColumnHistogramChart,l=Te.useRef(),s=r.ChartData,x=r.DimensionList,L=!1,A=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,g=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,H,D,j,K,J,U,V,N,$,X,se,re,oe,he,Le,pe=[],ue=[],O,q,w,p,C,c,d,i,y,f,a,m,P,ie=[],Q=0;const Ae=2;let ge={dimensionList:x,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{we()}catch(Ce){be("Columnchart","createColumnChart",Ce)}},[e]);const we=()=>{({formatOptions:e,svg:C,width:O,height:q}=kt(l,e)),fe(),{maxNumberForPrimaryAxis:se,maxNumberForSecondaryAxis:re}=Nt(e,ge.yMinLeft,ge.yMaxLeft,ge.yMinRight,ge.yMaxRight),{margin:H,yLabel:D,xLabel:j,yTitle:K,xTitle:J,dimensionHeightWidthArray:U,chartTitleHeight:V,secondaryAxisTitleWidth:N,legendMargin:$,secondaryYLabel:X}=Tt(O,q,se,re,ge.yMaxLeft,e,ge.legendList,ge.dimensionList,ge.yMaxRight,A,u,t),te(H),{dataTable:w,dataTableHeight:p}=ea(e,D,K,s,ge.dimensionList),vt(C,O,q,e),c=Ct(C,H),mt(c,e,p,oe,he,n),ae(),ce(),me(),Gt(c,e,p,D,a,he),de(s,q,C,H,oe),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,C,c,w,h,d,i,y,void 0,void 0,p,n,e,D,K,ge.dimensionList,oe,f,ge.formattedDimensionListMap,o,H,he)),Mt(e,L,C,H,j,q,J,ge.chartType,D,oe,he),St(he,e,p,L,C,H,K,D),Ut(C,A,H,e,p,he,oe,X,N),Ft(C,e,O,V),Dt(q,C,U,V,O,$,e,s,o,p,H,nt.rectangle)},fe=()=>{const Ce=[],Me=[];let ve=[],xe=-1/0,Fe=1/0;s.forEach(Y=>{Me.push(Y.legend),Y.data.forEach(W=>{Ce.push(W),xe=Math.max(xe,W.value),Fe=Math.min(Fe,W.value)})}),ge.chartData=Ce,ge.legendList=Me,ge.yMaxLeft=xe,ge.yMinLeft=Fe>0?0:Fe,ie=JSON.parse(JSON.stringify(s)),ie.forEach(Y=>Y.data.forEach(W=>ve.push(W.value)));let ye=S||S==0?S:0,ee=b||b==0?b:ie[0]?.data?.length;if(ge.yMaxLeft=parseFloat((ye+"").length>(ee+"").length?ye+"":ee+""),ge.xMax=T.max(ve),ge.xMin=T.min(ve),ge.xMin===ge.xMax){const Y=ge.xMax===0?1:Math.abs(ge.xMax*.1);ge.xMin-=Y,ge.xMax+=Y}},ae=()=>{switch(e.bins.binsCalculation){case"Automatic":Le=oe/50;break;case"Number of Bins":ke(!1);break;case"Bin Width":ke(!0)}},ke=Ce=>{ie.forEach(Fe=>Fe.data.sort(function(ye,ee){return ye.value-ee.value}));let Me=ge.xMax-ge.xMin,ve;Ce?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ve=Me/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ve=Me/parseFloat(e.bins.binsCalculationValue));let xe=ge.xMin;if(Ce)for(pe=[xe];xe<ge.xMax;)xe+=ve,pe.push(xe);else for(pe=[xe];Math.round(xe)<Math.round(ge.xMax);)xe+=ve,pe.push(Math.round(xe))},ce=()=>{i=T.scaleLinear().domain([ge.xMin,ge.xMax]).range([0,oe]);const Ce=pe.length>0?pe:i.ticks(Le);let Me=T.bin().value(xe=>xe).domain(i.domain()).thresholds(Ce);ie.forEach(xe=>{let Fe=Me(xe.data.map(ye=>ye.value));ue.push(Fe)}),ie.forEach((xe,Fe)=>ue[Fe].forEach(ye=>{ye.name=xe.properties.legend,ye.color=xe.properties.color,ye.opacity=xe.properties.opacity}));let ve=[];ue.forEach(xe=>xe.forEach(Fe=>ve.push(Fe.length))),ge.yMaxLeft=T.max(ve),ge.yMinLeft=T.min(ve),d=T.scaleLinear().range([he,0]).domain([S||S==0?S:0,b||b==0?b:ge.yMaxLeft+.2*ge.yMaxLeft])},me=()=>{Ve();{let Ce=st(ge.yMaxLeft,ge.yMinLeft,he,e,ge,S,b,!1,oe);a=T.axisLeft(d).tickFormat(Me=>_e(Me,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,oe)).tickValues(Ce.autoLabelFlag?void 0:Ce.yAxisLabelArray).ticks(Ce.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ve=()=>{let Ce=parseInt(e.xAxisLabel.xAxisPosition);hi(ge.xMax,ge.xMin,oe,e,_,g,he,!1).xAxisLabelArray.shift(),m=(Ce==1?T.axisTop(i):T.axisBottom(i)).tickFormat(ve=>_e(ve,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(ia(e,he,p)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?m.ticks(Le):m.tickValues(pe).ticks(oe/50)},Ye=Ce=>{const Me=e.animation.animationEnabled,ve=c.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(ue).enter().append("g").selectAll("rect").data(Fe=>Fe).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",1).attr("transform",function(Fe){return"translate("+i(Fe.x0)+","+he+")"}).attr("width",function(Fe){return i(Fe.x1)-i(Fe.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(Fe.x1)-i(Fe.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",Fe=>Fe.color!==De.white?Fe.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(Fe,ye)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:`${ye.x0}-${ye.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ye.properties?.currentMeasure?ye.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:_e(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(ye.length/ie[0].data.length):ye.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,Fe)}).on("mouseout",rt);(Me?ve.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):ve).attr("transform",function(Fe){return"translate("+i(Fe.x0)+","+(d(Fe.length)>0?d(Fe.length):0)+")"}).attr("height",function(Fe){return he-d(Fe.length)}),c.selectAll(".parentGroup").raise()},te=Ce=>{oe=O-Ce.left-Ce.right,he=q-Ce.bottom-Ce.top},de=(Ce,Me,ve,xe,Fe)=>{if(!e.plotArea.fitChart){const ye=Ce[0].data.length-Ae,ee=Me-20;P=ge.dimensionList.slice(Q,Q+Ae),ie=JSON.parse(JSON.stringify(Ce)),ie.forEach((I,v)=>ie[v].data=I.data.filter(F=>P.includes(F.dimension))),ve.append("rect").attr("x",xe.left).attr("y",ee).attr("width",Fe).attr("height",8).attr("fill","#ddd").attr("rx",4);const Y=Fe*Ae/ge.dimensionList.length,W=ve.append("rect").attr("x",xe.left).attr("y",ee).attr("width",Y).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",I=>{let v=Math.min(Math.max(I.x,xe.left),xe.left+Fe-Y);W.attr("x",v),Q=Math.round((v-xe.left)/(Fe-Y)*ye),P=ge.dimensionList.slice(Q,Q+Ae),ie=JSON.parse(JSON.stringify(Ce)),ie.forEach((F,z)=>ie[z].data=F.data.filter(R=>P.includes(R.dimension))),Ve(),Pe()}));ve.on("wheel",I=>{I.preventDefault();const v=Math.abs(I.deltaX)>Math.abs(I.deltaY)?I.deltaX:I.deltaY;Q+=v>0?1:-1,Q=Math.max(0,Math.min(Q,ye));const F=xe.left+(Fe-Y)*Q/ye;W.attr("x",F),ie=JSON.parse(JSON.stringify(Ce)),ie.forEach((z,R)=>ie[R].data=z.data.filter(E=>P.includes(E.dimension))),Ve(),Pe()})}Pe()},Pe=()=>{qt(c,ge,j,e,p,d,m,U,q,h,t,oe,he,P,i),Ye()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:o,style:{width:"100%",height:"100%"}})})},ar=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID(),A=0,u=le.LineChart,S=Te.useRef(),b=Te.useRef(s);b.current=s;const _=Te.useRef(x);_.current=x;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1;let j=!1;const K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p=!1,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce=[],me=0,Ve=0,Ye=0,te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(W){be("Linechart","createLineChart",W)}},[e]);const de=()=>{({formatOptions:e,svg:a,width:d,height:i}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:w,customYaxisMaxValue:U,secondaryCustomYaxisMaxValue:N}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:$,yLabel:X,xLabel:se,yTitle:re,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Le,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:Ve,columnWidth:Ye,scrollbarVisible:p}=Tt(d,i,q,w,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,K,t,!1,te),ee($),{dataTable:y,dataTableHeight:f}=ea(e,X,re,g,te.dimensionList,r),vt(a,d,i,e),m=Ct(a,$),mt(m,e,f,C,c,u,L),Ce(),xe(),Gt(m,e,f,X,we,c),j&&oi(m,e,f,O,ae,c,C),Mt(e,D,a,$,se,i,oe,te.chartType,X,C,c),St(c,e,f,D,a,$,re,X),j&&Ut(a,j,$,e,f,c,C,O,pe),Ft(a,e,d,Le),Dt(i,a,he,Le,d,ue,e,g,L,f,$,nt.line,u,n),Bt(g,i,d,a,$,C,p,Ve,te,me,!1,Me)},Pe=()=>{const W=[],I=[];let v=[],F=-1/0,z=1/0,R=-1/0,E=1/0;e.plotArea.hideZeroValues&&(te.hideZeroValues=!0),g.forEach(k=>{I.push(k.properties.alias?k.properties.alias:k.legend),k.data.forEach(M=>{W.push(M),k.properties.axis==="Secondary"?(j=!0,R=Math.max(R,M.value),E=Math.min(E,M.value)):(F=Math.max(F,M.value),z=Math.min(z,M.value))})}),te.chartData=W,te.legendList=I,te.yMaxLeft=F,te.yMinLeft=z,te.yMaxRight=R,te.yMinRight=E,v=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(k=>k):te.dimensionList,te.dimensionList.forEach((k,M)=>{te.formattedDimensionListMap.set(k,v[M])}),ce=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ke=te.dimensionList:ke=te.dimensionList.slice(me,me+Ve)},Ce=()=>{let W=st(U||te.yMaxLeft,te.yMinLeft,c,e,te,J,U).yAxisLabelArray;if(te.yMaxLeft=W[W.length-1],te.yMinLeft=W[0],P=T.scaleLinear().domain([te.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:te.yMinLeft*.9:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:te.yMaxLeft*1.1]).range([f>0?c-f:c,0]),j&&(ie=T.scaleLinear().domain([te.yMinRight>=0?(V||V==0)&&!Number.isNaN(V)?V:0:(V||V==0)&&!Number.isNaN(V)?V:te.yMinRight*1.1,te.yMaxRight<=0?N||0:N||te.yMaxRight*1.1]).range([f>0?c-f:c,0])),Ae=[0,C],e.seriesLabel.seriesLabelVisibility){let I=aa(C,P,e,ce,ie,j,c,!1);I.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(ge=I.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Ae=[0,C-I.heightWidth[0]]:Ae=[I.heightWidth[0],C]}},Me=(W,I,v)=>{ce=I,ke=W,Ve=v,Y()},ve=()=>{Q=T.scalePoint().domain(ke).range(Ae).padding(.5)},xe=()=>{{let W=st(U||te.yMaxLeft,te.yMinLeft,c,e,te,J,U);we=T.axisLeft(P).tickFormat(I=>_e(I,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,C,ge)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let W=st(N||te.yMaxRight,V||te.yMinRight,c,e,te,V,N);ae=T.axisRight(ie).tickFormat(I=>_e(I,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickSize(Pt(e,C,ge)).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{fe=T.axisBottom(Q).tickSize(ia(e,c,f,!0)).tickSizeOuter(0).tickValues(Lt(ke,C))},ye=W=>{const I=[...W].reverse();I.forEach(M=>{M.data.forEach(G=>{G.hideZero=M.properties.hideZeroValues,G.axis=M.properties.axis})});const v=T.line().x(M=>{const G=Q(M.dimension);return G??0}).y(M=>M.axis===at.primary?P(M.value):ie(M.value)).defined(M=>M.hideZero||te.hideZeroValues?!!M.value:!0).curve(Ot(e)),F=e.animation.animationEnabled,z=M=>F?M.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):M;let R=m.selectAll(".parentGroup").data([I]);R=R.enter().append("g").attr("class","lines parentGroup").merge(R);let E=R.selectAll(".line-group").data(M=>M),k=E.enter().append("g").attr("class","line-group");k.append("path").attr("class","visibleLine").attr("fill","none"),k.merge(E).each(function(M){const Z=T.select(this).selectAll("path.visibleLine").data([M]).join("path").attr("class","visibleLine").attr("d",B=>v(B.data)).attr("stroke",B=>B.properties.color!==De.white?B.properties.color:"none").attr("stroke-dasharray",B=>{const Se=parseInt(B.properties.lineWidth);switch(B.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",B=>B.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",B=>B.properties.lineStyle!=="None"?B.properties.lineWidth:0).attr("hoverId",(M.properties.alias||M.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${L}-clip)`).attr("d",B=>v(B.data)).attr(Qe.SeriesId,B=>B.properties.legendUniqueId).attr(Qe.DimValue,B=>B.properties.alias||B.properties.name||"").on("click",At(_,b,(B,Se)=>({seriesId:Se.properties.legendUniqueId,dimValue:Se.properties.alias||Se.properties.name||"",legendUniqueId:Se.properties.legendUniqueId,seriesDisplayName:Se.properties.alias||Se.properties.name||""})));F&&Z.each(function(){const B=T.select(this),Se=this.getTotalLength();B.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se),z(B).attr("stroke-dashoffset",0)})}),E.exit().remove(),Ca(R,I,"None",Q,P,ie,null,e,te,N,V,J,U,!1,l),m.selectAll(".parentGroup").raise()},ee=W=>{C=d-W.left-W.right,c=i-W.bottom-W.top},Y=()=>{ve(),Fe(),qt(m,te,se,e,f,P,fe,he,i,C/ke.length,t,C,c,ke,Q),ye(ce),Da(g,Q,P,ie,$,dt,[],[],e,u,i,d,C,ke,c,L,a,h,void 0,void 0,o);let W=aa(C,P,e,ce,ie,j,c,!1).labelArray;za(e,m,W),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,a,m,y,A,P,Q,void 0,void 0,void 0,f,u,e,X,re,te.dimensionList,C,Ae,te.formattedDimensionListMap,L,$,c))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},ir=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.StackLineChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=r.DimensionList,H=(bt(r.ChartData,r.DimensionList)||[]).reverse(),D=!1,j=new Map,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae=[],ke=0,ce=2,me=!1,Ve=0,Ye=[];const te=!1;let de={dimensionList:g,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(v){be("StackLinechart","createStackLineChart",v)}},[e]);const Pe=()=>{({formatOptions:e,svg:f,width:c,height:d}=kt(S,e)),Ce(),{formatOptions:e}=Qt(e,H,r.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:w}=Nt(e,de.yMinLeft,de.yMaxLeft,de.yMinRight,de.yMaxRight),{margin:$,yLabel:X,xLabel:se,yTitle:re,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Le,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:ce,columnWidth:Ve,scrollbarVisible:me}=Tt(c,d,q,w,de.yMaxLeft,e,de.legendList,de.dimensionList,de.yMaxRight,K,te,t,!1,de),ee($),{dataTable:i,dataTableHeight:y}=ea(e,X,re,H,de.dimensionList,r),vt(f,c,d,e),a=Ct(f,$),mt(a,e,y,p,C,u,L),Me(),xe(),Gt(a,e,y,X,ge,C),Mt(e,D,f,$,se,d,oe,de.chartType,X,p,C),St(C,e,y,D,f,$,re,X),Ut(f,K,$,e,y,C,p,O,pe),Ft(f,e,c,Le),Dt(d,f,he,Le,c,ue,e,[...H].reverse(),L,y,$,nt.line,u,n),Bt(H,d,c,f,$,p,me,ce,de,ke,!1,I),qa(j,ie,m,$,dt,[],e,u,d,c,f,o)},Ce=()=>{const v=[],F=[];e.plotArea.hideZeroValues&&(de.hideZeroValues=!0),H.forEach((G,Z)=>{const B=`${Z}~$~${G.properties.alias?G.properties.alias:G.legend}`;G.properties.legend=B,F.push(B);for(const Se of G.data)v.push(Se)}),de.chartData=v,de.legendList=F,ae=JSON.parse(JSON.stringify(H));let z=pt(de.dimensionList,H,te);e.plotArea.fitChart?fe=de.dimensionList:(fe=de.dimensionList.slice(ke,ke+ce),ae.forEach((G,Z)=>ae[Z].data=G.data.filter(B=>fe.includes(B.dimension))));const R=T.stack().keys(de.legendList).offset(T.stackOffsetDiverging)(z);W();let E=1/0,k=-1/0;for(const G of R)for(const[Z,B]of G)E=Math.min(E,Z),k=Math.max(k,B);de.yMinLeft=E>0?0:E,de.yMaxLeft=k;let M=t?gt(e.xAxisLabel.xAxisNumberFormat,de.dimensionList).map(G=>G):de.dimensionList;de.dimensionList.forEach((G,Z)=>{de.formattedDimensionListMap.set(G,M[Z])})},Me=()=>{let v=st(U||de.yMaxLeft,de.yMinLeft,C,e,de,J,U).yAxisLabelArray;if(de.yMaxLeft=v[v.length-1],de.yMinLeft=v[0],m=T.scaleLinear().domain([de.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:de.yMinLeft<0?de.yMinLeft*1.1:de.yMinLeft*.9,de.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:de.yMaxLeft*1.1]).range([y>0?C-y:C,0]),Q=[0,p],e.seriesLabel.seriesLabelVisibility){let F=aa(p,m,e,ae,void 0,K,C,!0);F.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Ae=F.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,p-F.heightWidth[0]]:Q=[F.heightWidth[0],p]}ve()},ve=()=>{ie=T.scalePoint().domain(fe).range(Q).padding(.5)},xe=()=>{Fe();{let v=st(U||de.yMaxLeft,de.yMinLeft,C,e,de,J,U);ge=T.axisLeft(m).tickFormat(F=>_e(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,p,Ae)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{we=T.axisBottom(ie).tickSize(ia(e,C,y,!0)).tickSizeOuter(0).tickValues(Lt(fe,p))},ye=v=>{v.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})});const F=T.line().x(k=>ie(k.data.dimension)?ie(k.data.dimension):null).y(k=>k[1]>0?m(k[1]):m(k[0])).defined(k=>{const M=k;return M.hideZero||de.hideZeroValues?M.data[M.key]:!0}).curve(Ot(e));let z=a.selectAll(".parentGroup").data([Ye]);z=z.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(z);let R=z.selectAll(".line-group").data(k=>k);const E=R.enter().append("g").attr("class",k=>"line-group "+k.key.replace(/ /g,"-"));E.append("path").attr("class","line").attr("fill","none"),E.merge(R).each(function(k,M){const G=T.select(this),Z=G.selectAll("path.visibleLine").data([k]).join("path").attr("class","visibleLine").attr("hoverId",ze=>(H[M]?.properties?.alias||H[M]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",F(k)).attr("stroke",k.color!==De.white?k.color:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(H[M].properties.lineWidth.toString());switch(H[M].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",H[M].properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",H[M].properties.lineStyle!==yt.none?H[M].properties.lineWidth:0).attr("fill","none").attr(Qe.SeriesId,H[M].properties.legendUniqueId).attr(Qe.DimValue,H[M].properties.alias||H[M].properties.name||"").on("click",At(_,b,()=>({seriesId:H[M].properties.legendUniqueId,dimValue:H[M].properties.alias||H[M].properties.name||"",legendUniqueId:H[M].properties.legendUniqueId,seriesDisplayName:H[M].properties.alias||H[M].properties.name||""}))),B=e.animation.animationEnabled,Se=Z.node().getTotalLength();B?Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0):Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",0),G.selectAll("path.hoverLine").data([k]).join("path").attr("class","hoverLine").attr("d",F(k)).attr("stroke",De.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(){f.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),f.selectAll('[hoverId="'+yi(H[M].properties.alias||H[M].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){f.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),R.exit().remove(),Ca(z,v,u,ie,m,P,null,e,de,N,V,J,U,!1,x)},ee=v=>{p=c-v.left-v.right,C=d-v.bottom-v.top},Y=()=>{ve(),Fe(),qt(a,de,se,e,y,m,we,he,d,A,t,p,C,fe,ie),W(),ye(ae),Va(Ye,ie,m,P,$,dt,[],[],e,u,d,c,p,fe,C,L,f,h,y,o);let v=aa(p,m,e,ae,void 0,K,C,!0).labelArray;za(e,a,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,m,ie,void 0,void 0,void 0,y,le.LineChart,e,X,re,de.dimensionList,p,Q,de.formattedDimensionListMap,L,$,C))},W=()=>{let v=pt(fe,ae,te);Ye=T.stack().keys(de.legendList).offset(T.stackOffsetDiverging)(v),ae.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=Ye[R][k][0],E[1]=Ye[R][k][1]}));let F=e.annotation.annotationSetLabelColor;Ye.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(H[R].properties.color)),z.individualAnnotationVisibility=JSON.parse(JSON.stringify(H[R].properties.individualAnnotationVisibility)),E.data.labelPosition=H[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(H[R].properties.color)):H[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(H[R].properties.hideZeroValues)),E.properties=H[R].properties}))},I=(v,F,z)=>{ae=F,fe=v,ce=z,Ka(r,j,fe),Y()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},lr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.NormalizedStackLineChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe=[],ae=0,ke,ce=0,me=!1,Ve=[];const Ye=!0;let te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(v){be("NormalizedLinechart","createNormalizedLinechart",v)}},[e]);const de=()=>{({formatOptions:e,svg:y,width:C,height:c}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:ce,scrollbarVisible:me}=Tt(C,c,O,q,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,Ye,t,!1,te),ee(N),{dataTable:d,dataTableHeight:i}=ea(e,$,se,g,te.dimensionList,r),vt(y,C,c,e),f=Ct(y,N),mt(f,e,i,w,p,u,L),Ce(),xe(),Gt(f,e,i,$,Ae,p),Mt(e,D,y,N,X,c,re,te.chartType,$,w,p),St(p,e,i,D,y,N,se,$),Ut(y,j,N,e,i,p,w,ue,Le),Ft(y,e,C,he),Dt(c,y,oe,he,C,pe,e,[...g].reverse(),L,i,N,nt.line,u,n),Bt(g,c,C,y,N,w,me,ke,te,ae,!1,Y)},Pe=()=>{const v=[],F=[];e.plotArea.hideZeroValues&&(te.hideZeroValues=!0,g.forEach(M=>{M.data=M.data.filter(G=>G.value!==0)})),g.forEach((M,G)=>{const Z=`${G}~$~${M.properties.legend}`;M.properties.legend=Z,F.push(Z);for(const B of M.data)v.push(B)}),te.chartData=v,te.legendList=F,fe=JSON.parse(JSON.stringify(g)),we=te.dimensionList;const z=pt(te.dimensionList,g,Ye),R=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(z);I();let E=1/0;for(const M of R)for(const[G]of M)E=Math.min(E,G);te.yMinLeft=E>0?0:E,te.yMaxLeft=1;const k=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(M=>M):te.dimensionList;te.formattedDimensionListMap=new Map(te.dimensionList.map((M,G)=>[M,k[G]]))},Ce=()=>{if(a=T.scaleLinear().domain([te.yMinLeft<0?-1:0,1]).range([i>0?p-i:p,0]),ie=[0,w],e.seriesLabel.seriesLabelVisibility){ve(Ve,fe);let v=aa(w,a,e,fe,void 0,j,p,!0);v.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Q=v.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ie=[0,w-v.heightWidth[0]]:ie=[v.heightWidth[0],w]}},Me=()=>{P=T.scalePoint().domain(we).range(ie).padding(.5)};function ve(v,F){v.forEach((z,R)=>z.forEach((E,k)=>{F[R]&&F[R].data[k]&&(F[R].data[k][0]=E[0]=E.data.total===0?0:E[0]/E.data.total,F[R].data[k][1]=E[1]=E.data.total===0?0:E[1]/E.data.total)}))}const xe=()=>{Ae=T.axisLeft(a).tickSize(Pt(e,w,Q)).ticks(i>0?(p-i)/80:p/80,"%").tickPadding(8).tickSizeOuter(0)},Fe=()=>{ge=T.axisBottom(P).tickSize(ia(e,p,i,!0)).tickSizeOuter(0).tickValues(Lt(we,w))},ye=v=>{ve(Ve,fe),v.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})});const F=T.line().x(k=>P(k.data.dimension)?P(k.data.dimension):null).y(k=>k[1]>0?a(k[1]):a(k[0])).curve(Ot(e));let z=f.selectAll(".parentGroup").data([Ve]);z=z.enter().append("g").attr("class","lines parentGroup").merge(z);let R=z.selectAll(".line-group").data(k=>k),E=R.enter().append("g").attr("class",k=>"line-group "+k.key.replace(/ /g,"-"));E.attr("hoverId",k=>(v[k.index]?.properties?.alias||v[k.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),E.merge(R).each(function(k,M){const G=T.select(this),Z=G.selectAll("path.visibleLine").data([k]).join("path").attr("class","visibleLine").attr("d",F(k)).attr("stroke",k.color!==De.white?k.color:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[M].properties.lineWidth.toString());switch(g[M].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",g[M].properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",g[M].properties.lineStyle!==yt.none?g[M].properties.lineWidth:0).attr("fill","none").attr(Qe.SeriesId,g[M].properties.legendUniqueId).attr(Qe.DimValue,g[M].properties.alias||g[M].properties.name||"").on("click",At(_,b,()=>({seriesId:g[M].properties.legendUniqueId,dimValue:g[M].properties.alias||g[M].properties.name||"",legendUniqueId:g[M].properties.legendUniqueId,seriesDisplayName:g[M].properties.alias||g[M].properties.name||""}))),B=e.animation.animationEnabled,Se=Z.node().getTotalLength();B?Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0):Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",0),G.selectAll("path.hoverLine").data([k]).join("path").attr("class","hoverLine").attr("d",F(k)).attr("stroke",De.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(ze,Ie){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),y.selectAll('[hoverId="'+yi(v[Ie.index]?.properties?.alias||v[Ie.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(ze,Ie){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),y.selectAll('[hoverId="'+yi(v[Ie.index]?.properties?.alias||Ie[Ie.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),R.exit().remove(),Ca(z,v,u,P,a,m,null,e,te,V,U,K,J,!0,x)},ee=v=>{w=C-v.left-v.right,p=c-v.bottom-v.top},Y=(v,F,z)=>{fe=F,we=v,ke=z,W()},W=()=>{Me(),I(),Fe(),qt(f,te,X,e,i,a,ge,oe,c,A,t,w,p,we,P),ye(fe),Va(Ve,P,a,m,N,dt,[],[],e,u,c,C,w,we,p,L,y,h,i,o);let v=aa(w,a,e,fe,void 0,j,p,!0).labelArray;za(e,f,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,d,A,a,P,void 0,void 0,void 0,i,le.LineChart,e,$,se,te.dimensionList,w,ie,te.formattedDimensionListMap,L,N,p))},I=()=>{let v=pt(we,fe,Ye);Ve=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(v),fe.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=Ve[R][k][0],E[1]=Ve[R][k][1]}));let F=e.annotation.annotationSetLabelColor;Ve.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(g[R].properties.color)),E.data.labelPosition=g[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues)),E.properties=g[R].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},rr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID();let A=0;const u=le.HorizontalBarChart,S=Te.useRef(),b=Te.useRef(s);b.current=s;const _=Te.useRef(x);_.current=x;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!0;let j=!1;const K=!1,J=new Map;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C=new Map,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce=[],me=0,Ve=2,Ye=!1,te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(W){be("HorizontalBarchart","createHorizontalBarChart",W)}},[e]);const de=()=>{({formatOptions:e,svg:a,width:i,height:y}=kt(S,e)),Pe(),{maxNumberForPrimaryAxis:w,maxNumberForSecondaryAxis:p,customYaxisMaxValue:V,secondaryCustomYaxisMaxValue:$}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:X,yLabel:se,xLabel:re,yTitle:oe,xTitle:he,dimensionHeightWidthArray:Le,chartTitleHeight:pe,secondaryAxisTitleWidth:ue,legendMargin:O,secondaryYLabel:q,visibleBars:Ve,columnWidth:A,scrollbarVisible:Ye}=Tt(i,y,w,p,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,K,t,D,te),ye(X),vt(a,i,y,e),m=Ct(a,X),mt(m,e,f,c,d,u,L),Ce(),ve(),Ya(e,m,se,d,c,we),j&&Rl(e,m,q,fe,c),Mt(e,D,a,X,re,y,he,te.chartType,se,c,d),St(d,e,f,D,a,X,oe,se,c),Ut(a,j,X,e,f,d,c,q,ue,D),Ft(a,e,i,pe),Dt(y,a,Le,pe,i,O,e,g,L,f,X,nt.rectangle,u,n),Bt(g,y,i,a,X,c,Ye,Ve,te,me,!1,ee,D)},Pe=()=>{const W=[],I=[];let v=[],F=-1/0,z=1/0,R=-1/0,E=1/0,k=1/0,M=-1/0;g.forEach(G=>{I.push(G.properties.legendUniqueId),M=-1/0,k=1/0,G.data.forEach(Z=>{W.push(Z),G.properties.axis==="Secondary"?(j=!0,R=Math.max(R,Z.value),E=Math.min(E,Z.value)):(F=Math.max(F,Z.value),z=Math.min(z,Z.value)),M=Math.max(M,Z.value),k=Math.min(k,Z.value)}),G.properties.setColorScale&&J.set(G.properties.legendUniqueId,T.scaleSequential().domain([k,M]).interpolator(ii.interpolateRgb(G.properties.startColor,G.properties.endColor)))}),te.chartData=W,te.legendList=I,te.yMaxLeft=F,te.yMinLeft=z>0?0:z,te.yMaxRight=R,te.yMinRight=E>0?0:E,v=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(G=>G):te.dimensionList,te.dimensionList.forEach((G,Z)=>{te.formattedDimensionListMap.set(G,v[Z])}),ce=JSON.parse(JSON.stringify(g)),ke=te.dimensionList,e.plotArea.hideZeroValues&&(te.hideZeroValues=!0)},Ce=()=>{let W=st(te.yMaxLeft,te.yMinLeft,d,e,te,U,V,D,c).yAxisLabelArray;te.yMaxLeft=W[W.length-1],te.yMinLeft=W[0],Q=T.scaleLinear().domain([te.yMinLeft>=0?U!==void 0&&!Number.isNaN(U)?U:0:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:V!==void 0&&!Number.isNaN(V)?V:te.yMaxLeft*1.1]).range([0,c]),j&&(Ae=T.scaleLinear().domain([te.yMinRight>=0?(N||N==0)&&!Number.isNaN(N)?N:0:(N||N==0)&&!Number.isNaN(N)?N:te.yMinRight*1.1,te.yMaxRight<=0?$||0:$||te.yMaxRight*1.1]).range([0,c])),ge=[d,0]},Me=()=>{ie=T.scaleBand().domain(te.legendList).range([0,A]).paddingInner(te.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),P=T.scalePoint().domain(ke).range(ge).padding(.5)},ve=()=>{{let W=st(V||te.yMaxLeft,te.yMinLeft,d,e,te,U,V,D,c);we=T.axisBottom(Q).tickFormat(I=>_e(I,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let W=st($||te.yMaxRight,N||te.yMinRight,d,e,te,N,$);fe=T.axisTop(Ae).tickFormat(I=>_e(I,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0)}},xe=()=>{ae=T.axisLeft(P).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*c*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(ke,d))},Fe=W=>{W.forEach(I=>{I.data.forEach(v=>{v.hideZero=I.properties.hideZeroValues,v.axis=I.properties.axis,v.legendUniqueId=I.properties.legendUniqueId})}),ke.forEach(I=>{m.append("rect").attr("id",`dim-background-${I}`).attr("class","dimension-background").attr("y",P(I)-A/2).attr("height",A).attr("x",0).attr("width",c).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),W.forEach(I=>{let v=m.selectAll(".parentGroup").data([I],k=>k.properties.legendUniqueId);v=v.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(v);let F=v.selectAll(".column-group").data(I.data.map(k=>({...k,properties:I.properties})),k=>k.legend+k.dimension),z=F.enter().append("g").attr("class","column-group").attr("hoverId",(I.properties.alias||I.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",k=>`translate(0, ${P(k.dimension)-A/2})`);F.attr("transform",k=>`translate(0, ${P(k.dimension)-A/2})`),z.merge(F).attr("transform",k=>`translate(0, ${P(k.dimension)-A/2})`);const R=z.append("rect").attr("y",k=>ie(k.legendUniqueId)).attr("height",ie.bandwidth()).attr("x",k=>{const M=I.properties.axis===at.primary?Q:Ae;return k.value>=0,M(0)}).attr("width",0).attr("fill",k=>J.get(I.properties.legendUniqueId)?.(k.value)??I.properties.color).attr("stroke-dasharray",k=>k.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",k=>`${k.properties.stackBorderWidth}px`).attr("stroke",k=>I.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?I.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",k=>k.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>I.properties.legendUniqueId).attr(Qe.DimValue,k=>Array.isArray(k.dimension)?String(k.dimension[0]):String(k.dimension));(e.animation.animationEnabled?R.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):R).attr("x",k=>{const M=I.properties.axis===at.primary?Q:Ae;return k.value>=0?M(0):M(k.value)}).attr("width",k=>{const M=I.properties.axis===at.primary?Q:Ae,G=I.properties.axis===at.primary?V:$;return k.value>=0?G&&k.value>G?M(G)-M(0):M(k.value)-M(0):Math.abs(M(0)-M(k.value))}),z.merge(F).on("mousemove",(k,M)=>{(I.properties.alias||I.properties.name||"Legend").replace(/ /g,"-");const G=Array.isArray(M.dimension)?M.dimension[0]:M.dimension,Z=String(te.formattedDimensionListMap.get(G)??G??""),B=ht(l,String(G??""),{...I.properties,formattedDimensionValue:Z});ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:te.formattedDimensionListMap.get(Array.isArray(M.dimension)?M.dimension[0]:M.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?M[1]-M[0]:M.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,k,I.properties,B)}).on("mouseout",(k,M)=>{(I.properties.alias||I.properties.name||"Legend").replace(/ /g,"-"),rt()}).on("click",At(_,b,(k,M)=>({seriesId:I.properties.legendUniqueId,dimValue:Array.isArray(M.dimension)?String(M.dimension[0]):String(M.dimension),legendUniqueId:I.properties.legendUniqueId,seriesDisplayName:I.properties.alias||I.properties.name||""}))),F.exit().remove()}),m.selectAll(".parentGroup").raise()},ye=W=>{c=i-W.left-W.right,d=y-W.bottom-W.top},ee=(W,I,v)=>{ce=I,ke=W,Ve=v,Ka(r,C,ke),e.xAxisLabel.hideZeroValues&&(ke=ke.filter(F=>C.get(F)!==0)),Y()},Y=()=>{Me(),xe(),Ua(e,m,re,d,c,ae,fe,Q,te.yMaxLeft,ke,u,t,i,Le,A,P),Fe(ce),Da(ce,P,Q,Ae,X,dt,[],[],e,u,y,i,c,ke,d,L,a,h,ie,A,o,!1,D)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},nr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.StackHorizontalBarChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse(),H=r.DimensionList,D=!0,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U,V,N,$,X,se,re,oe,he,Le,pe,ue;const O=new Map;let q,w,p,C,c,d,i,y,f,a,m,P,ie=[],Q=0,Ae=2,ge=!1,we=[];const fe=!1;let ae=new Map,ke={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ce()}catch(Y){be("StackStackHorizontalBarchart","createStackHorizontalBarChart",Y)}},[e]);const ce=()=>{({formatOptions:e,svg:c,width:p,height:C}=kt(S,e)),me(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,ke.yMinLeft,ke.yMaxLeft,ke.yMinRight,ke.yMaxRight),{margin:U,yLabel:V,xLabel:N,yTitle:$,xTitle:X,dimensionHeightWidthArray:se,chartTitleHeight:re,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Le,visibleBars:Ae,columnWidth:A,scrollbarVisible:ge}=Tt(p,C,pe,ue,ke.yMaxLeft,e,ke.legendList,ke.dimensionList,ke.yMaxRight,j,fe,t,D,ke),Ce(U),vt(c,p,C,e),d=Ct(c,U),mt(d,e,0,q,w,u,L),Ve(),te(),Ya(e,d,V,w,q,a),Mt(e,D,c,U,N,C,X,ke.chartType,V,q,w),St(w,e,0,D,c,U,$,V,p),Ft(c,e,p,re),Dt(C,c,se,re,p,he,e,[...g].reverse(),L,0,U,nt.rectangle,u,n),Bt(g,C,p,c,U,q,ge,Ae,ke,Q,!1,Me,D)},me=()=>{const Y=[],W=[];let I=-1/0,v=1/0;g.forEach((M,G)=>{const Z=`${G}~$~${M.properties.legend}`;M.properties.legend=Z,W.push(Z),I=-1/0,v=1/0;for(const B of M.data)I=Math.max(I,B.value),v=Math.min(v,B.value),Y.push(B);M.properties.setColorScale&&O.set(M.properties.legendUniqueId,T.scaleSequential().domain([v,I]).interpolator(T.interpolateRgb(M.properties.startColor,M.properties.endColor)))}),ke.chartData=Y,ke.legendList=W,ie=JSON.parse(JSON.stringify(g));let F=pt(ke.dimensionList,g,fe);e.plotArea.fitChart?P=ke.dimensionList:(P=ke.dimensionList.slice(Q,Q+Ae),ie.forEach((M,G)=>ie[G].data=M.data.filter(Z=>P.includes(Z.dimension))));const z=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(F);xe();let R=1/0,E=-1/0;for(const M of z)for(const[G,Z]of M)R=Math.min(R,G),E=Math.max(E,Z);ke.yMinLeft=R>0?0:R,ke.yMaxLeft=E;let k=t?gt(e.xAxisLabel.xAxisNumberFormat,ke.dimensionList).map(M=>M):ke.dimensionList;ke.dimensionList.forEach((M,G)=>{ke.formattedDimensionListMap.set(M,k[G])}),e.plotArea.hideZeroValues&&(ke.hideZeroValues=!0)},Ve=()=>{let Y=st(ke.yMaxLeft,ke.yMinLeft,w,e,ke,K,J,D,q).yAxisLabelArray;ke.yMaxLeft=Y[Y.length-1],ke.yMinLeft=Y[0],i=T.scaleLinear().domain([ke.yMinLeft>=0?K!==void 0&&!Number.isNaN(K)?K:0:ke.yMinLeft<0?ke.yMinLeft*1.1:ke.yMinLeft*.9,ke.yMaxLeft<=0?0:J!==void 0&&!Number.isNaN(J)?J:ke.yMaxLeft*1.1]).range([0,q]),f=[w,0]},Ye=()=>{y=T.scalePoint().domain(P).range(f).padding(.5)},te=()=>{{let Y=st(J||ke.yMaxLeft,ke.yMinLeft,w,e,ke,K,J,D,q);a=T.axisBottom(i).tickFormat(W=>_e(W,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-w:0).tickValues(Y.autoLabelFlag?void 0:Y.yAxisLabelArray).ticks(Y.customTickValue).tickPadding(8).tickSizeOuter(0)}},de=()=>{m=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*q*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,w))},Pe=Y=>{Y.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})}),P.forEach(k=>{d.append("rect").attr("id",`dim-background-${k}`).attr("class","dimension-background").attr("y",y(k)-A/2).attr("height",A).attr("x",0).attr("width",q).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let W=d.selectAll(".parentGroup").data([we]);W=W.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(W);let I=W.selectAll(".column-group").data(k=>k);I=I.enter().append("g").attr("class",k=>"column-group "+k.key.replace(/ /g,"-")).attr("hoverId",k=>(Y[k.index].properties.alias||Y[k.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(I);let F=I.selectAll("rect").data(k=>k);const z=(k,M)=>{const G=Array.from(I.nodes()).indexOf(k[M].parentNode);return{props:g[G]?.properties,groupIndex:G}},R=F.enter().append("rect").merge(F).attr("y",k=>y(k.data.dimension)-A/2).attr("height",A).attr("fill",(k,M,G)=>{const{props:Z}=z(G,M);return O.get(Z.legendUniqueId)?.(k.data[k.key])??Z?.color??"gray"}).attr("stroke",(k,M,G)=>{const Z=z(G,M).props;return Z?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?Z.stackBorderColor:"none"}).attr("stroke-dasharray",(k,M,G)=>z(G,M).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(k,M,G)=>(z(G,M).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",k=>Math.min(i(k[0]),i(k[1]))).attr("width",0).attr("visibility",(k,M,G)=>{const Z=z(G,M).props;return k.data[k.key]===0&&Z?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,k=>k.key??"").attr(Qe.DimValue,k=>Array.isArray(k.data.dimension)?String(k.data.dimension[0]):String(k.data.dimension)).on("mousemove",(k,M)=>{const G=M.data.dimension;ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ke.formattedDimensionListMap.get(G)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e(M.data[M.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,k,M.properties,ht(x,String(G??""),{...M.properties,formattedDimensionValue:String(ke.formattedDimensionListMap.get(G)??G??"")}))}).on("mouseout",(k,M)=>{M.data.dimension,rt()}).on("click",At(_,b,(k,M)=>({seriesId:M.key,dimValue:Array.isArray(M.data.dimension)?String(M.data.dimension[0]):String(M.data.dimension),legendUniqueId:M.key,seriesDisplayName:M.properties?.alias||M.properties?.name||""})));R.attr("x",k=>i(0)),(e.animation.animationEnabled?R.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):R).attr("x",k=>Math.min(i(k[0]),i(k[1]))).attr("width",k=>Math.abs(i(k[1])-i(k[0]))),I.exit().remove(),d.selectAll(".parentGroup").raise()},Ce=Y=>{q=p-Y.left-Y.right,w=C-Y.bottom-Y.top},Me=(Y,W,I)=>{ie=W,P=Y,Ae=I,Ka(r,ae,P),xe(),ve()},ve=()=>{Ye(),de(),Ua(e,d,N,w,q,m,void 0,i,ke.yMaxLeft,P,u,t,p,se,A,y);const Y=new Map;P.forEach((W,I)=>{let v=0;we.forEach(F=>{const z=F[I]?.[0]??0;z<v&&(v=z)}),Y.set(W,v)}),Pe(ie),Va(we,y,i,void 0,U,dt,[],[],e,u,C,p,q,P,w,L,c,h,0,o,D),qa(ae,y,i,U,dt,[],e,u,C,p,c,o,D,Y),Fe(),d.selectAll(".connectors").raise()},xe=()=>{let Y=pt(P,ie,fe);we=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(Y),ie.forEach((I,v)=>I.data.forEach((F,z)=>{F[0]=we[v][z][0],F[1]=we[v][z][1]}));let W=e.annotation.annotationSetLabelColor;we.forEach((I,v)=>I.forEach(F=>{F.key=I.key,I.color=JSON.parse(JSON.stringify(g[v].properties.color)),F.data.labelPosition=g[v].properties.dataLabelPosition,F.data.labelColor=W=="2"?JSON.parse(JSON.stringify(g[v].properties.color)):g[v].properties.labelColor,F.hideZero=JSON.parse(JSON.stringify(g[v].properties.hideZeroValues)),F.properties=g[v].properties}))},Fe=()=>{try{const Y=Number(e.connector?.connectorVisibility);if(!e.connector||Y===2)return;const W=[],I=[],v=[];let F;const z=[];if(Y===1)F=1;else if(Y===3){const B=Number(e.connector.connectorFollow);B===1?F=Number(e.connector.connectorStepSize):B===2&&((e.connector.connectorExclude||[]).forEach(Se=>v.push(Se)),F=1)}const R=[],E=[],k=[],M=e.connector?.connectorCustomRange||[];v.forEach(B=>{const Se=B.split("-");Se.length&&R.push(Se[0])});const Z=(we?.[0]||[]).map((B,Se)=>({Dimension:B.data.dimension,Total:B.data.total,CustomTotal:B.data.total-(k[Se]??0),Index:Se}));if(F!=null){for(let B=0;B<Z.length;B++)(F===1||B%F===0&&F!==1)&&W.push(Z[B]);for(let B=F;B<Z.length;B+=F){const Se=Math.min(B+F,Z.length);let ze=-1/0;for(let Ie=B;Ie<Se;Ie++)Z[Ie].Total>ze&&(ze=Z[Ie].Total);ze!==-1/0&&z.push(ze)}for(let B=1;B<W.length;B++)I.push(W[B])}else{const B=[];(M||[]).forEach(Se=>{if(Se?.from&&Se?.to){const ze=Z.some(Oe=>Oe.Dimension===Se.from),Ie=Z.some(Oe=>Oe.Dimension===Se.to);ze&&Ie&&B.push({from:Se.from,to:Se.to})}}),B.forEach(Se=>{const ze=Z.findIndex(Oe=>Oe.Dimension===Se.from),Ie=Z.findIndex(Oe=>Oe.Dimension===Se.to);if(ze>=0&&Ie>=0){const Oe=Math.min(ze,Ie),lt=Math.max(ze,Ie);W.push(Z[Oe]);let ut=Z[Oe]?.Total??-1/0;for(let tt=Oe;tt<=lt;tt++)Z[tt].Total>ut&&(ut=Z[tt].Total);ut!==-1/0&&z.push(ut),I.push(Z[lt])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==De.white?e.connector.connectorMarkerColor:"none"),ye(W,z,I,F,R),ee(W,z,I,F,R)}catch(Y){console.error(Y)}},ye=(Y,W,I,v,F)=>{try{const z=y.bandwidth()??0,R=d.selectAll(".connector-paths").data([0]),E=R.enter().append("g").attr("class","connector-paths connectors").merge(R),k=Y.filter((Z,B)=>v!=null?B<Y.length-1:B<Y.length),M=E.selectAll("path.connector-path").data(k,(Z,B)=>Z?.Dimension??B);M.exit().remove(),M.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",(Z,B)=>{const Se=I?.[B]??{Total:0,Dimension:Z.Dimension},ze=Z?.Total??0,Ie=typeof Se.Total=="number"?i(Se.Total):0,Oe=typeof ze=="number"?i(ze):0,lt=Math.max(Ie,Oe);return e.total.totalVisibility?`M ${Oe+50},
74
+ ${y(Z.Dimension)+z/2-5}
75
75
  H ${60+lt}
76
- V ${y(Se.Dimension)+D/2+5}
76
+ V ${y(Se.Dimension)+z/2+5}
77
77
  H ${30+Ie}`:`M ${Oe+30},
78
- ${y(X.Dimension)+D/2-5}
78
+ ${y(Z.Dimension)+z/2-5}
79
79
  H ${45+lt}
80
- V ${y(Se.Dimension)+D/2+5}
81
- H ${10+Ie}`}).style("stroke",e.connector.connectorLineColor!==we.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(X,$)=>w.includes(X.Dimension)||X.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(D){console.error(D)}},le=(B,U,R,v,w)=>{try{const D=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,I=Ti(D,A);let W=e.connector.connectorFontStyle,C=e.connector.connectorNumberFormat,M=F/30<P.length?Math.round(F/30):P.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(C=".2s");const _=B.filter((Ie,Oe)=>v!=null?Oe<B.length-1:Oe<B.length),X=c.selectAll(".connector-texts").data([0]),Se=X.enter().append("g").attr("class","connector-texts connectors").merge(X).selectAll("text.connector-text").data(_,Ie=>Ie?.Dimension??Ie);Se.exit().remove(),Se.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(Se).attr("y",(Ie,Oe)=>{const lt=R?.[Oe]??{Dimension:Ie.Dimension,Total:0},ut=y(Ie.Dimension)??0;return(y(lt.Dimension)??ut)+v*I/2}).attr("x",(Ie,Oe)=>{const lt=R?.[Oe]??{Total:0},ut=Ie?.Total??0,tt=Math.max(i(lt.Total),i(ut));return e.total.totalVisibility?70+tt:50+tt}).text((Ie,Oe)=>{const lt=R?.[Oe]??{Total:0,CustomTotal:0,Dimension:Ie.Dimension};return Ie.CustomTotal==0&&lt.CustomTotal!=0&&(Ie.CustomTotal=1),hi(lt.Total,Ie.Total,parseInt(e.connector.connectorDecimalPrecision),C,parseInt(Ie.Dimension),parseInt(lt.Dimension),e)}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==we.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",W.includes("Italic")?"Italic":"").style("text-decoration",W.includes("Underline")?"Underline":"").style("font-weight",W.includes("Bold")?"Bold":"").style("visibility",(Ie,Oe)=>w.includes(Ie.Dimension)||Ie.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(D){console.error(D)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},or=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID();let A=0;const u=re.NormalizedStackHorizontalBarChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse(),G=r.DimensionList,V=!0,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y,N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b;const k=new Map;let d,c,i,y,f,a,L,P,ae=[],Q=0,be,Le=!1,Fe=[];const me=!0;let te={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(he){ge("StackNormalizedStackBarchart","createNormalizedStackBarChart",he)}},[e]);const ke=()=>{({formatOptions:e,svg:d,width:F,height:b}=Ct(S,e)),ee(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:Y,yLabel:N,xLabel:E,yTitle:z,xTitle:q,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:oe,legendMargin:xe,secondaryYLabel:Ae,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(F,b,pe,ue,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,me,t,V,te),Pe(Y),kt(d,F,b,e),c=Mt(d,Y),mt(c,e,0,O,J,u),De(),Ye(),Ya(e,c,N,J,O,a),St(e,V,d,Y,E,b,q,te.chartType,N,O,J),Ft(J,e,0,V,d,Y,z,N,O),wt(d,e,F,ne),Dt(b,d,ce,ne,F,xe,e,[...g].reverse(),m,0,Y,nt.rectangle,u,n),Bt(g,b,F,d,Y,O,Le,be,te,Q,!1,ve,V)},ee=()=>{const he=[],fe=[];let de=-1/0,le=1/0;g.forEach((w,D)=>{const I=`${D}~$~${w.properties.legend}`;w.properties.legend=I,fe.push(I),de=-1/0,le=1/0;for(const W of w.data)de=Math.max(de,W.value),le=Math.min(le,W.value),he.push(W);w.properties.setColorScale&&k.set(w.properties.legendUniqueId,T.scaleSequential().domain([le,de]).interpolator(T.interpolateRgb(w.properties.startColor,w.properties.endColor)))}),te.chartData=he,te.legendList=fe,ae=JSON.parse(JSON.stringify(g));let B=pt(te.dimensionList,g,me);e.plotArea.fitChart?P=te.dimensionList:(P=te.dimensionList.slice(Q,Q+be),ae.forEach((w,D)=>ae[D].data=w.data.filter(I=>P.includes(I.dimension))));const U=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(B);Ce();let R=1/0;for(const w of U)for(const[D,I]of w)R=Math.min(R,D);te.yMinLeft=R>0?0:R,te.yMaxLeft=1;let v=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(w=>w):te.dimensionList;te.dimensionList.forEach((w,D)=>{te.formattedDimensionListMap.set(w,v[D])}),e.plotArea.hideZeroValues&&(te.hideZeroValues=!0)},De=()=>{let he=ot(Z||te.yMaxLeft,te.yMinLeft,J,e,te,K,Z,V,O).yAxisLabelArray;te.yMaxLeft=he[he.length-1],te.yMinLeft=he[0],i=T.scaleLinear().domain([te.yMinLeft<0?-1:0,1]).range([0,O]),f=[J,0]},Ve=()=>{y=T.scalePoint().domain(P).range(f).padding(.5)},Ye=()=>{a=T.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-J:0).ticks(O/80,"%").tickPadding(8).tickSizeOuter(0)},ie=()=>{L=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*O*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,J))},ye=he=>{Fe.forEach((w,D)=>w.forEach((I,W)=>{he[D].data[W][0]=I[0]=I.data.total===0?0:I[0]/I.data.total,he[D].data[W][1]=I[1]=I.data.total===0?0:I[1]/I.data.total})),he.forEach(w=>{w.data.forEach(D=>{D.hideZero=w.properties.hideZeroValues,D.axis=w.properties.axis})}),P.forEach(w=>{c.append("rect").attr("id",`dim-background-${w}`).attr("class","dimension-background").attr("y",y(w)-y.bandwidth()/2).attr("height",y.bandwidth()).attr("x",0).attr("width",O).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let fe=c.selectAll(".parentGroup").data([Fe]);fe=fe.enter().append("g").attr("class","columns parentGroup").merge(fe);let de=fe.selectAll(".column-group").data(w=>w);de=de.enter().append("g").attr("class",w=>"column-group "+w.key.replace(/ /g,"-")).attr("hoverId",w=>(he[w.index].properties.alias||he[w.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(de);let B=de.selectAll("rect").data(w=>w);const U=(w,D)=>{const I=Array.from(de.nodes()).indexOf(w[D].parentNode);return{props:g[I]?.properties,groupIndex:I}},R=B.enter().append("rect").merge(B).attr("y",w=>y(w.data.dimension)-A/2).attr("height",A).attr("fill",(w,D,I)=>{const{props:W}=U(I,D);return k.get(W.legendUniqueId)?.(w.data[w.key])??W?.color??"gray"}).attr("stroke",(w,D,I)=>{const W=U(I,D).props;return W?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?W.stackBorderColor:"none"}).attr("stroke-dasharray",(w,D,I)=>U(I,D).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(w,D,I)=>(U(I,D).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",w=>i(0)).attr("width",0).attr("visibility",(w,D,I)=>{const W=U(I,D).props;return w.data[w.key]===0&&W?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,w=>w.key??"").attr(Qe.DimValue,w=>Array.isArray(w.data.dimension)?String(w.data.dimension[0]):String(w.data.dimension)).on("mousemove",(w,D)=>{const I=D.data.dimension;st([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:te.formattedDimensionListMap.get(I)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():D.properties?.currentMeasure?D.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||D.value,value:_e(D[1]-D[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:D.properties.alias}],e,w,D.properties,ht(x,String(I??""),{...D.properties,formattedDimensionValue:String(te.formattedDimensionListMap.get(I)??I??"")}))}).on("mouseout",(w,D)=>{let I=(D.properties.alias||D.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+I+'"]').classed("highlight",!1).classed("unhighlight",!1),rt()}).on("click",At(H,p,(w,D)=>({seriesId:D.key,dimValue:Array.isArray(D.data.dimension)?String(D.data.dimension[0]):String(D.data.dimension),legendUniqueId:D.key,seriesDisplayName:D.properties?.alias||D.properties?.name||""})));(e.animation.animationEnabled?R.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):R).attr("x",w=>Math.min(i(w[0]),i(w[1]))).attr("width",w=>Math.abs(i(w[1])-i(w[0]))),de.exit().remove(),c.selectAll(".parentGroup").raise()},Pe=he=>{O=F-he.left-he.right,J=b-he.bottom-he.top},Me=()=>{Ve(),ie(),Ua(e,c,E,J,O,L,void 0,i,te.yMaxLeft,P,u,t,F,ce,A,y),ye(ae),Va(Fe,y,i,void 0,Y,dt,[],[],e,u,b,F,O,P,J,m,d,h,0,o,V)},Ce=()=>{let he=pt(P,ae,me);Fe=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(he),ae.forEach((de,le)=>de.data.forEach((B,U)=>{B[0]=Fe[le][U][0],B[1]=Fe[le][U][1]}));let fe=e.annotation.annotationSetLabelColor;Fe.forEach((de,le)=>de.forEach(B=>{B.key=de.key,de.color=JSON.parse(JSON.stringify(g[le].properties.color)),B.data.labelPosition=g[le].properties.dataLabelPosition,B.data.labelColor=fe=="2"?JSON.parse(JSON.stringify(g[le].properties.color)):g[le].properties.labelColor,B.hideZero=JSON.parse(JSON.stringify(g[le].properties.hideZeroValues)),B.properties=g[le].properties}))},ve=(he,fe,de)=>{ae=fe,P=he,be=de,Ce(),Me()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID();let A=0;const u=re.LayeredHorizontalBarChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!0,j=!1,K=new Map;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae=[],Q=0,be=2,Le=!1,Fe=[];const me=!1;let te={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(le){ge("StackStackHorizontalBarchart","createStackHorizontalBarChart",le)}},[e]);const ke=()=>{({formatOptions:e,svg:d,width:b,height:k}=Ct(S,e)),ee(),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:N,yLabel:E,xLabel:z,yTitle:q,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:oe,secondaryAxisTitleWidth:xe,legendMargin:Ae,secondaryYLabel:pe,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(b,k,ue,O,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,me,t,V,te),Pe(N),kt(d,b,k,e),c=Mt(d,N),mt(c,e,0,J,F,u,m),De(),Ye(),Ya(e,c,E,F,J,a),St(e,V,d,N,z,k,ce,te.chartType,E,J,F),Ft(F,e,0,V,d,N,q,E),wt(d,e,b,oe),Dt(k,d,ne,oe,b,Ae,e,g,m,0,N,nt.rectangle,u,n),Bt(g,k,b,d,N,J,Le,be,te,Q,!1,Me,V)},ee=()=>{const le=[],B=[];let U=[],R=-1/0,v=1/0,w=-1/0,D=1/0,I=-1/0,W=1/0;g.forEach(C=>{B.push(C.properties.legendUniqueId),I=-1/0,W=1/0,C.data.forEach(M=>{le.push(M),I=Math.max(I,M.value),W=Math.min(W,M.value),R=Math.max(R,M.value),v=Math.min(v,M.value)}),C.properties.setColorScale&&K.set(C.properties.legendUniqueId,T.scaleSequential().domain([W,I]).interpolator(T.interpolateRgb(C.properties.startColor,C.properties.endColor)))}),te.chartData=le,te.legendList=B,te.yMaxLeft=R,te.yMinLeft=v>0?0:v,te.yMaxRight=w,te.yMinRight=D,U=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(C=>C):te.dimensionList,U=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(C=>C):te.dimensionList,te.dimensionList.forEach((C,M)=>{te.formattedDimensionListMap.set(C,U[M]),te.formattedDimensionListMap.set(C,U[M])}),ae=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?P=te.dimensionList:P=te.dimensionList.slice(Q,Q+be),e.plotArea.hideZeroValues&&(te.hideZeroValues=!0)},De=()=>{let le=ot(Y||te.yMaxLeft,te.yMinLeft,F,e,te,Z,Y,V,J).yAxisLabelArray;te.yMaxLeft=le[le.length-1],te.yMinLeft=le[0],i=T.scaleLinear().domain([te.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:0:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:te.yMaxLeft*1.1]).range([0,J]),f=[F,0],Ve()},Ve=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(te.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=T.scalePoint().domain(P).range(f).padding(.5)},Ye=()=>{ie();{let le=ot(Y||te.yMaxLeft,te.yMinLeft,F,e,te,Z,Y,V,J);a=T.axisBottom(i).tickFormat(B=>_e(B,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-F:0).tickValues(le.autoLabelFlag?void 0:le.yAxisLabelArray).ticks(le.customTickValue).tickPadding(8).tickSizeOuter(0)}},ie=()=>{L=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*J*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,F))},ye=le=>{le.forEach(B=>{B.data.forEach(U=>{U.hideZero=B.properties.hideZeroValues,U.axis=B.properties.axis,U.properties=B.properties})}),le.forEach((B,U)=>{let R=c.selectAll(`.parentGroup-${B.properties.legendUniqueId}`).data([B],W=>W.properties.legendUniqueId);R=R.enter().append("g").attr("class",`column parentGroup parentGroup-${B.properties.legendUniqueId}`).attr("clip-path",`url(#${m}-clip)`).merge(R);let v=R.selectAll(".column-group").data(B.data,W=>W.dimension+"_"+B.properties.legendUniqueId),w=v.enter().append("g").attr("class","column-group").attr("hoverId",(B.properties.alias||B.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",W=>U===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+U*2)})`);v.attr("transform",W=>U===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+U*2)})`),w.merge(v).attr("transform",W=>U===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+U*2)})`);const D=w.append("rect").attr("y",0).attr("height",U===0?A:A/2).attr("x",()=>i(0)).attr("width",0).attr("fill",W=>K.get(B.properties.legendUniqueId)?.(W.value)??B.properties.color).attr("stroke-dasharray",()=>B.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${B.properties.stackBorderWidth}px`).attr("stroke",()=>B.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?B.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",W=>W.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>B.properties.legendUniqueId).attr(Qe.DimValue,W=>Array.isArray(W.dimension)?String(W.dimension[0]):String(W.dimension));(e.animation.animationEnabled?D.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):D).attr("x",W=>W.value>0?i(0):i(W.value)).attr("width",W=>W.value>0?i(W.value)-i(0):Math.abs(i(0)-i(W.value))),v.select("rect").transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("x",W=>W.value>0?i(0):i(W.value)).attr("width",W=>W.value>0?i(W.value)-i(0):Math.abs(i(0)-i(W.value))),w.merge(v).on("mousemove",(W,C)=>{st([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:te.formattedDimensionListMap.get(C.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||C.value,value:_e(C.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:B.properties.alias}],e,W,B.properties,ht(x,String(C.dimension??""),{...B.properties,formattedDimensionValue:String(te.formattedDimensionListMap.get(C.dimension)??C.dimension??"")}))}).on("mouseout",()=>{rt()}).on("click",At(H,p,(W,C)=>({seriesId:B.properties.legendUniqueId,dimValue:Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension),legendUniqueId:B.properties.legendUniqueId,seriesDisplayName:B.properties.alias||B.properties.name||""}))),v.exit().remove()}),c.selectAll(".parentGroup").raise()},Pe=le=>{J=b-le.left-le.right,F=k-le.bottom-le.top},Me=(le,B,U)=>{ae=B,P=le,be=U,Ce()},Ce=()=>{Ve(),ie(),Ua(e,c,z,F,J,L,void 0,i,te.yMaxLeft,P,u,t,b,ne,A,y),ve(),ye(ae),Da(ae,y,i,void 0,N,dt,[],[],e,u,k,b,J,P,F,m,d,h,void 0,A,o,!1,V),he()},ve=()=>{let le=pt(P,ae,me);Fe=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(le),ae.forEach((U,R)=>U.data.forEach((v,w)=>{v[0]=Fe[R][w][0],v[1]=Fe[R][w][1]}));let B=e.annotation.annotationSetLabelColor;Fe.forEach((U,R)=>U.forEach(v=>{v.key=U.key,U.color=JSON.parse(JSON.stringify(g[R].properties.color)),v.data.labelPosition=g[R].properties.dataLabelPosition,v.data.labelColor=B=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,v.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues))}))},he=()=>{try{const le=Number(e.connector?.connectorVisibility);if(!e.connector||le===2)return;const B=[],U=[],R=[];let v;const w=[];if(le===1)v=1;else if(le===3){const X=Number(e.connector.connectorFollow);X===1?v=Number(e.connector.connectorStepSize):X===2&&((e.connector.connectorExclude||[]).forEach($=>R.push($)),v=1)}const D=[],I=[],W=[],C=e.connector?.connectorCustomRange||[];R.forEach(X=>{const $=X.split("-");$.length&&D.push($[0])});const _=(Fe?.[0]||[]).map((X,$)=>({Dimension:X.data.Dimension,Total:X.data.Total,CustomTotal:X.data.Total-(W[$]??0),Index:$}));if(v!=null){for(let X=0;X<_.length;X++)(v===1||X%v===0&&v!==1)&&B.push(_[X]);for(let X=v;X<_.length;X+=v){const $=Math.min(X+v,_.length);let Se=-1/0;for(let ze=X;ze<$;ze++)_[ze].Total>Se&&(Se=_[ze].Total);Se!==-1/0&&w.push(Se)}for(let X=1;X<B.length;X++)U.push(B[X])}else{const X=[];(C||[]).forEach($=>{if($?.from&&$?.to){const Se=_.some(Ie=>Ie.Dimension===$.from),ze=_.some(Ie=>Ie.Dimension===$.to);Se&&ze&&X.push({from:$.from,to:$.to})}}),X.forEach($=>{const Se=_.findIndex(Ie=>Ie.Dimension===$.from),ze=_.findIndex(Ie=>Ie.Dimension===$.to);if(Se>=0&&ze>=0){const Ie=Math.min(Se,ze),Oe=Math.max(Se,ze);B.push(_[Ie]);let lt=_[Ie]?.Total??-1/0;for(let ut=Ie;ut<=Oe;ut++)_[ut].Total>lt&&(lt=_[ut].Total);lt!==-1/0&&w.push(lt),U.push(_[Oe])}})}c.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!==we.white?e.connector.connectorMarkerColor:"none"),fe(B,w,U,v,D),de(B,w,U,v,D)}catch(le){console.error(le)}},fe=(le,B,U,R,v)=>{try{c.append("g").selectAll("path").data(le).enter().filter((w,D)=>R!=null?D<le.length-1:D<le.length).append("path").attr("d",(w,D)=>e.total.totalVisibility?`M ${i(w.Total)+50},
82
- ${y(w.Dimension)+y.bandwidth()/2-5}
83
- H ${60+Math.max(i(B[D]),i(U[D].Total),i(w.Total))}
84
- V ${y(U[D].Dimension)+y.bandwidth()/2+5}
85
- H ${30+i(U[D].Total)}`:`M ${i(w.Total)+30},
86
- ${y(w.Dimension)+y.bandwidth()/2-5}
87
- H ${45+Math.max(i(B[D]),i(U[D].Total),i(w.Total))}
88
- V ${y(U[D].Dimension)+y.bandwidth()/2+5}
89
- H ${10+i(U[D].Total)}
90
- `).style("stroke",e.connector.connectorLineColor!==we.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",w=>v.includes(w.Dimension)||w.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(w){console.error(w)}},de=(le,B,U,R,v)=>{try{let w=e.connector.connectorFontStyle,D=e.connector.connectorNumberFormat,I=F/30<P.length?Math.round(F/30):P.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(D=".2s"),c.append("g").selectAll("text1").data(le).enter().filter((W,C)=>R!=null?C<le.length-1:C<le.length).append("text").attr("y",(W,C)=>R==null?y(U[C].Dimension)/2+y(W.Dimension)/2+15:R==1?I<6&&y.bandwidth()>40?y(U[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(U[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(U[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2*R+12).attr("x",(W,C)=>e.total.totalVisibility?70+Math.max(i(B[C]),i(U[C].Total),i(W.Total)):50+Math.max(i(B[C]),i(U[C].Total),i(W.Total))).text((W,C)=>(W.CustomTotal==0&&U[C].CustomTotal!=0&&(W.CustomTotal=1),hi(U[C].Total,W.Total,parseInt(e.connector.connectorDecimalPrecision),D,parseInt(W.Dimension),parseInt(U[C].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!==we.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",w.includes("Italic")?"Italic":"").style("text-decoration",w.includes("Underline")?"Underline":"").style("font-weight",w.includes("Bold")?"Bold":"").style("visibility",W=>v.includes(W.Dimension)||W.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(w){console.error(w)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:r})=>{const o=crypto.randomUUID(),h=0,n=re.ColumnHistogramChart,l=Te.useRef(),s=r.ChartData,x=r.DimensionList,m=!1,A=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,p=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,H=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,g=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,G,V,j,K,Z,Y,N,E,z,q,ce,ne,oe,xe,Ae,pe=[],ue=[],O,J,F,b,k,d,c,i,y,f,a,L=[],P=0;const ae=2;let Q={dimensionList:x,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{be()}catch(ye){ge("HorizontalHistogramChart","createHorizontalChart",ye)}},[e]);const be=()=>{({formatOptions:e,svg:k,width:O,height:J}=Ct(l,e)),Le(),{formatOptions:e}=Qt(e,s,r.DataTableData??[]),{maxNumberForPrimaryAxis:ce,maxNumberForSecondaryAxis:ne}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:G,yLabel:V,xLabel:j,yTitle:K,xTitle:Z,dimensionHeightWidthArray:Y,chartTitleHeight:N,secondaryAxisTitleWidth:E,legendMargin:z,secondaryYLabel:q}=vt(O,J,ce,ne,Q.yMaxLeft,e,Q.legendList,Q.dimensionList,Q.yMaxRight,A,u,t),Ve(G),{dataTable:F,dataTableHeight:b}=ea(e,V,K,s,Q.dimensionList),kt(k,O,J,e),d=Mt(k,G),mt(d,e,b,oe,xe,n),Fe(),te(),ke(),qt(d,Q,j,e,b,c,f,Y,J,h,t,oe,xe,a,c),Gt(d,e,b,V,y,xe),Ye(s,J,k,G,oe),St(e,m,k,G,j,J,Z,Q.chartType,V,oe,xe),Ft(xe,e,b,m,k,G,K,V),Ut(k,A,G,e,b,xe,oe,q,E),wt(k,e,O,N),Dt(J,k,Y,N,O,z,e,s,o,b,G,nt.rectangle)},Le=()=>{const ye=[],Pe=[];let Me=[],Ce=-1/0,ve=1/0;s.forEach(de=>{Pe.push(de.legend),de.data.forEach(le=>{ye.push(le),Ce=Math.max(Ce,le.value),ve=Math.min(ve,le.value)})}),Q.chartData=ye,Q.legendList=Pe,Q.yMaxLeft=Ce,Q.yMinLeft=ve>0?0:ve,L=JSON.parse(JSON.stringify(s)),L.forEach(de=>de.data.forEach(le=>Me.push(le.value)));let he=S||S==0?S:0,fe=p||p==0?p:L[0]?.data?.length;Q.yMaxLeft=parseFloat((he+"").length>(fe+"").length?he+"":fe+""),Q.xMax=T.max(Me),Q.xMin=T.min(Me)},Fe=()=>{switch(e.bins.binsCalculation){case"Automatic":Ae=xe/50;break;case"Number of Bins":me(!1);break;case"Bin Width":me(!0)}},me=ye=>{L.forEach(ve=>ve.data.sort((he,fe)=>he.value-fe.value));let Pe=Q.xMax-Q.xMin,Me;ye?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),Me=Pe/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),Me=Pe/parseFloat(e.bins.binsCalculationValue));let Ce=Q.xMin;if(ye)for(pe=[Ce];Ce<Q.xMax;)Ce+=Me,pe.push(Ce);else for(pe=[Ce];Math.round(Ce)<Math.round(Q.xMax);)Ce+=Me,pe.push(Math.round(Ce))},te=()=>{c=T.scaleLinear().domain([Q.xMin,Q.xMax]).range([xe,0]);const ye=pe.length>0?pe:c.ticks(Ae);let Pe=T.bin().value(Ce=>Ce).domain(c.domain()).thresholds(ye);L.forEach(Ce=>{let ve=Pe(Ce.data.map(he=>he.value));ue.push(ve)}),L.forEach((Ce,ve)=>ue[ve].forEach(he=>{he.name=Ce.properties.legend,he.color=Ce.properties.color,he.opacity=Ce.properties.opacity}));let Me=[];ue.forEach(Ce=>Ce.forEach(ve=>Me.push(ve.length))),Q.yMaxLeft=T.max(Me),Q.yMinLeft=T.min(Me),i=T.scaleLinear().domain([H||H==0?H:0,g||g==0?g:Q.yMaxLeft+.2*Q.yMaxLeft]).range([0,oe])},ke=()=>{ee();{let ye=ot(Q.yMaxLeft,Q.yMinLeft,oe,e,Q,S,p,!1,xe);f=T.axisBottom(i).tickFormat(Pe=>_e(Pe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-xe+0:0).tickValues(ye.autoLabelFlag?void 0:ye.yAxisLabelArray).ticks(ye.customTickValue).tickPadding(8).tickSizeOuter(0)}},ee=()=>{xi(Q.xMax,Q.xMin,xe,e,H,g,oe,!1).xAxisLabelArray.shift(),y=T.axisLeft(c).tickFormat(Pe=>_e(Pe,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-oe:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(Ae):y.tickValues(pe).ticks(xe/50)},De=ye=>{const Pe=e.animation.animationEnabled,Me=d.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(ue).enter().append("g").selectAll("rect").data(ve=>ve).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",0).attr("y",ve=>{const he=c(ve.x0),fe=c(ve.x1);return Math.min(he,fe)}).attr("height",ve=>{const he=c(ve.x0),fe=c(ve.x1),de=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(fe-he)-de)}).attr("width",0).style("fill",ve=>ve.color!==we.white?ve.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(ve,he)=>{st([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():he.properties?.currentMeasure?he.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${he.x0}-${he.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:_e(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(he.length/L[0].data.length):he.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,ve)}).on("mouseout",rt);(Pe?Me.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Me).attr("width",ve=>i(ve.length)),d.selectAll(".parentGroup").raise()},Ve=ye=>{oe=O-ye.left-ye.right,xe=J-ye.bottom-ye.top},Ye=(ye,Pe,Me,Ce,ve)=>{if(!e.plotArea.fitChart){const he=ye[0].data.length-ae,fe=Pe-20;a=Q.dimensionList.slice(P,P+ae),L=JSON.parse(JSON.stringify(ye)),L.forEach((B,U)=>L[U].data=B.data.filter(R=>a.includes(R.dimension))),Me.append("rect").attr("x",Ce.left).attr("y",fe).attr("width",ve).attr("height",8).attr("fill","#ddd").attr("rx",4);const de=ve*ae/Q.dimensionList.length,le=Me.append("rect").attr("x",Ce.left).attr("y",fe).attr("width",de).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",B=>{let U=Math.min(Math.max(B.x,Ce.left),Ce.left+ve-de);le.attr("x",U),P=Math.round((U-Ce.left)/(ve-de)*he),a=Q.dimensionList.slice(P,P+ae),L=JSON.parse(JSON.stringify(ye)),L.forEach((R,v)=>L[v].data=R.data.filter(w=>a.includes(w.dimension))),ee(),ie()}));Me.on("wheel",B=>{B.preventDefault();const U=Math.abs(B.deltaX)>Math.abs(B.deltaY)?B.deltaX:B.deltaY;P+=U>0?1:-1,P=Math.max(0,Math.min(P,he));const R=Ce.left+(ve-de)*P/he;le.attr("x",R),L=JSON.parse(JSON.stringify(ye)),L.forEach((v,w)=>L[w].data=v.data.filter(D=>a.includes(D.dimension))),ee(),ie()})}ie()},ie=()=>{Gt(d,e,b,V,y,xe),De()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"className",ref:l,id:o,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const m=crypto.randomUUID(),A=0,u=re.AreaChart,S=Te.useRef(),p=Te.useRef(s);p.current=s;const H=Te.useRef(x);H.current=x;const g=bt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1;let j=!1;const K=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,E=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me,te,ke=[],ee=0,De,Ve,Ye,ie={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ye()}catch(U){ge("Linechart","createLineChart",U)}},[e]);const ye=()=>{({formatOptions:e,svg:f,width:d,height:c}=Ct(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:F}=Nt(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:z,yLabel:q,xLabel:ce,yTitle:ne,xTitle:oe,dimensionHeightWidthArray:xe,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:De,columnWidth:Ve,scrollbarVisible:Ye}=vt(d,c,J,F,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,K,t,!1,ie),de(z),{dataTable:i,dataTableHeight:y}=ea(e,q,ne,g,ie.dimensionList,r),kt(f,d,c,e),a=Mt(f,z),mt(a,e,y,b,k,u,m),Me(),ve(),Gt(a,e,y,q,Le,k),j&&ci(a,e,y,O,me,k,b),St(e,V,f,z,ce,c,oe,ie.chartType,q,b,k),Ft(k,e,y,V,f,z,ne,q),Ut(f,j,z,e,y,k,b,O,pe),wt(f,e,d,Ae),Dt(c,f,xe,Ae,d,ue,e,g,m,y,z,nt.areaWithLine,u,n),Bt(g,c,d,f,z,b,Ye,De,ie,ee,!1,le)},Pe=()=>{const U=[],R=[];let v=[],w=-1/0,D=1/0,I=-1/0,W=1/0;e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0,g.forEach(C=>{C.data=C.data.filter(M=>M.value!==0)})),g.forEach(C=>{R.push(C.properties.alias?C.properties.alias:C.legend),C.data.forEach(M=>{U.push(M),C.properties.axis==="Secondary"?(j=!0,I=Math.max(I,M.value),W=Math.min(W,M.value)):(w=Math.max(w,M.value),D=Math.min(D,M.value))})}),ie.chartData=U,ie.legendList=R,ie.yMaxLeft=w,ie.yMinLeft=D>0?0:D,ie.yMaxRight=I,ie.yMinRight=W,v=t?gt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(C=>C):ie.dimensionList,ie.dimensionList.forEach((C,M)=>{ie.formattedDimensionListMap.set(C,v[M])}),ke=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?te=ie.dimensionList:te=ie.dimensionList.slice(ee,ee+De)},Me=()=>{let U=ot(Y||ie.yMaxLeft,ie.yMinLeft,k,e,ie,Z,Y).yAxisLabelArray;if(ie.yMaxLeft=U[U.length-1],ie.yMinLeft=U[0],L=T.scaleLinear().domain([ie.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:0:ie.yMinLeft<0?ie.yMinLeft*1.1:ie.yMinLeft*.9,ie.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:ie.yMaxLeft*1.1]).range([y>0?k-y:k,0]),j&&(P=T.scaleLinear().domain([ie.yMinRight>=0?(N||N==0)&&!Number.isNaN(N)?N:0:(N||N==0)&&!Number.isNaN(N)?N:ie.yMinRight*1.1,ie.yMaxRight<=0?E||0:E||ie.yMaxRight*1.1]).range([y>0?k-y:k,0])),Q=[0,b],e.seriesLabel.seriesLabelVisibility){let R=aa(b,L,e,ke,void 0,j,k);R.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(be=R.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,b-R.heightWidth[0]]:Q=[R.heightWidth[0],b]}},Ce=()=>{ae=T.scalePoint().domain(te).range(Q).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{he();{let U=ot(Y||ie.yMaxLeft,ie.yMinLeft,k,e,ie,Z,Y);Le=T.axisLeft(L).tickFormat(R=>_e(R,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,b,be)).tickValues(U.autoLabelFlag?void 0:U.yAxisLabelArray).ticks(U.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let U=oi(E||P.domain()[1],P.domain()[0],e,k);me=T.axisRight(P).tickFormat(R=>_e(R,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(U.autoLabelFlag?void 0:U.secondaryYAxisLabelArray).ticks(U.secondaryCustomTickValue??k/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-b:0).tickSizeOuter(0)}},he=()=>{Fe=T.axisBottom(ae).tickSize(ia(e,k,y,!0)).tickSizeOuter(0).tickValues(Lt(te,b))},fe=U=>{const R=e.plotArea.plotAreaHideLineAndMarkers;U.forEach(_=>{_.data.forEach(X=>{X.hideZero=_.properties.hideZeroValues,X.axis=_.properties.axis})});const v=T.area().x(_=>ae(_.dimension)?ae(_.dimension):null).y0(_=>_.axis===at.primary?L(0):P(0)).y1(_=>_.axis===at.primary?L(_.value):P(_.value)).defined(_=>_.hideZero?!!_.value:!0).curve(Ot(e)),w=T.area().x(_=>ae(_.dimension)?ae(_.dimension):null).y0(()=>L(0)).y1(()=>L(0)).defined(_=>_.hideZero?!!_.value:!0).curve(Ot(e)),D=e.animation.animationEnabled;let I=a.selectAll(".parentGroup").data([U]),W=a.append("g").attr("class","focusClass");I=I.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(I);let C=I.selectAll(".area-group").data(_=>_),M=C.enter().append("g").attr("class","area-group");M.append("path").attr("class","area parentGroup").attr("fill",_=>_.properties.color!==we.white?_.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",_=>(_.properties?.alias||_.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",_=>w(_.data)).attr(Qe.SeriesId,_=>_.properties.legendUniqueId).attr(Qe.DimValue,_=>_.properties.alias||_.properties.name||"").on("click",At(H,p,(_,X)=>({seriesId:X.properties.legendUniqueId,dimValue:X.properties.alias||X.properties.name||"",legendUniqueId:X.properties.legendUniqueId,seriesDisplayName:X.properties.alias||X.properties.name||""}))).each(function(_){D?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",v(_.data)):T.select(this).attr("d",v(_.data))}),M.merge(C).each(function(_){const X=T.select(this);X.selectAll("path.visibleLine").data([_]).join("path").attr("class","visibleLine parentGroup").attr("d",$=>D?w($.data):v($.data)).attr("stroke",$=>$.properties.areaBorderColor!==we.white?$.properties.areaBorderColor:"none").attr("stroke-dasharray",$=>{const Se=parseInt($.properties.lineWidth);switch($.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",$=>$.properties.lineStyle===yt.dotted?sa.round:sa.butt).attr("stroke-width",$=>R?$.properties.lineStyle!==yt.none&&e.plotArea.plotAreaHideLineAndMarkers?$.properties.lineWidth:"0":0).attr("fill","none").each(function($){D&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",v($.data))}),X.selectAll("path.hoverLine").data([_]).join("path").attr("class","hoverLine").attr("d",$=>v($.data)).attr("fill",we.transparent).attr("stroke","none").style("pointer-events","all").raise(),yi(e,I,W,te,U,ae,L,u)}),C.exit().remove(),Ca(I,U,u,ae,L,P,null,e,ie,E,N,Z,Y,!1,l),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},de=U=>{b=d-U.left-U.right,k=c-U.bottom-U.top},le=(U,R,v)=>{ke=R,te=U,De=v,B()},B=()=>{Ce(),he(),Da(g,ae,L,P,z,dt,[],[],e,u,c,d,b,te,k,m,f,h,void 0,void 0,o);let U=aa(b,L,e,ke,void 0,j,k).labelArray;qt(a,ie,ce,e,y,L,Fe,xe,c,A,t,b,k,te,ae),fe(ke),za(e,a,U),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,L,ae,void 0,void 0,void 0,y,u,e,q,ne,te,b,Q,ie.formattedDimensionListMap,m,z,k))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},ur=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID(),A=0,u=re.StackAreaChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],G=r.DimensionList,V=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F=new Map,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me,te=[],ke=0,ee,De,Ve,Ye=[];const ie=!1;let ye={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(v){ge("StackAreaChart","createAreaChart",v)}},[e]);const Pe=()=>{({formatOptions:e,svg:f,width:d,height:c}=Ct(S,e)),Me(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:J}=Nt(e,ye.yMinLeft,ye.yMaxLeft,ye.yMinRight,ye.yMaxRight),{margin:E,yLabel:z,xLabel:q,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:oe,chartTitleHeight:xe,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:ue,visibleBars:ee,columnWidth:De,scrollbarVisible:Ve}=vt(d,c,O,J,ye.yMaxLeft,e,ye.legendList,ye.dimensionList,ye.yMaxRight,j,ie,t,!1,ye),le(E),{dataTable:i,dataTableHeight:y}=ea(e,z,ce,g,ye.dimensionList,r),kt(f,d,c,e),a=Mt(f,E),mt(a,e,y,b,k,u,m),Ce(),he(),Gt(a,e,y,z,Le,k),St(e,V,f,E,q,c,ne,ye.chartType,z,b,k),Ft(k,e,y,V,f,E,ce,z),Ut(f,j,E,e,y,k,b,ue,Ae),wt(f,e,d,xe),Dt(c,f,oe,xe,d,pe,e,[...g].reverse(),m,y,E,nt.areaWithLine,u,n),Bt(g,c,d,f,E,b,Ve,ee,ye,ke,!1,B,V)},Me=()=>{const v=[],w=[];e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0,g.forEach(_=>{_.data=_.data.filter(X=>X.value!==0)})),g.forEach((_,X)=>{const $=`${X}~$~${_.properties.alias}`;_.properties.legend=$,w.push($);for(const Se of _.data)v.push(Se)}),ye.chartData=v,ye.legendList=w,te=JSON.parse(JSON.stringify(g));let D=pt(ye.dimensionList,g,ie);e.plotArea.fitChart?me=ye.dimensionList:(me=ye.dimensionList.slice(ke,ke+ee),te.forEach((_,X)=>te[X].data=_.data.filter($=>me.includes($.dimension))));const I=T.stack().keys(ye.legendList).offset(T.stackOffsetNone)(D);R();let W=1/0,C=-1/0;for(const _ of I)for(const[X,$]of _)W=Math.min(W,X),C=Math.max(C,$);ye.yMinLeft=W>0?0:W,ye.yMaxLeft=C;let M=t?gt(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList).map(_=>_):ye.dimensionList;ye.dimensionList.forEach((_,X)=>{ye.formattedDimensionListMap.set(_,M[X])})},Ce=()=>{let v=ot(Z||ye.yMaxLeft,ye.yMinLeft,k,e,ye,K,Z).yAxisLabelArray;if(ye.yMaxLeft=v[v.length-1],ye.yMinLeft=v[0],L=T.scaleLinear().domain([ye.yMinLeft>=0?K!==void 0&&!Number.isNaN(K)?K:0:ye.yMinLeft<0?ye.yMinLeft*1.1:ye.yMinLeft*.9,ye.yMaxLeft<=0?0:Z!==void 0&&!Number.isNaN(Z)?Z:ye.yMaxLeft*1.1]).range([y>0?k-y:k,0]),Q=[0,b],e.seriesLabel.seriesLabelVisibility){let w=aa(b,L,e,g,void 0,j,k,!0);w.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(be=w.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,b-w.heightWidth[0]]:Q=[w.heightWidth[0],b]}},ve=()=>{ae=T.scalePoint().domain(me).range(Q).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},he=()=>{{let v=ot(Z||ye.yMaxLeft,ye.yMinLeft,k,e,ye,K,Z);Le=T.axisLeft(L).tickFormat(w=>_e(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,b,be)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},fe=()=>{Fe=T.axisBottom(ae).tickSize(ia(e,k,y,!0)).tickSizeOuter(0).tickValues(Lt(me,b))},de=v=>{const w=e.animation.animationEnabled,D=e.plotArea.plotAreaHideLineAndMarkers;v.forEach($=>{$.data.forEach(Se=>{Se.hideZero=$.properties.hideZeroValues,Se.axis=$.properties.axis})});const I=T.area().x($=>ae($.data.dimension)?ae($.data.dimension):null).y0($=>L($[0])).y1($=>L($[1])).defined($=>$.data.hideZero?!!$.data.key:!0).curve(Ot(e)),W=T.area().x($=>ae($.data.dimension)?ae($.data.dimension):null).y0(()=>L(0)).y1(()=>L(0)).defined($=>$.data.hideZero?!!$.data.key:!0).curve(Ot(e));let C=a.selectAll(".lineGroup").data([Ye]),M=a.append("g").attr("class","focusClass");C=C.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(C);let _=C.selectAll(".area-group").data($=>$),X=_.enter().append("g").attr("class",$=>"area-group "+$.key.replace(/ /g,"-"));X.append("path").attr("hoverId",$=>(v[$.index].properties.alias||v[$.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",$=>$.color!==we.white?$.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",$=>W($)).attr(Qe.SeriesId,$=>g[$.index]?.properties?.legendUniqueId??$.key).attr(Qe.DimValue,$=>g[$.index]?.properties?.alias||g[$.index]?.properties?.name||"").on("click",At(H,p,($,Se)=>{const ze=g[Se.index]?.properties?.legendUniqueId??Se.key,Ie=g[Se.index]?.properties?.alias||g[Se.index]?.properties?.name||"";return{seriesId:ze,dimValue:Ie,legendUniqueId:ze,seriesDisplayName:Ie}})).each(function($){w?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",I($)):T.select(this).attr("d",I($))}),X.merge(_).each(function($,Se){const ze=T.select(this);ze.selectAll("path.visibleLine").data([$]).join("path").attr("class","visibleLine parentGroup").attr("d",Ie=>w?W(Ie):I(Ie)).attr("stroke",Ie=>Ie.color!==we.white?g[Se].properties.areaBorderColor:"none").attr("stroke-dasharray",Ie=>{const Oe=parseInt(g[Se].properties.lineWidth.toString());switch(g[Se].properties.lineStyle){case yt.dotted:return`0,${Oe+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[Se]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>D?g[Se].properties.lineStyle!==yt.none?g[Se].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(Ie){w&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",I(Ie))}),ze.selectAll("path.hoverLine").data([$]).join("path").attr("class","hoverLine").attr("d",Ie=>I(Ie)).attr("fill",we.transparent).attr("stroke","none").style("pointer-events","all").raise(),f.selectAll('[hoverId="'+(g[$.index].properties.alias||g[$.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),_.exit().remove(),yi(e,C,M,me,v,ae,L,u,!0),Ca(C,v,u,ae,L,P,null,e,ye,N,Y,K,Z,!1,x),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},le=v=>{b=d-v.left-v.right,k=c-v.bottom-v.top},B=(v,w,D)=>{te=w,me=v,ee=D,Ka(r,F,me),R(),U()},U=()=>{ve(),fe(),qt(a,ye,q,e,y,L,Fe,oe,c,A,t,b,k,me,ae),de(te),Va(Ye,ae,L,P,E,dt,[],[],e,u,c,d,b,me,k,m,f,h,y,o);let v=aa(b,L,e,te,void 0,j,k,!0).labelArray;za(e,a,v),qa(F,ae,L,E,dt,[],e,u,c,d,f,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,L,ae,void 0,void 0,void 0,y,u,e,z,ce,ye.dimensionList,b,Q,ye.formattedDimensionListMap,m,E,k))},R=()=>{let v=pt(me,te,ie);Ye=T.stack().keys(ye.legendList).offset(T.stackOffsetNone)(v),te.forEach((D,I)=>D.data.forEach((W,C)=>{W[0]=Ye[I][C][0],W[1]=Ye[I][C][1]}));let w=e.annotation.annotationSetLabelColor;Ye.forEach((D,I)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(g[I].properties.color)),W.data.labelPosition=g[I].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(g[I].properties.color)):g[I].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(g[I].properties.hideZeroValues)),W.properties=g[I].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},hr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=crypto.randomUUID(),A=0,u=re.NormalizedStackAreaChart,S=Te.useRef(),p=Te.useRef(l);p.current=l;const H=Te.useRef(s);H.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],G=r.DimensionList,V=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,me=[],te=0,ke,ee,De,Ve=[];const Ye=!0;let ie={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ye()}catch(R){ge("NormalizedLinechart","createLineChart",R)}},[e]);const ye=()=>{({formatOptions:e,svg:y,width:k,height:d}=Ct(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:E,yLabel:z,xLabel:q,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:oe,chartTitleHeight:xe,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:De,scrollbarVisible:ee}=vt(k,d,O,J,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,Ye,t,!1,ie),de(E),{dataTable:c,dataTableHeight:i}=ea(e,z,ce,g,ie.dimensionList,r),kt(y,k,d,e),f=Mt(y,E),mt(f,e,i,F,b,u),Me(),ve(),Gt(f,e,i,z,be,b),St(e,V,y,E,q,d,ne,ie.chartType,z,F,b),Ft(b,e,i,V,y,E,ce,z),Ut(y,j,E,e,i,b,F,ue,Ae),wt(y,e,k,xe),Dt(d,y,oe,xe,k,pe,e,[...g].reverse(),m,i,E,nt.areaWithLine,u,n),Bt(g,d,k,y,E,F,ee,ke,ie,te,!1,le)},Pe=()=>{const R=[],v=[];e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0,g.forEach(C=>{C.data=C.data.filter(M=>M.value!==0)})),g.forEach((C,M)=>{const _=`${M}~$~${C.properties.alias}`;C.properties.legend=_,v.push(_);for(const X of C.data)R.push(X)}),ie.chartData=R,ie.legendList=v,me=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?Fe=ie.dimensionList:(Fe=ie.dimensionList.slice(te,te+ke),me.forEach(C=>{C.data=C.data.filter(M=>Fe.includes(M.dimension))}));const w=pt(ie.dimensionList,g,Ye),D=T.stack().keys(ie.legendList).offset(T.stackOffsetNone)(w);U();let I=1/0;for(const C of D)for(const[M]of C)I=Math.min(I,M);ie.yMinLeft=I>0?0:I,ie.yMaxLeft=1;const W=t?gt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(C=>C):ie.dimensionList;ie.formattedDimensionListMap=new Map(ie.dimensionList.map((C,M)=>[C,W[M]]))},Me=()=>{if(a=T.scaleLinear().domain([ie.yMinLeft<0?-1:0,1]).range([i>0?b-i:b,0]),ae=[0,F],e.seriesLabel.seriesLabelVisibility){let R=aa(F,a,e,g,void 0,j,b,!0);R.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Q=R.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ae=[0,F-R.heightWidth[0]]:ae=[R.heightWidth[0],F]}},Ce=()=>{P=T.scalePoint().domain(Fe).range(ae).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{be=T.axisLeft(a).tickSize(Pt(e,F,Q)).ticks(i>0?(b-i)/80:b/80,"%").tickPadding(8).tickSizeOuter(0)},he=()=>{Le=T.axisBottom(P).tickSize(ia(e,b,i,!0)).tickSizeOuter(0).tickValues(Lt(Fe,F))},fe=R=>{const v=e.animation.animationEnabled,w=e.plotArea.plotAreaHideLineAndMarkers;Ve.forEach((X,$)=>X.forEach((Se,ze)=>{const Ie=Se.data.total;R[$].data[ze]&&(R[$].data[ze][0]=Se[0]=Ie===0?0:Se[0]/Ie,R[$].data[ze][1]=Se[1]=Ie===0?0:Se[1]/Ie)})),R.forEach(X=>{X.data.forEach($=>{$.hideZero=X.properties.hideZeroValues,$.axis=X.properties.axis})});const D=T.area().x(X=>P(X.data.dimension)?P(X.data.dimension):null).y0(X=>a(X[0])).y1(X=>a(X[1])).defined(X=>X.data.hideZero?!!X[0]:!0).curve(T.curveLinear),I=T.area().x(X=>P(X.data.dimension)?P(X.data.dimension):null).y0(()=>a(0)).y1(()=>a(0)).defined(X=>X.data.hideZero?!!X.data.key:!0).curve(Ot(e));let W=f.selectAll(".lineGroup").data([Ve]),C=f.append("g").attr("class","focusClass");W=W.enter().append("g").attr("class","areas lineGroup").merge(W);let M=W.selectAll(".area-group").data(X=>X),_=M.enter().append("g").attr("class",X=>"area-group "+X.key.replace(/ /g,"-"));_.append("path").attr("hoverId",X=>(R[X.index]?.properties?.alias||R[X.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",X=>X.color!==we.white?X.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",X=>I(X)).attr(Qe.SeriesId,X=>g[X.index]?.properties?.legendUniqueId??X.key).attr(Qe.DimValue,X=>g[X.index]?.properties?.alias||g[X.index]?.properties?.name||"").on("click",At(H,p,(X,$)=>{const Se=g[$.index]?.properties?.legendUniqueId??$.key,ze=g[$.index]?.properties?.alias||g[$.index]?.properties?.name||"";return{seriesId:Se,dimValue:ze,legendUniqueId:Se,seriesDisplayName:ze}})).each(function(X){const $=T.select(this);v?$.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",D(X)):$.attr("d",D(X))}),_.merge(M).each(function(X,$){const Se=T.select(this);Se.selectAll("path.visibleLine").data([X]).join("path").attr("class","visibleLine parentGroup").attr("d",ze=>v?I(ze):D(ze)).attr("stroke",ze=>ze.color!==we.white?g[$].properties.areaBorderColor:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[$].properties.lineWidth.toString());switch(g[$].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[$]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>w?g[$].properties.lineStyle!==yt.none?g[$].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(ze){v&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",D(ze))}),Se.selectAll("path.hoverLine").data([X]).join("path").attr("class","hoverLine").attr("d",ze=>D(ze)).attr("fill",we.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+ui((R[X.index]?.properties?.alias||R[X.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),M.exit().remove(),yi(e,W,C,Fe,R,P,a,u,!0),f.selectAll(".parentGroup").raise(),f.selectAll(".hoverLine").raise(),Ca(W,R,u,P,a,L,null,e,ie,N,Y,K,Z,!0,x),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,c,A,a,P,void 0,void 0,void 0,i,u,e,z,ce,ie.dimensionList,F,ae,ie.formattedDimensionListMap,m,E,b))},de=R=>{F=k-R.left-R.right,b=d-R.bottom-R.top},le=(R,v,w)=>{me=v,Fe=R,ke=w,U(),B()},B=()=>{Ce(),he(),qt(f,ie,q,e,i,a,Le,oe,d,A,t,F,b,Fe,P),fe(me),Va(Ve,P,a,L,E,dt,[],[],e,u,d,k,F,Fe,b,m,y,h,i,o,!1);let R=aa(F,a,e,me,void 0,j,b,!0).labelArray;za(e,f,R)},U=()=>{let R=pt(Fe,me,Ye);Ve=T.stack().keys(ie.legendList).offset(T.stackOffsetNone)(R),me.forEach((w,D)=>w.data.forEach((I,W)=>{Ve[D][W]&&(I[0]=Ve[D][W][0],I[1]=Ve[D][W][1])}));let v=e.annotation.annotationSetLabelColor;Ve.forEach((w,D)=>w.forEach(I=>{I.key=w.key,w.color=JSON.parse(JSON.stringify(g[D].properties.color)),I.data.labelPosition=g[D].properties.dataLabelPosition,I.data.labelColor=v=="2"?JSON.parse(JSON.stringify(g[D].properties.color)):g[D].properties.labelColor,I.hideZero=JSON.parse(JSON.stringify(g[D].properties.hideZeroValues)),I.properties=g[D].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Oa={left:"Left",right:"Right",center:"Center"},zt={left:"left",right:"right",top:"top",bottom:"bottom"},Ha={solid:"solid",dashed:"Dashed",dotted:"Dotted"},ei={rounded:"rounded",pill:"pill",extra_rounded:"extra_rounded",squircle:"squircle",rectangle:"rectangle"},ca={curve:"curve",elbow:"elbow",diagonal:"diagonal",s_curve:"s-curve",arc:"arc",reverse_elbow:"reverse-elbow",zigzag:"zigzag"},tl="PieFamilyCommonFunctions.ts",xr=(t,e,r,o)=>{try{let h=t.total.totalPosition,n=t.total.totalAlignment,l=t.legends.legendPosition,s=0;switch(h){case va.top:switch(s=l=="Top"?35:0,n){case $t.start:return{x:5,y:e+s+10};case $t.middle:return{x:r/2,y:e+s+10};case $t.end:return{x:r-20,y:e+s+10}}break;case va.bottom:switch(s=l=="Bottom"?30:0,n){case $t.start:return{x:10,y:o-s-10};case $t.middle:return{x:r/2,y:o-s-10};case $t.end:return{x:r-20,y:o-s-10}}break}}catch(h){ge(tl,"getTotalValueCords",h)}},vi=(t,e,r,o,h,n)=>{try{if(t.total&&t.total.totalVisibility){let l=t.total.totalFontStyle,s=t.total.totalAlignment,x=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":je(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),m=xr(t,r,h,n);const A=o.append("g").attr("transform",`translate(${m.x}, ${m.y})`).style("user-select","none");A.append("text").text(t.total.showTotalLabel!==!1?`${t.total.editTotalTextToggle?t.total.editTotalText:"Total"} : ${x}`:x).style("fill",t.total.totalColor!==we.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",l.includes(se.italic)?se.italic:"").style("text-decoration",l.includes(se.underline)?se.underline:"").style("font-weight",l.includes(se.bold)?se.bold:"").attr("text-anchor",s===$t.start?"start":s===$t.middle?"middle":s===$t.end?"end":""),t.animation?.animationEnabled&&A.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(Xe[t.animation.animationEffect]).attr("opacity",1)}}catch(l){ge(tl,"drawTotalValue",l)}},Ea="PieChart.tsx",pr=({data:t,formatOptions:e,chartId:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=Te.useRef(),A=Te.useRef(l);A.current=l;const u=Te.useRef(s);u.current=s;const S=bt(t.ChartData);let p,H,g,G=40,V=Ht,j=[0,0],K,Z,Y,N,E,z,q,ce,ne=!1;Te.useEffect(()=>{oe()},[e]);const oe=()=>{({chartFormatOptions:p,svg:E,width:g,height:H}=Jt(m,e)),xe(),j=Ia(p,S),{margins:V,innerHeight:K,innerWidth:Z,legendListWidth:ce,chartTitleHeight:G}=Na(p,g,H,j,V),Ae(),jt(m,g,H,p),N=la(E,V),_t(m,G,g,p),Pa(p,E,S,g,H,ce,G,r,V,nt.circle,void 0,n),pe(),ue(),p.plotArea.annotationDraggable&&p.plotArea.dataLabels?Oi(dt,z,p,O(),re.PieChart,g,H,N,Math.min(K*.5,Z*.5),o,h):F(),vi(p,q,G,E,g,H)},xe=()=>{try{q=0,t.ChartData.forEach(b=>{b.properties.dataLabelPosition=="2"&&(ne=!0),q+=b.data[0].value})}catch(b){ge(Ea,"loopOverSeriesData",b)}},Ae=()=>{try{Y=Math.min(K*.5,Z*.5),ne&&(Y=Y*.9)}catch(b){ge(Ea,"defineChartRadius",b)}},pe=()=>{try{let b=et(p.plotArea.rotation);const k=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;z=T.pie().value(i=>Math.abs(k?100:i.data[0].value)).startAngle((b??0)*(Math.PI/180)%360).endAngle(((b??0)+360)*(Math.PI/180)%360)(t.ChartData).map((i,y)=>({...i,x0:i.startAngle,x1:i.endAngle,y0:0,y1:Y,depth:2}))}catch(b){ge(Ea,"initPieChartData",b)}},ue=()=>{try{const b=T.arc().innerRadius(0).outerRadius(Y),k=T.arc().innerRadius(0).outerRadius(Y+10),d=N.append("g").attr("class","parentGroup").attr("fill-opacity",p.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data(z).enter().append("path").attr("class",c=>"path").attr("hoverId",c=>(c.data?.properties?.alias||c.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",c=>c.data.properties.color!==we.white?c.data.properties.color:"none").attr(Qe.SeriesId,c=>c.data.properties.legendUniqueId??c.data.properties.name??"").attr(Qe.DimValue,c=>c.data.properties.alias||c.data.legend||"").on("click",At(u,A,(c,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(c){T.select(this).transition().duration(100).attr("d",k)}).on("mousemove. ",c=>{st([{key:p.yAxisTitle.yAxisTitleText,value:p.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(c.currentTarget.__data__.data.data[0].value/q)*100).toFixed(et(p.toolTip.toolTipDecimalPrecision))+"%":je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(c.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:c.currentTarget.__data__.data.properties.alias}],p,void 0,c.currentTarget.__data__.data.properties,ht(x,String(c.currentTarget.__data__.data.legend??""),c.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(c){T.select(this).transition().duration(100).attr("d",b),rt()});p.animation.animationEnabled?d.transition().duration(p.animation.animationDuration).ease(Xe[p.animation.animationEffect]).attrTween("d",function(c){const i=T.interpolate({startAngle:c.startAngle,endAngle:c.startAngle},c);return y=>b(i(y))}):d.attr("d",c=>b(c))}catch(b){ge(Ea,"drawPieChart",b)}},O=()=>{try{return`translate(${Z/2},${K/2})`}catch(b){return ge(Ea,"getPiePosition",b),""}},J=(b,k)=>{try{if(k)return"translate(0 0)";{const d=(b.startAngle+b.endAngle)/2,c=Math.cos(d-Math.PI/2)*(Y*.65),i=Math.sin(d-Math.PI/2)*(Y*.65);let y=d*180/Math.PI%360,f=0;return y>180&&y<360?f=90:f=-90,y+=f,`translate(${c},${i}) rotate(${y})`}}catch(d){return ge(Ea,"getDataLabelTransformString",d),""}},F=()=>{try{if(p.plotArea.dataLabels){const b=z&&z.length===1;N.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(z.filter(c=>c.data.properties.dataLabelPosition=="1"),p,c=>c.data.data[0].value)).enter().append("text").attr("hoverId",c=>(c.data?.properties?.alias||c.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",c=>c.data.properties?.labelFontSize??11).attr("fill",c=>c.data.properties?.labelFontColor??we.black).attr("font-style",c=>c.data.properties?.labelFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",c=>c.data.properties?.labelFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",c=>c.data.properties?.labelFontStyle?.includes(se.bold)?se.bold:"").attr("font-family",c=>c.data.properties?.labelFont??qe).attr("transform",c=>J(c,b)).attr("visibility",c=>c.endAngle-c.startAngle<.09&&e.plotArea.hideInsignificantValue?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(c=>{const{plotArea:i}=p;return i.dataLabelName?c.data.properties?.alias||c.data.legend:""}),N.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(z.filter(c=>c.data.properties.dataLabelPosition=="1"),p,c=>c.data.data[0].value)).enter().append("text").attr("hoverId",c=>(c.data?.properties?.alias||c.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",c=>c.data.properties?.valueFontSize??11).attr("fill",c=>c.data.properties?.valueFontColor??we.black).attr("font-style",c=>c.data.properties?.valueFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",c=>c.data.properties?.valueFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",c=>c.data.properties?.valueFontStyle?.includes(se.bold)?se.bold:"300").attr("font-family",c=>c.data.properties?.valueFont??qe).attr("transform",c=>J(c,b)).attr("visibility",c=>c.endAngle-c.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",p.plotArea.dataLabelName?"1.00em":"0em").text(c=>{if(p.plotArea.dataLabelValue){const i=c.data.data[0].value;return p.plotArea.dataLabelValue&&i!==void 0?p.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/q)*100).toFixed(et(p.plotArea.dataLabelDecimalPrecision)??0)+"%":je(p.plotArea.plotAreaDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",p.plotArea.dataLabelValue?p.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",c=>c.data.properties?.valueFontStyle?.includes(se.bold)?se.bold:"300").attr("fill-opacity",.5).text(c=>{const i=Math.abs(c.data.data[0].value);return p.plotArea.plotAreaAbsoluteValue&&i!==void 0?T.format(".2s")(i):""});let k=T.arc().startAngle(c=>c.x0).endAngle(c=>c.x1).innerRadius(c=>c.depth>1?c.y1-1+Y/7:0).outerRadius(c=>c.depth>1?c.y1-1+Y/7:0),d=T.arc().startAngle(c=>c.x0).endAngle(c=>c.x1).innerRadius(c=>c.depth>2?c.y0:0).outerRadius(c=>c.y1+Y/1.5);N.selectAll("polyline.pie-label-connector").data(Rt(z.filter(c=>c.data.properties.dataLabelPosition=="2"),p,c=>c.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",O()).style("stroke",c=>p.connector.connectorColorOption=="Uniform"?p.connector.connectorUniformLineColor:c.data.properties.color).style("fill","none").style("stroke-dasharray",p.connector.connectorStyle===Ha.solid?0:p.connector.connectorStyle===Ha.dotted?1:4).style("stroke-width",p.connector.connectorLineThickness).attr("points",c=>{const i=d.centroid(c),y=k.centroid(c);let f=c.x0+(c.x1-c.x0)/2;f=f%(2*Math.PI);const a=Y*1.1*(f<Math.PI?1:-1),L=y[1];return[i,y,[a,L]].map(P=>P.join(",")).join(" ")}),N.append("g").attr("class","pie-label-group").attr("transform",O()).selectAll("foreignObject").data(Rt(z.filter(c=>c.data.properties.dataLabelPosition=="2"),p,c=>c.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",c=>{let i=c.x0+(c.x1-c.x0)/2;i=i%(2*Math.PI);const f=i<Math.PI?0:-80;return Y*1.1*(i<Math.PI?1:-1)+f}).attr("y",c=>k.centroid(c)[1]-30).append("xhtml:div").attr("hoverId",c=>(c.data.properties.alias||c.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(c=>{let i=c.data.data[0].value.toString();c.data.data[0].value!==void 0&&(i=p.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(c.data[0].value/q)*100).toFixed(et(p.plotArea.dataLabelDecimalPrecision))+"%":je(p.plotArea.plotAreaDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(c.data.data[0].value));let y="";return p.plotArea.dataLabelName&&(y+=`<span style="
91
- font-size: ${c.data.properties.labelFontSize}px;
92
- color: ${c.data.properties.labelFontColor};
93
- font-style: ${c.data.properties.labelFontStyle.includes(se.italic)?se.italic:""};
94
- text-decoration: ${c.data.properties.labelFontStyle.includes(se.underline)?se.underline:""};
95
- font-weight: ${c.data.properties.labelFontStyle.includes(se.bold)?se.bold:""};
96
- font-family: ${c.data.properties.labelFont};
80
+ V ${y(Se.Dimension)+z/2+5}
81
+ H ${10+Ie}`}).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(Z,B)=>F.includes(Z.Dimension)||Z.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(z){console.error(z)}},ee=(Y,W,I,v,F)=>{try{const z=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,R=mi(z,A);let E=e.connector.connectorFontStyle,k=e.connector.connectorNumberFormat,M=w/30<P.length?Math.round(w/30):P.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(k=".2s");const G=Y.filter((Ie,Oe)=>v!=null?Oe<Y.length-1:Oe<Y.length),Z=d.selectAll(".connector-texts").data([0]),Se=Z.enter().append("g").attr("class","connector-texts connectors").merge(Z).selectAll("text.connector-text").data(G,Ie=>Ie?.Dimension??Ie);Se.exit().remove(),Se.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(Se).attr("y",(Ie,Oe)=>{const lt=I?.[Oe]??{Dimension:Ie.Dimension,Total:0},ut=y(Ie.Dimension)??0;return(y(lt.Dimension)??ut)+v*R/2}).attr("x",(Ie,Oe)=>{const lt=I?.[Oe]??{Total:0},ut=Ie?.Total??0,tt=Math.max(i(lt.Total),i(ut));return e.total.totalVisibility?70+tt:50+tt}).text((Ie,Oe)=>{const lt=I?.[Oe]??{Total:0,CustomTotal:0,Dimension:Ie.Dimension};return Ie.CustomTotal==0&&lt.CustomTotal!=0&&(Ie.CustomTotal=1),ui(lt.Total,Ie.Total,parseInt(e.connector.connectorDecimalPrecision),k,parseInt(Ie.Dimension),parseInt(lt.Dimension),e)}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",E.includes("Italic")?"Italic":"").style("text-decoration",E.includes("Underline")?"Underline":"").style("font-weight",E.includes("Bold")?"Bold":"").style("visibility",(Ie,Oe)=>F.includes(Ie.Dimension)||Ie.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(z){console.error(z)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},sr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.NormalizedStackHorizontalBarChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse(),H=r.DimensionList,D=!0,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p;const C=new Map;let c,d,i,y,f,a,m,P,ie=[],Q=0,Ae,ge=!1,we=[];const fe=!0;let ae={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(xe){be("StackNormalizedStackBarchart","createNormalizedStackBarChart",xe)}},[e]);const ke=()=>{({formatOptions:e,svg:c,width:w,height:p}=kt(S,e)),ce(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,ae.yMinLeft,ae.yMaxLeft,ae.yMinRight,ae.yMaxRight),{margin:U,yLabel:V,xLabel:N,yTitle:$,xTitle:X,dimensionHeightWidthArray:se,chartTitleHeight:re,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Le,visibleBars:Ae,columnWidth:A,scrollbarVisible:ge}=Tt(w,p,pe,ue,ae.yMaxLeft,e,ae.legendList,ae.dimensionList,ae.yMaxRight,j,fe,t,D,ae),Pe(U),vt(c,w,p,e),d=Ct(c,U),mt(d,e,0,O,q,u),me(),Ye(),Ya(e,d,V,q,O,a),Mt(e,D,c,U,N,p,X,ae.chartType,V,O,q),St(q,e,0,D,c,U,$,V,O),Ft(c,e,w,re),Dt(p,c,se,re,w,he,e,[...g].reverse(),L,0,U,nt.rectangle,u,n),Bt(g,p,w,c,U,O,ge,Ae,ae,Q,!1,ve,D)},ce=()=>{const xe=[],Fe=[];let ye=-1/0,ee=1/0;g.forEach((F,z)=>{const R=`${z}~$~${F.properties.legend}`;F.properties.legend=R,Fe.push(R),ye=-1/0,ee=1/0;for(const E of F.data)ye=Math.max(ye,E.value),ee=Math.min(ee,E.value),xe.push(E);F.properties.setColorScale&&C.set(F.properties.legendUniqueId,T.scaleSequential().domain([ee,ye]).interpolator(T.interpolateRgb(F.properties.startColor,F.properties.endColor)))}),ae.chartData=xe,ae.legendList=Fe,ie=JSON.parse(JSON.stringify(g));let Y=pt(ae.dimensionList,g,fe);e.plotArea.fitChart?P=ae.dimensionList:(P=ae.dimensionList.slice(Q,Q+Ae),ie.forEach((F,z)=>ie[z].data=F.data.filter(R=>P.includes(R.dimension))));const W=T.stack().keys(ae.legendList).offset(T.stackOffsetDiverging)(Y);Me();let I=1/0;for(const F of W)for(const[z,R]of F)I=Math.min(I,z);ae.yMinLeft=I>0?0:I,ae.yMaxLeft=1;let v=t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(F=>F):ae.dimensionList;ae.dimensionList.forEach((F,z)=>{ae.formattedDimensionListMap.set(F,v[z])}),e.plotArea.hideZeroValues&&(ae.hideZeroValues=!0)},me=()=>{let xe=st(J||ae.yMaxLeft,ae.yMinLeft,q,e,ae,K,J,D,O).yAxisLabelArray;ae.yMaxLeft=xe[xe.length-1],ae.yMinLeft=xe[0],i=T.scaleLinear().domain([ae.yMinLeft<0?-1:0,1]).range([0,O]),f=[q,0]},Ve=()=>{y=T.scalePoint().domain(P).range(f).padding(.5)},Ye=()=>{a=T.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-q:0).ticks(O/80,"%").tickPadding(8).tickSizeOuter(0)},te=()=>{m=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*O*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,q))},de=xe=>{we.forEach((F,z)=>F.forEach((R,E)=>{xe[z].data[E][0]=R[0]=R.data.total===0?0:R[0]/R.data.total,xe[z].data[E][1]=R[1]=R.data.total===0?0:R[1]/R.data.total})),xe.forEach(F=>{F.data.forEach(z=>{z.hideZero=F.properties.hideZeroValues,z.axis=F.properties.axis})}),P.forEach(F=>{d.append("rect").attr("id",`dim-background-${F}`).attr("class","dimension-background").attr("y",y(F)-y.bandwidth()/2).attr("height",y.bandwidth()).attr("x",0).attr("width",O).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Fe=d.selectAll(".parentGroup").data([we]);Fe=Fe.enter().append("g").attr("class","columns parentGroup").merge(Fe);let ye=Fe.selectAll(".column-group").data(F=>F);ye=ye.enter().append("g").attr("class",F=>"column-group "+F.key.replace(/ /g,"-")).attr("hoverId",F=>(xe[F.index].properties.alias||xe[F.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(ye);let Y=ye.selectAll("rect").data(F=>F);const W=(F,z)=>{const R=Array.from(ye.nodes()).indexOf(F[z].parentNode);return{props:g[R]?.properties,groupIndex:R}},I=Y.enter().append("rect").merge(Y).attr("y",F=>y(F.data.dimension)-A/2).attr("height",A).attr("fill",(F,z,R)=>{const{props:E}=W(R,z);return C.get(E.legendUniqueId)?.(F.data[F.key])??E?.color??"gray"}).attr("stroke",(F,z,R)=>{const E=W(R,z).props;return E?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?E.stackBorderColor:"none"}).attr("stroke-dasharray",(F,z,R)=>W(R,z).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(F,z,R)=>(W(R,z).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",F=>i(0)).attr("width",0).attr("visibility",(F,z,R)=>{const E=W(R,z).props;return F.data[F.key]===0&&E?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,F=>F.key??"").attr(Qe.DimValue,F=>Array.isArray(F.data.dimension)?String(F.data.dimension[0]):String(F.data.dimension)).on("mousemove",(F,z)=>{const R=z.data.dimension;ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ae.formattedDimensionListMap.get(R)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():z.properties?.currentMeasure?z.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||z.value,value:_e(z[1]-z[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:z.properties.alias}],e,F,z.properties,ht(x,String(R??""),{...z.properties,formattedDimensionValue:String(ae.formattedDimensionListMap.get(R)??R??"")}))}).on("mouseout",(F,z)=>{let R=(z.properties.alias||z.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+R+'"]').classed("highlight",!1).classed("unhighlight",!1),rt()}).on("click",At(_,b,(F,z)=>({seriesId:z.key,dimValue:Array.isArray(z.data.dimension)?String(z.data.dimension[0]):String(z.data.dimension),legendUniqueId:z.key,seriesDisplayName:z.properties?.alias||z.properties?.name||""})));(e.animation.animationEnabled?I.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):I).attr("x",F=>Math.min(i(F[0]),i(F[1]))).attr("width",F=>Math.abs(i(F[1])-i(F[0]))),ye.exit().remove(),d.selectAll(".parentGroup").raise()},Pe=xe=>{O=w-xe.left-xe.right,q=p-xe.bottom-xe.top},Ce=()=>{Ve(),te(),Ua(e,d,N,q,O,m,void 0,i,ae.yMaxLeft,P,u,t,w,se,A,y),de(ie),Va(we,y,i,void 0,U,dt,[],[],e,u,p,w,O,P,q,L,c,h,0,o,D)},Me=()=>{let xe=pt(P,ie,fe);we=T.stack().keys(ae.legendList).offset(T.stackOffsetDiverging)(xe),ie.forEach((ye,ee)=>ye.data.forEach((Y,W)=>{Y[0]=we[ee][W][0],Y[1]=we[ee][W][1]}));let Fe=e.annotation.annotationSetLabelColor;we.forEach((ye,ee)=>ye.forEach(Y=>{Y.key=ye.key,ye.color=JSON.parse(JSON.stringify(g[ee].properties.color)),Y.data.labelPosition=g[ee].properties.dataLabelPosition,Y.data.labelColor=Fe=="2"?JSON.parse(JSON.stringify(g[ee].properties.color)):g[ee].properties.labelColor,Y.hideZero=JSON.parse(JSON.stringify(g[ee].properties.hideZeroValues)),Y.properties=g[ee].properties}))},ve=(xe,Fe,ye)=>{ie=Fe,P=xe,Ae=ye,Me(),Ce()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},or=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.LayeredHorizontalBarChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!0,j=!1,K=new Map;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie=[],Q=0,Ae=2,ge=!1,we=[];const fe=!1;let ae={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(ee){be("StackStackHorizontalBarchart","createStackHorizontalBarChart",ee)}},[e]);const ke=()=>{({formatOptions:e,svg:c,width:p,height:C}=kt(S,e)),ce(),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ae.yMinLeft,ae.yMaxLeft,ae.yMinRight,ae.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe,visibleBars:Ae,columnWidth:A,scrollbarVisible:ge}=Tt(p,C,ue,O,ae.yMaxLeft,e,ae.legendList,ae.dimensionList,ae.yMaxRight,j,fe,t,D,ae),Pe(V),vt(c,p,C,e),d=Ct(c,V),mt(d,e,0,q,w,u,L),me(),Ye(),Ya(e,d,N,w,q,a),Mt(e,D,c,V,$,C,se,ae.chartType,N,q,w),St(w,e,0,D,c,V,X,N),Ft(c,e,p,oe),Dt(C,c,re,oe,p,Le,e,g,L,0,V,nt.rectangle,u,n),Bt(g,C,p,c,V,q,ge,Ae,ae,Q,!1,Ce,D)},ce=()=>{const ee=[],Y=[];let W=[],I=-1/0,v=1/0,F=-1/0,z=1/0,R=-1/0,E=1/0;g.forEach(k=>{Y.push(k.properties.legendUniqueId),R=-1/0,E=1/0,k.data.forEach(M=>{ee.push(M),R=Math.max(R,M.value),E=Math.min(E,M.value),I=Math.max(I,M.value),v=Math.min(v,M.value)}),k.properties.setColorScale&&K.set(k.properties.legendUniqueId,T.scaleSequential().domain([E,R]).interpolator(T.interpolateRgb(k.properties.startColor,k.properties.endColor)))}),ae.chartData=ee,ae.legendList=Y,ae.yMaxLeft=I,ae.yMinLeft=v>0?0:v,ae.yMaxRight=F,ae.yMinRight=z,W=t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(k=>k):ae.dimensionList,W=t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(k=>k):ae.dimensionList,ae.dimensionList.forEach((k,M)=>{ae.formattedDimensionListMap.set(k,W[M]),ae.formattedDimensionListMap.set(k,W[M])}),ie=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?P=ae.dimensionList:P=ae.dimensionList.slice(Q,Q+Ae),e.plotArea.hideZeroValues&&(ae.hideZeroValues=!0)},me=()=>{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U,D,q).yAxisLabelArray;ae.yMaxLeft=ee[ee.length-1],ae.yMinLeft=ee[0],i=T.scaleLinear().domain([ae.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:ae.yMinLeft<0?ae.yMinLeft*1.1:ae.yMinLeft*.9,ae.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:ae.yMaxLeft*1.1]).range([0,q]),f=[w,0],Ve()},Ve=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(ae.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=T.scalePoint().domain(P).range(f).padding(.5)},Ye=()=>{te();{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U,D,q);a=T.axisBottom(i).tickFormat(Y=>_e(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-w:0).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue).tickPadding(8).tickSizeOuter(0)}},te=()=>{m=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*q*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,w))},de=ee=>{ee.forEach(Y=>{Y.data.forEach(W=>{W.hideZero=Y.properties.hideZeroValues,W.axis=Y.properties.axis,W.properties=Y.properties})}),ee.forEach((Y,W)=>{let I=d.selectAll(`.parentGroup-${Y.properties.legendUniqueId}`).data([Y],E=>E.properties.legendUniqueId);I=I.enter().append("g").attr("class",`column parentGroup parentGroup-${Y.properties.legendUniqueId}`).attr("clip-path",`url(#${L}-clip)`).merge(I);let v=I.selectAll(".column-group").data(Y.data,E=>E.dimension+"_"+Y.properties.legendUniqueId),F=v.enter().append("g").attr("class","column-group").attr("hoverId",(Y.properties.alias||Y.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",E=>W===0?`translate(0, ${y(E.dimension)-A/2})`:`translate(0, ${y(E.dimension)-A/(2+W*2)})`);v.attr("transform",E=>W===0?`translate(0, ${y(E.dimension)-A/2})`:`translate(0, ${y(E.dimension)-A/(2+W*2)})`),F.merge(v).attr("transform",E=>W===0?`translate(0, ${y(E.dimension)-A/2})`:`translate(0, ${y(E.dimension)-A/(2+W*2)})`);const z=F.append("rect").attr("y",0).attr("height",W===0?A:A/2).attr("x",()=>i(0)).attr("width",0).attr("fill",E=>K.get(Y.properties.legendUniqueId)?.(E.value)??Y.properties.color).attr("stroke-dasharray",()=>Y.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${Y.properties.stackBorderWidth}px`).attr("stroke",()=>Y.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Y.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",E=>E.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>Y.properties.legendUniqueId).attr(Qe.DimValue,E=>Array.isArray(E.dimension)?String(E.dimension[0]):String(E.dimension));(e.animation.animationEnabled?z.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):z).attr("x",E=>E.value>0?i(0):i(E.value)).attr("width",E=>E.value>0?i(E.value)-i(0):Math.abs(i(0)-i(E.value))),v.select("rect").transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("x",E=>E.value>0?i(0):i(E.value)).attr("width",E=>E.value>0?i(E.value)-i(0):Math.abs(i(0)-i(E.value))),F.merge(v).on("mousemove",(E,k)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ae.formattedDimensionListMap.get(k.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():k.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||k.value,value:_e(k.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Y.properties.alias}],e,E,Y.properties,ht(x,String(k.dimension??""),{...Y.properties,formattedDimensionValue:String(ae.formattedDimensionListMap.get(k.dimension)??k.dimension??"")}))}).on("mouseout",()=>{rt()}).on("click",At(_,b,(E,k)=>({seriesId:Y.properties.legendUniqueId,dimValue:Array.isArray(k.dimension)?String(k.dimension[0]):String(k.dimension),legendUniqueId:Y.properties.legendUniqueId,seriesDisplayName:Y.properties.alias||Y.properties.name||""}))),v.exit().remove()}),d.selectAll(".parentGroup").raise()},Pe=ee=>{q=p-ee.left-ee.right,w=C-ee.bottom-ee.top},Ce=(ee,Y,W)=>{ie=Y,P=ee,Ae=W,Me()},Me=()=>{Ve(),te(),Ua(e,d,$,w,q,m,void 0,i,ae.yMaxLeft,P,u,t,p,re,A,y),ve(),de(ie),Da(ie,y,i,void 0,V,dt,[],[],e,u,C,p,q,P,w,L,c,h,void 0,A,o,!1,D),xe()},ve=()=>{let ee=pt(P,ie,fe);we=T.stack().keys(ae.legendList).offset(T.stackOffsetDiverging)(ee),ie.forEach((W,I)=>W.data.forEach((v,F)=>{v[0]=we[I][F][0],v[1]=we[I][F][1]}));let Y=e.annotation.annotationSetLabelColor;we.forEach((W,I)=>W.forEach(v=>{v.key=W.key,W.color=JSON.parse(JSON.stringify(g[I].properties.color)),v.data.labelPosition=g[I].properties.dataLabelPosition,v.data.labelColor=Y=="2"?JSON.parse(JSON.stringify(g[I].properties.color)):g[I].properties.labelColor,v.hideZero=JSON.parse(JSON.stringify(g[I].properties.hideZeroValues))}))},xe=()=>{try{const ee=Number(e.connector?.connectorVisibility);if(!e.connector||ee===2)return;const Y=[],W=[],I=[];let v;const F=[];if(ee===1)v=1;else if(ee===3){const Z=Number(e.connector.connectorFollow);Z===1?v=Number(e.connector.connectorStepSize):Z===2&&((e.connector.connectorExclude||[]).forEach(B=>I.push(B)),v=1)}const z=[],R=[],E=[],k=e.connector?.connectorCustomRange||[];I.forEach(Z=>{const B=Z.split("-");B.length&&z.push(B[0])});const G=(we?.[0]||[]).map((Z,B)=>({Dimension:Z.data.Dimension,Total:Z.data.Total,CustomTotal:Z.data.Total-(E[B]??0),Index:B}));if(v!=null){for(let Z=0;Z<G.length;Z++)(v===1||Z%v===0&&v!==1)&&Y.push(G[Z]);for(let Z=v;Z<G.length;Z+=v){const B=Math.min(Z+v,G.length);let Se=-1/0;for(let ze=Z;ze<B;ze++)G[ze].Total>Se&&(Se=G[ze].Total);Se!==-1/0&&F.push(Se)}for(let Z=1;Z<Y.length;Z++)W.push(Y[Z])}else{const Z=[];(k||[]).forEach(B=>{if(B?.from&&B?.to){const Se=G.some(Ie=>Ie.Dimension===B.from),ze=G.some(Ie=>Ie.Dimension===B.to);Se&&ze&&Z.push({from:B.from,to:B.to})}}),Z.forEach(B=>{const Se=G.findIndex(Ie=>Ie.Dimension===B.from),ze=G.findIndex(Ie=>Ie.Dimension===B.to);if(Se>=0&&ze>=0){const Ie=Math.min(Se,ze),Oe=Math.max(Se,ze);Y.push(G[Ie]);let lt=G[Ie]?.Total??-1/0;for(let ut=Ie;ut<=Oe;ut++)G[ut].Total>lt&&(lt=G[ut].Total);lt!==-1/0&&F.push(lt),W.push(G[Oe])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==De.white?e.connector.connectorMarkerColor:"none"),Fe(Y,F,W,v,z),ye(Y,F,W,v,z)}catch(ee){console.error(ee)}},Fe=(ee,Y,W,I,v)=>{try{d.append("g").selectAll("path").data(ee).enter().filter((F,z)=>I!=null?z<ee.length-1:z<ee.length).append("path").attr("d",(F,z)=>e.total.totalVisibility?`M ${i(F.Total)+50},
82
+ ${y(F.Dimension)+y.bandwidth()/2-5}
83
+ H ${60+Math.max(i(Y[z]),i(W[z].Total),i(F.Total))}
84
+ V ${y(W[z].Dimension)+y.bandwidth()/2+5}
85
+ H ${30+i(W[z].Total)}`:`M ${i(F.Total)+30},
86
+ ${y(F.Dimension)+y.bandwidth()/2-5}
87
+ H ${45+Math.max(i(Y[z]),i(W[z].Total),i(F.Total))}
88
+ V ${y(W[z].Dimension)+y.bandwidth()/2+5}
89
+ H ${10+i(W[z].Total)}
90
+ `).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",F=>v.includes(F.Dimension)||F.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}},ye=(ee,Y,W,I,v)=>{try{let F=e.connector.connectorFontStyle,z=e.connector.connectorNumberFormat,R=w/30<P.length?Math.round(w/30):P.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(z=".2s"),d.append("g").selectAll("text1").data(ee).enter().filter((E,k)=>I!=null?k<ee.length-1:k<ee.length).append("text").attr("y",(E,k)=>I==null?y(W[k].Dimension)/2+y(E.Dimension)/2+15:I==1?R<6&&y.bandwidth()>40?y(W[k].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(W[k].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(W[k].Dimension)+y.bandwidth()/2+y.bandwidth()/2*I+12).attr("x",(E,k)=>e.total.totalVisibility?70+Math.max(i(Y[k]),i(W[k].Total),i(E.Total)):50+Math.max(i(Y[k]),i(W[k].Total),i(E.Total))).text((E,k)=>(E.CustomTotal==0&&W[k].CustomTotal!=0&&(E.CustomTotal=1),ui(W[k].Total,E.Total,parseInt(e.connector.connectorDecimalPrecision),z,parseInt(E.Dimension),parseInt(W[k].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",F.includes("Italic")?"Italic":"").style("text-decoration",F.includes("Underline")?"Underline":"").style("font-weight",F.includes("Bold")?"Bold":"").style("visibility",E=>v.includes(E.Dimension)||E.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:r})=>{const o=crypto.randomUUID(),h=0,n=le.ColumnHistogramChart,l=Te.useRef(),s=r.ChartData,x=r.DimensionList,L=!1,A=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,g=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,H,D,j,K,J,U,V,N,$,X,se,re,oe,he,Le,pe=[],ue=[],O,q,w,p,C,c,d,i,y,f,a,m=[],P=0;const ie=2;let Q={dimensionList:x,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ae()}catch(de){be("HorizontalHistogramChart","createHorizontalChart",de)}},[e]);const Ae=()=>{({formatOptions:e,svg:C,width:O,height:q}=kt(l,e)),ge(),{formatOptions:e}=Qt(e,s,r.DataTableData??[]),{maxNumberForPrimaryAxis:se,maxNumberForSecondaryAxis:re}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:H,yLabel:D,xLabel:j,yTitle:K,xTitle:J,dimensionHeightWidthArray:U,chartTitleHeight:V,secondaryAxisTitleWidth:N,legendMargin:$,secondaryYLabel:X}=Tt(O,q,se,re,Q.yMaxLeft,e,Q.legendList,Q.dimensionList,Q.yMaxRight,A,u,t),Ve(H),{dataTable:w,dataTableHeight:p}=ea(e,D,K,s,Q.dimensionList),vt(C,O,q,e),c=Ct(C,H),mt(c,e,p,oe,he,n),we(),ae(),ke(),qt(c,Q,j,e,p,d,f,U,q,h,t,oe,he,a,d),Gt(c,e,p,D,y,he),Ye(s,q,C,H,oe),Mt(e,L,C,H,j,q,J,Q.chartType,D,oe,he),St(he,e,p,L,C,H,K,D),Ut(C,A,H,e,p,he,oe,X,N),Ft(C,e,O,V),Dt(q,C,U,V,O,$,e,s,o,p,H,nt.rectangle)},ge=()=>{const de=[],Pe=[];let Ce=[],Me=-1/0,ve=1/0;s.forEach(ye=>{Pe.push(ye.legend),ye.data.forEach(ee=>{de.push(ee),Me=Math.max(Me,ee.value),ve=Math.min(ve,ee.value)})}),Q.chartData=de,Q.legendList=Pe,Q.yMaxLeft=Me,Q.yMinLeft=ve>0?0:ve,m=JSON.parse(JSON.stringify(s)),m.forEach(ye=>ye.data.forEach(ee=>Ce.push(ee.value)));let xe=S||S==0?S:0,Fe=b||b==0?b:m[0]?.data?.length;if(Q.yMaxLeft=parseFloat((xe+"").length>(Fe+"").length?xe+"":Fe+""),Q.xMax=T.max(Ce),Q.xMin=T.min(Ce),Q.xMin===Q.xMax){const ye=Q.xMax===0?1:Math.abs(Q.xMax*.1);Q.xMin-=ye,Q.xMax+=ye}},we=()=>{switch(e.bins.binsCalculation){case"Automatic":Le=he/50;break;case"Number of Bins":fe(!1);break;case"Bin Width":fe(!0)}},fe=de=>{m.forEach(ve=>ve.data.sort((xe,Fe)=>xe.value-Fe.value));let Pe=Q.xMax-Q.xMin,Ce;de?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),Ce=Pe/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),Ce=Pe/parseFloat(e.bins.binsCalculationValue));let Me=Q.xMin;if(de)for(pe=[Me];Me<Q.xMax;)Me+=Ce,pe.push(Me);else for(pe=[Me];Math.round(Me)<Math.round(Q.xMax);)Me+=Ce,pe.push(Math.round(Me))},ae=()=>{d=T.scaleLinear().domain([Q.xMin,Q.xMax]).range([he,0]);const de=pe.length>0?pe:d.ticks(Le);let Pe=T.bin().value(Me=>Me).domain(d.domain()).thresholds(de);m.forEach(Me=>{let ve=Pe(Me.data.map(xe=>xe.value));ue.push(ve)}),m.forEach((Me,ve)=>ue[ve].forEach(xe=>{xe.name=Me.properties.legend,xe.color=Me.properties.color,xe.opacity=Me.properties.opacity}));let Ce=[];ue.forEach(Me=>Me.forEach(ve=>Ce.push(ve.length))),Q.yMaxLeft=T.max(Ce),Q.yMinLeft=T.min(Ce),i=T.scaleLinear().domain([_||_==0?_:0,g||g==0?g:Q.yMaxLeft+.2*Q.yMaxLeft]).range([0,oe])},ke=()=>{ce();{let de=st(Q.yMaxLeft,Q.yMinLeft,oe,e,Q,S,b,!1,he);f=T.axisBottom(i).tickFormat(Pe=>_e(Pe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-he+0:0).tickValues(de.autoLabelFlag?void 0:de.yAxisLabelArray).ticks(de.customTickValue).tickPadding(8).tickSizeOuter(0)}},ce=()=>{hi(Q.xMax,Q.xMin,he,e,_,g,oe,!1).xAxisLabelArray.shift(),y=T.axisLeft(d).tickFormat(Pe=>_e(Pe,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-oe:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(Le):y.tickValues(pe).ticks(he/50)},me=de=>{const Pe=e.animation.animationEnabled,Ce=c.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(ue).enter().append("g").selectAll("rect").data(ve=>ve).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",0).attr("y",ve=>{const xe=d(ve.x0),Fe=d(ve.x1);return Math.min(xe,Fe)}).attr("height",ve=>{const xe=d(ve.x0),Fe=d(ve.x1),ye=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(Fe-xe)-ye)}).attr("width",0).style("fill",ve=>ve.color!==De.white?ve.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(ve,xe)=>{ot([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():xe.properties?.currentMeasure?xe.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${xe.x0}-${xe.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:_e(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(xe.length/m[0].data.length):xe.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,ve)}).on("mouseout",rt);(Pe?Ce.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ce).attr("width",ve=>i(ve.length)),c.selectAll(".parentGroup").raise()},Ve=de=>{oe=O-de.left-de.right,he=q-de.bottom-de.top},Ye=(de,Pe,Ce,Me,ve)=>{if(!e.plotArea.fitChart){const xe=de[0].data.length-ie,Fe=Pe-20;a=Q.dimensionList.slice(P,P+ie),m=JSON.parse(JSON.stringify(de)),m.forEach((Y,W)=>m[W].data=Y.data.filter(I=>a.includes(I.dimension))),Ce.append("rect").attr("x",Me.left).attr("y",Fe).attr("width",ve).attr("height",8).attr("fill","#ddd").attr("rx",4);const ye=ve*ie/Q.dimensionList.length,ee=Ce.append("rect").attr("x",Me.left).attr("y",Fe).attr("width",ye).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",Y=>{let W=Math.min(Math.max(Y.x,Me.left),Me.left+ve-ye);ee.attr("x",W),P=Math.round((W-Me.left)/(ve-ye)*xe),a=Q.dimensionList.slice(P,P+ie),m=JSON.parse(JSON.stringify(de)),m.forEach((I,v)=>m[v].data=I.data.filter(F=>a.includes(F.dimension))),ce(),te()}));Ce.on("wheel",Y=>{Y.preventDefault();const W=Math.abs(Y.deltaX)>Math.abs(Y.deltaY)?Y.deltaX:Y.deltaY;P+=W>0?1:-1,P=Math.max(0,Math.min(P,xe));const I=Me.left+(ve-ye)*P/xe;ee.attr("x",I),m=JSON.parse(JSON.stringify(de)),m.forEach((v,F)=>m[F].data=v.data.filter(z=>a.includes(z.dimension))),ce(),te()})}te()},te=()=>{Gt(c,e,p,D,y,he),me()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"className",ref:l,id:o,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID(),A=0,u=le.AreaChart,S=Te.useRef(),b=Te.useRef(s);b.current=s;const _=Te.useRef(x);_.current=x;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1;let j=!1;const K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke=[],ce=0,me,Ve,Ye,te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(W){be("Linechart","createLineChart",W)}},[e]);const de=()=>{({formatOptions:e,svg:f,width:c,height:d}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:w,customYaxisMaxValue:U,secondaryCustomYaxisMaxValue:N}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:$,yLabel:X,xLabel:se,yTitle:re,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Le,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:me,columnWidth:Ve,scrollbarVisible:Ye}=Tt(c,d,q,w,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,K,t,!1,te),ye($),{dataTable:i,dataTableHeight:y}=ea(e,X,re,g,te.dimensionList,r),vt(f,c,d,e),a=Ct(f,$),mt(a,e,y,p,C,u,L),Ce(),ve(),Gt(a,e,y,X,ge,C),j&&oi(a,e,y,O,fe,C,p),Mt(e,D,f,$,se,d,oe,te.chartType,X,p,C),St(C,e,y,D,f,$,re,X),Ut(f,j,$,e,y,C,p,O,pe),Ft(f,e,c,Le),Dt(d,f,he,Le,c,ue,e,g,L,y,$,nt.areaWithLine,u,n),Bt(g,d,c,f,$,p,Ye,me,te,ce,!1,ee)},Pe=()=>{const W=[],I=[];let v=[],F=-1/0,z=1/0,R=-1/0,E=1/0;e.plotArea.hideZeroValues&&(te.hideZeroValues=!0,g.forEach(k=>{k.data=k.data.filter(M=>M.value!==0)})),g.forEach(k=>{I.push(k.properties.alias?k.properties.alias:k.legend),k.data.forEach(M=>{W.push(M),k.properties.axis==="Secondary"?(j=!0,R=Math.max(R,M.value),E=Math.min(E,M.value)):(F=Math.max(F,M.value),z=Math.min(z,M.value))})}),te.chartData=W,te.legendList=I,te.yMaxLeft=F,te.yMinLeft=z>0?0:z,te.yMaxRight=R,te.yMinRight=E>0?0:E,v=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(k=>k):te.dimensionList,te.dimensionList.forEach((k,M)=>{te.formattedDimensionListMap.set(k,v[M])}),ke=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ae=te.dimensionList:ae=te.dimensionList.slice(ce,ce+me)},Ce=()=>{let W=st(U||te.yMaxLeft,te.yMinLeft,C,e,te,J,U).yAxisLabelArray;if(te.yMaxLeft=W[W.length-1],te.yMinLeft=W[0],m=T.scaleLinear().domain([te.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:te.yMaxLeft*1.1]).range([y>0?C-y:C,0]),j&&(P=T.scaleLinear().domain([te.yMinRight>=0?(V||V==0)&&!Number.isNaN(V)?V:0:(V||V==0)&&!Number.isNaN(V)?V:te.yMinRight*1.1,te.yMaxRight<=0?N||0:N||te.yMaxRight*1.1]).range([y>0?C-y:C,0])),Q=[0,p],e.seriesLabel.seriesLabelVisibility){let I=aa(p,m,e,ke,void 0,j,C);I.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Ae=I.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,p-I.heightWidth[0]]:Q=[I.heightWidth[0],p]}},Me=()=>{ie=T.scalePoint().domain(ae).range(Q).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{xe();{let W=st(U||te.yMaxLeft,te.yMinLeft,C,e,te,J,U);ge=T.axisLeft(m).tickFormat(I=>_e(I,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,p,Ae)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue??C/30).tickPadding(8).tickSizeOuter(0)}if(j){let W=st(N||te.yMaxRight,V||te.yMinRight,C,e,te,V,N);fe=T.axisRight(P).tickFormat(I=>_e(I,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue??C/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-p:0).tickSizeOuter(0)}},xe=()=>{we=T.axisBottom(ie).tickSize(ia(e,C,y,!0)).tickSizeOuter(0).tickValues(Lt(ae,p))},Fe=W=>{const I=e.plotArea.plotAreaHideLineAndMarkers;W.forEach(G=>{G.data.forEach(Z=>{Z.hideZero=G.properties.hideZeroValues,Z.axis=G.properties.axis})});const v=T.area().x(G=>ie(G.dimension)?ie(G.dimension):null).y0(G=>G.axis===at.primary?m(0):P(0)).y1(G=>G.axis===at.primary?m(G.value):P(G.value)).defined(G=>G.hideZero?!!G.value:!0).curve(Ot(e)),F=T.area().x(G=>ie(G.dimension)?ie(G.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(G=>G.hideZero?!!G.value:!0).curve(Ot(e)),z=e.animation.animationEnabled;let R=a.selectAll(".parentGroup").data([W]),E=a.append("g").attr("class","focusClass");R=R.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${L}-clip)`).merge(R);let k=R.selectAll(".area-group").data(G=>G),M=k.enter().append("g").attr("class","area-group");M.append("path").attr("class","area parentGroup").attr("fill",G=>G.properties.color!==De.white?G.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",G=>(G.properties?.alias||G.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",G=>F(G.data)).attr(Qe.SeriesId,G=>G.properties.legendUniqueId).attr(Qe.DimValue,G=>G.properties.alias||G.properties.name||"").on("click",At(_,b,(G,Z)=>({seriesId:Z.properties.legendUniqueId,dimValue:Z.properties.alias||Z.properties.name||"",legendUniqueId:Z.properties.legendUniqueId,seriesDisplayName:Z.properties.alias||Z.properties.name||""}))).each(function(G){z?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",v(G.data)):T.select(this).attr("d",v(G.data))}),M.merge(k).each(function(G){const Z=T.select(this);Z.selectAll("path.visibleLine").data([G]).join("path").attr("class","visibleLine parentGroup").attr("d",B=>z?F(B.data):v(B.data)).attr("stroke",B=>B.properties.areaBorderColor!==De.white?B.properties.areaBorderColor:"none").attr("stroke-dasharray",B=>{const Se=parseInt(B.properties.lineWidth);switch(B.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",B=>B.properties.lineStyle===yt.dotted?sa.round:sa.butt).attr("stroke-width",B=>I?B.properties.lineStyle!==yt.none&&e.plotArea.plotAreaHideLineAndMarkers?B.properties.lineWidth:"0":0).attr("fill","none").each(function(B){z&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",v(B.data))}),Z.selectAll("path.hoverLine").data([G]).join("path").attr("class","hoverLine").attr("d",B=>v(B.data)).attr("fill",De.transparent).attr("stroke","none").style("pointer-events","all").raise(),di(e,R,E,ae,W,ie,m,u)}),k.exit().remove(),Ca(R,W,u,ie,m,P,null,e,te,N,V,J,U,!1,l),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ye=W=>{p=c-W.left-W.right,C=d-W.bottom-W.top},ee=(W,I,v)=>{ke=I,ae=W,me=v,Y()},Y=()=>{Me(),xe(),Da(g,ie,m,P,$,dt,[],[],e,u,d,c,p,ae,C,L,f,h,void 0,void 0,o);let W=aa(p,m,e,ke,void 0,j,C).labelArray;qt(a,te,se,e,y,m,we,he,d,A,t,p,C,ae,ie),Fe(ke),za(e,a,W),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,m,ie,void 0,void 0,void 0,y,u,e,X,re,ae,p,Q,te.formattedDimensionListMap,L,$,C))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.StackAreaChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w=new Map,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae=[],ke=0,ce,me,Ve,Ye=[];const te=!1;let de={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(v){be("StackAreaChart","createAreaChart",v)}},[e]);const Pe=()=>{({formatOptions:e,svg:f,width:c,height:d}=kt(S,e)),Ce(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:q}=Nt(e,de.yMinLeft,de.yMaxLeft,de.yMinRight,de.yMaxRight),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ce,columnWidth:me,scrollbarVisible:Ve}=Tt(c,d,O,q,de.yMaxLeft,e,de.legendList,de.dimensionList,de.yMaxRight,j,te,t,!1,de),ee(N),{dataTable:i,dataTableHeight:y}=ea(e,$,se,g,de.dimensionList,r),vt(f,c,d,e),a=Ct(f,N),mt(a,e,y,p,C,u,L),Me(),xe(),Gt(a,e,y,$,ge,C),Mt(e,D,f,N,X,d,re,de.chartType,$,p,C),St(C,e,y,D,f,N,se,$),Ut(f,j,N,e,y,C,p,ue,Le),Ft(f,e,c,he),Dt(d,f,oe,he,c,pe,e,[...g].reverse(),L,y,N,nt.areaWithLine,u,n),Bt(g,d,c,f,N,p,Ve,ce,de,ke,!1,Y,D)},Ce=()=>{const v=[],F=[];e.plotArea.hideZeroValues&&(de.hideZeroValues=!0,g.forEach(G=>{G.data=G.data.filter(Z=>Z.value!==0)})),g.forEach((G,Z)=>{const B=`${Z}~$~${G.properties.alias}`;G.properties.legend=B,F.push(B);for(const Se of G.data)v.push(Se)}),de.chartData=v,de.legendList=F,ae=JSON.parse(JSON.stringify(g));let z=pt(de.dimensionList,g,te);e.plotArea.fitChart?fe=de.dimensionList:(fe=de.dimensionList.slice(ke,ke+ce),ae.forEach((G,Z)=>ae[Z].data=G.data.filter(B=>fe.includes(B.dimension))));const R=T.stack().keys(de.legendList).offset(T.stackOffsetNone)(z);I();let E=1/0,k=-1/0;for(const G of R)for(const[Z,B]of G)E=Math.min(E,Z),k=Math.max(k,B);de.yMinLeft=E>0?0:E,de.yMaxLeft=k;let M=t?gt(e.xAxisLabel.xAxisNumberFormat,de.dimensionList).map(G=>G):de.dimensionList;de.dimensionList.forEach((G,Z)=>{de.formattedDimensionListMap.set(G,M[Z])})},Me=()=>{let v=st(J||de.yMaxLeft,de.yMinLeft,C,e,de,K,J).yAxisLabelArray;if(de.yMaxLeft=v[v.length-1],de.yMinLeft=v[0],m=T.scaleLinear().domain([de.yMinLeft>=0?K!==void 0&&!Number.isNaN(K)?K:0:de.yMinLeft<0?de.yMinLeft*1.1:de.yMinLeft*.9,de.yMaxLeft<=0?0:J!==void 0&&!Number.isNaN(J)?J:de.yMaxLeft*1.1]).range([y>0?C-y:C,0]),Q=[0,p],e.seriesLabel.seriesLabelVisibility){let F=aa(p,m,e,g,void 0,j,C,!0);F.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Ae=F.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,p-F.heightWidth[0]]:Q=[F.heightWidth[0],p]}},ve=()=>{ie=T.scalePoint().domain(fe).range(Q).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},xe=()=>{{let v=st(J||de.yMaxLeft,de.yMinLeft,C,e,de,K,J);ge=T.axisLeft(m).tickFormat(F=>_e(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,p,Ae)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{we=T.axisBottom(ie).tickSize(ia(e,C,y,!0)).tickSizeOuter(0).tickValues(Lt(fe,p))},ye=v=>{const F=e.animation.animationEnabled,z=e.plotArea.plotAreaHideLineAndMarkers;v.forEach(B=>{B.data.forEach(Se=>{Se.hideZero=B.properties.hideZeroValues,Se.axis=B.properties.axis})});const R=T.area().x(B=>ie(B.data.dimension)?ie(B.data.dimension):null).y0(B=>m(B[0])).y1(B=>m(B[1])).defined(B=>B.data.hideZero?!!B.data.key:!0).curve(Ot(e)),E=T.area().x(B=>ie(B.data.dimension)?ie(B.data.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(B=>B.data.hideZero?!!B.data.key:!0).curve(Ot(e));let k=a.selectAll(".lineGroup").data([Ye]),M=a.append("g").attr("class","focusClass");k=k.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${L}-clip)`).merge(k);let G=k.selectAll(".area-group").data(B=>B),Z=G.enter().append("g").attr("class",B=>"area-group "+B.key.replace(/ /g,"-"));Z.append("path").attr("hoverId",B=>(v[B.index].properties.alias||v[B.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",B=>B.color!==De.white?B.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",B=>E(B)).attr(Qe.SeriesId,B=>g[B.index]?.properties?.legendUniqueId??B.key).attr(Qe.DimValue,B=>g[B.index]?.properties?.alias||g[B.index]?.properties?.name||"").on("click",At(_,b,(B,Se)=>{const ze=g[Se.index]?.properties?.legendUniqueId??Se.key,Ie=g[Se.index]?.properties?.alias||g[Se.index]?.properties?.name||"";return{seriesId:ze,dimValue:Ie,legendUniqueId:ze,seriesDisplayName:Ie}})).each(function(B){F?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",R(B)):T.select(this).attr("d",R(B))}),Z.merge(G).each(function(B,Se){const ze=T.select(this);ze.selectAll("path.visibleLine").data([B]).join("path").attr("class","visibleLine parentGroup").attr("d",Ie=>F?E(Ie):R(Ie)).attr("stroke",Ie=>Ie.color!==De.white?g[Se].properties.areaBorderColor:"none").attr("stroke-dasharray",Ie=>{const Oe=parseInt(g[Se].properties.lineWidth.toString());switch(g[Se].properties.lineStyle){case yt.dotted:return`0,${Oe+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[Se]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>z?g[Se].properties.lineStyle!==yt.none?g[Se].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(Ie){F&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",R(Ie))}),ze.selectAll("path.hoverLine").data([B]).join("path").attr("class","hoverLine").attr("d",Ie=>R(Ie)).attr("fill",De.transparent).attr("stroke","none").style("pointer-events","all").raise(),f.selectAll('[hoverId="'+(g[B.index].properties.alias||g[B.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),G.exit().remove(),di(e,k,M,fe,v,ie,m,u,!0),Ca(k,v,u,ie,m,P,null,e,de,V,U,K,J,!1,x),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ee=v=>{p=c-v.left-v.right,C=d-v.bottom-v.top},Y=(v,F,z)=>{ae=F,fe=v,ce=z,Ka(r,w,fe),I(),W()},W=()=>{ve(),Fe(),qt(a,de,X,e,y,m,we,oe,d,A,t,p,C,fe,ie),ye(ae),Va(Ye,ie,m,P,N,dt,[],[],e,u,d,c,p,fe,C,L,f,h,y,o);let v=aa(p,m,e,ae,void 0,j,C,!0).labelArray;za(e,a,v),qa(w,ie,m,N,dt,[],e,u,d,c,f,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,m,ie,void 0,void 0,void 0,y,u,e,$,se,de.dimensionList,p,Q,de.formattedDimensionListMap,L,N,C))},I=()=>{let v=pt(fe,ae,te);Ye=T.stack().keys(de.legendList).offset(T.stackOffsetNone)(v),ae.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=Ye[R][k][0],E[1]=Ye[R][k][1]}));let F=e.annotation.annotationSetLabelColor;Ye.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(g[R].properties.color)),E.data.labelPosition=g[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues)),E.properties=g[R].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},ur=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.NormalizedStackAreaChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe=[],ae=0,ke,ce,me,Ve=[];const Ye=!0;let te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(I){be("NormalizedLinechart","createLineChart",I)}},[e]);const de=()=>{({formatOptions:e,svg:y,width:C,height:c}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:me,scrollbarVisible:ce}=Tt(C,c,O,q,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,Ye,t,!1,te),ye(N),{dataTable:d,dataTableHeight:i}=ea(e,$,se,g,te.dimensionList,r),vt(y,C,c,e),f=Ct(y,N),mt(f,e,i,w,p,u),Ce(),ve(),Gt(f,e,i,$,Ae,p),Mt(e,D,y,N,X,c,re,te.chartType,$,w,p),St(p,e,i,D,y,N,se,$),Ut(y,j,N,e,i,p,w,ue,Le),Ft(y,e,C,he),Dt(c,y,oe,he,C,pe,e,[...g].reverse(),L,i,N,nt.areaWithLine,u,n),Bt(g,c,C,y,N,w,ce,ke,te,ae,!1,ee)},Pe=()=>{const I=[],v=[];e.plotArea.hideZeroValues&&(te.hideZeroValues=!0,g.forEach(k=>{k.data=k.data.filter(M=>M.value!==0)})),g.forEach((k,M)=>{const G=`${M}~$~${k.properties.alias}`;k.properties.legend=G,v.push(G);for(const Z of k.data)I.push(Z)}),te.chartData=I,te.legendList=v,fe=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?we=te.dimensionList:(we=te.dimensionList.slice(ae,ae+ke),fe.forEach(k=>{k.data=k.data.filter(M=>we.includes(M.dimension))}));const F=pt(te.dimensionList,g,Ye),z=T.stack().keys(te.legendList).offset(T.stackOffsetNone)(F);W();let R=1/0;for(const k of z)for(const[M]of k)R=Math.min(R,M);te.yMinLeft=R>0?0:R,te.yMaxLeft=1;const E=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(k=>k):te.dimensionList;te.formattedDimensionListMap=new Map(te.dimensionList.map((k,M)=>[k,E[M]]))},Ce=()=>{if(a=T.scaleLinear().domain([te.yMinLeft<0?-1:0,1]).range([i>0?p-i:p,0]),ie=[0,w],e.seriesLabel.seriesLabelVisibility){let I=aa(w,a,e,g,void 0,j,p,!0);I.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Q=I.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ie=[0,w-I.heightWidth[0]]:ie=[I.heightWidth[0],w]}},Me=()=>{P=T.scalePoint().domain(we).range(ie).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{Ae=T.axisLeft(a).tickSize(Pt(e,w,Q)).ticks(i>0?(p-i)/80:p/80,"%").tickPadding(8).tickSizeOuter(0)},xe=()=>{ge=T.axisBottom(P).tickSize(ia(e,p,i,!0)).tickSizeOuter(0).tickValues(Lt(we,w))},Fe=I=>{const v=e.animation.animationEnabled,F=e.plotArea.plotAreaHideLineAndMarkers;Ve.forEach((Z,B)=>Z.forEach((Se,ze)=>{const Ie=Se.data.total;I[B].data[ze]&&(I[B].data[ze][0]=Se[0]=Ie===0?0:Se[0]/Ie,I[B].data[ze][1]=Se[1]=Ie===0?0:Se[1]/Ie)})),I.forEach(Z=>{Z.data.forEach(B=>{B.hideZero=Z.properties.hideZeroValues,B.axis=Z.properties.axis})});const z=T.area().x(Z=>P(Z.data.dimension)?P(Z.data.dimension):null).y0(Z=>a(Z[0])).y1(Z=>a(Z[1])).defined(Z=>Z.data.hideZero?!!Z[0]:!0).curve(T.curveLinear),R=T.area().x(Z=>P(Z.data.dimension)?P(Z.data.dimension):null).y0(()=>a(0)).y1(()=>a(0)).defined(Z=>Z.data.hideZero?!!Z.data.key:!0).curve(Ot(e));let E=f.selectAll(".lineGroup").data([Ve]),k=f.append("g").attr("class","focusClass");E=E.enter().append("g").attr("class","areas lineGroup").merge(E);let M=E.selectAll(".area-group").data(Z=>Z),G=M.enter().append("g").attr("class",Z=>"area-group "+Z.key.replace(/ /g,"-"));G.append("path").attr("hoverId",Z=>(I[Z.index]?.properties?.alias||I[Z.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Z=>Z.color!==De.white?Z.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",Z=>R(Z)).attr(Qe.SeriesId,Z=>g[Z.index]?.properties?.legendUniqueId??Z.key).attr(Qe.DimValue,Z=>g[Z.index]?.properties?.alias||g[Z.index]?.properties?.name||"").on("click",At(_,b,(Z,B)=>{const Se=g[B.index]?.properties?.legendUniqueId??B.key,ze=g[B.index]?.properties?.alias||g[B.index]?.properties?.name||"";return{seriesId:Se,dimValue:ze,legendUniqueId:Se,seriesDisplayName:ze}})).each(function(Z){const B=T.select(this);v?B.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",z(Z)):B.attr("d",z(Z))}),G.merge(M).each(function(Z,B){const Se=T.select(this);Se.selectAll("path.visibleLine").data([Z]).join("path").attr("class","visibleLine parentGroup").attr("d",ze=>v?R(ze):z(ze)).attr("stroke",ze=>ze.color!==De.white?g[B].properties.areaBorderColor:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[B].properties.lineWidth.toString());switch(g[B].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[B]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>F?g[B].properties.lineStyle!==yt.none?g[B].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(ze){v&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",z(ze))}),Se.selectAll("path.hoverLine").data([Z]).join("path").attr("class","hoverLine").attr("d",ze=>z(ze)).attr("fill",De.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+yi((I[Z.index]?.properties?.alias||I[Z.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),M.exit().remove(),di(e,E,k,we,I,P,a,u,!0),f.selectAll(".parentGroup").raise(),f.selectAll(".hoverLine").raise(),Ca(E,I,u,P,a,m,null,e,te,V,U,K,J,!0,x),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,d,A,a,P,void 0,void 0,void 0,i,u,e,$,se,te.dimensionList,w,ie,te.formattedDimensionListMap,L,N,p))},ye=I=>{w=C-I.left-I.right,p=c-I.bottom-I.top},ee=(I,v,F)=>{fe=v,we=I,ke=F,W(),Y()},Y=()=>{Me(),xe(),qt(f,te,X,e,i,a,ge,oe,c,A,t,w,p,we,P),Fe(fe),Va(Ve,P,a,m,N,dt,[],[],e,u,c,C,w,we,p,L,y,h,i,o,!1);let I=aa(w,a,e,fe,void 0,j,p,!0).labelArray;za(e,f,I)},W=()=>{let I=pt(we,fe,Ye);Ve=T.stack().keys(te.legendList).offset(T.stackOffsetNone)(I),fe.forEach((F,z)=>F.data.forEach((R,E)=>{Ve[z][E]&&(R[0]=Ve[z][E][0],R[1]=Ve[z][E][1])}));let v=e.annotation.annotationSetLabelColor;Ve.forEach((F,z)=>F.forEach(R=>{R.key=F.key,F.color=JSON.parse(JSON.stringify(g[z].properties.color)),R.data.labelPosition=g[z].properties.dataLabelPosition,R.data.labelColor=v=="2"?JSON.parse(JSON.stringify(g[z].properties.color)):g[z].properties.labelColor,R.hideZero=JSON.parse(JSON.stringify(g[z].properties.hideZeroValues)),R.properties=g[z].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},Oa={left:"Left",right:"Right",center:"Center"},zt={left:"left",right:"right",top:"top",bottom:"bottom"},Ha={solid:"solid",dashed:"Dashed",dotted:"Dotted"},ei={rounded:"rounded",pill:"pill",extra_rounded:"extra_rounded",squircle:"squircle",rectangle:"rectangle"},ca={curve:"curve",elbow:"elbow",diagonal:"diagonal",s_curve:"s-curve",arc:"arc",reverse_elbow:"reverse-elbow",zigzag:"zigzag"},el="PieFamilyCommonFunctions.ts",hr=(t,e,r,o)=>{try{let h=t.total.totalPosition,n=t.total.totalAlignment,l=t.legends.legendPosition,s=0;switch(h){case va.top:switch(s=l=="Top"?35:0,n){case $t.start:return{x:5,y:e+s+10};case $t.middle:return{x:r/2,y:e+s+10};case $t.end:return{x:r-20,y:e+s+10}}break;case va.bottom:switch(s=l=="Bottom"?30:0,n){case $t.start:return{x:10,y:o-s-10};case $t.middle:return{x:r/2,y:o-s-10};case $t.end:return{x:r-20,y:o-s-10}}break}}catch(h){be(el,"getTotalValueCords",h)}},fi=(t,e,r,o,h,n)=>{try{if(t.total&&t.total.totalVisibility){let l=t.total.totalFontStyle,s=t.total.totalAlignment,x=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":je(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),L=hr(t,r,h,n);const A=o.append("g").attr("transform",`translate(${L.x}, ${L.y})`).style("user-select","none");A.append("text").text(t.total.showTotalLabel!==!1?`${t.total.editTotalTextToggle?t.total.editTotalText:"Total"} : ${x}`:x).style("fill",t.total.totalColor!==De.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",l.includes(ne.italic)?ne.italic:"").style("text-decoration",l.includes(ne.underline)?ne.underline:"").style("font-weight",l.includes(ne.bold)?ne.bold:"").attr("text-anchor",s===$t.start?"start":s===$t.middle?"middle":s===$t.end?"end":""),t.animation?.animationEnabled&&A.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(Xe[t.animation.animationEffect]).attr("opacity",1)}}catch(l){be(el,"drawTotalValue",l)}},Ea="PieChart.tsx",xr=({data:t,formatOptions:e,chartId:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=Te.useRef(),A=Te.useRef(l);A.current=l;const u=Te.useRef(s);u.current=s;const S=bt(t.ChartData);let b,_,g,H=40,D=Ht,j=[0,0],K,J,U,V,N,$,X,se,re=!1;Te.useEffect(()=>{oe()},[e]);const oe=()=>{({chartFormatOptions:b,svg:N,width:g,height:_}=Jt(L,e)),he(),j=Ia(b,S),{margins:D,innerHeight:K,innerWidth:J,legendListWidth:se,chartTitleHeight:H}=Na(b,g,_,j,D),Le(),jt(L,g,_,b),V=la(N,D),_t(L,H,g,b),Pa(b,N,S,g,_,se,H,r,D,nt.circle,void 0,n),pe(),ue(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?Qi(dt,$,b,O(),le.PieChart,g,_,V,Math.min(K*.5,J*.5),o,h):w(),fi(b,X,H,N,g,_)},he=()=>{try{X=0,t.ChartData.forEach(p=>{p.properties.dataLabelPosition=="2"&&(re=!0),X+=p.data[0].value})}catch(p){be(Ea,"loopOverSeriesData",p)}},Le=()=>{try{U=Math.min(K*.5,J*.5),re&&(U=U*.9)}catch(p){be(Ea,"defineChartRadius",p)}},pe=()=>{try{let p=et(b.plotArea.rotation);const C=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;$=T.pie().value(i=>Math.abs(C?100:i.data[0].value)).startAngle((p??0)*(Math.PI/180)%360).endAngle(((p??0)+360)*(Math.PI/180)%360)(t.ChartData).map((i,y)=>({...i,x0:i.startAngle,x1:i.endAngle,y0:0,y1:U,depth:2}))}catch(p){be(Ea,"initPieChartData",p)}},ue=()=>{try{const p=T.arc().innerRadius(0).outerRadius(U),C=T.arc().innerRadius(0).outerRadius(U+10),c=V.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data($).enter().append("path").attr("class",d=>"path").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",d=>d.data.properties.color!==De.white?d.data.properties.color:"none").attr(Qe.SeriesId,d=>d.data.properties.legendUniqueId??d.data.properties.name??"").attr(Qe.DimValue,d=>d.data.properties.alias||d.data.legend||"").on("click",At(u,A,(d,i)=>({seriesId:i.data.properties.legendUniqueId??i.data.properties.name??"",dimValue:i.data.properties.alias||i.data.legend||"",legendUniqueId:i.data.properties.legendUniqueId??i.data.properties.name??"",seriesDisplayName:i.data.properties.alias||i.data.properties.name||""}))).on("mouseover.arc",function(d){T.select(this).transition().duration(100).attr("d",C)}).on("mousemove. ",d=>{ot([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(d.currentTarget.__data__.data.data[0].value/X)*100).toFixed(et(b.toolTip.toolTipDecimalPrecision))+"%":je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(d.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:d.currentTarget.__data__.data.properties.alias}],b,void 0,d.currentTarget.__data__.data.properties,ht(x,String(d.currentTarget.__data__.data.legend??""),d.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(d){T.select(this).transition().duration(100).attr("d",p),rt()});b.animation.animationEnabled?c.transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attrTween("d",function(d){const i=T.interpolate({startAngle:d.startAngle,endAngle:d.startAngle},d);return y=>p(i(y))}):c.attr("d",d=>p(d))}catch(p){be(Ea,"drawPieChart",p)}},O=()=>{try{return`translate(${J/2},${K/2})`}catch(p){return be(Ea,"getPiePosition",p),""}},q=(p,C)=>{try{if(C)return"translate(0 0)";{const c=(p.startAngle+p.endAngle)/2,d=Math.cos(c-Math.PI/2)*(U*.65),i=Math.sin(c-Math.PI/2)*(U*.65);let y=c*180/Math.PI%360,f=0;return y>180&&y<360?f=90:f=-90,y+=f,`translate(${d},${i}) rotate(${y})`}}catch(c){return be(Ea,"getDataLabelTransformString",c),""}},w=()=>{try{if(b.plotArea.dataLabels){const p=$&&$.length===1;V.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.labelFontSize??11).attr("fill",d=>d.data.properties?.labelFontColor??De.black).attr("font-style",d=>d.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",d=>d.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",d=>d.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",d=>d.data.properties?.labelFont??qe).attr("transform",d=>q(d,p)).attr("visibility",d=>d.endAngle-d.startAngle<.09&&e.plotArea.hideInsignificantValue?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(d=>{const{plotArea:i}=b;return i.dataLabelName?d.data.properties?.alias||d.data.legend:""}),V.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.valueFontSize??11).attr("fill",d=>d.data.properties?.valueFontColor??De.black).attr("font-style",d=>d.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",d=>d.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",d=>d.data.properties?.valueFont??qe).attr("transform",d=>q(d,p)).attr("visibility",d=>d.endAngle-d.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(d=>{if(b.plotArea.dataLabelValue){const i=d.data.data[0].value;return b.plotArea.dataLabelValue&&i!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/X)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision)??0)+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("fill-opacity",.5).text(d=>{const i=Math.abs(d.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&i!==void 0?T.format(".2s")(i):""});let C=T.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>1?d.y1-1+U/7:0).outerRadius(d=>d.depth>1?d.y1-1+U/7:0),c=T.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>2?d.y0:0).outerRadius(d=>d.y1+U/1.5);V.selectAll("polyline.pie-label-connector").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",O()).style("stroke",d=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:d.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Ha.solid?0:b.connector.connectorStyle===Ha.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",d=>{const i=c.centroid(d),y=C.centroid(d);let f=d.x0+(d.x1-d.x0)/2;f=f%(2*Math.PI);const a=U*1.1*(f<Math.PI?1:-1),m=y[1];return[i,y,[a,m]].map(P=>P.join(",")).join(" ")}),V.append("g").attr("class","pie-label-group").attr("transform",O()).selectAll("foreignObject").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",d=>{let i=d.x0+(d.x1-d.x0)/2;i=i%(2*Math.PI);const f=i<Math.PI?0:-80;return U*1.1*(i<Math.PI?1:-1)+f}).attr("y",d=>C.centroid(d)[1]-30).append("xhtml:div").attr("hoverId",d=>(d.data.properties.alias||d.data.properties.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(d=>{let i=d.data.data[0].value.toString();d.data.data[0].value!==void 0&&(i=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(d.data[0].value/X)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision))+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(d.data.data[0].value));let y="";return b.plotArea.dataLabelName&&(y+=`<span style="
91
+ font-size: ${d.data.properties.labelFontSize}px;
92
+ color: ${d.data.properties.labelFontColor};
93
+ font-style: ${d.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:""};
94
+ text-decoration: ${d.data.properties.labelFontStyle.includes(ne.underline)?ne.underline:""};
95
+ font-weight: ${d.data.properties.labelFontStyle.includes(ne.bold)?ne.bold:""};
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
- ${c.data.legend}
99
- </span>`),p.plotArea.dataLabelValue&&c.data.data[0].value!==void 0&&(y+=`<span style="
100
- font-size: ${c.data.properties.valueFontSize}px;
101
- color: ${c.data.properties.valueFontColor};
102
- font-style: ${c.data.properties.valueFontStyle.includes(se.italic)?se.italic:""};
103
- text-decoration: ${c.data.properties.valueFontStyle.includes(se.underline)?se.underline:""};
104
- font-weight: ${c.data.properties.valueFontStyle.includes(se.bold)?se.bold:"300"};
105
- font-family: ${c.data.properties.valueFont};
98
+ ${d.data.legend}
99
+ </span>`),b.plotArea.dataLabelValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
100
+ font-size: ${d.data.properties.valueFontSize}px;
101
+ color: ${d.data.properties.valueFontColor};
102
+ font-style: ${d.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
103
+ text-decoration: ${d.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
104
+ font-weight: ${d.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
105
+ font-family: ${d.data.properties.valueFont};
106
106
  display: block;">
107
107
  ${i}
108
- </span>`),p.plotArea.plotAreaAbsoluteValue&&c.data.data[0].value!==void 0&&(y+=`<span style="
109
- font-size: ${c.data.properties.valueFontSize}px;
110
- color: ${c.data.properties.valueFontColor};
111
- font-style: ${c.data.properties.valueFontStyle.includes(se.italic)?se.italic:""};
112
- text-decoration: ${c.data.properties.valueFontStyle.includes(se.underline)?se.underline:""};
113
- font-weight: ${c.data.properties.valueFontStyle.includes(se.bold)?se.bold:"300"};
114
- font-family: ${c.data.properties.valueFont};
108
+ </span>`),b.plotArea.plotAreaAbsoluteValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
109
+ font-size: ${d.data.properties.valueFontSize}px;
110
+ color: ${d.data.properties.valueFontColor};
111
+ font-style: ${d.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
112
+ text-decoration: ${d.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
113
+ font-weight: ${d.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
114
+ font-family: ${d.data.properties.valueFont};
115
115
  display: block;">
116
- ${T.format(".2s")(c.data.data[0].value)}
117
- </span>`),y}),p.animation.animationEnabled&&N.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(p.animation.animationDuration).ease(Xe[p.animation.animationEffect]).attr("opacity",1)}}catch(b){ge(Ea,"drawPieDataLabels",b)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:m,id:r,style:{width:"100%",height:"100%"}})})},Ma="DonutChart.tsx",br=({data:t,formatOptions:e,chartId:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const m=Te.useRef(),A=Te.useRef(l);A.current=l;const u=Te.useRef(s);u.current=s;const S=bt(t.ChartData);let p,H,g,G=40,V=Ht,j=[0,0],K,Z,Y,N,E,z,q,ce,ne=!1,oe;Te.useEffect(()=>{xe()},[e]);const xe=()=>{({chartFormatOptions:p,svg:oe,width:H,height:g}=Jt(m,e)),Ae(),j=Ia(p,S),{margins:V,innerHeight:K,innerWidth:Z,legendListWidth:E,chartTitleHeight:G}=Na(p,H,g,j,V),pe(),jt(m,H,g,p),z=la(oe,V),_t(m,G,H,p),Pa(p,oe,S,H,g,E,G,r,V,nt.hollowCircle,!1,n),ue(),O(),p.plotArea.annotationDraggable&&p.plotArea.dataLabels?Oi(dt,q,p,J(),re.DonutChart,H,g,z,Math.min(K*.5,Z*.5),o,h):b(),k()},Ae=()=>{try{ce=0,S.forEach(d=>{d.properties.dataLabelPosition=="2"&&(ne=!0),ce+=d.data[0].value})}catch(d){ge(Ma,"loopOverSeriesData",d)}},pe=()=>{try{Y=Math.min(K*.4,Z*.4),ne&&(Y=Y*.9),N=Math.min(et(p.plotArea.innerRadius)/100*Y,Y)}catch(d){ge(Ma,"defineChartRadius",d)}},ue=()=>{try{let d=et(p.plotArea.rotation);const c=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;q=T.pie().value(f=>Math.abs(c?100:f.data[0].value)).startAngle((d??0)*(Math.PI/180)%360).endAngle(((d??0)+360)*(Math.PI/180)%360)(S)?.map((f,a)=>({...f,x0:f.startAngle,x1:f.endAngle,y0:0,y1:Y,depth:2}))}catch(d){ge(Ma,"initPieChartData",d)}},O=()=>{try{const d=p.animation.animationEnabled,c=T.arc().innerRadius(N).outerRadius(Y),i=T.arc().innerRadius(N).outerRadius(Y+10),f=z.append("g").attr("class","parentGroup").attr("fill-opacity",p.plotArea.opacity).attr("transform",`${J()}`).selectAll("path").data(q).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!==we.white?a.data.properties.color:"none").attr(Qe.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(Qe.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",At(u,A,(a,L)=>({seriesId:L.data.properties.legendUniqueId??L.data.properties.name??"",dimValue:L.data.properties.alias||L.data.legend||"",legendUniqueId:L.data.properties.legendUniqueId??L.data.properties.name??"",seriesDisplayName:L.data.properties.alias||L.data.properties.name||""}))).each(function(a){const L=a;L._current={startAngle:0,endAngle:0}}).on("mouseover.arc",function(){d?T.select(this).transition().duration(150).attr("d",i):T.select(this).attr("d",i)}).on("mousemove.text",a=>{st([{key:p.yAxisTitle.yAxisTitleText,value:p.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/ce)*100).toFixed(et(p.toolTip.toolTipDecimalPrecision))+"%":je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],p,void 0,a.currentTarget.__data__.data.properties,ht(x,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>rt()).on("mouseout.arc",function(){d?T.select(this).transition().duration(150).attr("d",c):T.select(this).attr("d",c)});d?f.transition().duration(p.animation.animationDuration).ease(Xe[p.animation.animationEffect]).attrTween("d",function(a){const L=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(P){return c(L(P))}}):f.attr("d",a=>c(a))}catch(d){ge(Ma,"drawDonutChart",d)}},J=()=>{try{return`translate(${Z/2},${K/2})`}catch(d){return ge(Ma,"getPiePosition",d),""}},F=(d,c)=>{try{if(c)return"translate(0 0)";{const i=(d.startAngle+d.endAngle)/2,y=(N+Y)/2,f=Math.cos(i-Math.PI/2)*y,a=Math.sin(i-Math.PI/2)*y;let L=i*180/Math.PI%360,P=0;return L>180&&L<360?P=90:P=-90,L+=P,`translate(${f},${a}) rotate(${L})`}}catch(i){return ge(Ma,"getDataLabelTransformString",i),""}},b=()=>{try{if(p.plotArea.dataLabels){const d=q&&q.length===1;z.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(q.filter(y=>y.data.properties.dataLabelPosition=="1"),p,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??we.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(se.bold)?se.bold:"").attr("font-family",y=>y.data.properties?.labelFont??qe).attr("transform",y=>F(y,d)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:f}=p;return f.dataLabelName?y.data?.properties?.alias||y.data.legend:""}),z.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(q.filter(y=>y.data.properties.dataLabelPosition=="1"),p,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??we.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(se.bold)?se.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??qe).attr("fill",y=>y.data.properties?.valueFontColor??we.black).attr("transform",y=>F(y,d)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",p.plotArea.dataLabelName?"1.00em":"0em").text(y=>{if(p.plotArea.dataLabelValue){const f=y.data.data[0].value;return p.plotArea.dataLabelValue&&f!==void 0?p.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(f/ce)*100).toFixed(et(p.plotArea.dataLabelDecimalPrecision)??0)+"%":je(p.plotArea.plotAreaDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(f):f}}).append("tspan").attr("x",0).attr("y",p.plotArea.dataLabelValue?p.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(se.bold)?se.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??we.black).attr("fill-opacity",.5).text(y=>{const f=Math.abs(y.data.data[0].value);return p.plotArea.plotAreaAbsoluteValue&&f!==void 0?T.format(".2s")(f):""});let c=T.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>1?y.y1-1+Y/7:0).outerRadius(y=>y.depth>1?y.y1-1+Y/7:0),i=T.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>2?y.y0:0).outerRadius(y=>y.y1+Y/1.5);z.selectAll("polyline.pie-label-connector").data(Rt(q.filter(y=>y.data.properties.dataLabelPosition=="2"),p,y=>y.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",J()).style("stroke",y=>p.connector.connectorColorOption=="Uniform"?p.connector.connectorUniformLineColor:y.data.properties.color).style("fill","none").style("stroke-dasharray",p.connector.connectorStyle===Ha.solid?0:p.connector.connectorStyle===Ha.dotted?1:4).style("stroke-width",p.connector.connectorLineThickness).attr("points",y=>{const f=i.centroid(y),a=c.centroid(y);let L=y.x0+(y.x1-y.x0)/2;L=L%(2*Math.PI);const P=Y*1.1*(L<Math.PI?1:-1),ae=a[1];return[f,a,[P,ae]].map(Q=>Q.join(",")).join(" ")}),z.append("g").attr("class","pie-label-group").attr("transform",J()).selectAll("foreignObject").data(Rt(q.filter(y=>y.data.properties.dataLabelPosition=="2"),p,y=>y.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",y=>{let f=y.x0+(y.x1-y.x0)/2;f=f%(2*Math.PI);const L=f<Math.PI?0:-80;return Y*1.1*(f<Math.PI?1:-1)+L}).attr("y",y=>c.centroid(y)[1]-30).append("xhtml:div").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(y=>{try{let f=y.data.data[0].value.toString();y.data.data[0].value!==void 0&&(f=p.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y.data.data[0].value/ce)*100).toFixed(et(p.plotArea.dataLabelDecimalPrecision))+"%":je(p.plotArea.plotAreaDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(y.data.data[0].value));let a="";return p.plotArea.dataLabelName&&(a+=`<span style="
116
+ ${T.format(".2s")(d.data.data[0].value)}
117
+ </span>`),y}),b.animation.animationEnabled&&V.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",1)}}catch(p){be(Ea,"drawPieDataLabels",p)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:L,id:r,style:{width:"100%",height:"100%"}})})},Ma="DonutChart.tsx",pr=({data:t,formatOptions:e,chartId:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=Te.useRef(),A=Te.useRef(l);A.current=l;const u=Te.useRef(s);u.current=s;const S=bt(t.ChartData);let b,_,g,H=40,D=Ht,j=[0,0],K,J,U,V,N,$,X,se,re=!1,oe;Te.useEffect(()=>{he()},[e]);const he=()=>{({chartFormatOptions:b,svg:oe,width:_,height:g}=Jt(L,e)),Le(),j=Ia(b,S),{margins:D,innerHeight:K,innerWidth:J,legendListWidth:N,chartTitleHeight:H}=Na(b,_,g,j,D),pe(),jt(L,_,g,b),$=la(oe,D),_t(L,H,_,b),Pa(b,oe,S,_,g,N,H,r,D,nt.hollowCircle,!1,n),ue(),O(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?Qi(dt,X,b,q(),le.DonutChart,_,g,$,Math.min(K*.5,J*.5),o,h):p(),C()},Le=()=>{try{se=0,S.forEach(c=>{c.properties.dataLabelPosition=="2"&&(re=!0),se+=c.data[0].value})}catch(c){be(Ma,"loopOverSeriesData",c)}},pe=()=>{try{U=Math.min(K*.4,J*.4),re&&(U=U*.9),V=Math.min(et(b.plotArea.innerRadius)/100*U,U)}catch(c){be(Ma,"defineChartRadius",c)}},ue=()=>{try{let c=et(b.plotArea.rotation);const d=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;X=T.pie().value(f=>Math.abs(d?100:f.data[0].value)).startAngle((c??0)*(Math.PI/180)%360).endAngle(((c??0)+360)*(Math.PI/180)%360)(S)?.map((f,a)=>({...f,x0:f.startAngle,x1:f.endAngle,y0:0,y1:U,depth:2}))}catch(c){be(Ma,"initPieChartData",c)}},O=()=>{try{const c=b.animation.animationEnabled,d=T.arc().innerRadius(V).outerRadius(U),i=T.arc().innerRadius(V).outerRadius(U+10),f=$.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${q()}`).selectAll("path").data(X).enter().append("path").attr("class",a=>"path").attr("hoverId",a=>(a.data?.properties?.alias||a.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",a=>a.data.properties.color!==De.white?a.data.properties.color:"none").attr(Qe.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(Qe.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",At(u,A,(a,m)=>({seriesId:m.data.properties.legendUniqueId??m.data.properties.name??"",dimValue:m.data.properties.alias||m.data.legend||"",legendUniqueId:m.data.properties.legendUniqueId??m.data.properties.name??"",seriesDisplayName:m.data.properties.alias||m.data.properties.name||""}))).each(function(a){const m=a;m._current={startAngle:0,endAngle:0}}).on("mouseover.arc",function(){c?T.select(this).transition().duration(150).attr("d",i):T.select(this).attr("d",i)}).on("mousemove.text",a=>{ot([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/se)*100).toFixed(et(b.toolTip.toolTipDecimalPrecision))+"%":je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],b,void 0,a.currentTarget.__data__.data.properties,ht(x,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>rt()).on("mouseout.arc",function(){c?T.select(this).transition().duration(150).attr("d",d):T.select(this).attr("d",d)});c?f.transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attrTween("d",function(a){const m=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(P){return d(m(P))}}):f.attr("d",a=>d(a))}catch(c){be(Ma,"drawDonutChart",c)}},q=()=>{try{return`translate(${J/2},${K/2})`}catch(c){return be(Ma,"getPiePosition",c),""}},w=(c,d)=>{try{if(d)return"translate(0 0)";{const i=(c.startAngle+c.endAngle)/2,y=(V+U)/2,f=Math.cos(i-Math.PI/2)*y,a=Math.sin(i-Math.PI/2)*y;let m=i*180/Math.PI%360,P=0;return m>180&&m<360?P=90:P=-90,m+=P,`translate(${f},${a}) rotate(${m})`}}catch(i){return be(Ma,"getDataLabelTransformString",i),""}},p=()=>{try{if(b.plotArea.dataLabels){const c=X&&X.length===1;$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??De.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",y=>y.data.properties?.labelFont??qe).attr("transform",y=>w(y,c)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:f}=b;return f.dataLabelName?y.data?.properties?.alias||y.data.legend:""}),$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.lableFontColor??De.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??qe).attr("fill",y=>y.data.properties?.valueFontColor??De.black).attr("transform",y=>w(y,c)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(y=>{if(b.plotArea.dataLabelValue){const f=y.data.data[0].value;return b.plotArea.dataLabelValue&&f!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(f/se)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision)??0)+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(f):f}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??De.black).attr("fill-opacity",.5).text(y=>{const f=Math.abs(y.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&f!==void 0?T.format(".2s")(f):""});let d=T.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>1?y.y1-1+U/7:0).outerRadius(y=>y.depth>1?y.y1-1+U/7:0),i=T.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>2?y.y0:0).outerRadius(y=>y.y1+U/1.5);$.selectAll("polyline.pie-label-connector").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",q()).style("stroke",y=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:y.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Ha.solid?0:b.connector.connectorStyle===Ha.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",y=>{const f=i.centroid(y),a=d.centroid(y);let m=y.x0+(y.x1-y.x0)/2;m=m%(2*Math.PI);const P=U*1.1*(m<Math.PI?1:-1),ie=a[1];return[f,a,[P,ie]].map(Q=>Q.join(",")).join(" ")}),$.append("g").attr("class","pie-label-group").attr("transform",q()).selectAll("foreignObject").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",y=>{let f=y.x0+(y.x1-y.x0)/2;f=f%(2*Math.PI);const m=f<Math.PI?0:-80;return U*1.1*(f<Math.PI?1:-1)+m}).attr("y",y=>d.centroid(y)[1]-30).append("xhtml:div").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(y=>{try{let f=y.data.data[0].value.toString();y.data.data[0].value!==void 0&&(f=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y.data.data[0].value/se)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision))+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(y.data.data[0].value));let a="";return b.plotArea.dataLabelName&&(a+=`<span style="
118
118
  font-size: ${y.data.properties.labelFontSize}px;
119
119
  color: ${y.data.properties.labelFontColor};
120
- font-style: ${y.data.properties.labelFontStyle.includes(se.italic)?se.italic:""};
121
- text-decoration: ${y.data.properties.labelFontStyle.includes(se.underline)?se.underline:""};
122
- font-weight: ${y.data.properties.labelFontStyle.includes(se.bold)?se.bold:""};
120
+ font-style: ${y.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:""};
121
+ text-decoration: ${y.data.properties.labelFontStyle.includes(ne.underline)?ne.underline:""};
122
+ font-weight: ${y.data.properties.labelFontStyle.includes(ne.bold)?ne.bold:""};
123
123
  font-family: ${y.data.properties.labelFont};
124
124
  display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
125
125
  ${y.data.legend}
126
- </span>`),p.plotArea.dataLabelValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
126
+ </span>`),b.plotArea.dataLabelValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
127
127
  font-size: ${y.data.properties.valueFontSize}px;
128
128
  color: ${y.data.properties.valueFontColor};
129
- font-style: ${y.data.properties.valueFontStyle.includes(se.italic)?se.italic:""};
130
- text-decoration: ${y.data.properties.valueFontStyle.includes(se.underline)?se.underline:""};
131
- font-weight: ${y.data.properties.valueFontStyle.includes(se.bold)?se.bold:"300"};
129
+ font-style: ${y.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
130
+ text-decoration: ${y.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
131
+ font-weight: ${y.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
132
132
  font-family: ${y.data.properties.valueFont};
133
133
  display: block;">
134
134
  ${f}
135
- </span>`),p.plotArea.plotAreaAbsoluteValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
135
+ </span>`),b.plotArea.plotAreaAbsoluteValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
136
136
  font-size: ${y.data.properties.valueFontSize}px;
137
137
  color: ${y.data.properties.valueFontColor};
138
- font-style: ${y.data.properties.valueFontStyle.includes(se.italic)?se.italic:""};
139
- text-decoration: ${y.data.properties.valueFontStyle.includes(se.underline)?se.underline:""};
140
- font-weight: ${y.data.properties.valueFontStyle.includes(se.bold)?se.bold:"300"};
138
+ font-style: ${y.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
139
+ text-decoration: ${y.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
140
+ font-weight: ${y.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
141
141
  font-family: ${y.data.properties.valueFont};
142
142
  display: block;">
143
143
  ${T.format(".2s")(y.data.data[0].value)}
144
- </span>`),a}catch(f){return ge(Ma,"drawDonutDataLabels",f),""}}),p.animation.animationEnabled&&z.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(p.animation.animationDuration).ease(Xe[p.animation.animationEffect]).attr("opacity",1)}}catch(d){ge(Ma,"drawDonutDataLabels",d)}},k=()=>{try{if(p.total&&p.total.totalVisibility){let d=ce,c=p.total.totalFontStyle;const i=z.append("g").attr("transform",J()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",p.total.totalColor!==we.white?p.total.totalColor:"none").style("font-family",p.total.totalFontFamily).style("font-size",p.total.totalFontSize).style("font-style",c.includes(se.italic)?se.italic:"").style("text-decoration",c.includes(se.underline)?se.underline:"").style("font-weight",c.includes(se.bold)?se.bold:"").attr("text-anchor","middle").attr("visibility",p.plotArea.dataLabelValue?"visible":"hidden").text(p.total.showTotalLabel!==!1?p.total.editTotalText:"").append("tspan").attr("x",0).attr("y",p.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",c.includes(se.bold)?se.bold:300).text(p.total.totalNumberFormat===",.0%"||p.total.totalNumberFormat==="Percentage"?"100%":je(p.total.totalDisplayUnits,p.total.totalNumberFormat,p.total.totalDecimalPrecision)(d)),p.animation.animationEnabled&&i.attr("opacity",0).transition().duration(p.animation.animationDuration).ease(Xe[p.animation.animationEffect]).attr("opacity",1)}}catch(d){ge(Ma,"drawTotalValue",d)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:m,id:r,style:{width:"100%",height:"100%"}})})},Ga="TreemapChart.tsx",gr=({data:t,formatOptions:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{const l=Te.useRef(),s=Te.useRef(o);s.current=o;const x=Te.useRef(h);x.current=h;let m,A,u,S=40,p=Ht,H,g,G,V,j,K;Te.useEffect(()=>{Z()},[e]);const Z=()=>{({chartFormatOptions:m,svg:K,width:A,height:u}=Jt(l,e)),{margins:p,chartTitleHeight:S,innerHeight:H,innerWidth:g}=Qa(m,u,A,!0),jt(l,A,u,m),G=la(K,p),_t(l,S,A,m),Y(),N(),ce()},Y=()=>{try{const ne={name:"root",children:t.ChartData},oe=T.hierarchy(ne).sum(xe=>xe.data&&xe.data[0].value).sort((xe,Ae)=>(Ae.data.data[0].value??0)-(xe.data.data[0].value??0));V=T.treemap().tile(T.treemapSquarify).size([g,H]).padding(1).round(!0)(oe).leaves(),j=V[0].data.properties.color}catch(ne){ge(Ga,"initChartData",ne)}},N=()=>{try{if(m.colorScale.showColor===ga.colorTheme){let oe=V[0].data.data.length>1?1:0,xe=m.colorScale.startColor,Ae=m.colorScale.endColor,pe=new Set(V.map(F=>F.data.data[oe].value)),ue=Array.from(pe).sort((F,b)=>F-b),O=ue.length,J;if(O===1)J=()=>xe;else{const F=T.interpolateLab(xe,Ae);J=T.scaleOrdinal().domain(ue.map(String)).range(ue.map((b,k)=>F(k/(O-1))))}V=V.map(F=>{let b=F.data.data[oe].value;return{...F,data:{...F.data,properties:{...F.data.properties,themeColor:J(b.toString())}}}}),E(xe,Ae,O,ue)}}catch(ne){ge(Ga,"prepareTreeColors",ne)}},E=(ne,oe,xe,Ae)=>{try{let pe=T.scalePow().exponent(1).domain([0,xe-1]).range([ne,oe]),O=K.append("foreignObject").attr("class","parentGroup").attr("x",A-130).attr("y",u-30).attr("width",115).attr("height",10).selectAll(null).data(Ae).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",(F,b)=>pe(b)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const J=K.append("g").attr("transform",`translate(${A-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");K.append("g").attr("transform",`translate(${A-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){ge(Ga,"appendColorScale",pe)}},z=ne=>{try{switch(m.colorScale.showColor){case ga.none:return j;case ga.discrete:return ne.properties.color;case ga.colorTheme:return ne.properties.themeColor;default:return}}catch(oe){ge(Ga,"getColor",oe)}},q=ne=>{try{const oe=ne?.currentTarget?.__data__?.data?.properties;if(!oe)return;switch(m.colorScale.showColor){case ga.none:return{...oe,markerColor:j};case ga.colorTheme:return{...oe,markerColor:oe.themeColor};case ga.discrete:default:return oe}}catch(oe){ge(Ga,"getMarkerColorForTooltip",oe)}},ce=()=>{try{const ne=m.animation.animationEnabled,oe=G.selectAll("g").data(V).enter().append("g").attr("transform",Ae=>`translate(${Ae.x0},${Ae.y0})`),xe=oe.append("rect").attr("fill",Ae=>z(Ae.data)).attr("fill-opacity",ne?0:.7).attr("width",Ae=>Ae.x1-Ae.x0).attr("height",Ae=>Ae.y1-Ae.y0).on("mousemove",(Ae,pe)=>{st([{key:m.yAxisTitle.yAxisTitleText,value:je(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,q(Ae),ht(n,String(pe.data.data[0]?.legend??""),q(Ae)))}).on("mouseout",()=>rt()).attr(Qe.SeriesId,Ae=>String(Ae.data.properties?.legendUniqueId??Ae.data.legend??"")).attr(Qe.DimValue,Ae=>String(Ae.data.data[0].legend??"")).on("click",At(x,s,(Ae,pe)=>{const ue=String(pe.data.properties?.legendUniqueId??pe.data.legend??""),O=String(pe.data.data[0].legend??"");return{seriesId:ue,dimValue:O,legendUniqueId:ue,seriesDisplayName:String(pe.data.properties?.alias||pe.data.properties?.name||O)}}));if(ne&&xe.transition().duration(m.animation.animationDuration).ease(Xe[m.animation.animationEffect]).attr("fill-opacity",.7),oe.append("clipPath").attr("id",(Ae,pe)=>`clip-${pe}-${r}`).append("rect").attr("width",Ae=>Ae.x1-Ae.x0).attr("height",Ae=>Ae.y1-Ae.y0),m.plotArea.dataLabels){const Ae=m.annotation.annotationRangeFilter;oe.filter(pe=>{if(!Ae?.enabled)return!0;const ue=pe.data.data[0].value;switch(Ae.condition){case"lt":return ue<Ae.maxVal;case"gt":return ue>Ae.minVal;case"in":return ue>=Ae.minVal&&ue<=Ae.maxVal;case"not-in":return ue<Ae.minVal||ue>Ae.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(se.italic)?se.italic:"").style("text-decoration",pe=>pe.data.properties.fontStyle.includes(se.underline)?se.underline:"").style("font-weight",pe=>pe.data.properties.fontStyle.includes(se.bold)?se.bold:"").attr("clip-path",(pe,ue)=>`url(#clip-${ue}-${r})`),m.plotArea.dataLabelName&&oe.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(pe=>pe.data.legend),m.plotArea.dataLabelValue&&oe.selectAll("text").append("tspan").attr("x",5).attr("y",m.plotArea.dataLabelName?"2.1em":"1.1em").text(pe=>je(m.plotArea.plotAreaDisplayUnits,m.plotArea.dataLabelNumberFormat,m.plotArea.dataLabelDecimalPrecision)(pe.data.data[0].value)),ne&&oe.selectAll("text").attr("opacity",0).transition().duration(m.animation.animationDuration).ease(Xe[m.animation.animationEffect]).attr("opacity",1)}}catch(ne){ge(Ga,"initChartRect",ne)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},ra="PieofPieChart.tsx",Ar=({data:t,formatOptions:e,chartId:r,legendProperties:o,tooltipFormatter:h})=>{const n=Te.useRef();let l,s,x,m=40,A=Ht,u,S,p,H,g,G,V,j,K,Z,Y,N,E,z=[0,0],q,ce;Te.useEffect(()=>{ne()},[e]);const ne=()=>{({chartFormatOptions:l,svg:H,width:s,height:x}=Jt(n,e)),{plotArea:ce}=l,oe(),{margins:A,innerHeight:u,innerWidth:S,legendListWidth:q,chartTitleHeight:m}=Na(l,s,x,z,A),xe(),jt(n,s,x,l),p=la(H,A),_t(n,m,s,l),Ae(),pe(),b(),vi(l,j,m,H,s,x),c()},oe=()=>{try{let i=It(Bi(o,"name"),et(l.legends.legendFontSize),l.legends.legendFontFamily);z=[i.width,i.height]}catch(i){ge(ra,"calculateMaxPossibleWidth",i)}},xe=()=>{try{G=Math.min(u*.4,S*.4),V=l.pieofPie.pieOfPieRadius}catch(i){ge(ra,"calculatePieRadius",i)}},Ae=()=>{try{let i=new Map;o.forEach(a=>{i.set(a.name,a)}),j=0,t.forEach(a=>{a.properties=i.get(a.legend),j+=a.data[0].value,a.children&&a.children.forEach(L=>L.properties=i.get(L.legend))}),g=T.pie().value(a=>a.data[0].value)(t).map((a,L)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:G,depth:2}))}catch(i){ge(ra,"initChartData",i)}},pe=()=>{try{const i=T.arc().innerRadius(0).outerRadius(G),y=T.arc().innerRadius(0).outerRadius(G+10),f=p.append("g").attr("class","parentGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data(g).enter().append("path").attr("class",a=>"path "+a.data.legend).attr("hoverId",a=>a.data.legend.replace(/ /g,"-")).attr("fill",a=>a.data.properties.color!==we.white?a.data.properties.color:"none").on("mouseover.arc",function(a){T.select(this).transition().duration(100).attr("d",y)}).on("mousemove.text",a=>{st([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/j)*100).toFixed(et(l.toolTip.toolTipDecimalPrecision)??0)+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],l,void 0,a.currentTarget.__data__.data.properties,ht(h,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(a){T.select(this).transition().duration(100).attr("d",i),rt()}).on("click",(a,L)=>{try{let P=L;if(P.data.children&&P.data.children.length>1){p.selectAll(".childGroup").remove(),p.selectAll(".childLabels").remove(),p.selectAll("line").remove(),K=P.data.legend;let ae=90-(L.x0+L.x1)/2/Math.PI*180;ue(P.data.children,ae,L)}}catch(P){ge(ra,"drawPieChart_onClick",P)}});l.animation.animationEnabled?f.transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attrTween("d",function(a){const L=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return P=>i(L(P))}):f.attr("d",a=>i(a))}catch(i){ge(ra,"drawPieChart",i)}},ue=(i,y,f)=>{try{p.select(".parentGroup").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`),p.selectAll(".parentLabels").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`);let L=T.pie().value(Q=>Q.data[0].value)(i).map((Q,be)=>({...Q,x0:Q.startAngle,x1:Q.endAngle,y0:0,y1:V,depth:2}));const P=T.arc().innerRadius(0).outerRadius(V),ae=T.arc().innerRadius(0).outerRadius(V+10);p.append("g").attr("class","childGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${J()}`).selectAll("path").data(L).enter().append("path").attr("class",Q=>"path "+Q.data.legend).attr("hoverId",Q=>Q.data.legend.replace(/ /g,"-")).attr("fill",Q=>Q.data.properties.color!==we.white?Q.data.properties.color:"none").attr("d",Q=>P(Q)).on("mouseover.arc",function(Q){T.select(this).transition().duration(100).attr("d",ae)}).on("mousemove.text",Q=>{st([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(Q.currentTarget.__data__.data.data[0].value/j)*100).toFixed(et(l.toolTip.toolTipDecimalPrecision))+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(Q.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:Q.currentTarget.__data__.data.legend}],l,void 0,Q.currentTarget.__data__.data.properties,ht(h,String(Q.currentTarget.__data__.data.legend??""),Q.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(Q){T.select(this).transition().duration(100).attr("d",P),rt()}),k(L),d(f,i)}catch(a){ge(ra,"drawChildPie",a)}},O=()=>{try{return Z=K?3*S/8:S/2,Y=u/2,`translate(${Z},${Y})`}catch(i){ge(ra,"getParentPiePosition",i)}},J=()=>{try{return N=3*S/4,E=u/2,`translate(${N},${E})`}catch(i){ge(ra,"getChildPiePosition",i)}},F=(i,y)=>{try{const f=(i.startAngle+i.endAngle)/2,a=Math.cos(f-Math.PI/2)*(y*.65),L=Math.sin(f-Math.PI/2)*(y*.65);let P=f*180/Math.PI-90;return`translate(${a},${L}) rotate(${P})`}catch(f){ge(ra,"getDataLabelTransformString",f)}},b=()=>{try{l.plotArea.dataLabels&&(p.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(g,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.labelFontSize??11).attr("fill",i=>i.data.properties?.labelFontColor??we.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(se.bold)?se.bold:"").attr("font-family",i=>i.data.properties?.labelFont??qe).attr("transform",i=>F(i,G)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:y}=l;return y.dataLabelName?i.data.legend:""}),p.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(g,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.valueFontSize??11).attr("fill",i=>i.data.properties?.valueFontColor??we.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(se.bold)?se.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??qe).attr("transform",i=>F(i,G)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(l.plotArea.dataLabelValue){const y=i.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&y!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y/j)*100).toFixed(et(l.plotArea.dataLabelDecimalPrecision)??0)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(y):y}}))}catch(i){ge(ra,"drawParentPieDataLabels",i)}},k=i=>{try{l.plotArea.dataLabels&&(p.append("g").attr("class","childLabels parentGroup").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??we.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(se.bold)?se.bold:"").attr("font-family",y=>y.data.properties?.labelFont??qe).attr("transform",y=>F(y,V)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:f}=l;return f.dataLabelName?y.data.legend:""}),p.append("g").attr("class","childLabels parentGroup").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.valueFontColor??we.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(se.italic)?se.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(se.underline)?se.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(se.bold)?se.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??qe).attr("transform",y=>F(y,V)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(y=>{if(l.plotArea.dataLabelValue){const f=y.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&f!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(f/j)*100).toFixed(et(l.plotArea.dataLabelDecimalPrecision)??0)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(f):f}}))}catch(y){ge(ra,"drawChildPieDataLabels",y)}},d=(i,y)=>{try{let f=Math.abs(i.x0-i.x1)/2,L=i.y1*Math.sin(f),P=L/Math.tan(f);p.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",Z+P).attr("y1",Y-L).attr("x2",N).attr("y2",E-V),p.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",Z+P).attr("y1",Y+L).attr("x2",N).attr("y2",E+V)}catch(f){ge(ra,"drawLines",f)}},c=()=>{try{let i=o.map(y=>({legend:y.name,properties:y,data:[]}))}catch(i){ge(ra,"initLegendList",i)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},da="PyramidChart.tsx",Lr=({data:t,formatOptions:e,chartId:r,onDataLabelCoordinatesChange:o,addLocalFilterFromLib:h,tooltipFormatter:n})=>{const l=Te.useRef();let s=bt(t.ChartData),x,m,A,u,S=40,p=Ht,H=[0,0],g,G,V,j,K=[0],Z,Y,N,E;Te.useEffect(()=>{z()},[e]);const z=()=>{({chartFormatOptions:x,svg:m,width:A,height:u}=Jt(l,e)),H=Ia(x,s),{margins:p,innerHeight:g,innerWidth:G,legendListWidth:N,chartTitleHeight:S}=Na(x,A,u,H,p),q(),jt(l,A,u,x),Z=ce(),_t(l,S,A,x),Pa(x,m,s,A,u,N,S,r,p,nt.rectangle,!1,h),ne(),oe(),Ae(),xe()},q=()=>{try{V=Math.min(g,G),j=.866*V}catch(ue){ge(da,"initPyramidSideCalculations",ue)}},ce=()=>{try{return m.append("g").attr("transform",`translate(${p.left},${p.top+(g-j)/2})`)}catch(ue){return ge(da,"initChartArea",ue),null}},ne=()=>{try{s=s.sort((ue,O)=>{const J=ue.data[0].value,F=O.data[0].value;return x.plotArea.flipPyramid?F-J:J-F}),Y=T.sum(s,ue=>Math.abs(ue.data[0].value)),K=[0],s.forEach((ue,O)=>{const J=Math.abs(ue.data[0].value)/Y*j;K.push(K[O]+J)})}catch(ue){ge(da,"initPyramidData",ue)}},oe=()=>{try{s.forEach((ue,O)=>{try{const J=K[O],F=K[O+1];let b=x.plotArea.flipPyramid?1:0;const k=V*(b-K[O]/j),d=V*(b-K[O+1]/j),c=G/2,i=Z.append("g").attr("id","PyramidChart").attr("class","parentGroup"),y=x.animation.animationEnabled,f=i.append("polygon").attr("class","segment").attr("hoverId",ue.legend.replace(/\s+/g,"-")).attr("data-series-id",ue.legendUniqueId??ue.legend).attr("data-dim-value",ue.legend).attr("points",`
145
- ${c-k/2},${J}
146
- ${c+k/2},${J}
147
- ${c+d/2},${F}
148
- ${c-d/2},${F}
149
- `).attr("fill",ue.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{st([{key:ue.legend,value:x.toolTip.toolTipNumberFormat==",.0%"?ue.data[0].value?(Math.abs(ue.data[0].value/Y)*100).toFixed(et(x.toolTip.toolTipDecimalPrecision))+"%":"":je(x.toolTip.toolTipDisplayUnits,x.toolTip.toolTipNumberFormat,x.toolTip.toolTipDecimalPrecision)(ue.data[0].value)}],x,void 0,ue.properties,ht(n,String(ue.legend??""),ue.properties)),T.select(this).style("opacity",.8).style("stroke",x.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){ge(da,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{rt(),T.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){ge(da,"drawPyramidChart.onMouseOut",a)}});y&&f.transition().duration(x.animation.animationDuration).ease(Xe[x.animation.animationEffect]).attr("opacity",1)}catch(J){ge(da,"drawPyramidChart.forEach",J)}})}catch(ue){ge(da,"drawPyramidChart",ue)}},xe=ue=>{try{if(x.annotation.annotationVisibility){let O=dt.annotation(),J=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None",F=Rt(E,x,d=>d.data.measure);const b=x.annotation.connectorStyle?.toLowerCase();O.editMode(x.annotation.annotationDraggable).accessors({x:function(){return G*.5},y:function(d,c){return d.y}}).on("dragend",function(d){try{F.forEach(c=>{c.data.legend===d.data.legend&&(c.dx=d._dx,c.dy=d._dy,c.width=A,c.height=u)}),o&&o(F.map(c=>({data:{legend:c.data.legend,isVisible:c.data.isVisible??!0},dx:c.dx,dy:c.dy,width:A,height:u}))),k.selectAll(".connector").attr("hoverId",c=>c.data.legend.replace(/\s+/g,"-")).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[b]),k.selectAll(`.connector-${J}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",c=>c.data.currentLegend.replace(/\s+/g,"-")).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[b]).filter(c=>c._dx==0&&c._dy==0).remove(),k.selectAll(".annotation-note-label").filter(c=>c.data&&c.data.isVisible).style("display","block"),k.selectAll(".annotation-note-title").filter(c=>c.data&&c.data.isVisible).style("display","block")}catch(c){ge(da,"pyramidAnnotations.onDragEnd",c)}}).notePadding(0).annotations(F);let k=Z.append("g").attr("class","annotation-group parentGroup").call(O);x.animation.animationEnabled&&k.attr("opacity",0).transition().duration(x.animation.animationDuration).ease(Xe[x.animation.animationEffect]).attr("opacity",1),k.selectAll("rect").style("visibility","hidden"),k.selectAll(".annotation-subject").remove(),k.selectAll(".connector").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[b]),k.selectAll(`.connector-${J}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[b]).filter(d=>d._dx==0&&d._dy==0).remove(),k.selectAll(".connector-end").filter(d=>d.connector.end=="dot"&&d._dx==0&&d._dy==0).remove(),k.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"),k.selectAll(".annotation-note-title").filter(d=>d.data&&!d.data.isVisible).style("display","none"),x.annotation.annotationType==Wt.automatic&&k.selectAll(".annotation-note-content").attr("transform",function(){const c=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(c)return`translate(${parseFloat(c[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)"),!x.plotArea.dataLabelName&&k.selectAll("tspan").attr("dy","0"),x.plotArea.dataLabelName&&k.selectAll(".annotation-note-title").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("font-size",d=>d.data.labelFontSize).attr("font-family",d=>d.data.labelFontFamily).style("font-style",d=>d.data.labelFontStyle.includes(se.italic)?se.italic:"").style("text-decoration",d=>d.data.labelFontStyle.includes(se.underline)?se.underline:"").style("font-weight",d=>d.data.labelFontStyle.includes(se.bold)?se.bold:"300").style("fill",d=>d.data.labelFontColor),x.plotArea.dataLabelValue&&k.selectAll(".annotation-note-label").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("font-size",d=>d.data.valueFontSize).attr("font-family",d=>d.data.valueFontFamily).style("font-style",d=>d.data.valueFontStyle.includes(se.italic)?se.italic:"").style("text-decoration",d=>d.data.valueFontStyle.includes(se.underline)?se.underline:"").style("font-weight",d=>d.data.valueFontStyle.includes(se.bold)?se.bold:"300").style("fill",d=>d.data.valueFontColor)}}catch(O){ge(da,"pyramidAnnotations",O)}},Ae=()=>{try{let ue=x.annotation.annotationType??"1",O=[ue=="1"?"connector":""],J=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"none";const F=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates||[])),b=new Map(F.map(k=>[k.data?.legend,k]));E=[],s.forEach((k,d)=>{try{const c=x.annotation.annotationVisibility,i=s.length-1;if(c===Wt.none||c===Wt.startOnly&&d!==0||c===Wt.endOnly&&d!==i||c===Wt.startAndEndBoth&&d!==0&&d!==i)return;let y={note:{title:x.plotArea.dataLabelName?k.properties.alias:"",label:x.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(k.data[0].value/Y)*100).toFixed(et(x.plotArea.dataLabelDecimalPrecision))+"%":x.plotArea.dataLabelValue?k.data[0].value>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(k.data[0].value/1e9)+"B":je(x.annotation.annotationDisplayUnits,x.plotArea.dataLabelNumberFormat,x.plotArea.dataLabelDecimalPrecision)(k.data[0].value):"",align:"middle"},data:{x:G/2,y:pe(k,d,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:ml[x.annotation.connectorCurve]},disable:O,subject:{height:15,width:15},type:fl[ue],color:x.plotArea.dataLabelNameColor!=we.black?x.plotArea.dataLabelNameColor:we.black,height:A,width:A,index:d};const f=b.get(k.legend);f&&(y.dx=f.dx*A/(f.width||A),y.dy=f.dy*u/(f.height||u),y.data.isVisible=f.data?.isVisible??!0),E.push(y)}catch(c){ge(da,"prepareNewAnnotationsList.forEach",c)}})}catch(ue){ge(da,"prepareNewAnnotationsList",ue)}},pe=(ue,O,J)=>{try{switch(J){case ni.top:return K[O]+30;case ni.middle:return(K[O]+K[O+1])/2+15;case ni.bottom:return K[O+1];default:return K[O]+30}}catch(F){return ge(da,"getYCordinate",F),0}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},Ta="ProgressChart.tsx",mr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:o,tooltipFormatter:h})=>{const n=Te.useRef();let l=bt(t),s,x,m,A=40,u=Ht,S=[0,0],p,H,g,G,V,j,K,Z;const Y=1,N=0;Te.useEffect(()=>{E()},[e]);const E=()=>{({chartFormatOptions:s,svg:V,width:x,height:m}=Jt(n,e)),S=Ia(s,l),{margins:u,innerHeight:p,innerWidth:H,legendListWidth:j,chartTitleHeight:A}=Na(s,x,m,S,u),z(),jt(n,x,m,s),G=la(V,u),_t(n,A,x,s),Pa(s,V,l,x,m,j,A,r,u,nt.hollowCircle,!0,o),q(),ce(),vi(s,g,A,V,x,m)},z=()=>{try{K=Math.min(p*.45,H*.45),Z=Math.min(et(s.plotArea.innerRadius)/100*K,K)}catch(oe){ge(Ta,"setRadiusAndInnerRadius",oe)}},q=()=>{try{g=t[Y].data[0].value+t[N].data[0].value}catch(oe){ge(Ta,"initProgressChartData",oe)}},ce=()=>{try{let oe=t[Y].data[0].value,xe=t[N].data[0].value,Ae=Math.PI*2,pe=xe/oe*Math.PI*2,ue=s.plotArea.dataLabelValueFontStyle;const O=T.arc().innerRadius(Z).outerRadius(K).startAngle(0).cornerRadius(et(s.plotArea.cornerRadius));G.append("path").attr("class","secondary-circle").attr("fill",t[Y].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressScale).attr("hoverId",F=>(t[Y]?.properties?.alias||t[Y]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[Y].properties.legendUniqueId??t[Y].properties.alias??"*").attr("data-dim-value",t[Y].properties.alias??"*").attr("d",O({endAngle:Ae})).on("mousemove",F=>{try{st([{key:t[Y].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(oe)}],s,void 0,t[Y].properties,ht(h,String(t[Y].properties?.alias??""),t[Y].properties))}catch(b){ge(Ta,"drawProgressChart.onMouseMove.secondary-circle",b)}}).on("mouseout",()=>{try{rt()}catch(F){ge(Ta,"drawProgressChart.onMouseOut.secondary-circle",F)}}).attr("transform",ne()),G.append("path").attr("class","progress-circle").attr("fill",t[N].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressGoal).attr("hoverId",F=>(t[N]?.properties?.alias||t[N]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[N].properties.legendUniqueId??t[N].properties.alias??"*").attr("data-dim-value",t[N].properties.alias??"*").attr("d",O({endAngle:pe})).on("mousemove",F=>{try{st([{key:t[N].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(xe/oe*100)+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(oe)},{key:t[Y].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(xe)}],s,void 0,t[N].properties,ht(h,String(t[N].properties?.alias??""),t[N].properties))}catch(b){ge(Ta,"drawProgressChart.onMouseMove.progress-circle",b)}}).on("mouseout",()=>{try{rt()}catch(F){ge(Ta,"drawProgressChart.onMouseOut.progress-circle",F)}}).attr("transform","translate("+H/2+","+p/2+")").transition().duration(s.animation.animationEnabled?s.animation.animationDuration:0).ease(Xe[s.animation.animationEffect]).attrTween("d",function(F){try{const b=T.interpolate(0,pe);return function(k){try{return O({endAngle:b(k)})}catch(d){return ge(Ta,"drawProgressChart.attrTween.inner",d),""}}}catch(b){return ge(Ta,"drawProgressChart.attrTween",b),()=>""}});const J=G.append("text").attr("transform",ne()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>s.plotArea.dataLabels&&Gi([{value:xe}],s,b=>b?.value??0).length>0?"visible":"hidden").attr("fill",s.plotArea.dataLabelValueColor!==we.white?s.plotArea.dataLabelValueColor:s.toolTip.toolTipDisplayUnits).attr("font-style",ue.includes(se.italic)?se.italic:"").attr("text-decoration",ue.includes(se.underline)?se.underline:"").attr("font-weight",ue.includes(se.bold)?se.bold:"").attr("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-size",s.plotArea.dataLabelValueFontSize).text(()=>s.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(xe/oe*100)+"%":je(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormatProgress,s.plotArea.dataLabelDecimalPrecision)(xe));s.animation.animationEnabled&&J.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1)}catch(oe){ge(Ta,"drawProgressChart",oe)}},ne=()=>{try{return"translate("+H/2+","+p/2+")"}catch(oe){return ge(Ta,"getTransformString",oe),""}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},fr=({data:{ChartData:t},formatOptions:e,chartId:r})=>{const o=Te.useRef(),h=bt(t);let n,l,s,x=40,m=Ht,A,u,S,p,H,g,G,V,j,K,Z,Y={},N;const E="Speedometer.tsx";Te.useEffect(()=>{z()},[e]);const z=()=>{({chartFormatOptions:n,svg:p,width:l,height:s}=Jt(o,e)),{margins:m,chartTitleHeight:x,innerHeight:A,innerWidth:u}=Qa(n,s,l),q(),jt(o,l,s,n),S=la(p,m),_t(o,x,l,n),ne(),oe(),Ae(),ue()},q=()=>{try{let b;A*.8<u*.45?(H=A*.8,b="width"):(H=u*.45,b="height"),N=ce(b),g=et(n.plotArea.innerRadiusForSpeedometer)/100*H}catch(b){ge(E,"initChartRadius",b)}};function ce(b){try{return b=="height"?`translate(${u/2},${A/2+H/2})`:`translate(${u/2},${s-60})`}catch(k){return ge(E,"centerTranslation",k),""}}const ne=()=>{try{let b=t[0].data[0].value;b<0?(G=0,V=b):(G=b,V=0),n.customScaling.customScalingtoggle?K=100:K=et(n.plotArea.ticks)}catch(b){ge(E,"initSpeedometerData",b)}},oe=()=>{try{j=[];let b=et(n.plotArea.ticks);if(n.customScaling.customScalingtoggle){for(let k=1;k<=b;k++){let d=n.customScaling[`share${k}`];if(j.length<100)for(let c=0;c<d;c++)j.push(n.customScaling[`division${k}`])}if(j.length<101)for(let k=j.length;k<100;k++)j.push(we.black)}else if(n.colorScale.showColor==ga.none){const k=t[0].properties?.color??"#bac8de";for(let d=1;d<=b;d++)j.push(k)}else if(n.colorScale.showColor==ga.discrete)for(let k=1;k<=b;k++)j.push(n.colorScale["division"+k]);else{let k=n.colorScale.startColor,d=n.colorScale.endColor;const c=T.scaleLinear().domain([0,b]).range([k,d]);for(let i=0;i<b;i++)j.push(c(i))}}catch(b){ge(E,"initColorTheme",b)}},xe=(b,k,d)=>{try{let c=[],i=Math.abs(b)-Math.abs(k),y=Math.abs(i)/d,f=k>0?0:k;c.push(f);for(let a=0;a<d-1;a++)f+=parseFloat(y.toFixed(5)),f.toFixed(5)<=Math.abs(b)&&c.push(f);return c.push(c.includes(b)?0:b),c}catch(c){return ge(E,"setTickValues",c),[]}},Ae=()=>{try{switch(n.plotArea.dataLabelsOptions){case Wt.automatic:Z=pe();break;case Wt.startOnly:Z=[V];break;case Wt.endOnly:let k=Array(K).fill("");k[K]=G,Z=k;break;case Wt.startAndEndBoth:let d=Array(K).fill("");d[K]=G,d[0]=V,Z=d;break;case Wt.none:Z=[];break}}catch(b){ge(E,"setDataLabelsOptions",b)}},pe=()=>{try{let b,k=et(n.plotArea.ticks),d=xe(G,V,K);if(n.customScaling.customScalingtoggle){let c=Array(100).fill("");c[0]=V;let i=0;for(let y=1;y<=k;y++){let f=parseInt(n.customScaling[`share${y}`]);if(i+=f,i>=100)break;c[i]=d[i]}c[99]=G,b=c}else b=d;return b}catch(b){return ge(E,"initTicksValues",b),[]}},ue=()=>{try{let k=function(d,c){try{let i=function(De){try{return De*Math.PI/180}catch(Ve){return ge(E,"deg2rad",Ve),0}},y=function(De){try{let Ve;for(Ve in De)ee[Ve]=De[Ve];L=ee.maxAngle-ee.minAngle,ae=Math.round(H*ee.pointerHeadLengthPercent),Le=T.scaleLinear().range([0,1]).domain([ee.minValue,ee.maxValue]),be=T.arc().innerRadius(g).outerRadius(H).startAngle((Ye,ie)=>{let ye=1/ee.majorTicks*ie;return i(ee.minAngle+ye*L)}).endAngle((Ye,ie)=>{let ye=1/ee.majorTicks*(ie+1);return i(ee.minAngle+ye*L)})}catch(Ve){ge(E,"configure",Ve)}},f=function(De,Ve){try{if(Ve===0){S.append("g").attr("class","arc").attr("transform",N).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(j).enter().append("path").attr("fill",ve=>ve).attr("stroke",ve=>ve).attr("d",be);let Me=G,Ce=S.append("g").attr("class","label").attr("transform",N);if(Ce.selectAll("text").data(Z).enter().append("text").attr("transform",function(ve,he){let fe=L/ee.majorTicks*he;return"rotate("+(ee.minAngle+fe)+") translate(0,"+(ee.labelInset-H)+")"}).attr("text-anchor","middle").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==we.white?n.plotArea.dataLabelValueColor:"none").attr("font-style",n.plotArea.dataLabelValueFontStyle.includes(se.italic)?se.italic:"").attr("text-decoration",n.plotArea.dataLabelValueFontStyle.includes(se.underline)?se.underline:"").attr("font-weight",n.plotArea.dataLabelValueFontStyle.includes(se.bold)?se.bold:"").attr("font-family",n.plotArea.dataLabelValueFontFamily).text(ve=>n.plotArea.dataLabelNumberFormat==",.0%"?Q=Math.round(ve/Me*100)+"%":je(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(ve)).attr("visibility",ve=>ve===""?"hidden":"visible"),n.animation.animationEnabled){const ve=n.animation.animationDuration,he=Xe[n.animation.animationEffect];Ce.selectAll("text").attr("opacity",0).attr("transform",function(fe,de){const le=L/ee.majorTicks*de;return`rotate(${ee.minAngle+le}) translate(0, ${ee.labelInset-H+20})`}).transition().duration(ve).ease(he).attr("opacity",1).attr("transform",function(fe,de){const le=L/ee.majorTicks*de;return`rotate(${ee.minAngle+le}) translate(0, ${ee.labelInset-H})`})}}n.pointerValue.showPointerValue&&h.length===2&&J(N);let Ye=[[ee.pointerWidth/2,0],[0,-ae],[-(ee.pointerWidth/2),0],[0,ee.pointerTailLength],[ee.pointerWidth/2,0]],ie=T.line().curve(T.curveLinear);te=S.append("g").data([Ye]).attr("class","pointer").attr("transform",N).append("path").attr("d",Ve>0?ie:null).attr("transform","rotate("+ee.minAngle+")").attr("fill",n.plotArea.pointerColor).on("mousemove",(Pe,Me)=>{st([{key:`${t[Ve].data[0].legend}`,value:n.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[Ve].data[0].value/Fe[Fe.length-1]*100)+"%":je(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(t[Ve].data[0].value)}],n,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{rt()}),te.selectAll("text").append("text").text(ee.maxValue),a(De===void 0?0:De)}catch(Ye){ge(E,"gauge.render",Ye)}},a=function(De,Ve){try{Ve!==void 0&&y(Ve);let Ye=Le(De),ie=ee.minAngle+Ye*L;te.transition().duration(n.animation.animationEnabled?n.animation.animationDuration:0).ease(Xe[n.animation.animationEffect]).attr("transform","rotate("+ie+")")}catch(Ye){ge(E,"gauge.update",Ye)}},L,P,ae,Q,be,Le,Fe,me,te,ke,ee={clipWidth:u,clipHeight:A,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:et(n.plotArea.pointerHeadLength)/10,minValue:V,maxValue:G,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:K,labelFormat:De=>je(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(De),labelInset:-5};return Y.configure=y,Y.render=f,Y.update=a,y(c),Y}catch(i){ge(E,"gauge",i)}}("#power-gauge",{clipWidth:u,clipHeight:A,ringWidth:2.75*et(n.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:G,transitionMs:0});if(h.length>0)for(let d=0;d<h.length;d++)k.render(O(h[d],d),d)}catch(b){ge(E,"initSpeedometer",b)}};function O(b,k){try{let d=G,c=b.data[0].value;return d<0&&c>0||d>0&&c<0?0:d<0&&c<0&&d>c?d:d<0&&c<0&&d<c||d>c?c:d}catch(d){return ge(E,"setPointerofSpeedometer",d),0}}function J(b){try{let k="";if(n.pointerValue.kpiAlias)k=n.pointerValue.kpiAliasText;else switch(n.pointerValue.connectorKPIforSpeedometer){case Za.PointerValue:k="Pointer Value";break;case Za.Absolute:k="Absolute Value";break;case Za.CAGR:k="CAGR";break;case Za.PercentageGrowth:k="Percentage Growth";break}let d=n.pointerValue.pointerValueFontStyle;S.selectAll(".pointerValueText").remove(),S.append("g").attr("class","pointerValueText").attr("transform",b).selectAll("text").data(["chartData.dataArray[1].maximumMeasure"]).enter().append("text").attr("dy","24").attr("text-anchor","middle").attr("font-size",n.pointerValue.pointerValueFontSize).attr("fill",n.pointerValue.pointerValueColor!==we.white?n.pointerValue.pointerValueColor:"none").attr("font-style",d.includes(se.italic)?se.italic:"").attr("text-decoration",d.includes(se.underline)?se.underline:"").attr("font-weight",d.includes(se.bold)?se.bold:"").attr("font-family",n.pointerValue.pointerValueFontFamily).text(i=>`${k}: ${!n.pointerValue.pointerValueAlias&&i!=0?F(t[0].data[0].value,t[1].data[0].value):n.pointerValue.pointerValueAliasText}`).attr("visibility",n.plotArea.dataLabels?"visible":"hidden")}catch(k){ge(E,"setPointerValueText",k)}}function F(b,k){try{let d=b-k,c=1,i=parseInt(n.pointerValue.connectorKPIforSpeedometer),y,f;const a=n.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:d=k;break;case 2:d=Math.abs(d);break;case 3:return y=`.${a}%`,d=Math.pow(k/b,1/c)-1,f=T.format(y)(d),f;case 4:return y=`.${a}%`,d=Math.round(k/b*100-100)/100,f=T.format(y)(d),f}return isNaN(d)&&(d=0),je(n.pointerValue.pointerValueDisplayUnits,n.pointerValue.pointerValueNumberFormat,a)(d)}catch(d){return ge(E,"connectorNumberFormat",d),""}}return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:o,id:r,style:{width:"100%",height:"100%"}})})};function Sa(t,e,r){console.error(`[${t}][${e}]`,r)}const Tr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:o,tooltipFormatter:h})=>{const n=Te.useRef(),l=bt(t);let s,x,m,A=40,u=Ht,S=[0,0],p,H,g,G,V,j;Te.useEffect(()=>{K()},[e]);const K=()=>{({chartFormatOptions:s,svg:G,width:x,height:m}=Jt(n,e)),Z(),{margins:u,innerHeight:p,innerWidth:H,legendListWidth:j,chartTitleHeight:A}=Na(s,x,m,S,u),S=Ia(s,l),jt(n,x,m,s),g=la(G,u),_t(n,A,x,s),Pa(s,G,l,x,m,j,A,r,u,nt.hollowCircle,!1,o),N()},Z=()=>{try{V=0,l.forEach(z=>{V+=z.data[0].value})}catch(z){Sa("RadialBarChart.tsx","loopOverChartData",z)}},Y=z=>{try{switch(s.plotArea.dataLabelsOptions){case Wt.automatic:return z.map((ce,ne)=>({...ce,index:ne}));case Wt.startOnly:return[{...z[0],index:0}];case Wt.endOnly:return[{...z[z.length-1],index:z.length-1}];case Wt.startAndEndBoth:return[{...z[0],index:0},{...z[z.length-1],index:z.length-1}];case Wt.none:return[]}}catch(q){return Sa("RadialBarChart.tsx","getModifiedDataForLabels",q),z}},N=()=>{try{let z=function(me,te){try{const ke=T.interpolate(0,c(Math.abs(me.data[0].value)));return ee=>ae({...me,endAngle:ke(ee)},te)}catch(ke){Sa("RadialBarChart.tsx","arcTween",ke)}},q=function(me){try{return me*180/F}catch(te){Sa("RadialBarChart.tsx","radTodeg",te)}},ce=function(me){try{return me*Math.PI/180}catch(te){Sa("RadialBarChart.tsx","degToRad",te)}},ne=function(me){try{return b+(L-(me+1))*(P+k)}catch(te){Sa("RadialBarChart.tsx","getInnerRadius",te)}},oe=function(me){try{return ne(me)+P}catch(te){Sa("RadialBarChart.tsx","getOuterRadius",te)}},xe=l.length>1?T.max(l,me=>me.data[0].value)*1.1:t[0].data[0].value*1.1,Ae=s.plotArea.dataLabelValueFontStyle,pe=je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(xe),ue=s.plotArea.axialAxis?It(pe,et(s.plotArea.axialAxisDataLabelFontSize),s.plotArea.axialAxisDataLabelFontFamily).width+10:20;const O=Math.min(p*.5,H*.5)-ue;let J=g.append("g").attr("transform",E()).attr("width",H).attr("height",p);const F=Math.PI,b=l.length>1?10:70,k=et(s.plotArea.arcPadding),d=et(s.plotArea.axialTicks);let c=T.scaleLinear().domain([0,xe]).range([0,ce(360)]),i=c.ticks(d);i[i.length-1]==xe&&i.pop();let y=i,f=l.map((me,te)=>me.data[0].legend),a=l.reduce((me,te)=>me+te.data[0].value,0);const L=f.length,P=(O-b-L*k)/L;let ae=T.arc().innerRadius((me,te)=>ne(te)).outerRadius((me,te)=>oe(te)).startAngle(0).endAngle(me=>me.endAngle),Q=T.arc().innerRadius((me,te)=>ne(te)).outerRadius((me,te)=>oe(te)).startAngle(0).endAngle(ce(360)),be=J.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");s.plotArea.axialGrid&&be.append("circle").attr("r",(me,te)=>oe(te)+k).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let Le=J.append("g").attr("class","a axis").selectAll("g").data(y).enter().append("g").attr("transform",me=>"rotate("+(q(c(me))-90)+")");s.plotArea.axialGrid&&Le.append("line").attr("x2",O).attr("stroke","#a9a9a9").attr("stroke-width",1),Le.append("text").attr("x",O+10).attr("class","text-xs text-gray-600").style("text-anchor",me=>c(me)>=F&&c(me)<2*F?"end":null).attr("transform",me=>"rotate("+(90-q(c(me)))+","+(O+10)+",0)").text(me=>je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(me)).attr("fill",s.plotArea.axialAxisDataLabelColor!==we.white?s.plotArea.axialAxisDataLabelColor:"none").style("font-size",s.plotArea.axialAxisDataLabelFontSize).style("font-family",s.plotArea.axialAxisDataLabelFontFamily).attr("font-style",s.plotArea.axialAxisDataLabelFontStyle.includes(se.italic)?se.italic:"").attr("text-decoration",s.plotArea.axialAxisDataLabelFontStyle.includes(se.underline)?se.underline:"").attr("font-weight",s.plotArea.axialAxisDataLabelFontStyle.includes(se.bold)?se.bold:"").attr("visibility",s.plotArea.axialAxis?"visible":"hidden");let Fe=J.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,te)=>ae({...me,endAngle:0},te)).on("mousemove",(me,te)=>{st([{key:s.yAxisTitle.yAxisTitleText,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(te.data[0].value/a)*100).toFixed(et(s.toolTip.toolTipDecimalPrecision))+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(te.data[0].value)},{key:"Legend",value:te.properties.alias}],s,void 0,te.properties,ht(h,String(te.data[0]?.legend??""),te.properties))}).on("mouseout",()=>{rt()});if(s.animation.animationEnabled?Fe.transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attrTween("d",z):Fe.attr("d",(me,te)=>ae({...me,endAngle:c(Math.abs(me.data[0].value))},te)),s.plotArea.dataLabels){const me=Gi(Y(t),s,ke=>ke?.data?.[0]?.value??0),te=J.selectAll(".arc-label-"+r).data(me).enter().append("text").attr("class","arc-label-"+r).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(ke,ee)=>(oe(ke.index??ee)-ne(ke.index??ee))/1.75);te.append("textPath").attr("xlink:href",(ke,ee)=>`#arc-path-${ke.index??ee}-`+r).style("startOffset","50%").attr("hoverId",ke=>ke.legend.replaceAll(" ","-")).text(ke=>`  ${ke.properties.alias}
150
-  ${s.plotArea.dataLabelValue?je(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormat,s.plotArea.dataLabelDecimalPrecision)(ke.data[0].value):""}`).attr("fill",s.plotArea.dataLabelValueColor!==we.white?s.plotArea.dataLabelValueColor:"none").style("font-size",s.plotArea.dataLabelValueFontSize).style("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-style",Ae.includes(se.italic)?se.italic:"").attr("text-decoration",Ae.includes(se.underline)?se.underline:"").attr("font-weight",Ae.includes(se.bold)?se.bold:"").on("mousemove",(ke,ee)=>{st([{key:s.yAxisTitle.yAxisTitleText,value:je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)(ee.data[0].value)},{key:"Legend",value:ee.properties.alias}],s,ke,ee.properties,ht(h,String(ee.data[0]?.legend??""),ee.properties))}).on("mouseout",()=>{rt()}),s.animation.animationEnabled&&te.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1),Fe.each((ke,ee)=>{J.append("path").attr("id",`arc-path-${ee}-`+r).attr("d",Q(ke,ee)).attr("fill","none").attr("stroke","none")})}}catch(z){Sa("RadialBarChart.tsx","initRadialBarChart",z)}},E=()=>{try{return`translate(${H/2},${p/2})`}catch(z){Sa("RadialBarChart.tsx","getPiePosition",z)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},ya="WordCloud.tsx",vr=({data:{ChartData:t},formatOptions:e,chartId:r,tooltipFormatter:o})=>{const h=Te.useRef();let n=bt(t),l,s,x,m=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,p,H,g,G,V,j=0;Te.useEffect(()=>{K()},[e]);const K=()=>{({chartFormatOptions:l,svg:G,width:s,height:x}=Jt(h,e)),{margins:S,chartTitleHeight:u,innerHeight:p,innerWidth:H}=Qa(l,x,s),jt(h,s,x,l),g=la(G,S),_t(h,u,s,l),Z(),Y()},Z=()=>{try{j=0,n=n.map(N=>{let E=N.data[0].value;return j+=E,l.plotArea.hideZeroValues&&E==0?null:(E<m&&(m=E),E>A&&(A=E),N)}),n=n.filter(N=>N!==null),V=T.scaleLinear().domain([m,A]).range([12,70])}catch(N){ge(ya,"calculateWordCloudData",N)}},Y=()=>{try{let N=function(ce){try{g.append("g").attr("transform","translate("+q.size()[0]/2+","+q.size()[1]/2+")").selectAll("text").data(ce).enter().append("text").attr("font-size",function(ne){try{return V(ne.data[0].value)+"px"}catch(oe){return ge(ya,"draw-font-size",oe),"12px"}}).attr("text-anchor","middle").style("font-family",l.text.textFontFamily).attr("fill",function(ne){try{return ne.properties.color!==we.white?ne.properties.color:"none"}catch(oe){return ge(ya,"draw-fill",oe),"none"}}).attr("transform",function(ne){try{return"translate("+[ne.x,ne.y]+")rotate("+ne.rotate+")"}catch(oe){return ge(ya,"draw-transform",oe),""}}).text(function(ne){try{return ne.properties.alias}catch(oe){return ge(ya,"draw-text",oe),""}}).attr("data-series-id",ne=>ne.properties.legendUniqueId??ne.properties.alias).attr("data-dim-value",ne=>ne.properties.alias).on("mousemove.text",(ne,oe)=>{try{st([{key:oe.properties.alias,value:je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(oe.data[0].value)},{key:oe.properties.measureUniqueId,value:j}],l,void 0,oe.properties,ht(o,String(oe.properties.alias??""),oe.properties))}catch(xe){ge(ya,"draw-mousemove",xe)}}).on("mouseout.text",()=>{try{rt()}catch(ne){ge(ya,"draw-mouseout",ne)}})}catch(ne){ge(ya,"draw",ne)}},E=l.text.textSpacing,z=l.text.textRotation,q=yl().size([H,p]).words(n).padding(E).rotate(function(){try{return Math.round(Math.random())*z}catch(ce){return ge(ya,"rotate",ce),0}}).random(()=>.5).font(l.text.textFontFamily).fontWeight("bolder").fontSize(function(ce){try{return V(ce.data[0].value)}catch(ne){return ge(ya,"fontSize",ne),12}}).text(function(ce){try{return ce.properties.alias}catch(ne){return ge(ya,"text",ne),""}}).on("end",N);q.start()}catch(N){ge(ya,"drawWordCloudChart",N)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:h,id:r,style:{width:"100%",height:"100%"}})})},kr=({data:t,formatOptions:e,chartId:r})=>{const o=Te.useRef();let h=bt(t),n,l,s,x=40,m=Ht,A,u,S,p=[0,0],H,g;Te.useEffect(()=>{G()},[e]);const G=()=>{({chartFormatOptions:n,svg:g,width:l,height:s}=Jt(o,e)),p=j(),{margins:m,innerHeight:A,innerWidth:u,legendListWidth:S,chartTitleHeight:x}=Na(n,l,s,p,m,!0),jt(o,l,s,n),H=la(g,m),_t(o,x,l,n),V(),K()},V=()=>{try{let Z=n.plotArea.dataLabelNameFontStyle,Y=n.plotArea.dataLabelValueFontStyle,N=H.attr("class","vennContainer");N&&N.datum(t).call(bl.VennDiagram().width(u).height(A)),N&&N.selectAll(".venn-circle path").style("fill-opacity",n.plotArea.opacity),n.plotArea.dataLabelName?(N&&N.selectAll(".venn-circle text").html(""),N&&N.selectAll(".venn-circle text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",Z.includes(se.italic)?se.italic:"").attr("text-decoration",Z.includes(se.underline)?se.underline:"").style("font-weight",Z.includes(se.bold)?se.bold:"").html(E=>E.label).attr("visibility",n.plotArea.dataLabelName?"visible":"hidden")):(N&&N.selectAll(".venn-circle text").style("visibility","hidden"),N&&N.selectAll(".venn-circle text").html("")),n.plotArea.dataLabelValue&&N&&N.selectAll(".venn-circle text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==we.white?n.plotArea.dataLabelValueColor:"none").style("font-style",Y.includes(se.italic)?se.italic:"normal").attr("text-decoration",Y.includes(se.underline)?se.underline:"none").style("font-weight",Y.includes(se.bold)?se.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(E=>E.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(E.actualValue):"").attr("visibility",n.plotArea.dataLabelValue?"visible":"hidden"),n.plotArea.intersectionLabelVisibility?(N&&N.selectAll(".venn-intersection text").html(""),N&&N.selectAll(".venn-intersection text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",Z.includes(se.italic)?se.italic:"").attr("text-decoration",Z.includes(se.underline)?se.underline:"").style("font-weight",Z.includes(se.bold)?se.bold:"").html(E=>E.label).attr("visibility",n.plotArea.intersectionLabelVisibility?"visible":"hidden")):(N&&N.selectAll(".venn-intersection text").style("visibility","hidden"),N&&N.selectAll(".venn-intersection text").html("")),n.plotArea.intersectionValueVisibility&&N&&N.selectAll(".venn-intersection text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==we.white?n.plotArea.dataLabelValueColor:"none").style("font-style",Y.includes(se.italic)?se.italic:"normal").attr("text-decoration",Y.includes(se.underline)?se.underline:"none").style("font-weight",Y.includes(se.bold)?se.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(E=>E.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(E.actualValue):"").attr("visibility",n.plotArea.intersectionValueVisibility?"visible":"hidden"),N&&N.selectAll(".venn-circle path").style("fill",E=>E.properties?E.properties.color:null),N&&N.selectAll("g").on("mousemove",function(E,z){st([{key:z.label,value:je(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(z.size)}],n,void 0,z.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(E,z){rt();var q=T.select(this).transition("tooltip").duration(400);q.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(Z){ge("VennChart.tsx","drawVennDiagramChart",Z)}},j=()=>{try{let Z=0,Y=0;return h.forEach(N=>{if(N.legendDisplay){let E=It(N.legendDisplay+" : "+N.actualValue,et(n.legends.legendFontSize),n.legends.legendFontFamily);Z=Math.max(Z,E.width),Y=Math.max(Y,E.height)}}),[Z,Y]}catch(Z){return ge("VennChart.tsx","calculateLegendsMaxPossibleWidth",Z),[0,0]}},K=()=>{try{let Z=n.legends.legendPosition,Y=n.legends.legendAlignmentTopBottom,N=n.legends.legendAlignment;switch(Z){case Be.none:break;case Be.right:oa(g,h,l-S-25,x+5,S+15,s-x-10,Z,N,nt.none,n,r,!0);break;case Be.top:oa(g,h,5,x+5,l-10,30,Z,Y,nt.none,n,r,!0);break;case Be.left:oa(g,h,5,m.top,S+15,s-x-10,Z,N,nt.none,n,r,!0);break;case Be.bottom:oa(g,h,5,s-35,l-10,30,Z,Y,nt.none,n,r,!0);break}}catch(Z){ge("VennChart.tsx","initLegendListWithTotalValueAllowance",Z)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:o,id:r,style:{width:"100%",height:"100%"}})})},Cr=({formatOptions:t,data:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{if(!e)return null;let l=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],s=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const x=Te.useRef(),m=Te.useRef(o);m.current=o;const A=Te.useRef(h);A.current=h;let u,S,p,H=40,g=Ht,G,V,j,K,Z=Oa.left,Y=0,N=!1,E=new Map,z=new Map,q=.8,ce=.8;Te.useEffect(()=>{ne()},[t]);const ne=()=>{({chartFormatOptions:u,svg:K,width:S,height:p}=Jt(x,t)),{margins:g,chartTitleHeight:H,innerHeight:G,innerWidth:V}=Qa(u,p,S),oe(),jt(x,S,p,u),j=la(K,g),_t(x,H,S,u),pe()},oe=()=>{try{q=et(u.nodes.nodesFillOpacity),ce=et(u.links.linksFillOpacity),s.forEach(b=>{b.totalValue=0}),s.forEach(b=>l.forEach(k=>(b.name==k.source||b.name==k.target)&&(b.totalValue=(b.totalValue||0)+k.value))),s=s.filter(b=>b.totalValue!=0),l=l.filter(b=>b.value!=0);let J=ue(l),F=new Map;J.forEach(b=>{b.nodes.forEach(k=>{F.set(k,b.layer)})}),s.forEach(b=>{let k=F.get(b.name);E.set(k,(E.get(k)||0)+b.totalValue)}),s.forEach(b=>{z.set(b.name,b.totalValue/E.get(F.get(b.name))*100)}),xe(J)}catch(J){ge("SankeyChart.tsx","prepareDataForSankey",J)}},xe=J=>{try{N=u.nodes.nodesLabelWrap,Z=u.nodes.nodesLabelVisibility?u.nodes.sankeyChartType:"None";let F="",b=0;s.forEach(c=>{F=c.name.length>F.length?c.name:F,b=c.totalValue.toString().length>b.toString().length?c.totalValue:b});let k=It(F,et(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily),d=It(je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(b),et(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily);Y=Math.max(k.width,d.width)+6,N&&(Y=Math.min(V*.1,Y))}catch(F){ge("SankeyChart.tsx","calculateMaxNodeValueWidth",F)}},Ae=(J,F)=>{try{let b=u.nodes.spacing!==void 0?et(u.nodes.spacing)*1.5:15,k=u.nodes.sankeyNodeWidth!==void 0?u.nodes.sankeyNodeWidth:10,d=[],c=[];switch(Z){case Oa.center:d=[1,5],c=[V,G];break;case Oa.right:d=[1,5],c=[V-Y,G];break;case Oa.left:d=[Y,5],c=[V,G];break;default:d=[1,5],c=[V,G];break}return ki.sankey().nodeId(y=>y.name).nodeAlign(ki.sankeyJustify).nodeWidth(k).nodePadding(b).extent([d,c]).nodeSort(null)({nodes:J.map(y=>Object.assign({},y)),links:F.map(y=>Object.assign({},y))})}catch(b){return ge("SankeyChart.tsx","getsankey",b),{nodes:[],links:[]}}},pe=()=>{try{let J=function(){try{const f={};d.forEach(a=>{const L=a.x0;f[L]||(f[L]=[]),f[L].push(a)}),Object.keys(f).forEach(a=>{const L=f[a];if(L.length===0)return;L.sort((Le,Fe)=>Le.y0-Fe.y0);const P=L[0],ae=L[L.length-1],Q=P.y1-P.y0,be=ae.y1-ae.y0;if(P.y0=0,P.y1=Q,ae.y1=G,ae.y0=G-be,L.length>2){const Le=L.slice(1,L.length-1),Fe=ae.y0-P.y1,me=T.sum(Le,ee=>ee.y1-ee.y0),te=(Fe-me)/(Le.length+1);let ke=P.y1+te;Le.forEach(ee=>{const De=ee.y1-ee.y0;ee.y0=ke,ee.y1=ke+De,ke+=De+te})}})}catch(f){ge("SankeyChart.tsx","centerAlignNodesByLayer",f)}},F=function(){try{d.forEach(f=>{let a=0,L=0;f.sourceLinks.forEach(P=>{P.sy=a,a+=P.width}),f.targetLinks.forEach(P=>{P.ty=L,L+=P.width})})}catch(f){ge("SankeyChart.tsx","arrangeFlows",f)}},b=function(f){return function(a){try{const L=a.source.x1,P=a.source.y0+a.sy+a.width/2,ae=a.target.x0,Q=a.target.y0+a.ty+a.width/2,be=ae-L,Le=L+be*f,Fe=ae-be*f;return`M${L},${P} C${Le},${P} ${Fe},${Q} ${ae},${Q}`}catch(L){return ge("SankeyChart.tsx","sankeyLinkCustom",L),""}}},k=u.nodes.curviness!==void 0?u.nodes.curviness!=="0"?u.nodes.curviness:.1:.5;const{nodes:d,links:c}=Ae(s,l);F(),J(),F(),F();const i=j.append("g").selectAll("rect").data(d).enter().append("rect").style("fill-opacity",q).attr("id",f=>"Node"+f.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none").attr("stroke-width",u.nodes.nodesBorderVisibility?u.nodes.nodesBorderThickness:0).attr("x",f=>f.x0).attr("y",f=>f.y0).attr("height",f=>f.y1-f.y0).attr("width",f=>f.x1-f.x0).attr("fill",f=>f.color?f.color:we.white).on("mousemove",function(f,a){try{u.toolTip.toolTipVisibility&&st([{key:a.name.split("~$~")[1],value:u.toolTip.toolTipNumberFormat==",.0%"?z.get(a.name)+"%":je(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerShape:"square",markerColor:a.color},ht(n,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),j.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),j.selectAll(".sankey-nodes-texts").style("opacity","0"),j.selectAll(".sankey-links").style("stroke-opacity",.1),j.select(`#Node${a.index}`).style("stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",q).style("cursor","pointer"),j.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(L=>{j.select(`#Node${L.target.index}`).style("fill-opacity",q).style("stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${L.index}`).style("stroke-opacity",ce),j.select(`#Label${L.target.index}`).style("opacity",1)}),a.targetLinks.forEach(L=>{j.select(`#Node${L.source.index}`).style("fill-opacity",q).style("stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${L.index}`).style("stroke-opacity",ce),j.select(`#Label${L.source.index}`).style("opacity",1)})}catch(L){ge("SankeyChart.tsx","Nodes.onMouseMove",L)}}).on("mouseout",function(f){try{j.selectAll(".sankey-nodes").style("fill-opacity",q).style("stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",ce),j.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&rt()}catch(a){ge("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(Qe.SeriesId,f=>String(f.name??"")).attr(Qe.DimValue,f=>String(f.name??"")).on("click",At(A,m,(f,a)=>{const L=String(a.name??"");return{seriesId:L,dimValue:L,legendUniqueId:L,seriesDisplayName:L.includes("~$~")?L.split("~$~")[1]:L}}));if(j.append("g").attr("fill","none").selectAll("g").data(c).enter().append("g").style("mix-blend-mode","multiply").append("path").attr("class","sankey-links").attr("stroke-opacity",ce).attr("id",f=>"Link"+f.index).attr("d",b(k)).attr("stroke",f=>u.links.linksColor==="Source"?f.source.color:f.target.color).attr("stroke-width",f=>Math.max(1,f.width)).on("mousemove",function(f,a){try{j.selectAll(".sankey-links").style("stroke-opacity",.1),j.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),j.selectAll(".sankey-nodes-texts").style("opacity","0"),j.select(`#Link${a.index}`).style("stroke-opacity",ce).style("cursor","pointer"),j.select(`#Node${a.target.index}`).style("fill-opacity",q).style("Stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none"),j.select(`#Node${a.source.index}`).style("fill-opacity",q).style("Stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none"),j.select(`#Label${a.target.index}`).style("opacity",1),j.select(`#Label${a.source.index}`).style("opacity",1),u.toolTip.toolTipVisibility&&st([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:je(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerColor:a.source.color,markerShape:"circle"},ht(n,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(L){ge("SankeyChart.tsx","link.onMouseMove",L)}}).on("mouseout",function(f){try{u.toolTip.toolTipVisibility&&rt(),j.selectAll(".sankey-nodes").style("fill-opacity",q),j.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==we.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",ce),j.selectAll(".sankey-nodes-texts").style("opacity","1"),T.select(this).select("rect").style("pointer-events","all"),T.select(this).style("cursor","none")}catch(a){ge("SankeyChart.tsx","link.onMouseOut",a)}}),u.nodes.nodesLabelVisibility)try{const f=j.append("g").attr("font-family",u.nodes.nodesLabelFontFamily).attr("font-size",u.nodes.nodesLabelFontSize).style("font-style",u.nodes.nodesLabelFontStyle.includes(se.italic)?se.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(se.underline)?se.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(se.bold)?se.bold:"").attr("display",u.nodes.nodesLabelVisibility?"visible":"none").selectAll("text").data(d).enter().append("g").attr("class","sankey-nodes-texts").attr("id",a=>"Label"+a.index).each(function(a){try{if(u.nodes.sankeyChartType!=="None"){const L=u.nodes.sankeyNodeWidth,P=Z===Oa.center;T.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y-16).attr("width",be=>P?L:Y).attr("height",20).append("xhtml:div").style("white-space",P||N?"nowrap":"normal").style("overflow",P||N?"hidden":"visible").style("text-overflow",P||N?"ellipsis":"clip").style("display","block").style("max-width",be=>P?"100px":Y+"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(se.italic)?se.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(se.underline)?se.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(se.bold)?se.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",be=>z.get(be.name)>0?be.alias?be.alias.includes("~$~")?be.alias.split("~$~")[1]:be.alias:be.name.includes("~$~")?be.name.split("~$~")[1]:be.name:"").text(be=>z.get(be.name)>0?be.alias?be.alias.includes("~$~")?be.alias.split("~$~")[1]:be.alias:be.name.includes("~$~")?be.name.split("~$~")[1]:be.name:""),T.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y).attr("width",be=>P?L:Y).attr("height",20).append("xhtml:div").style("white-space",P||N?"nowrap":"normal").style("overflow",P||N?"hidden":"visible").style("text-overflow",P||N?"ellipsis":"clip").style("display","block").style("max-width",be=>P?"100px":Y+"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(se.italic)?se.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(se.underline)?se.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(se.bold)?se.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",be=>z.get(be.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?z.get(be.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(be.totalValue):"").text(be=>z.get(be.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?z.get(be.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(be.totalValue):"")}}catch(L){ge("SankeyChart.tsx","texts.each",L)}})}catch(f){ge("SankeyChart.tsx","inittree.texts",f)}}catch(J){ge("SankeyChart.tsx","inittree",J)}};function ue(J){try{const F=new Map,b=new Map,k=new Set;for(const{source:f,target:a}of J)k.add(f),k.add(a),F.has(a)||F.set(a,new Set),b.has(f)||b.set(f,new Set),F.get(a).add(f),b.get(f).add(a);const d=new Map,c=[];for(const f of k)F.has(f)||(d.set(f,0),c.push(f));for(;c.length>0;){const f=c.shift(),a=d.get(f),L=b.get(f)||[];for(const P of L){const ae=a+1;(!d.has(P)||d.get(P)<ae)&&(d.set(P,ae),c.push(P))}}const i=new Map;for(const[f,a]of d.entries())i.has(a)||i.set(a,[]),i.get(a).push(f);return[...i.entries()].sort((f,a)=>f[0]-a[0]).map(([f,a])=>({layer:f,nodes:a}))}catch(F){return ge("SankeyChart.tsx","assignNodeLayers",F),[]}}const O=J=>{try{let F={};const b=Number(u.nodes.sankeyNodeWidth),k=b/2;switch(Z){case"Right":F.x=J.x1+6;break;default:case"Left":F.x=J.x0-Y;break;case"Center":F.x=J.x0+k-b/2;break}return F.y=(J.y1+J.y0)/2,F}catch(F){return ge("SankeyChart.tsx","getXandYPositionOfLables",F),{x:0,y:0}}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:x,id:r,style:{width:"100%",height:"100%"}})})},Mr={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]]]}}]},Sr=({data:t,geoJsonNode:e,formatOptions:r,chartId:o})=>{const h=Te.useRef();let n=bt(t),l,s,x,m=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,p,H,g,G,V=0,j=1,K,Z=new Map,Y=new Map,N=new Map,E=Number.MAX_VALUE,z=Number.MIN_VALUE,q=0,ce=0,ne,oe;Te.useEffect(()=>{xe()},[r,o]);const xe=()=>{({chartFormatOptions:l,svg:G,width:s,height:x}=Jt(h,r)),{margins:S,chartTitleHeight:u,innerHeight:p,innerWidth:H}=Qa(l,x,s),jt(h,s,x,l),g=la(G,S),_t(h,u,s,l),Ae(t),pe(),ue(),O()},Ae=F=>{try{let b=new Set,k=new Set;F.forEach(i=>{i.data.forEach((y,f)=>{f===V&&(b.add(y.value.toString()),q+=y.value),f===j&&(k.add(y.value.toString()),ce+=y.value)})});let d=l.colorScaleForMaps&&l.colorScaleForMaps.startColorForMaps?l.colorScaleForMaps.startColorForMaps:"#c1d8f3",c=l.colorScaleForMaps&&l.colorScaleForMaps.endColorForMaps?l.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(b.size===1)ne=()=>d;else{const i=T.interpolateLab(d,c);ne=T.scaleOrdinal().domain(Array.from(b)).range(Array.from(b).map((y,f)=>i(f/(b.size-1))))}if(k.size===1)oe=()=>d;else{const i=T.interpolateLab(l.colorScaleForMapsBubble.startColorForMapsBubble,l.colorScaleForMapsBubble.endColorForMapsBubble);oe=T.scaleOrdinal().domain(Array.from(k)).range(Array.from(k).map((y,f)=>i(f/(k.size-1))))}}catch(b){ge("Maps.tsx","dataPreparation",b)}},pe=F=>{K=Mr},ue=()=>{try{n?.forEach(F=>{N.set(F.legend,F)}),e.mappings.forEach(F=>{Y.set(F.actualName,F.mappedName)}),e.groups.forEach(F=>{F.groupedRegions.forEach(b=>{Z.set(b,F.groupName)})}),K.features.forEach(F=>{const b=F.properties.name;let k;if(Y.has(b)){const d=Y.get(b);F.properties.displayName=d,k=d}if(Z.has(b)){const d=Z.get(b);F.properties.displayName=d,k=d}else k=b;if(N.has(k)){const d=N.get(k);F.properties.data=d;let c;d.data&&d.data[1]&&(c=d.data[1]?d.data[1].value:0,E=Math.min(E,c),z=Math.max(z,c)),d.data&&d.data[0]&&(c=d.data[0].value,m=Math.min(m,c),A=Math.max(A,c))}else F.properties.data=void 0})}catch(F){ge("Maps.tsx","generateDataForMaps",F)}},O=()=>{try{let F=0;const b=T.geoAlbersUsa().fitSize([H,p],K),k=T.geoPath().projection(b),d=g.append("g").attr("class","paths");if(d.selectAll(o+" .path-group").data(K.features).enter().append("path").attr("id",c=>c.properties.name).attr("fill",(c,i)=>J(c)).attr("stroke",c=>c.properties.data?"unset":"#CCCCCC").attr("fill-opacity",l.plotArea.opacity).attr("stroke-width","0.4px").attr("d",c=>(F+=k.area(c),k(c))).on("mousemove",(c,i)=>{let y=i.properties.data;if(y){let f=y.data.map(a=>({key:a.dimension,value:je("None",l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.value)}));st([{key:"Region",value:y.properties.alias},...f],l,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(c,i)=>{rt()}),l.plotArea.dataLabels){const c=F/K.features.length,i=l.plotArea.dataLabelName,y=l.plotArea.dataLabelValue,f=a=>l.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?k.area(a)<c*.25:!1;d.selectAll(".text-container").data(K.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>k.centroid(a)[0]-50).attr("y",a=>{const L=k.centroid(a);return i&&y?L[1]-15:L[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let L=a.properties.data;if((i||y)&&L&&!f(a)){if(f(a))return null;const P=L?.properties.alias||a.properties.displayName,ae=l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/q*100)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let Q="";return l.plotArea.dataLabelName&&(Q+=`<div style=
144
+ </span>`),a}catch(f){return be(Ma,"drawDonutDataLabels",f),""}}),b.animation.animationEnabled&&$.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",1)}}catch(c){be(Ma,"drawDonutDataLabels",c)}},C=()=>{try{if(b.total&&b.total.totalVisibility){let c=se,d=b.total.totalFontStyle;const i=$.append("g").attr("transform",q()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",b.total.totalColor!==De.white?b.total.totalColor:"none").style("font-family",b.total.totalFontFamily).style("font-size",b.total.totalFontSize).style("font-style",d.includes(ne.italic)?ne.italic:"").style("text-decoration",d.includes(ne.underline)?ne.underline:"").style("font-weight",d.includes(ne.bold)?ne.bold:"").attr("text-anchor","middle").attr("visibility",b.plotArea.dataLabelValue?"visible":"hidden").text(b.total.showTotalLabel!==!1?b.total.editTotalText:"").append("tspan").attr("x",0).attr("y",b.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",d.includes(ne.bold)?ne.bold:300).text(b.total.totalNumberFormat===",.0%"||b.total.totalNumberFormat==="Percentage"?"100%":je(b.total.totalDisplayUnits,b.total.totalNumberFormat,b.total.totalDecimalPrecision)(c)),b.animation.animationEnabled&&i.attr("opacity",0).transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",1)}}catch(c){be(Ma,"drawTotalValue",c)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:L,id:r,style:{width:"100%",height:"100%"}})})},Ga="TreemapChart.tsx",br=({data:t,formatOptions:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{const l=Te.useRef(),s=Te.useRef(o);s.current=o;const x=Te.useRef(h);x.current=h;let L,A,u,S=40,b=Ht,_,g,H,D,j,K;Te.useEffect(()=>{J()},[e]);const J=()=>{({chartFormatOptions:L,svg:K,width:A,height:u}=Jt(l,e)),{margins:b,chartTitleHeight:S,innerHeight:_,innerWidth:g}=Qa(L,u,A,!0),jt(l,A,u,L),H=la(K,b),_t(l,S,A,L),U(),V(),se()},U=()=>{try{const re={name:"root",children:t.ChartData},oe=T.hierarchy(re).sum(he=>he.data&&he.data[0].value).sort((he,Le)=>(Le.data.data[0].value??0)-(he.data.data[0].value??0));D=T.treemap().tile(T.treemapSquarify).size([g,_]).padding(1).round(!0)(oe).leaves(),j=D[0].data.properties.color}catch(re){be(Ga,"initChartData",re)}},V=()=>{try{if(L.colorScale.showColor===ga.colorTheme){let oe=D[0].data.data.length>1?1:0,he=L.colorScale.startColor,Le=L.colorScale.endColor,pe=new Set(D.map(w=>w.data.data[oe].value)),ue=Array.from(pe).sort((w,p)=>w-p),O=ue.length,q;if(O===1)q=()=>he;else{const w=T.interpolateLab(he,Le);q=T.scaleOrdinal().domain(ue.map(String)).range(ue.map((p,C)=>w(C/(O-1))))}D=D.map(w=>{let p=w.data.data[oe].value;return{...w,data:{...w.data,properties:{...w.data.properties,themeColor:q(p.toString())}}}}),N(he,Le,O,ue)}}catch(re){be(Ga,"prepareTreeColors",re)}},N=(re,oe,he,Le)=>{try{let pe=T.scalePow().exponent(1).domain([0,he-1]).range([re,oe]),O=K.append("foreignObject").attr("class","parentGroup").attr("x",A-130).attr("y",u-30).attr("width",115).attr("height",10).selectAll(null).data(Le).enter().append("xhtml:div").style("width",`${100/he}%`).style("height","100%").style("flex-direction","row").style("display","inline-block").attr("width","20px").attr("height","10px").style("background-color",(w,p)=>pe(p)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const q=K.append("g").attr("transform",`translate(${A-120},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",L.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",L.yAxisTitle.yAxisTitleFontFamily).text("min");K.append("g").attr("transform",`translate(${A-10},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",L.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",L.yAxisTitle.yAxisTitleFontFamily).text("max")}catch(pe){be(Ga,"appendColorScale",pe)}},$=re=>{try{switch(L.colorScale.showColor){case ga.none:return j;case ga.discrete:return re.properties.color;case ga.colorTheme:return re.properties.themeColor;default:return}}catch(oe){be(Ga,"getColor",oe)}},X=re=>{try{const oe=re?.currentTarget?.__data__?.data?.properties;if(!oe)return;switch(L.colorScale.showColor){case ga.none:return{...oe,markerColor:j};case ga.colorTheme:return{...oe,markerColor:oe.themeColor};case ga.discrete:default:return oe}}catch(oe){be(Ga,"getMarkerColorForTooltip",oe)}},se=()=>{try{const re=L.animation.animationEnabled,oe=H.selectAll("g").data(D).enter().append("g").attr("transform",Le=>`translate(${Le.x0},${Le.y0})`),he=oe.append("rect").attr("fill",Le=>$(Le.data)).attr("fill-opacity",re?0:.7).attr("width",Le=>Le.x1-Le.x0).attr("height",Le=>Le.y1-Le.y0).on("mousemove",(Le,pe)=>{ot([{key:L.yAxisTitle.yAxisTitleText,value:je(L.toolTip.toolTipDisplayUnits,L.toolTip.toolTipNumberFormat,L.toolTip.toolTipDecimalPrecision)(pe.data.data[0].value)},{key:"Legend",value:pe.data.data[0].legend}],L,void 0,X(Le),ht(n,String(pe.data.data[0]?.legend??""),X(Le)))}).on("mouseout",()=>rt()).attr(Qe.SeriesId,Le=>String(Le.data.properties?.legendUniqueId??Le.data.legend??"")).attr(Qe.DimValue,Le=>String(Le.data.data[0].legend??"")).on("click",At(x,s,(Le,pe)=>{const ue=String(pe.data.properties?.legendUniqueId??pe.data.legend??""),O=String(pe.data.data[0].legend??"");return{seriesId:ue,dimValue:O,legendUniqueId:ue,seriesDisplayName:String(pe.data.properties?.alias||pe.data.properties?.name||O)}}));if(re&&he.transition().duration(L.animation.animationDuration).ease(Xe[L.animation.animationEffect]).attr("fill-opacity",.7),oe.append("clipPath").attr("id",(Le,pe)=>`clip-${pe}-${r}`).append("rect").attr("width",Le=>Le.x1-Le.x0).attr("height",Le=>Le.y1-Le.y0),L.plotArea.dataLabels){const Le=L.annotation.annotationRangeFilter;oe.filter(pe=>{if(!Le?.enabled)return!0;const ue=pe.data.data[0].value;switch(Le.condition){case"lt":return ue<Le.maxVal;case"gt":return ue>Le.minVal;case"in":return ue>=Le.minVal&&ue<=Le.maxVal;case"not-in":return ue<Le.minVal||ue>Le.maxVal;default:return!0}}).append("text").style("fill",pe=>pe.data.properties.labelFontColor).style("font-family",pe=>pe.data.properties.fontFamily).style("font-size",pe=>pe.data.properties.fontSize).style("font-style",pe=>pe.data.properties.fontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",pe=>pe.data.properties.fontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",pe=>pe.data.properties.fontStyle.includes(ne.bold)?ne.bold:"").attr("clip-path",(pe,ue)=>`url(#clip-${ue}-${r})`),L.plotArea.dataLabelName&&oe.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(pe=>pe.data.legend),L.plotArea.dataLabelValue&&oe.selectAll("text").append("tspan").attr("x",5).attr("y",L.plotArea.dataLabelName?"2.1em":"1.1em").text(pe=>je(L.plotArea.plotAreaDisplayUnits,L.plotArea.dataLabelNumberFormat,L.plotArea.dataLabelDecimalPrecision)(pe.data.data[0].value)),re&&oe.selectAll("text").attr("opacity",0).transition().duration(L.animation.animationDuration).ease(Xe[L.animation.animationEffect]).attr("opacity",1)}}catch(re){be(Ga,"initChartRect",re)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},ra="PieofPieChart.tsx",gr=({data:t,formatOptions:e,chartId:r,legendProperties:o,tooltipFormatter:h})=>{const n=Te.useRef();let l,s,x,L=40,A=Ht,u,S,b,_,g,H,D,j,K,J,U,V,N,$=[0,0],X,se;Te.useEffect(()=>{re()},[e]);const re=()=>{({chartFormatOptions:l,svg:_,width:s,height:x}=Jt(n,e)),{plotArea:se}=l,oe(),{margins:A,innerHeight:u,innerWidth:S,legendListWidth:X,chartTitleHeight:L}=Na(l,s,x,$,A),he(),jt(n,s,x,l),b=la(_,A),_t(n,L,s,l),Le(),pe(),p(),fi(l,j,L,_,s,x),d()},oe=()=>{try{let i=It(Ui(o,"name"),et(l.legends.legendFontSize),l.legends.legendFontFamily);$=[i.width,i.height]}catch(i){be(ra,"calculateMaxPossibleWidth",i)}},he=()=>{try{H=Math.min(u*.4,S*.4),D=l.pieofPie.pieOfPieRadius}catch(i){be(ra,"calculatePieRadius",i)}},Le=()=>{try{let i=new Map;o.forEach(a=>{i.set(a.name,a)}),j=0,t.forEach(a=>{a.properties=i.get(a.legend),j+=a.data[0].value,a.children&&a.children.forEach(m=>m.properties=i.get(m.legend))}),g=T.pie().value(a=>a.data[0].value)(t).map((a,m)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:H,depth:2}))}catch(i){be(ra,"initChartData",i)}},pe=()=>{try{const i=T.arc().innerRadius(0).outerRadius(H),y=T.arc().innerRadius(0).outerRadius(H+10),f=b.append("g").attr("class","parentGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data(g).enter().append("path").attr("class",a=>"path "+a.data.legend).attr("hoverId",a=>a.data.legend.replace(/ /g,"-")).attr("fill",a=>a.data.properties.color!==De.white?a.data.properties.color:"none").on("mouseover.arc",function(a){T.select(this).transition().duration(100).attr("d",y)}).on("mousemove.text",a=>{ot([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/j)*100).toFixed(et(l.toolTip.toolTipDecimalPrecision)??0)+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],l,void 0,a.currentTarget.__data__.data.properties,ht(h,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(a){T.select(this).transition().duration(100).attr("d",i),rt()}).on("click",(a,m)=>{try{let P=m;if(P.data.children&&P.data.children.length>1){b.selectAll(".childGroup").remove(),b.selectAll(".childLabels").remove(),b.selectAll("line").remove(),K=P.data.legend;let ie=90-(m.x0+m.x1)/2/Math.PI*180;ue(P.data.children,ie,m)}}catch(P){be(ra,"drawPieChart_onClick",P)}});l.animation.animationEnabled?f.transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attrTween("d",function(a){const m=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return P=>i(m(P))}):f.attr("d",a=>i(a))}catch(i){be(ra,"drawPieChart",i)}},ue=(i,y,f)=>{try{b.select(".parentGroup").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`),b.selectAll(".parentLabels").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`);let m=T.pie().value(Q=>Q.data[0].value)(i).map((Q,Ae)=>({...Q,x0:Q.startAngle,x1:Q.endAngle,y0:0,y1:D,depth:2}));const P=T.arc().innerRadius(0).outerRadius(D),ie=T.arc().innerRadius(0).outerRadius(D+10);b.append("g").attr("class","childGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${q()}`).selectAll("path").data(m).enter().append("path").attr("class",Q=>"path "+Q.data.legend).attr("hoverId",Q=>Q.data.legend.replace(/ /g,"-")).attr("fill",Q=>Q.data.properties.color!==De.white?Q.data.properties.color:"none").attr("d",Q=>P(Q)).on("mouseover.arc",function(Q){T.select(this).transition().duration(100).attr("d",ie)}).on("mousemove.text",Q=>{ot([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(Q.currentTarget.__data__.data.data[0].value/j)*100).toFixed(et(l.toolTip.toolTipDecimalPrecision))+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(Q.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:Q.currentTarget.__data__.data.legend}],l,void 0,Q.currentTarget.__data__.data.properties,ht(h,String(Q.currentTarget.__data__.data.legend??""),Q.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(Q){T.select(this).transition().duration(100).attr("d",P),rt()}),C(m),c(f,i)}catch(a){be(ra,"drawChildPie",a)}},O=()=>{try{return J=K?3*S/8:S/2,U=u/2,`translate(${J},${U})`}catch(i){be(ra,"getParentPiePosition",i)}},q=()=>{try{return V=3*S/4,N=u/2,`translate(${V},${N})`}catch(i){be(ra,"getChildPiePosition",i)}},w=(i,y)=>{try{const f=(i.startAngle+i.endAngle)/2,a=Math.cos(f-Math.PI/2)*(y*.65),m=Math.sin(f-Math.PI/2)*(y*.65);let P=f*180/Math.PI-90;return`translate(${a},${m}) rotate(${P})`}catch(f){be(ra,"getDataLabelTransformString",f)}},p=()=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(g,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.labelFontSize??11).attr("fill",i=>i.data.properties?.labelFontColor??De.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",i=>i.data.properties?.labelFont??qe).attr("transform",i=>w(i,H)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:y}=l;return y.dataLabelName?i.data.legend:""}),b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(g,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.valueFontSize??11).attr("fill",i=>i.data.properties?.valueFontColor??De.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??qe).attr("transform",i=>w(i,H)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(l.plotArea.dataLabelValue){const y=i.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&y!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y/j)*100).toFixed(et(l.plotArea.dataLabelDecimalPrecision)??0)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(y):y}}))}catch(i){be(ra,"drawParentPieDataLabels",i)}},C=i=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","childLabels parentGroup").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??De.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",y=>y.data.properties?.labelFont??qe).attr("transform",y=>w(y,D)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:f}=l;return f.dataLabelName?y.data.legend:""}),b.append("g").attr("class","childLabels parentGroup").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.valueFontColor??De.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??qe).attr("transform",y=>w(y,D)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(y=>{if(l.plotArea.dataLabelValue){const f=y.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&f!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(f/j)*100).toFixed(et(l.plotArea.dataLabelDecimalPrecision)??0)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(f):f}}))}catch(y){be(ra,"drawChildPieDataLabels",y)}},c=(i,y)=>{try{let f=Math.abs(i.x0-i.x1)/2,m=i.y1*Math.sin(f),P=m/Math.tan(f);b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",J+P).attr("y1",U-m).attr("x2",V).attr("y2",N-D),b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",J+P).attr("y1",U+m).attr("x2",V).attr("y2",N+D)}catch(f){be(ra,"drawLines",f)}},d=()=>{try{let i=o.map(y=>({legend:y.name,properties:y,data:[]}))}catch(i){be(ra,"initLegendList",i)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},da="PyramidChart.tsx",Ar=({data:t,formatOptions:e,chartId:r,onDataLabelCoordinatesChange:o,addLocalFilterFromLib:h,tooltipFormatter:n})=>{const l=Te.useRef();let s=bt(t.ChartData),x,L,A,u,S=40,b=Ht,_=[0,0],g,H,D,j,K=[0],J,U,V,N;Te.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:x,svg:L,width:A,height:u}=Jt(l,e)),_=Ia(x,s),{margins:b,innerHeight:g,innerWidth:H,legendListWidth:V,chartTitleHeight:S}=Na(x,A,u,_,b),X(),jt(l,A,u,x),J=se(),_t(l,S,A,x),Pa(x,L,s,A,u,V,S,r,b,nt.rectangle,!1,h),re(),oe(),Le(),he()},X=()=>{try{D=Math.min(g,H),j=.866*D}catch(ue){be(da,"initPyramidSideCalculations",ue)}},se=()=>{try{return L.append("g").attr("transform",`translate(${b.left},${b.top+(g-j)/2})`)}catch(ue){return be(da,"initChartArea",ue),null}},re=()=>{try{s=s.sort((ue,O)=>{const q=ue.data[0].value,w=O.data[0].value;return x.plotArea.flipPyramid?w-q:q-w}),U=T.sum(s,ue=>Math.abs(ue.data[0].value)),K=[0],s.forEach((ue,O)=>{const q=Math.abs(ue.data[0].value)/U*j;K.push(K[O]+q)})}catch(ue){be(da,"initPyramidData",ue)}},oe=()=>{try{s.forEach((ue,O)=>{try{const q=K[O],w=K[O+1];let p=x.plotArea.flipPyramid?1:0;const C=D*(p-K[O]/j),c=D*(p-K[O+1]/j),d=H/2,i=J.append("g").attr("id","PyramidChart").attr("class","parentGroup"),y=x.animation.animationEnabled,f=i.append("polygon").attr("class","segment").attr("hoverId",ue.legend.replace(/\s+/g,"-")).attr("data-series-id",ue.legendUniqueId??ue.legend).attr("data-dim-value",ue.legend).attr("points",`
145
+ ${d-C/2},${q}
146
+ ${d+C/2},${q}
147
+ ${d+c/2},${w}
148
+ ${d-c/2},${w}
149
+ `).attr("fill",ue.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{ot([{key:ue.legend,value:x.toolTip.toolTipNumberFormat==",.0%"?ue.data[0].value?(Math.abs(ue.data[0].value/U)*100).toFixed(et(x.toolTip.toolTipDecimalPrecision))+"%":"":je(x.toolTip.toolTipDisplayUnits,x.toolTip.toolTipNumberFormat,x.toolTip.toolTipDecimalPrecision)(ue.data[0].value)}],x,void 0,ue.properties,ht(n,String(ue.legend??""),ue.properties)),T.select(this).style("opacity",.8).style("stroke",x.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){be(da,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{rt(),T.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){be(da,"drawPyramidChart.onMouseOut",a)}});y&&f.transition().duration(x.animation.animationDuration).ease(Xe[x.animation.animationEffect]).attr("opacity",1)}catch(q){be(da,"drawPyramidChart.forEach",q)}})}catch(ue){be(da,"drawPyramidChart",ue)}},he=ue=>{try{if(x.annotation.annotationVisibility){let O=dt.annotation(),q=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None",w=Rt(N,x,c=>c.data.measure);const p=x.annotation.connectorStyle?.toLowerCase();O.editMode(x.annotation.annotationDraggable).accessors({x:function(){return H*.5},y:function(c,d){return c.y}}).on("dragend",function(c){try{w.forEach(d=>{d.data.legend===c.data.legend&&(d.dx=c._dx,d.dy=c._dy,d.width=A,d.height=u)}),o&&o(w.map(d=>({data:{legend:d.data.legend,isVisible:d.data.isVisible??!0},dx:d.dx,dy:d.dy,width:A,height:u}))),C.selectAll(".connector").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]),C.selectAll(`.connector-${q}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),C.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend.replace(/\s+/g,"-")).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]).filter(d=>d._dx==0&&d._dy==0).remove(),C.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block"),C.selectAll(".annotation-note-title").filter(d=>d.data&&d.data.isVisible).style("display","block")}catch(d){be(da,"pyramidAnnotations.onDragEnd",d)}}).notePadding(0).annotations(w);let C=J.append("g").attr("class","annotation-group parentGroup").call(O);x.animation.animationEnabled&&C.attr("opacity",0).transition().duration(x.animation.animationDuration).ease(Xe[x.animation.animationEffect]).attr("opacity",1),C.selectAll("rect").style("visibility","hidden"),C.selectAll(".annotation-subject").remove(),C.selectAll(".connector").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]),C.selectAll(`.connector-${q}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),C.selectAll(".note-line").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]).filter(c=>c._dx==0&&c._dy==0).remove(),C.selectAll(".connector-end").filter(c=>c.connector.end=="dot"&&c._dx==0&&c._dy==0).remove(),C.selectAll(".annotation-note-label").filter(c=>c.data&&!c.data.isVisible).style("display","none"),C.selectAll(".annotation-note-title").filter(c=>c.data&&!c.data.isVisible).style("display","none"),x.annotation.annotationType==Wt.automatic&&C.selectAll(".annotation-note-content").attr("transform",function(){const d=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(d)return`translate(${parseFloat(d[1])}, 0)`}),C.selectAll(".annotation-note-label").attr("y","15").attr("text-anchor","middle"),C.selectAll(".annotation-note-title").attr("text-anchor","middle"),C.selectAll(".annotation-note-content").attr("transform","translate(0,-28)"),!x.plotArea.dataLabelName&&C.selectAll("tspan").attr("dy","0"),x.plotArea.dataLabelName&&C.selectAll(".annotation-note-title").attr("hoverId",c=>c.data.legend.replace(/\s+/g,"-")).style("font-size",c=>c.data.labelFontSize).attr("font-family",c=>c.data.labelFontFamily).style("font-style",c=>c.data.labelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",c=>c.data.labelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",c=>c.data.labelFontStyle.includes(ne.bold)?ne.bold:"300").style("fill",c=>c.data.labelFontColor),x.plotArea.dataLabelValue&&C.selectAll(".annotation-note-label").attr("hoverId",c=>c.data.legend.replace(/\s+/g,"-")).style("font-size",c=>c.data.valueFontSize).attr("font-family",c=>c.data.valueFontFamily).style("font-style",c=>c.data.valueFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",c=>c.data.valueFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",c=>c.data.valueFontStyle.includes(ne.bold)?ne.bold:"300").style("fill",c=>c.data.valueFontColor)}}catch(O){be(da,"pyramidAnnotations",O)}},Le=()=>{try{let ue=x.annotation.annotationType??"1",O=[ue=="1"?"connector":""],q=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"none";const w=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates||[])),p=new Map(w.map(C=>[C.data?.legend,C]));N=[],s.forEach((C,c)=>{try{const d=x.annotation.annotationVisibility,i=s.length-1;if(d===Wt.none||d===Wt.startOnly&&c!==0||d===Wt.endOnly&&c!==i||d===Wt.startAndEndBoth&&c!==0&&c!==i)return;let y={note:{title:x.plotArea.dataLabelName?C.properties.alias:"",label:x.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(C.data[0].value/U)*100).toFixed(et(x.plotArea.dataLabelDecimalPrecision))+"%":x.plotArea.dataLabelValue?C.data[0].value>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(C.data[0].value/1e9)+"B":je(x.annotation.annotationDisplayUnits,x.plotArea.dataLabelNumberFormat,x.plotArea.dataLabelDecimalPrecision)(C.data[0].value):"",align:"middle"},data:{x:H/2,y:pe(C,c,C.properties.dataLabelPosition),isVisible:!0,dimension:C.legend,legend:C.legend,measure:C.data[0].value,labelFontFamily:C.properties.labelFont,labelFontSize:C.properties.labelFontSize,labelFontColor:C.properties.labelFontColor,labelFontStyle:C.properties.labelFontStyle,valueFontFamily:C.properties.valueFont,valueFontSize:C.properties.valueFontSize,valueFontColor:C.properties.valueFontColor,valueFontStyle:C.properties.valueFontStyle},dx:0,dy:0,connector:{end:q,curve:Ll[x.annotation.connectorCurve]},disable:O,subject:{height:15,width:15},type:ml[ue],color:x.plotArea.dataLabelNameColor!=De.black?x.plotArea.dataLabelNameColor:De.black,height:A,width:A,index:c};const f=p.get(C.legend);f&&(y.dx=f.dx*A/(f.width||A),y.dy=f.dy*u/(f.height||u),y.data.isVisible=f.data?.isVisible??!0),N.push(y)}catch(d){be(da,"prepareNewAnnotationsList.forEach",d)}})}catch(ue){be(da,"prepareNewAnnotationsList",ue)}},pe=(ue,O,q)=>{try{switch(q){case ni.top:return K[O]+30;case ni.middle:return(K[O]+K[O+1])/2+15;case ni.bottom:return K[O+1];default:return K[O]+30}}catch(w){return be(da,"getYCordinate",w),0}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},Ta="ProgressChart.tsx",Lr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:o,tooltipFormatter:h})=>{const n=Te.useRef();let l=bt(t),s,x,L,A=40,u=Ht,S=[0,0],b,_,g,H,D,j,K,J;const U=1,V=0;Te.useEffect(()=>{N()},[e]);const N=()=>{({chartFormatOptions:s,svg:D,width:x,height:L}=Jt(n,e)),S=Ia(s,l),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:j,chartTitleHeight:A}=Na(s,x,L,S,u),$(),jt(n,x,L,s),H=la(D,u),_t(n,A,x,s),Pa(s,D,l,x,L,j,A,r,u,nt.hollowCircle,!0,o),X(),se(),fi(s,g,A,D,x,L)},$=()=>{try{K=Math.min(b*.45,_*.45),J=Math.min(et(s.plotArea.innerRadius)/100*K,K)}catch(oe){be(Ta,"setRadiusAndInnerRadius",oe)}},X=()=>{try{g=t[U].data[0].value+t[V].data[0].value}catch(oe){be(Ta,"initProgressChartData",oe)}},se=()=>{try{let oe=t[U].data[0].value,he=t[V].data[0].value,Le=Math.PI*2,pe=he/oe*Math.PI*2,ue=s.plotArea.dataLabelValueFontStyle;const O=T.arc().innerRadius(J).outerRadius(K).startAngle(0).cornerRadius(et(s.plotArea.cornerRadius));H.append("path").attr("class","secondary-circle").attr("fill",t[U].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressScale).attr("hoverId",w=>(t[U]?.properties?.alias||t[U]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[U].properties.legendUniqueId??t[U].properties.alias??"*").attr("data-dim-value",t[U].properties.alias??"*").attr("d",O({endAngle:Le})).on("mousemove",w=>{try{ot([{key:t[U].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(oe)}],s,void 0,t[U].properties,ht(h,String(t[U].properties?.alias??""),t[U].properties))}catch(p){be(Ta,"drawProgressChart.onMouseMove.secondary-circle",p)}}).on("mouseout",()=>{try{rt()}catch(w){be(Ta,"drawProgressChart.onMouseOut.secondary-circle",w)}}).attr("transform",re()),H.append("path").attr("class","progress-circle").attr("fill",t[V].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressGoal).attr("hoverId",w=>(t[V]?.properties?.alias||t[V]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[V].properties.legendUniqueId??t[V].properties.alias??"*").attr("data-dim-value",t[V].properties.alias??"*").attr("d",O({endAngle:pe})).on("mousemove",w=>{try{ot([{key:t[V].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(he/oe*100)+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(oe)},{key:t[U].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(he)}],s,void 0,t[V].properties,ht(h,String(t[V].properties?.alias??""),t[V].properties))}catch(p){be(Ta,"drawProgressChart.onMouseMove.progress-circle",p)}}).on("mouseout",()=>{try{rt()}catch(w){be(Ta,"drawProgressChart.onMouseOut.progress-circle",w)}}).attr("transform","translate("+_/2+","+b/2+")").transition().duration(s.animation.animationEnabled?s.animation.animationDuration:0).ease(Xe[s.animation.animationEffect]).attrTween("d",function(w){try{const p=T.interpolate(0,pe);return function(C){try{return O({endAngle:p(C)})}catch(c){return be(Ta,"drawProgressChart.attrTween.inner",c),""}}}catch(p){return be(Ta,"drawProgressChart.attrTween",p),()=>""}});const q=H.append("text").attr("transform",re()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>s.plotArea.dataLabels&&Hi([{value:he}],s,p=>p?.value??0).length>0?"visible":"hidden").attr("fill",s.plotArea.dataLabelValueColor!==De.white?s.plotArea.dataLabelValueColor:s.toolTip.toolTipDisplayUnits).attr("font-style",ue.includes(ne.italic)?ne.italic:"").attr("text-decoration",ue.includes(ne.underline)?ne.underline:"").attr("font-weight",ue.includes(ne.bold)?ne.bold:"").attr("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-size",s.plotArea.dataLabelValueFontSize).text(()=>s.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(he/oe*100)+"%":je(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormatProgress,s.plotArea.dataLabelDecimalPrecision)(he));s.animation.animationEnabled&&q.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1)}catch(oe){be(Ta,"drawProgressChart",oe)}},re=()=>{try{return"translate("+_/2+","+b/2+")"}catch(oe){return be(Ta,"getTransformString",oe),""}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},mr=({data:{ChartData:t},formatOptions:e,chartId:r})=>{const o=Te.useRef(),h=bt(t);let n,l,s,x=40,L=Ht,A,u,S,b,_,g,H,D,j,K,J,U={},V;const N="Speedometer.tsx";Te.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:n,svg:b,width:l,height:s}=Jt(o,e)),{margins:L,chartTitleHeight:x,innerHeight:A,innerWidth:u}=Qa(n,s,l),X(),jt(o,l,s,n),S=la(b,L),_t(o,x,l,n),re(),oe(),Le(),ue()},X=()=>{try{let p;A*.8<u*.45?(_=A*.8,p="width"):(_=u*.45,p="height"),V=se(p),g=et(n.plotArea.innerRadiusForSpeedometer)/100*_}catch(p){be(N,"initChartRadius",p)}};function se(p){try{return p=="height"?`translate(${u/2},${A/2+_/2})`:`translate(${u/2},${s-60})`}catch(C){return be(N,"centerTranslation",C),""}}const re=()=>{try{let p=t[0].data[0].value;p<0?(H=0,D=p):(H=p,D=0),n.customScaling.customScalingtoggle?K=100:K=et(n.plotArea.ticks)}catch(p){be(N,"initSpeedometerData",p)}},oe=()=>{try{j=[];let p=et(n.plotArea.ticks);if(n.customScaling.customScalingtoggle){for(let C=1;C<=p;C++){let c=n.customScaling[`share${C}`];if(j.length<100)for(let d=0;d<c;d++)j.push(n.customScaling[`division${C}`])}if(j.length<101)for(let C=j.length;C<100;C++)j.push(De.black)}else if(n.colorScale.showColor==ga.none){const C=t[0].properties?.color??"#bac8de";for(let c=1;c<=p;c++)j.push(C)}else if(n.colorScale.showColor==ga.discrete)for(let C=1;C<=p;C++)j.push(n.colorScale["division"+C]);else{let C=n.colorScale.startColor,c=n.colorScale.endColor;const d=T.scaleLinear().domain([0,p]).range([C,c]);for(let i=0;i<p;i++)j.push(d(i))}}catch(p){be(N,"initColorTheme",p)}},he=(p,C,c)=>{try{let d=[],i=Math.abs(p)-Math.abs(C),y=Math.abs(i)/c,f=C>0?0:C;d.push(f);for(let a=0;a<c-1;a++)f+=parseFloat(y.toFixed(5)),f.toFixed(5)<=Math.abs(p)&&d.push(f);return d.push(d.includes(p)?0:p),d}catch(d){return be(N,"setTickValues",d),[]}},Le=()=>{try{switch(n.plotArea.dataLabelsOptions){case Wt.automatic:J=pe();break;case Wt.startOnly:J=[D];break;case Wt.endOnly:let C=Array(K).fill("");C[K]=H,J=C;break;case Wt.startAndEndBoth:let c=Array(K).fill("");c[K]=H,c[0]=D,J=c;break;case Wt.none:J=[];break}}catch(p){be(N,"setDataLabelsOptions",p)}},pe=()=>{try{let p,C=et(n.plotArea.ticks),c=he(H,D,K);if(n.customScaling.customScalingtoggle){let d=Array(100).fill("");d[0]=D;let i=0;for(let y=1;y<=C;y++){let f=parseInt(n.customScaling[`share${y}`]);if(i+=f,i>=100)break;d[i]=c[i]}d[99]=H,p=d}else p=c;return p}catch(p){return be(N,"initTicksValues",p),[]}},ue=()=>{try{let C=function(c,d){try{let i=function(me){try{return me*Math.PI/180}catch(Ve){return be(N,"deg2rad",Ve),0}},y=function(me){try{let Ve;for(Ve in me)ce[Ve]=me[Ve];m=ce.maxAngle-ce.minAngle,ie=Math.round(_*ce.pointerHeadLengthPercent),ge=T.scaleLinear().range([0,1]).domain([ce.minValue,ce.maxValue]),Ae=T.arc().innerRadius(g).outerRadius(_).startAngle((Ye,te)=>{let de=1/ce.majorTicks*te;return i(ce.minAngle+de*m)}).endAngle((Ye,te)=>{let de=1/ce.majorTicks*(te+1);return i(ce.minAngle+de*m)})}catch(Ve){be(N,"configure",Ve)}},f=function(me,Ve){try{if(Ve===0){S.append("g").attr("class","arc").attr("transform",V).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(j).enter().append("path").attr("fill",ve=>ve).attr("stroke",ve=>ve).attr("d",Ae);let Ce=H,Me=S.append("g").attr("class","label").attr("transform",V);if(Me.selectAll("text").data(J).enter().append("text").attr("transform",function(ve,xe){let Fe=m/ce.majorTicks*xe;return"rotate("+(ce.minAngle+Fe)+") translate(0,"+(ce.labelInset-_)+")"}).attr("text-anchor","middle").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==De.white?n.plotArea.dataLabelValueColor:"none").attr("font-style",n.plotArea.dataLabelValueFontStyle.includes(ne.italic)?ne.italic:"").attr("text-decoration",n.plotArea.dataLabelValueFontStyle.includes(ne.underline)?ne.underline:"").attr("font-weight",n.plotArea.dataLabelValueFontStyle.includes(ne.bold)?ne.bold:"").attr("font-family",n.plotArea.dataLabelValueFontFamily).text(ve=>n.plotArea.dataLabelNumberFormat==",.0%"?Q=Math.round(ve/Ce*100)+"%":je(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(ve)).attr("visibility",ve=>ve===""?"hidden":"visible"),n.animation.animationEnabled){const ve=n.animation.animationDuration,xe=Xe[n.animation.animationEffect];Me.selectAll("text").attr("opacity",0).attr("transform",function(Fe,ye){const ee=m/ce.majorTicks*ye;return`rotate(${ce.minAngle+ee}) translate(0, ${ce.labelInset-_+20})`}).transition().duration(ve).ease(xe).attr("opacity",1).attr("transform",function(Fe,ye){const ee=m/ce.majorTicks*ye;return`rotate(${ce.minAngle+ee}) translate(0, ${ce.labelInset-_})`})}}n.pointerValue.showPointerValue&&h.length===2&&q(V);let Ye=[[ce.pointerWidth/2,0],[0,-ie],[-(ce.pointerWidth/2),0],[0,ce.pointerTailLength],[ce.pointerWidth/2,0]],te=T.line().curve(T.curveLinear);ae=S.append("g").data([Ye]).attr("class","pointer").attr("transform",V).append("path").attr("d",Ve>0?te:null).attr("transform","rotate("+ce.minAngle+")").attr("fill",n.plotArea.pointerColor).on("mousemove",(Pe,Ce)=>{ot([{key:`${t[Ve].data[0].legend}`,value:n.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[Ve].data[0].value/we[we.length-1]*100)+"%":je(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(t[Ve].data[0].value)}],n,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{rt()}),ae.selectAll("text").append("text").text(ce.maxValue),a(me===void 0?0:me)}catch(Ye){be(N,"gauge.render",Ye)}},a=function(me,Ve){try{Ve!==void 0&&y(Ve);let Ye=ge(me),te=ce.minAngle+Ye*m;ae.transition().duration(n.animation.animationEnabled?n.animation.animationDuration:0).ease(Xe[n.animation.animationEffect]).attr("transform","rotate("+te+")")}catch(Ye){be(N,"gauge.update",Ye)}},m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce={clipWidth:u,clipHeight:A,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:et(n.plotArea.pointerHeadLength)/10,minValue:D,maxValue:H,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:K,labelFormat:me=>je(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(me),labelInset:-5};return U.configure=y,U.render=f,U.update=a,y(d),U}catch(i){be(N,"gauge",i)}}("#power-gauge",{clipWidth:u,clipHeight:A,ringWidth:2.75*et(n.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:H,transitionMs:0});if(h.length>0)for(let c=0;c<h.length;c++)C.render(O(h[c],c),c)}catch(p){be(N,"initSpeedometer",p)}};function O(p,C){try{let c=H,d=p.data[0].value;return c<0&&d>0||c>0&&d<0?0:c<0&&d<0&&c>d?c:c<0&&d<0&&c<d||c>d?d:c}catch(c){return be(N,"setPointerofSpeedometer",c),0}}function q(p){try{let C="";if(n.pointerValue.kpiAlias)C=n.pointerValue.kpiAliasText;else switch(n.pointerValue.connectorKPIforSpeedometer){case Za.PointerValue:C="Pointer Value";break;case Za.Absolute:C="Absolute Value";break;case Za.CAGR:C="CAGR";break;case Za.PercentageGrowth:C="Percentage Growth";break}let c=n.pointerValue.pointerValueFontStyle;S.selectAll(".pointerValueText").remove(),S.append("g").attr("class","pointerValueText").attr("transform",p).selectAll("text").data(["chartData.dataArray[1].maximumMeasure"]).enter().append("text").attr("dy","24").attr("text-anchor","middle").attr("font-size",n.pointerValue.pointerValueFontSize).attr("fill",n.pointerValue.pointerValueColor!==De.white?n.pointerValue.pointerValueColor:"none").attr("font-style",c.includes(ne.italic)?ne.italic:"").attr("text-decoration",c.includes(ne.underline)?ne.underline:"").attr("font-weight",c.includes(ne.bold)?ne.bold:"").attr("font-family",n.pointerValue.pointerValueFontFamily).text(i=>`${C}: ${!n.pointerValue.pointerValueAlias&&i!=0?w(t[0].data[0].value,t[1].data[0].value):n.pointerValue.pointerValueAliasText}`).attr("visibility",n.plotArea.dataLabels?"visible":"hidden")}catch(C){be(N,"setPointerValueText",C)}}function w(p,C){try{let c=p-C,d=1,i=parseInt(n.pointerValue.connectorKPIforSpeedometer),y,f;const a=n.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:c=C;break;case 2:c=Math.abs(c);break;case 3:return y=`.${a}%`,c=Math.pow(C/p,1/d)-1,f=T.format(y)(c),f;case 4:return y=`.${a}%`,c=Math.round(C/p*100-100)/100,f=T.format(y)(c),f}return isNaN(c)&&(c=0),je(n.pointerValue.pointerValueDisplayUnits,n.pointerValue.pointerValueNumberFormat,a)(c)}catch(c){return be(N,"connectorNumberFormat",c),""}}return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:o,id:r,style:{width:"100%",height:"100%"}})})};function Sa(t,e,r){console.error(`[${t}][${e}]`,r)}const fr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:o,tooltipFormatter:h})=>{const n=Te.useRef(),l=bt(t);let s,x,L,A=40,u=Ht,S=[0,0],b,_,g,H,D,j;Te.useEffect(()=>{K()},[e]);const K=()=>{({chartFormatOptions:s,svg:H,width:x,height:L}=Jt(n,e)),J(),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:j,chartTitleHeight:A}=Na(s,x,L,S,u),S=Ia(s,l),jt(n,x,L,s),g=la(H,u),_t(n,A,x,s),Pa(s,H,l,x,L,j,A,r,u,nt.hollowCircle,!1,o),V()},J=()=>{try{D=0,l.forEach($=>{D+=$.data[0].value})}catch($){Sa("RadialBarChart.tsx","loopOverChartData",$)}},U=$=>{try{switch(s.plotArea.dataLabelsOptions){case Wt.automatic:return $.map((se,re)=>({...se,index:re}));case Wt.startOnly:return[{...$[0],index:0}];case Wt.endOnly:return[{...$[$.length-1],index:$.length-1}];case Wt.startAndEndBoth:return[{...$[0],index:0},{...$[$.length-1],index:$.length-1}];case Wt.none:return[]}}catch(X){return Sa("RadialBarChart.tsx","getModifiedDataForLabels",X),$}},V=()=>{try{let $=function(fe,ae){try{const ke=T.interpolate(0,d(Math.abs(fe.data[0].value)));return ce=>ie({...fe,endAngle:ke(ce)},ae)}catch(ke){Sa("RadialBarChart.tsx","arcTween",ke)}},X=function(fe){try{return fe*180/w}catch(ae){Sa("RadialBarChart.tsx","radTodeg",ae)}},se=function(fe){try{return fe*Math.PI/180}catch(ae){Sa("RadialBarChart.tsx","degToRad",ae)}},re=function(fe){try{return p+(m-(fe+1))*(P+C)}catch(ae){Sa("RadialBarChart.tsx","getInnerRadius",ae)}},oe=function(fe){try{return re(fe)+P}catch(ae){Sa("RadialBarChart.tsx","getOuterRadius",ae)}},he=l.length>1?T.max(l,fe=>fe.data[0].value)*1.1:t[0].data[0].value*1.1,Le=s.plotArea.dataLabelValueFontStyle,pe=je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(he),ue=s.plotArea.axialAxis?It(pe,et(s.plotArea.axialAxisDataLabelFontSize),s.plotArea.axialAxisDataLabelFontFamily).width+10:20;const O=Math.min(b*.5,_*.5)-ue;let q=g.append("g").attr("transform",N()).attr("width",_).attr("height",b);const w=Math.PI,p=l.length>1?10:70,C=et(s.plotArea.arcPadding),c=et(s.plotArea.axialTicks);let d=T.scaleLinear().domain([0,he]).range([0,se(360)]),i=d.ticks(c);i[i.length-1]==he&&i.pop();let y=i,f=l.map((fe,ae)=>fe.data[0].legend),a=l.reduce((fe,ae)=>fe+ae.data[0].value,0);const m=f.length,P=(O-p-m*C)/m;let ie=T.arc().innerRadius((fe,ae)=>re(ae)).outerRadius((fe,ae)=>oe(ae)).startAngle(0).endAngle(fe=>fe.endAngle),Q=T.arc().innerRadius((fe,ae)=>re(ae)).outerRadius((fe,ae)=>oe(ae)).startAngle(0).endAngle(se(360)),Ae=q.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");s.plotArea.axialGrid&&Ae.append("circle").attr("r",(fe,ae)=>oe(ae)+C).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let ge=q.append("g").attr("class","a axis").selectAll("g").data(y).enter().append("g").attr("transform",fe=>"rotate("+(X(d(fe))-90)+")");s.plotArea.axialGrid&&ge.append("line").attr("x2",O).attr("stroke","#a9a9a9").attr("stroke-width",1),ge.append("text").attr("x",O+10).attr("class","text-xs text-gray-600").style("text-anchor",fe=>d(fe)>=w&&d(fe)<2*w?"end":null).attr("transform",fe=>"rotate("+(90-X(d(fe)))+","+(O+10)+",0)").text(fe=>je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(fe)).attr("fill",s.plotArea.axialAxisDataLabelColor!==De.white?s.plotArea.axialAxisDataLabelColor:"none").style("font-size",s.plotArea.axialAxisDataLabelFontSize).style("font-family",s.plotArea.axialAxisDataLabelFontFamily).attr("font-style",s.plotArea.axialAxisDataLabelFontStyle.includes(ne.italic)?ne.italic:"").attr("text-decoration",s.plotArea.axialAxisDataLabelFontStyle.includes(ne.underline)?ne.underline:"").attr("font-weight",s.plotArea.axialAxisDataLabelFontStyle.includes(ne.bold)?ne.bold:"").attr("visibility",s.plotArea.axialAxis?"visible":"hidden");let we=q.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",fe=>fe.data[0].legend.replaceAll(" ","-")).attr("data-series-id",fe=>fe.properties.legendUniqueId??fe.data[0].legend).attr("data-dim-value",fe=>fe.data[0].legend).attr("fill",fe=>fe.properties.color).attr("d",(fe,ae)=>ie({...fe,endAngle:0},ae)).on("mousemove",(fe,ae)=>{ot([{key:s.yAxisTitle.yAxisTitleText,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(ae.data[0].value/a)*100).toFixed(et(s.toolTip.toolTipDecimalPrecision))+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ae.data[0].value)},{key:"Legend",value:ae.properties.alias}],s,void 0,ae.properties,ht(h,String(ae.data[0]?.legend??""),ae.properties))}).on("mouseout",()=>{rt()});if(s.animation.animationEnabled?we.transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attrTween("d",$):we.attr("d",(fe,ae)=>ie({...fe,endAngle:d(Math.abs(fe.data[0].value))},ae)),s.plotArea.dataLabels){const fe=Hi(U(t),s,ke=>ke?.data?.[0]?.value??0),ae=q.selectAll(".arc-label-"+r).data(fe).enter().append("text").attr("class","arc-label-"+r).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(ke,ce)=>(oe(ke.index??ce)-re(ke.index??ce))/1.75);ae.append("textPath").attr("xlink:href",(ke,ce)=>`#arc-path-${ke.index??ce}-`+r).style("startOffset","50%").attr("hoverId",ke=>ke.legend.replaceAll(" ","-")).text(ke=>`  ${ke.properties.alias}
150
+  ${s.plotArea.dataLabelValue?je(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormat,s.plotArea.dataLabelDecimalPrecision)(ke.data[0].value):""}`).attr("fill",s.plotArea.dataLabelValueColor!==De.white?s.plotArea.dataLabelValueColor:"none").style("font-size",s.plotArea.dataLabelValueFontSize).style("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-style",Le.includes(ne.italic)?ne.italic:"").attr("text-decoration",Le.includes(ne.underline)?ne.underline:"").attr("font-weight",Le.includes(ne.bold)?ne.bold:"").on("mousemove",(ke,ce)=>{ot([{key:s.yAxisTitle.yAxisTitleText,value:je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)(ce.data[0].value)},{key:"Legend",value:ce.properties.alias}],s,ke,ce.properties,ht(h,String(ce.data[0]?.legend??""),ce.properties))}).on("mouseout",()=>{rt()}),s.animation.animationEnabled&&ae.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1),we.each((ke,ce)=>{q.append("path").attr("id",`arc-path-${ce}-`+r).attr("d",Q(ke,ce)).attr("fill","none").attr("stroke","none")})}}catch($){Sa("RadialBarChart.tsx","initRadialBarChart",$)}},N=()=>{try{return`translate(${_/2},${b/2})`}catch($){Sa("RadialBarChart.tsx","getPiePosition",$)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},ya="WordCloud.tsx",Tr=({data:{ChartData:t},formatOptions:e,chartId:r,tooltipFormatter:o})=>{const h=Te.useRef();let n=bt(t),l,s,x,L=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,b,_,g,H,D,j=0;Te.useEffect(()=>{K()},[e]);const K=()=>{({chartFormatOptions:l,svg:H,width:s,height:x}=Jt(h,e)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=Qa(l,x,s),jt(h,s,x,l),g=la(H,S),_t(h,u,s,l),J(),U()},J=()=>{try{j=0,n=n.map(V=>{let N=V.data[0].value;return j+=N,l.plotArea.hideZeroValues&&N==0?null:(N<L&&(L=N),N>A&&(A=N),V)}),n=n.filter(V=>V!==null),D=T.scaleLinear().domain([L,A]).range([12,70])}catch(V){be(ya,"calculateWordCloudData",V)}},U=()=>{try{let V=function(se){try{g.append("g").attr("transform","translate("+X.size()[0]/2+","+X.size()[1]/2+")").selectAll("text").data(se).enter().append("text").attr("font-size",function(re){try{return D(re.data[0].value)+"px"}catch(oe){return be(ya,"draw-font-size",oe),"12px"}}).attr("text-anchor","middle").style("font-family",l.text.textFontFamily).attr("fill",function(re){try{return re.properties.color!==De.white?re.properties.color:"none"}catch(oe){return be(ya,"draw-fill",oe),"none"}}).attr("transform",function(re){try{return"translate("+[re.x,re.y]+")rotate("+re.rotate+")"}catch(oe){return be(ya,"draw-transform",oe),""}}).text(function(re){try{return re.properties.alias}catch(oe){return be(ya,"draw-text",oe),""}}).attr("data-series-id",re=>re.properties.legendUniqueId??re.properties.alias).attr("data-dim-value",re=>re.properties.alias).on("mousemove.text",(re,oe)=>{try{ot([{key:oe.properties.alias,value:je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(oe.data[0].value)},{key:oe.properties.measureUniqueId,value:j}],l,void 0,oe.properties,ht(o,String(oe.properties.alias??""),oe.properties))}catch(he){be(ya,"draw-mousemove",he)}}).on("mouseout.text",()=>{try{rt()}catch(re){be(ya,"draw-mouseout",re)}})}catch(re){be(ya,"draw",re)}},N=l.text.textSpacing,$=l.text.textRotation,X=dl().size([_,b]).words(n).padding(N).rotate(function(){try{return Math.round(Math.random())*$}catch(se){return be(ya,"rotate",se),0}}).random(()=>.5).font(l.text.textFontFamily).fontWeight("bolder").fontSize(function(se){try{return D(se.data[0].value)}catch(re){return be(ya,"fontSize",re),12}}).text(function(se){try{return se.properties.alias}catch(re){return be(ya,"text",re),""}}).on("end",V);X.start()}catch(V){be(ya,"drawWordCloudChart",V)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:h,id:r,style:{width:"100%",height:"100%"}})})},vr=({data:t,formatOptions:e,chartId:r})=>{const o=Te.useRef();let h=bt(t),n,l,s,x=40,L=Ht,A,u,S,b=[0,0],_,g;Te.useEffect(()=>{H()},[e]);const H=()=>{({chartFormatOptions:n,svg:g,width:l,height:s}=Jt(o,e)),b=j(),{margins:L,innerHeight:A,innerWidth:u,legendListWidth:S,chartTitleHeight:x}=Na(n,l,s,b,L,!0),jt(o,l,s,n),_=la(g,L),_t(o,x,l,n),D(),K()},D=()=>{try{let J=n.plotArea.dataLabelNameFontStyle,U=n.plotArea.dataLabelValueFontStyle,V=_.attr("class","vennContainer");V&&V.datum(t).call(pl.VennDiagram().width(u).height(A)),V&&V.selectAll(".venn-circle path").style("fill-opacity",n.plotArea.opacity),n.plotArea.dataLabelName?(V&&V.selectAll(".venn-circle text").html(""),V&&V.selectAll(".venn-circle text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",J.includes(ne.italic)?ne.italic:"").attr("text-decoration",J.includes(ne.underline)?ne.underline:"").style("font-weight",J.includes(ne.bold)?ne.bold:"").html(N=>N.label).attr("visibility",n.plotArea.dataLabelName?"visible":"hidden")):(V&&V.selectAll(".venn-circle text").style("visibility","hidden"),V&&V.selectAll(".venn-circle text").html("")),n.plotArea.dataLabelValue&&V&&V.selectAll(".venn-circle text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==De.white?n.plotArea.dataLabelValueColor:"none").style("font-style",U.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",U.includes(ne.underline)?ne.underline:"none").style("font-weight",U.includes(ne.bold)?ne.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(N=>N.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(N.actualValue):"").attr("visibility",n.plotArea.dataLabelValue?"visible":"hidden"),n.plotArea.intersectionLabelVisibility?(V&&V.selectAll(".venn-intersection text").html(""),V&&V.selectAll(".venn-intersection text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",J.includes(ne.italic)?ne.italic:"").attr("text-decoration",J.includes(ne.underline)?ne.underline:"").style("font-weight",J.includes(ne.bold)?ne.bold:"").html(N=>N.label).attr("visibility",n.plotArea.intersectionLabelVisibility?"visible":"hidden")):(V&&V.selectAll(".venn-intersection text").style("visibility","hidden"),V&&V.selectAll(".venn-intersection text").html("")),n.plotArea.intersectionValueVisibility&&V&&V.selectAll(".venn-intersection text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==De.white?n.plotArea.dataLabelValueColor:"none").style("font-style",U.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",U.includes(ne.underline)?ne.underline:"none").style("font-weight",U.includes(ne.bold)?ne.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(N=>N.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(N.actualValue):"").attr("visibility",n.plotArea.intersectionValueVisibility?"visible":"hidden"),V&&V.selectAll(".venn-circle path").style("fill",N=>N.properties?N.properties.color:null),V&&V.selectAll("g").on("mousemove",function(N,$){ot([{key:$.label,value:je(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)($.size)}],n,void 0,$.properties),T.select(this).transition("tooltip").duration(10).selectAll("path").style("stroke-dasharray","5,5").style("stroke-opacity",1).style("stroke","black")}).on("mouseout",function(N,$){rt();var X=T.select(this).transition("tooltip").duration(400);X.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(J){be("VennChart.tsx","drawVennDiagramChart",J)}},j=()=>{try{let J=0,U=0;return h.forEach(V=>{if(V.legendDisplay){let N=It(V.legendDisplay+" : "+V.actualValue,et(n.legends.legendFontSize),n.legends.legendFontFamily);J=Math.max(J,N.width),U=Math.max(U,N.height)}}),[J,U]}catch(J){return be("VennChart.tsx","calculateLegendsMaxPossibleWidth",J),[0,0]}},K=()=>{try{let J=n.legends.legendPosition,U=n.legends.legendAlignmentTopBottom,V=n.legends.legendAlignment;switch(J){case Be.none:break;case Be.right:oa(g,h,l-S-25,x+5,S+15,s-x-10,J,V,nt.none,n,r,!0);break;case Be.top:oa(g,h,5,x+5,l-10,30,J,U,nt.none,n,r,!0);break;case Be.left:oa(g,h,5,L.top,S+15,s-x-10,J,V,nt.none,n,r,!0);break;case Be.bottom:oa(g,h,5,s-35,l-10,30,J,U,nt.none,n,r,!0);break}}catch(J){be("VennChart.tsx","initLegendListWithTotalValueAllowance",J)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:o,id:r,style:{width:"100%",height:"100%"}})})},kr=({formatOptions:t,data:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{if(!e)return null;let l=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],s=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const x=Te.useRef(),L=Te.useRef(o);L.current=o;const A=Te.useRef(h);A.current=h;let u,S,b,_=40,g=Ht,H,D,j,K,J=Oa.left,U=0,V=!1,N=new Map,$=new Map,X=.8,se=.8;Te.useEffect(()=>{re()},[t]);const re=()=>{({chartFormatOptions:u,svg:K,width:S,height:b}=Jt(x,t)),{margins:g,chartTitleHeight:_,innerHeight:H,innerWidth:D}=Qa(u,b,S),oe(),jt(x,S,b,u),j=la(K,g),_t(x,_,S,u),pe()},oe=()=>{try{X=et(u.nodes.nodesFillOpacity),se=et(u.links.linksFillOpacity),s.forEach(p=>{p.totalValue=0}),s.forEach(p=>l.forEach(C=>(p.name==C.source||p.name==C.target)&&(p.totalValue=(p.totalValue||0)+C.value))),s=s.filter(p=>p.totalValue!=0),l=l.filter(p=>p.value!=0);let q=ue(l),w=new Map;q.forEach(p=>{p.nodes.forEach(C=>{w.set(C,p.layer)})}),s.forEach(p=>{let C=w.get(p.name);N.set(C,(N.get(C)||0)+p.totalValue)}),s.forEach(p=>{$.set(p.name,p.totalValue/N.get(w.get(p.name))*100)}),he(q)}catch(q){be("SankeyChart.tsx","prepareDataForSankey",q)}},he=q=>{try{V=u.nodes.nodesLabelWrap,J=u.nodes.nodesLabelVisibility?u.nodes.sankeyChartType:"None";let w="",p=0;s.forEach(d=>{w=d.name.length>w.length?d.name:w,p=d.totalValue.toString().length>p.toString().length?d.totalValue:p});let C=It(w,et(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily),c=It(je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(p),et(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily);U=Math.max(C.width,c.width)+6,V&&(U=Math.min(D*.1,U))}catch(w){be("SankeyChart.tsx","calculateMaxNodeValueWidth",w)}},Le=(q,w)=>{try{let p=u.nodes.spacing!==void 0?et(u.nodes.spacing)*1.5:15,C=u.nodes.sankeyNodeWidth!==void 0?u.nodes.sankeyNodeWidth:10,c=[],d=[];switch(J){case Oa.center:c=[1,5],d=[D,H];break;case Oa.right:c=[1,5],d=[D-U,H];break;case Oa.left:c=[U,5],d=[D,H];break;default:c=[1,5],d=[D,H];break}return Ti.sankey().nodeId(y=>y.name).nodeAlign(Ti.sankeyJustify).nodeWidth(C).nodePadding(p).extent([c,d]).nodeSort(null)({nodes:q.map(y=>Object.assign({},y)),links:w.map(y=>Object.assign({},y))})}catch(p){return be("SankeyChart.tsx","getsankey",p),{nodes:[],links:[]}}},pe=()=>{try{let q=function(){try{const f={};c.forEach(a=>{const m=a.x0;f[m]||(f[m]=[]),f[m].push(a)}),Object.keys(f).forEach(a=>{const m=f[a];if(m.length===0)return;m.sort((ge,we)=>ge.y0-we.y0);const P=m[0],ie=m[m.length-1],Q=P.y1-P.y0,Ae=ie.y1-ie.y0;if(P.y0=0,P.y1=Q,ie.y1=H,ie.y0=H-Ae,m.length>2){const ge=m.slice(1,m.length-1),we=ie.y0-P.y1,fe=T.sum(ge,ce=>ce.y1-ce.y0),ae=(we-fe)/(ge.length+1);let ke=P.y1+ae;ge.forEach(ce=>{const me=ce.y1-ce.y0;ce.y0=ke,ce.y1=ke+me,ke+=me+ae})}})}catch(f){be("SankeyChart.tsx","centerAlignNodesByLayer",f)}},w=function(){try{c.forEach(f=>{let a=0,m=0;f.sourceLinks.forEach(P=>{P.sy=a,a+=P.width}),f.targetLinks.forEach(P=>{P.ty=m,m+=P.width})})}catch(f){be("SankeyChart.tsx","arrangeFlows",f)}},p=function(f){return function(a){try{const m=a.source.x1,P=a.source.y0+a.sy+a.width/2,ie=a.target.x0,Q=a.target.y0+a.ty+a.width/2,Ae=ie-m,ge=m+Ae*f,we=ie-Ae*f;return`M${m},${P} C${ge},${P} ${we},${Q} ${ie},${Q}`}catch(m){return be("SankeyChart.tsx","sankeyLinkCustom",m),""}}},C=u.nodes.curviness!==void 0?u.nodes.curviness!=="0"?u.nodes.curviness:.1:.5;const{nodes:c,links:d}=Le(s,l);w(),q(),w(),w();const i=j.append("g").selectAll("rect").data(c).enter().append("rect").style("fill-opacity",X).attr("id",f=>"Node"+f.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none").attr("stroke-width",u.nodes.nodesBorderVisibility?u.nodes.nodesBorderThickness:0).attr("x",f=>f.x0).attr("y",f=>f.y0).attr("height",f=>f.y1-f.y0).attr("width",f=>f.x1-f.x0).attr("fill",f=>f.color?f.color:De.white).on("mousemove",function(f,a){try{u.toolTip.toolTipVisibility&&ot([{key:a.name.split("~$~")[1],value:u.toolTip.toolTipNumberFormat==",.0%"?$.get(a.name)+"%":je(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerShape:"square",markerColor:a.color},ht(n,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),j.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),j.selectAll(".sankey-nodes-texts").style("opacity","0"),j.selectAll(".sankey-links").style("stroke-opacity",.1),j.select(`#Node${a.index}`).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",X).style("cursor","pointer"),j.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(m=>{j.select(`#Node${m.target.index}`).style("fill-opacity",X).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${m.index}`).style("stroke-opacity",se),j.select(`#Label${m.target.index}`).style("opacity",1)}),a.targetLinks.forEach(m=>{j.select(`#Node${m.source.index}`).style("fill-opacity",X).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${m.index}`).style("stroke-opacity",se),j.select(`#Label${m.source.index}`).style("opacity",1)})}catch(m){be("SankeyChart.tsx","Nodes.onMouseMove",m)}}).on("mouseout",function(f){try{j.selectAll(".sankey-nodes").style("fill-opacity",X).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",se),j.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&rt()}catch(a){be("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(Qe.SeriesId,f=>String(f.name??"")).attr(Qe.DimValue,f=>String(f.name??"")).on("click",At(A,L,(f,a)=>{const m=String(a.name??"");return{seriesId:m,dimValue:m,legendUniqueId:m,seriesDisplayName:m.includes("~$~")?m.split("~$~")[1]:m}}));if(j.append("g").attr("fill","none").selectAll("g").data(d).enter().append("g").style("mix-blend-mode","multiply").append("path").attr("class","sankey-links").attr("stroke-opacity",se).attr("id",f=>"Link"+f.index).attr("d",p(C)).attr("stroke",f=>u.links.linksColor==="Source"?f.source.color:f.target.color).attr("stroke-width",f=>Math.max(1,f.width)).on("mousemove",function(f,a){try{j.selectAll(".sankey-links").style("stroke-opacity",.1),j.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),j.selectAll(".sankey-nodes-texts").style("opacity","0"),j.select(`#Link${a.index}`).style("stroke-opacity",se).style("cursor","pointer"),j.select(`#Node${a.target.index}`).style("fill-opacity",X).style("Stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Node${a.source.index}`).style("fill-opacity",X).style("Stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Label${a.target.index}`).style("opacity",1),j.select(`#Label${a.source.index}`).style("opacity",1),u.toolTip.toolTipVisibility&&ot([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:je(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerColor:a.source.color,markerShape:"circle"},ht(n,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(m){be("SankeyChart.tsx","link.onMouseMove",m)}}).on("mouseout",function(f){try{u.toolTip.toolTipVisibility&&rt(),j.selectAll(".sankey-nodes").style("fill-opacity",X),j.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",se),j.selectAll(".sankey-nodes-texts").style("opacity","1"),T.select(this).select("rect").style("pointer-events","all"),T.select(this).style("cursor","none")}catch(a){be("SankeyChart.tsx","link.onMouseOut",a)}}),u.nodes.nodesLabelVisibility)try{const f=j.append("g").attr("font-family",u.nodes.nodesLabelFontFamily).attr("font-size",u.nodes.nodesLabelFontSize).style("font-style",u.nodes.nodesLabelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ne.bold)?ne.bold:"").attr("display",u.nodes.nodesLabelVisibility?"visible":"none").selectAll("text").data(c).enter().append("g").attr("class","sankey-nodes-texts").attr("id",a=>"Label"+a.index).each(function(a){try{if(u.nodes.sankeyChartType!=="None"){const m=u.nodes.sankeyNodeWidth,P=J===Oa.center;T.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y-16).attr("width",Ae=>P?m:U).attr("height",20).append("xhtml:div").style("white-space",P||V?"nowrap":"normal").style("overflow",P||V?"hidden":"visible").style("text-overflow",P||V?"ellipsis":"clip").style("display","block").style("max-width",Ae=>P?"100px":U+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ne.bold)?ne.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",Ae=>$.get(Ae.name)>0?Ae.alias?Ae.alias.includes("~$~")?Ae.alias.split("~$~")[1]:Ae.alias:Ae.name.includes("~$~")?Ae.name.split("~$~")[1]:Ae.name:"").text(Ae=>$.get(Ae.name)>0?Ae.alias?Ae.alias.includes("~$~")?Ae.alias.split("~$~")[1]:Ae.alias:Ae.name.includes("~$~")?Ae.name.split("~$~")[1]:Ae.name:""),T.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y).attr("width",Ae=>P?m:U).attr("height",20).append("xhtml:div").style("white-space",P||V?"nowrap":"normal").style("overflow",P||V?"hidden":"visible").style("text-overflow",P||V?"ellipsis":"clip").style("display","block").style("max-width",Ae=>P?"100px":U+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ne.bold)?ne.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",Ae=>$.get(Ae.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(Ae.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(Ae.totalValue):"").text(Ae=>$.get(Ae.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(Ae.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(Ae.totalValue):"")}}catch(m){be("SankeyChart.tsx","texts.each",m)}})}catch(f){be("SankeyChart.tsx","inittree.texts",f)}}catch(q){be("SankeyChart.tsx","inittree",q)}};function ue(q){try{const w=new Map,p=new Map,C=new Set;for(const{source:f,target:a}of q)C.add(f),C.add(a),w.has(a)||w.set(a,new Set),p.has(f)||p.set(f,new Set),w.get(a).add(f),p.get(f).add(a);const c=new Map,d=[];for(const f of C)w.has(f)||(c.set(f,0),d.push(f));for(;d.length>0;){const f=d.shift(),a=c.get(f),m=p.get(f)||[];for(const P of m){const ie=a+1;(!c.has(P)||c.get(P)<ie)&&(c.set(P,ie),d.push(P))}}const i=new Map;for(const[f,a]of c.entries())i.has(a)||i.set(a,[]),i.get(a).push(f);return[...i.entries()].sort((f,a)=>f[0]-a[0]).map(([f,a])=>({layer:f,nodes:a}))}catch(w){return be("SankeyChart.tsx","assignNodeLayers",w),[]}}const O=q=>{try{let w={};const p=Number(u.nodes.sankeyNodeWidth),C=p/2;switch(J){case"Right":w.x=q.x1+6;break;default:case"Left":w.x=q.x0-U;break;case"Center":w.x=q.x0+C-p/2;break}return w.y=(q.y1+q.y0)/2,w}catch(w){return be("SankeyChart.tsx","getXandYPositionOfLables",w),{x:0,y:0}}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:x,id:r,style:{width:"100%",height:"100%"}})})},Cr={type:"FeatureCollection",features:[{type:"Feature",id:"AL",properties:{name:"Alabama",value:55},geometry:{type:"Polygon",coordinates:[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],[-85.069935,32.580372],[-84.960397,32.421541],[-85.004212,32.322956],[-84.889196,32.262709],[-85.058981,32.13674],[-85.053504,32.01077],[-85.141136,31.840985],[-85.042551,31.539753],[-85.113751,31.27686],[-85.004212,31.003013],[-85.497137,30.997536],[-87.600282,30.997536],[-87.633143,30.86609],[-87.408589,30.674397],[-87.446927,30.510088],[-87.37025,30.427934],[-87.518128,30.280057],[-87.655051,30.247195],[-87.90699,30.411504],[-87.934375,30.657966],[-88.011052,30.685351],[-88.10416,30.499135],[-88.137022,30.318396],[-88.394438,30.367688],[-88.471115,31.895754],[-88.241084,33.796253],[-88.098683,34.891641],[-88.202745,34.995703],[-87.359296,35.00118]]]}},{type:"Feature",id:"AK",properties:{name:"Alaska",value:87},geometry:{type:"MultiPolygon",coordinates:[[[[-131.602021,55.117982],[-131.569159,55.28229],[-131.355558,55.183705],[-131.38842,55.01392],[-131.645836,55.035827],[-131.602021,55.117982]]],[[[-131.832052,55.42469],[-131.645836,55.304197],[-131.749898,55.128935],[-131.832052,55.189182],[-131.832052,55.42469]]],[[[-132.976733,56.437924],[-132.735747,56.459832],[-132.631685,56.421493],[-132.664547,56.273616],[-132.878148,56.240754],[-133.069841,56.333862],[-132.976733,56.437924]]],[[[-133.595627,56.350293],[-133.162949,56.317431],[-133.05341,56.125739],[-132.620732,55.912138],[-132.472854,55.780691],[-132.4619,55.671152],[-132.357838,55.649245],[-132.341408,55.506844],[-132.166146,55.364444],[-132.144238,55.238474],[-132.029222,55.276813],[-131.97993,55.178228],[-131.958022,54.789365],[-132.029222,54.701734],[-132.308546,54.718165],[-132.385223,54.915335],[-132.483808,54.898904],[-132.686455,55.046781],[-132.746701,54.997489],[-132.916486,55.046781],[-132.889102,54.898904],[-132.73027,54.937242],[-132.626209,54.882473],[-132.675501,54.679826],[-132.867194,54.701734],[-133.157472,54.95915],[-133.239626,55.090597],[-133.223195,55.22752],[-133.453227,55.216566],[-133.453227,55.320628],[-133.277964,55.331582],[-133.102702,55.42469],[-133.17938,55.588998],[-133.387503,55.62186],[-133.420365,55.884753],[-133.497042,56.0162],[-133.639442,55.923092],[-133.694212,56.070969],[-133.546335,56.142169],[-133.666827,56.311955],[-133.595627,56.350293]]],[[[-133.738027,55.556137],[-133.546335,55.490413],[-133.414888,55.572568],[-133.283441,55.534229],[-133.420365,55.386352],[-133.633966,55.430167],[-133.738027,55.556137]]],[[[-133.907813,56.930849],[-134.050213,57.029434],[-133.885905,57.095157],[-133.343688,57.002049],[-133.102702,57.007526],[-132.932917,56.82131],[-132.620732,56.667956],[-132.653593,56.55294],[-132.817901,56.492694],[-133.042456,56.520078],[-133.201287,56.448878],[-133.420365,56.492694],[-133.66135,56.448878],[-133.710643,56.684386],[-133.688735,56.837741],[-133.869474,56.843218],[-133.907813,56.930849]]],[[[-134.115936,56.48174],[-134.25286,56.558417],[-134.400737,56.722725],[-134.417168,56.848695],[-134.296675,56.908941],[-134.170706,56.848695],[-134.143321,56.952757],[-133.748981,56.772017],[-133.710643,56.596755],[-133.847566,56.574848],[-133.935197,56.377678],[-133.836612,56.322908],[-133.957105,56.092877],[-134.110459,56.142169],[-134.132367,55.999769],[-134.230952,56.070969],[-134.291198,56.350293],[-134.115936,56.48174]]],[[[-134.636246,56.28457],[-134.669107,56.169554],[-134.806031,56.235277],[-135.178463,56.67891],[-135.413971,56.810356],[-135.331817,56.914418],[-135.424925,57.166357],[-135.687818,57.369004],[-135.419448,57.566174],[-135.298955,57.48402],[-135.063447,57.418296],[-134.849846,57.407343],[-134.844369,57.248511],[-134.636246,56.728202],[-134.636246,56.28457]]],[[[-134.712923,58.223407],[-134.373353,58.14673],[-134.176183,58.157683],[-134.187137,58.081006],[-133.902336,57.807159],[-134.099505,57.850975],[-134.148798,57.757867],[-133.935197,57.615466],[-133.869474,57.363527],[-134.083075,57.297804],[-134.154275,57.210173],[-134.499322,57.029434],[-134.603384,57.034911],[-134.6472,57.226604],[-134.575999,57.341619],[-134.608861,57.511404],[-134.729354,57.719528],[-134.707446,57.829067],[-134.784123,58.097437],[-134.91557,58.212453],[-134.953908,58.409623],[-134.712923,58.223407]]],[[[-135.857603,57.330665],[-135.715203,57.330665],[-135.567326,57.149926],[-135.633049,57.023957],[-135.857603,56.996572],[-135.824742,57.193742],[-135.857603,57.330665]]],[[[-136.279328,58.206976],[-135.978096,58.201499],[-135.780926,58.28913],[-135.496125,58.168637],[-135.64948,58.037191],[-135.59471,57.987898],[-135.45231,58.135776],[-135.107263,58.086483],[-134.91557,57.976944],[-135.025108,57.779775],[-134.937477,57.763344],[-134.822462,57.500451],[-135.085355,57.462112],[-135.572802,57.675713],[-135.556372,57.456635],[-135.709726,57.369004],[-135.890465,57.407343],[-136.000004,57.544266],[-136.208128,57.637374],[-136.366959,57.829067],[-136.569606,57.916698],[-136.558652,58.075529],[-136.421728,58.130299],[-136.377913,58.267222],[-136.279328,58.206976]]],[[[-147.079854,60.200582],[-147.501579,59.948643],[-147.53444,59.850058],[-147.874011,59.784335],[-147.80281,59.937689],[-147.435855,60.09652],[-147.205824,60.271782],[-147.079854,60.200582]]],[[[-147.561825,60.578491],[-147.616594,60.370367],[-147.758995,60.156767],[-147.956165,60.227967],[-147.791856,60.474429],[-147.561825,60.578491]]],[[[-147.786379,70.245291],[-147.682318,70.201475],[-147.162008,70.15766],[-146.888161,70.185044],[-146.510252,70.185044],[-146.099482,70.146706],[-145.858496,70.168614],[-145.622988,70.08646],[-145.195787,69.993352],[-144.620708,69.971444],[-144.461877,70.026213],[-144.078491,70.059075],[-143.914183,70.130275],[-143.497935,70.141229],[-143.503412,70.091936],[-143.25695,70.119321],[-142.747594,70.042644],[-142.402547,69.916674],[-142.079408,69.856428],[-142.008207,69.801659],[-141.712453,69.790705],[-141.433129,69.697597],[-141.378359,69.63735],[-141.208574,69.686643],[-141.00045,69.648304],[-141.00045,60.304644],[-140.53491,60.22249],[-140.474664,60.310121],[-139.987216,60.184151],[-139.696939,60.342983],[-139.088998,60.359413],[-139.198537,60.091043],[-139.045183,59.997935],[-138.700135,59.910304],[-138.623458,59.767904],[-137.604747,59.242118],[-137.445916,58.908024],[-137.265177,59.001132],[-136.827022,59.159963],[-136.580559,59.16544],[-136.465544,59.285933],[-136.476498,59.466672],[-136.301236,59.466672],[-136.25742,59.625503],[-135.945234,59.663842],[-135.479694,59.800766],[-135.025108,59.565257],[-135.068924,59.422857],[-134.959385,59.280456],[-134.701969,59.247595],[-134.378829,59.033994],[-134.400737,58.973748],[-134.25286,58.858732],[-133.842089,58.727285],[-133.173903,58.152206],[-133.075318,57.998852],[-132.867194,57.845498],[-132.560485,57.505928],[-132.253777,57.21565],[-132.368792,57.095157],[-132.05113,57.051341],[-132.127807,56.876079],[-131.870391,56.804879],[-131.837529,56.602232],[-131.580113,56.613186],[-131.087188,56.405062],[-130.78048,56.366724],[-130.621648,56.268139],[-130.468294,56.240754],[-130.424478,56.142169],[-130.101339,56.114785],[-130.002754,55.994292],[-130.150631,55.769737],[-130.128724,55.583521],[-129.986323,55.276813],[-130.095862,55.200136],[-130.336847,54.920812],[-130.687372,54.718165],[-130.785957,54.822227],[-130.917403,54.789365],[-131.010511,54.997489],[-130.983126,55.08512],[-131.092665,55.189182],[-130.862634,55.298721],[-130.928357,55.337059],[-131.158389,55.200136],[-131.284358,55.287767],[-131.426759,55.238474],[-131.843006,55.457552],[-131.700606,55.698537],[-131.963499,55.616383],[-131.974453,55.49589],[-132.182576,55.588998],[-132.226392,55.704014],[-132.083991,55.829984],[-132.127807,55.955953],[-132.324977,55.851892],[-132.522147,56.076446],[-132.642639,56.032631],[-132.719317,56.218847],[-132.527624,56.339339],[-132.341408,56.339339],[-132.396177,56.487217],[-132.297592,56.67891],[-132.450946,56.673433],[-132.768609,56.837741],[-132.993164,57.034911],[-133.51895,57.177311],[-133.507996,57.577128],[-133.677781,57.62642],[-133.639442,57.790728],[-133.814705,57.834544],[-134.072121,58.053622],[-134.143321,58.168637],[-134.586953,58.206976],[-135.074401,58.502731],[-135.282525,59.192825],[-135.38111,59.033994],[-135.337294,58.891593],[-135.140124,58.617746],[-135.189417,58.573931],[-135.05797,58.349376],[-135.085355,58.201499],[-135.277048,58.234361],[-135.430402,58.398669],[-135.633049,58.426053],[-135.91785,58.382238],[-135.912373,58.617746],[-136.087635,58.814916],[-136.246466,58.75467],[-136.876314,58.962794],[-136.931084,58.902547],[-136.586036,58.836824],[-136.317666,58.672516],[-136.213604,58.667039],[-136.180743,58.535592],[-136.043819,58.382238],[-136.388867,58.294607],[-136.591513,58.349376],[-136.59699,58.212453],[-136.859883,58.316515],[-136.947514,58.393192],[-137.111823,58.393192],[-137.566409,58.590362],[-137.900502,58.765624],[-137.933364,58.869686],[-138.11958,59.02304],[-138.634412,59.132579],[-138.919213,59.247595],[-139.417615,59.379041],[-139.746231,59.505011],[-139.718846,59.641934],[-139.625738,59.598119],[-139.5162,59.68575],[-139.625738,59.88292],[-139.488815,59.992458],[-139.554538,60.041751],[-139.801,59.833627],[-140.315833,59.696704],[-140.92925,59.745996],[-141.444083,59.871966],[-141.46599,59.970551],[-141.706976,59.948643],[-141.964392,60.019843],[-142.539471,60.085566],[-142.873564,60.091043],[-143.623905,60.036274],[-143.892275,59.997935],[-144.231845,60.140336],[-144.65357,60.206059],[-144.785016,60.29369],[-144.834309,60.441568],[-145.124586,60.430614],[-145.223171,60.299167],[-145.738004,60.474429],[-145.820158,60.551106],[-146.351421,60.408706],[-146.608837,60.238921],[-146.718376,60.397752],[-146.608837,60.485383],[-146.455483,60.463475],[-145.951604,60.578491],[-146.017328,60.666122],[-146.252836,60.622307],[-146.345944,60.737322],[-146.565022,60.753753],[-146.784099,61.044031],[-146.866253,60.972831],[-147.172962,60.934492],[-147.271547,60.972831],[-147.375609,60.879723],[-147.758995,60.912584],[-147.775426,60.808523],[-148.032842,60.781138],[-148.153334,60.819476],[-148.065703,61.005692],[-148.175242,61.000215],[-148.350504,60.803046],[-148.109519,60.737322],[-148.087611,60.594922],[-147.939734,60.441568],[-148.027365,60.277259],[-148.219058,60.332029],[-148.273827,60.249875],[-148.087611,60.217013],[-147.983549,59.997935],[-148.251919,59.95412],[-148.399797,59.997935],[-148.635305,59.937689],[-148.755798,59.986981],[-149.067984,59.981505],[-149.05703,60.063659],[-149.204907,60.008889],[-149.287061,59.904827],[-149.418508,59.997935],[-149.582816,59.866489],[-149.511616,59.806242],[-149.741647,59.729565],[-149.949771,59.718611],[-150.031925,59.61455],[-150.25648,59.521442],[-150.409834,59.554303],[-150.579619,59.444764],[-150.716543,59.450241],[-151.001343,59.225687],[-151.308052,59.209256],[-151.406637,59.280456],[-151.592853,59.159963],[-151.976239,59.253071],[-151.888608,59.422857],[-151.636669,59.483103],[-151.47236,59.472149],[-151.423068,59.537872],[-151.127313,59.669319],[-151.116359,59.778858],[-151.505222,59.63098],[-151.828361,59.718611],[-151.8667,59.778858],[-151.702392,60.030797],[-151.423068,60.211536],[-151.379252,60.359413],[-151.297098,60.386798],[-151.264237,60.545629],[-151.406637,60.720892],[-151.06159,60.786615],[-150.404357,61.038554],[-150.245526,60.939969],[-150.042879,60.912584],[-149.741647,61.016646],[-150.075741,61.15357],[-150.207187,61.257632],[-150.47008,61.246678],[-150.656296,61.29597],[-150.711066,61.252155],[-151.023251,61.180954],[-151.165652,61.044031],[-151.477837,61.011169],[-151.800977,60.852338],[-151.833838,60.748276],[-152.080301,60.693507],[-152.13507,60.578491],[-152.310332,60.507291],[-152.392486,60.304644],[-152.732057,60.173197],[-152.567748,60.069136],[-152.704672,59.915781],[-153.022334,59.888397],[-153.049719,59.691227],[-153.345474,59.620026],[-153.438582,59.702181],[-153.586459,59.548826],[-153.761721,59.543349],[-153.72886,59.433811],[-154.117723,59.368087],[-154.1944,59.066856],[-153.750768,59.050425],[-153.400243,58.968271],[-153.301658,58.869686],[-153.444059,58.710854],[-153.679567,58.612269],[-153.898645,58.606793],[-153.920553,58.519161],[-154.062953,58.4863],[-153.99723,58.376761],[-154.145107,58.212453],[-154.46277,58.059098],[-154.643509,58.059098],[-154.818771,58.004329],[-154.988556,58.015283],[-155.120003,57.955037],[-155.081664,57.872883],[-155.328126,57.829067],[-155.377419,57.708574],[-155.547204,57.785251],[-155.73342,57.549743],[-156.045606,57.566174],[-156.023698,57.440204],[-156.209914,57.473066],[-156.34136,57.418296],[-156.34136,57.248511],[-156.549484,56.985618],[-156.883577,56.952757],[-157.157424,56.832264],[-157.20124,56.766541],[-157.376502,56.859649],[-157.672257,56.607709],[-157.754411,56.67891],[-157.918719,56.657002],[-157.957058,56.514601],[-158.126843,56.459832],[-158.32949,56.48174],[-158.488321,56.339339],[-158.208997,56.295524],[-158.510229,55.977861],[-159.375585,55.873799],[-159.616571,55.594475],[-159.676817,55.654722],[-159.643955,55.829984],[-159.813741,55.857368],[-160.027341,55.791645],[-160.060203,55.720445],[-160.394296,55.605429],[-160.536697,55.473983],[-160.580512,55.567091],[-160.668143,55.457552],[-160.865313,55.528752],[-161.232268,55.358967],[-161.506115,55.364444],[-161.467776,55.49589],[-161.588269,55.62186],[-161.697808,55.517798],[-161.686854,55.408259],[-162.053809,55.074166],[-162.179779,55.15632],[-162.218117,55.03035],[-162.470057,55.052258],[-162.508395,55.249428],[-162.661749,55.293244],[-162.716519,55.222043],[-162.579595,55.134412],[-162.645319,54.997489],[-162.847965,54.926289],[-163.00132,55.079643],[-163.187536,55.090597],[-163.220397,55.03035],[-163.034181,54.942719],[-163.373752,54.800319],[-163.14372,54.76198],[-163.138243,54.696257],[-163.329936,54.74555],[-163.587352,54.614103],[-164.085754,54.61958],[-164.332216,54.531949],[-164.354124,54.466226],[-164.638925,54.389548],[-164.847049,54.416933],[-164.918249,54.603149],[-164.710125,54.663395],[-164.551294,54.88795],[-164.34317,54.893427],[-163.894061,55.041304],[-163.532583,55.046781],[-163.39566,54.904381],[-163.291598,55.008443],[-163.313505,55.128935],[-163.105382,55.183705],[-162.880827,55.183705],[-162.579595,55.446598],[-162.245502,55.682106],[-161.807347,55.89023],[-161.292514,55.983338],[-161.078914,55.939523],[-160.87079,55.999769],[-160.816021,55.912138],[-160.931036,55.813553],[-160.805067,55.736876],[-160.766728,55.857368],[-160.509312,55.868322],[-160.438112,55.791645],[-160.27928,55.76426],[-160.273803,55.857368],[-160.536697,55.939523],[-160.558604,55.994292],[-160.383342,56.251708],[-160.147834,56.399586],[-159.830171,56.541986],[-159.326293,56.667956],[-158.959338,56.848695],[-158.784076,56.782971],[-158.641675,56.810356],[-158.701922,56.925372],[-158.658106,57.034911],[-158.378782,57.264942],[-157.995396,57.41282],[-157.688688,57.609989],[-157.705118,57.719528],[-157.458656,58.497254],[-157.07527,58.705377],[-157.119086,58.869686],[-158.039212,58.634177],[-158.32949,58.661562],[-158.40069,58.760147],[-158.564998,58.803962],[-158.619768,58.913501],[-158.767645,58.864209],[-158.860753,58.694424],[-158.701922,58.480823],[-158.893615,58.387715],[-159.0634,58.420577],[-159.392016,58.760147],[-159.616571,58.929932],[-159.731586,58.929932],[-159.808264,58.803962],[-159.906848,58.782055],[-160.054726,58.886116],[-160.235465,58.902547],[-160.317619,59.072332],[-160.854359,58.88064],[-161.33633,58.743716],[-161.374669,58.667039],[-161.752577,58.552023],[-161.938793,58.656085],[-161.769008,58.776578],[-161.829255,59.061379],[-161.955224,59.36261],[-161.703285,59.48858],[-161.911409,59.740519],[-162.092148,59.88292],[-162.234548,60.091043],[-162.448149,60.178674],[-162.502918,59.997935],[-162.760334,59.959597],[-163.171105,59.844581],[-163.66403,59.795289],[-163.9324,59.806242],[-164.162431,59.866489],[-164.189816,60.02532],[-164.386986,60.074613],[-164.699171,60.29369],[-164.962064,60.337506],[-165.268773,60.578491],[-165.060649,60.68803],[-165.016834,60.890677],[-165.175665,60.846861],[-165.197573,60.972831],[-165.120896,61.076893],[-165.323543,61.170001],[-165.34545,61.071416],[-165.591913,61.109754],[-165.624774,61.279539],[-165.816467,61.301447],[-165.920529,61.416463],[-165.915052,61.558863],[-166.106745,61.49314],[-166.139607,61.630064],[-165.904098,61.662925],[-166.095791,61.81628],[-165.756221,61.827233],[-165.756221,62.013449],[-165.674067,62.139419],[-165.044219,62.539236],[-164.912772,62.659728],[-164.819664,62.637821],[-164.874433,62.807606],[-164.633448,63.097884],[-164.425324,63.212899],[-164.036462,63.262192],[-163.73523,63.212899],[-163.313505,63.037637],[-163.039658,63.059545],[-162.661749,63.22933],[-162.272887,63.486746],[-162.075717,63.514131],[-162.026424,63.448408],[-161.555408,63.448408],[-161.13916,63.503177],[-160.766728,63.771547],[-160.766728,63.837271],[-160.952944,64.08921],[-160.974852,64.237087],[-161.26513,64.395918],[-161.374669,64.532842],[-161.078914,64.494503],[-160.79959,64.609519],[-160.783159,64.719058],[-161.144637,64.921705],[-161.413007,64.762873],[-161.664946,64.790258],[-161.900455,64.702627],[-162.168825,64.680719],[-162.234548,64.620473],[-162.541257,64.532842],[-162.634365,64.384965],[-162.787719,64.324718],[-162.858919,64.49998],[-163.045135,64.538319],[-163.176582,64.401395],[-163.253259,64.467119],[-163.598306,64.565704],[-164.304832,64.560227],[-164.80871,64.450688],[-165.000403,64.434257],[-165.411174,64.49998],[-166.188899,64.576658],[-166.391546,64.636904],[-166.484654,64.735489],[-166.413454,64.872412],[-166.692778,64.987428],[-166.638008,65.113398],[-166.462746,65.179121],[-166.517516,65.337952],[-166.796839,65.337952],[-167.026871,65.381768],[-167.47598,65.414629],[-167.711489,65.496784],[-168.072967,65.578938],[-168.105828,65.682999],[-167.541703,65.819923],[-166.829701,66.049954],[-166.3313,66.186878],[-166.046499,66.110201],[-165.756221,66.09377],[-165.690498,66.203309],[-165.86576,66.21974],[-165.88219,66.312848],[-165.186619,66.466202],[-164.403417,66.581218],[-163.981692,66.592172],[-163.751661,66.553833],[-163.872153,66.389525],[-163.828338,66.274509],[-163.915969,66.192355],[-163.768091,66.060908],[-163.494244,66.082816],[-163.149197,66.060908],[-162.749381,66.088293],[-162.634365,66.039001],[-162.371472,66.028047],[-162.14144,66.077339],[-161.840208,66.02257],[-161.549931,66.241647],[-161.341807,66.252601],[-161.199406,66.208786],[-161.128206,66.334755],[-161.528023,66.395002],[-161.911409,66.345709],[-161.87307,66.510017],[-162.174302,66.68528],[-162.502918,66.740049],[-162.601503,66.89888],[-162.344087,66.937219],[-162.015471,66.778388],[-162.075717,66.652418],[-161.916886,66.553833],[-161.571838,66.438817],[-161.489684,66.55931],[-161.884024,66.718141],[-161.714239,67.002942],[-161.851162,67.052235],[-162.240025,66.991988],[-162.639842,67.008419],[-162.700088,67.057712],[-162.902735,67.008419],[-163.740707,67.128912],[-163.757138,67.254881],[-164.009077,67.534205],[-164.211724,67.638267],[-164.534863,67.725898],[-165.192096,67.966884],[-165.493328,68.059992],[-165.794559,68.081899],[-166.243668,68.246208],[-166.681824,68.339316],[-166.703731,68.372177],[-166.375115,68.42147],[-166.227238,68.574824],[-166.216284,68.881533],[-165.329019,68.859625],[-164.255539,68.930825],[-163.976215,68.985595],[-163.532583,69.138949],[-163.110859,69.374457],[-163.023228,69.609966],[-162.842489,69.812613],[-162.470057,69.982398],[-162.311225,70.108367],[-161.851162,70.311014],[-161.779962,70.256245],[-161.396576,70.239814],[-160.837928,70.343876],[-160.487404,70.453415],[-159.649432,70.792985],[-159.33177,70.809416],[-159.298908,70.760123],[-158.975769,70.798462],[-158.658106,70.787508],[-158.033735,70.831323],[-157.420318,70.979201],[-156.812377,71.285909],[-156.565915,71.351633],[-156.522099,71.296863],[-155.585543,71.170894],[-155.508865,71.083263],[-155.832005,70.968247],[-155.979882,70.96277],[-155.974405,70.809416],[-155.503388,70.858708],[-155.476004,70.940862],[-155.262403,71.017539],[-155.191203,70.973724],[-155.032372,71.148986],[-154.566832,70.990155],[-154.643509,70.869662],[-154.353231,70.8368],[-154.183446,70.7656],[-153.931507,70.880616],[-153.487874,70.886093],[-153.235935,70.924431],[-152.589656,70.886093],[-152.26104,70.842277],[-152.419871,70.606769],[-151.817408,70.546523],[-151.773592,70.486276],[-151.187559,70.382214],[-151.182082,70.431507],[-150.760358,70.49723],[-150.355064,70.491753],[-150.349588,70.436984],[-150.114079,70.431507],[-149.867617,70.508184],[-149.462323,70.519138],[-149.177522,70.486276],[-148.78866,70.404122],[-148.607921,70.420553],[-148.350504,70.305537],[-148.202627,70.349353],[-147.961642,70.316491],[-147.786379,70.245291]]],[[[-152.94018,58.026237],[-152.945657,57.982421],[-153.290705,58.048145],[-153.044242,58.305561],[-152.819688,58.327469],[-152.666333,58.562977],[-152.496548,58.354853],[-152.354148,58.426053],[-152.080301,58.311038],[-152.080301,58.152206],[-152.480117,58.130299],[-152.655379,58.059098],[-152.94018,58.026237]]],[[[-153.958891,57.538789],[-153.67409,57.670236],[-153.931507,57.69762],[-153.936983,57.812636],[-153.723383,57.889313],[-153.570028,57.834544],[-153.548121,57.719528],[-153.46049,57.796205],[-153.455013,57.96599],[-153.268797,57.889313],[-153.235935,57.998852],[-153.071627,57.933129],[-152.874457,57.933129],[-152.721103,57.993375],[-152.469163,57.889313],[-152.469163,57.599035],[-152.151501,57.620943],[-152.359625,57.42925],[-152.74301,57.505928],[-152.60061,57.379958],[-152.710149,57.275896],[-152.907319,57.325188],[-152.912796,57.128019],[-153.214027,57.073249],[-153.312612,56.991095],[-153.498828,57.067772],[-153.695998,56.859649],[-153.849352,56.837741],[-154.013661,56.744633],[-154.073907,56.969187],[-154.303938,56.848695],[-154.314892,56.919895],[-154.523016,56.991095],[-154.539447,57.193742],[-154.742094,57.275896],[-154.627078,57.511404],[-154.227261,57.659282],[-153.980799,57.648328],[-153.958891,57.538789]]],[[[-154.53397,56.602232],[-154.742094,56.399586],[-154.807817,56.432447],[-154.53397,56.602232]]],[[[-155.634835,55.923092],[-155.476004,55.912138],[-155.530773,55.704014],[-155.793666,55.731399],[-155.837482,55.802599],[-155.634835,55.923092]]],[[[-159.890418,55.28229],[-159.950664,55.068689],[-160.257373,54.893427],[-160.109495,55.161797],[-160.005433,55.134412],[-159.890418,55.28229]]],[[[-160.520266,55.358967],[-160.33405,55.358967],[-160.339527,55.249428],[-160.525743,55.128935],[-160.690051,55.211089],[-160.794113,55.134412],[-160.854359,55.320628],[-160.79959,55.380875],[-160.520266,55.358967]]],[[[-162.256456,54.981058],[-162.234548,54.893427],[-162.349564,54.838658],[-162.437195,54.931766],[-162.256456,54.981058]]],[[[-162.415287,63.634624],[-162.563165,63.536039],[-162.612457,63.62367],[-162.415287,63.634624]]],[[[-162.80415,54.488133],[-162.590549,54.449795],[-162.612457,54.367641],[-162.782242,54.373118],[-162.80415,54.488133]]],[[[-165.548097,54.29644],[-165.476897,54.181425],[-165.630251,54.132132],[-165.685021,54.252625],[-165.548097,54.29644]]],[[[-165.73979,54.15404],[-166.046499,54.044501],[-166.112222,54.121178],[-165.980775,54.219763],[-165.73979,54.15404]]],[[[-166.364161,60.359413],[-166.13413,60.397752],[-166.084837,60.326552],[-165.88219,60.342983],[-165.685021,60.277259],[-165.646682,59.992458],[-165.750744,59.89935],[-166.00816,59.844581],[-166.062929,59.745996],[-166.440838,59.855535],[-166.6161,59.850058],[-166.994009,59.992458],[-167.125456,59.992458],[-167.344534,60.074613],[-167.421211,60.206059],[-167.311672,60.238921],[-166.93924,60.206059],[-166.763978,60.310121],[-166.577762,60.321075],[-166.495608,60.392275],[-166.364161,60.359413]]],[[[-166.375115,54.01164],[-166.210807,53.934962],[-166.5449,53.748746],[-166.539423,53.715885],[-166.117699,53.852808],[-166.112222,53.776131],[-166.282007,53.683023],[-166.555854,53.622777],[-166.583239,53.529669],[-166.878994,53.431084],[-167.13641,53.425607],[-167.306195,53.332499],[-167.623857,53.250345],[-167.793643,53.337976],[-167.459549,53.442038],[-167.355487,53.425607],[-167.103548,53.513238],[-167.163794,53.611823],[-167.021394,53.715885],[-166.807793,53.666592],[-166.785886,53.732316],[-167.015917,53.754223],[-167.141887,53.825424],[-167.032348,53.945916],[-166.643485,54.017116],[-166.561331,53.880193],[-166.375115,54.01164]]],[[[-168.790446,53.157237],[-168.40706,53.34893],[-168.385152,53.431084],[-168.237275,53.524192],[-168.007243,53.568007],[-167.886751,53.518715],[-167.842935,53.387268],[-168.270136,53.244868],[-168.500168,53.036744],[-168.686384,52.965544],[-168.790446,53.157237]]],[[[-169.74891,52.894344],[-169.705095,52.795759],[-169.962511,52.790282],[-169.989896,52.856005],[-169.74891,52.894344]]],[[[-170.148727,57.221127],[-170.28565,57.128019],[-170.313035,57.221127],[-170.148727,57.221127]]],[[[-170.669036,52.697174],[-170.603313,52.604066],[-170.789529,52.538343],[-170.816914,52.636928],[-170.669036,52.697174]]],[[[-171.742517,63.716778],[-170.94836,63.5689],[-170.488297,63.69487],[-170.280174,63.683916],[-170.093958,63.612716],[-170.044665,63.492223],[-169.644848,63.4265],[-169.518879,63.366254],[-168.99857,63.338869],[-168.686384,63.295053],[-168.856169,63.147176],[-169.108108,63.180038],[-169.376478,63.152653],[-169.513402,63.08693],[-169.639372,62.939052],[-169.831064,63.075976],[-170.055619,63.169084],[-170.263743,63.180038],[-170.362328,63.2841],[-170.866206,63.415546],[-171.101715,63.421023],[-171.463193,63.306007],[-171.73704,63.366254],[-171.852055,63.486746],[-171.742517,63.716778]]],[[[-172.432611,52.390465],[-172.41618,52.275449],[-172.607873,52.253542],[-172.569535,52.352127],[-172.432611,52.390465]]],[[[-173.626584,52.14948],[-173.495138,52.105664],[-173.122706,52.111141],[-173.106275,52.07828],[-173.549907,52.028987],[-173.626584,52.14948]]],[[[-174.322156,52.280926],[-174.327632,52.379511],[-174.185232,52.41785],[-173.982585,52.319265],[-174.059262,52.226157],[-174.179755,52.231634],[-174.141417,52.127572],[-174.333109,52.116618],[-174.738403,52.007079],[-174.968435,52.039941],[-174.902711,52.116618],[-174.656249,52.105664],[-174.322156,52.280926]]],[[[-176.469116,51.853725],[-176.288377,51.870156],[-176.288377,51.744186],[-176.518409,51.760617],[-176.80321,51.61274],[-176.912748,51.80991],[-176.792256,51.815386],[-176.775825,51.963264],[-176.627947,51.968741],[-176.627947,51.859202],[-176.469116,51.853725]]],[[[-177.153734,51.946833],[-177.044195,51.897541],[-177.120872,51.727755],[-177.274226,51.678463],[-177.279703,51.782525],[-177.153734,51.946833]]],[[[-178.123152,51.919448],[-177.953367,51.913971],[-177.800013,51.793479],[-177.964321,51.651078],[-178.123152,51.919448]]],[[[173.107557,52.992929],[173.293773,52.927205],[173.304726,52.823143],[172.90491,52.762897],[172.642017,52.927205],[172.642017,53.003883],[173.107557,52.992929]]]]}},{type:"Feature",id:"AZ",properties:{name:"Arizona",value:98},geometry:{type:"Polygon",coordinates:[[[-109.042503,37.000263],[-109.04798,31.331629],[-111.074448,31.331629],[-112.246513,31.704061],[-114.815198,32.492741],[-114.72209,32.717295],[-114.524921,32.755634],[-114.470151,32.843265],[-114.524921,33.029481],[-114.661844,33.034958],[-114.727567,33.40739],[-114.524921,33.54979],[-114.497536,33.697668],[-114.535874,33.933176],[-114.415382,34.108438],[-114.256551,34.174162],[-114.136058,34.305608],[-114.333228,34.448009],[-114.470151,34.710902],[-114.634459,34.87521],[-114.634459,35.00118],[-114.574213,35.138103],[-114.596121,35.324319],[-114.678275,35.516012],[-114.738521,36.102045],[-114.371566,36.140383],[-114.251074,36.01989],[-114.152489,36.025367],[-114.048427,36.195153],[-114.048427,37.000263],[-110.499369,37.00574],[-109.042503,37.000263]]]}},{type:"Feature",id:"AR",properties:{name:"Arkansas",value:5},geometry:{type:"Polygon",coordinates:[[[-94.473842,36.501861],[-90.152536,36.496384],[-90.064905,36.304691],[-90.218259,36.184199],[-90.377091,35.997983],[-89.730812,35.997983],[-89.763673,35.811767],[-89.911551,35.756997],[-89.944412,35.603643],[-90.130628,35.439335],[-90.114197,35.198349],[-90.212782,35.023087],[-90.311367,34.995703],[-90.251121,34.908072],[-90.409952,34.831394],[-90.481152,34.661609],[-90.585214,34.617794],[-90.568783,34.420624],[-90.749522,34.365854],[-90.744046,34.300131],[-90.952169,34.135823],[-90.891923,34.026284],[-91.072662,33.867453],[-91.231493,33.560744],[-91.056231,33.429298],[-91.143862,33.347144],[-91.089093,33.13902],[-91.16577,33.002096],[-93.608485,33.018527],[-94.041164,33.018527],[-94.041164,33.54979],[-94.183564,33.593606],[-94.380734,33.544313],[-94.484796,33.637421],[-94.430026,35.395519],[-94.616242,36.501861],[-94.473842,36.501861]]]}},{type:"Feature",id:"CA",properties:{name:"California",value:38},geometry:{type:"Polygon",coordinates:[[[-123.233256,42.006186],[-122.378853,42.011663],[-121.037003,41.995232],[-120.001861,41.995232],[-119.996384,40.264519],[-120.001861,38.999346],[-118.71478,38.101128],[-117.498899,37.21934],[-116.540435,36.501861],[-115.85034,35.970598],[-114.634459,35.00118],[-114.634459,34.87521],[-114.470151,34.710902],[-114.333228,34.448009],[-114.136058,34.305608],[-114.256551,34.174162],[-114.415382,34.108438],[-114.535874,33.933176],[-114.497536,33.697668],[-114.524921,33.54979],[-114.727567,33.40739],[-114.661844,33.034958],[-114.524921,33.029481],[-114.470151,32.843265],[-114.524921,32.755634],[-114.72209,32.717295],[-116.04751,32.624187],[-117.126467,32.536556],[-117.24696,32.668003],[-117.252437,32.876127],[-117.329114,33.122589],[-117.471515,33.297851],[-117.7837,33.538836],[-118.183517,33.763391],[-118.260194,33.703145],[-118.413548,33.741483],[-118.391641,33.840068],[-118.566903,34.042715],[-118.802411,33.998899],[-119.218659,34.146777],[-119.278905,34.26727],[-119.558229,34.415147],[-119.875891,34.40967],[-120.138784,34.475393],[-120.472878,34.448009],[-120.64814,34.579455],[-120.609801,34.858779],[-120.670048,34.902595],[-120.631709,35.099764],[-120.894602,35.247642],[-120.905556,35.450289],[-121.004141,35.461243],[-121.168449,35.636505],[-121.283465,35.674843],[-121.332757,35.784382],[-121.716143,36.195153],[-121.896882,36.315645],[-121.935221,36.638785],[-121.858544,36.6114],[-121.787344,36.803093],[-121.929744,36.978355],[-122.105006,36.956447],[-122.335038,37.115279],[-122.417192,37.241248],[-122.400761,37.361741],[-122.515777,37.520572],[-122.515777,37.783465],[-122.329561,37.783465],[-122.406238,38.15042],[-122.488392,38.112082],[-122.504823,37.931343],[-122.701993,37.893004],[-122.937501,38.029928],[-122.97584,38.265436],[-123.129194,38.451652],[-123.331841,38.566668],[-123.44138,38.698114],[-123.737134,38.95553],[-123.687842,39.032208],[-123.824765,39.366301],[-123.764519,39.552517],[-123.85215,39.831841],[-124.109566,40.105688],[-124.361506,40.259042],[-124.410798,40.439781],[-124.158859,40.877937],[-124.109566,41.025814],[-124.158859,41.14083],[-124.065751,41.442061],[-124.147905,41.715908],[-124.257444,41.781632],[-124.213628,42.000709],[-123.233256,42.006186]]]}},{type:"Feature",id:"CO",properties:{name:"Colorado",value:59},geometry:{type:"Polygon",coordinates:[[[-107.919731,41.003906],[-105.728954,40.998429],[-104.053011,41.003906],[-102.053927,41.003906],[-102.053927,40.001626],[-102.042974,36.994786],[-103.001438,37.000263],[-104.337812,36.994786],[-106.868158,36.994786],[-107.421329,37.000263],[-109.042503,37.000263],[-109.042503,38.166851],[-109.058934,38.27639],[-109.053457,39.125316],[-109.04798,40.998429],[-107.919731,41.003906]]]}},{type:"Feature",id:"CT",properties:{name:"Connecticut",value:45},geometry:{type:"Polygon",coordinates:[[[-73.053528,42.039048],[-71.799309,42.022617],[-71.799309,42.006186],[-71.799309,41.414677],[-71.859555,41.321569],[-71.947186,41.338],[-72.385341,41.261322],[-72.905651,41.28323],[-73.130205,41.146307],[-73.371191,41.102491],[-73.655992,40.987475],[-73.727192,41.102491],[-73.48073,41.21203],[-73.55193,41.294184],[-73.486206,42.050002],[-73.053528,42.039048]]]}},{type:"Feature",id:"DE",properties:{name:"Delaware",value:76},geometry:{type:"Polygon",coordinates:[[[-75.414089,39.804456],[-75.507197,39.683964],[-75.611259,39.61824],[-75.589352,39.459409],[-75.441474,39.311532],[-75.403136,39.065069],[-75.189535,38.807653],[-75.09095,38.796699],[-75.047134,38.451652],[-75.693413,38.462606],[-75.786521,39.722302],[-75.616736,39.831841],[-75.414089,39.804456]]]}},{type:"Feature",id:"FL",properties:{name:"Florida",value:3},geometry:{type:"Polygon",coordinates:[[[-85.497137,30.997536],[-85.004212,31.003013],[-84.867289,30.712735],[-83.498053,30.647012],[-82.216449,30.570335],[-82.167157,30.356734],[-82.046664,30.362211],[-82.002849,30.564858],[-82.041187,30.751074],[-81.948079,30.827751],[-81.718048,30.745597],[-81.444201,30.707258],[-81.383954,30.27458],[-81.257985,29.787132],[-80.967707,29.14633],[-80.524075,28.461713],[-80.589798,28.41242],[-80.56789,28.094758],[-80.381674,27.738757],[-80.091397,27.021277],[-80.03115,26.796723],[-80.036627,26.566691],[-80.146166,25.739673],[-80.239274,25.723243],[-80.337859,25.465826],[-80.304997,25.383672],[-80.49669,25.197456],[-80.573367,25.241272],[-80.759583,25.164595],[-81.077246,25.120779],[-81.170354,25.224841],[-81.126538,25.378195],[-81.351093,25.821827],[-81.526355,25.903982],[-81.679709,25.843735],[-81.800202,26.090198],[-81.833064,26.292844],[-82.041187,26.517399],[-82.09048,26.665276],[-82.057618,26.878877],[-82.172634,26.917216],[-82.145249,26.791246],[-82.249311,26.758384],[-82.566974,27.300601],[-82.692943,27.437525],[-82.391711,27.837342],[-82.588881,27.815434],[-82.720328,27.689464],[-82.851774,27.886634],[-82.676512,28.434328],[-82.643651,28.888914],[-82.764143,28.998453],[-82.802482,29.14633],[-82.994175,29.179192],[-83.218729,29.420177],[-83.399469,29.518762],[-83.410422,29.66664],[-83.536392,29.721409],[-83.640454,29.885717],[-84.02384,30.104795],[-84.357933,30.055502],[-84.341502,29.902148],[-84.451041,29.929533],[-84.867289,29.743317],[-85.310921,29.699501],[-85.299967,29.80904],[-85.404029,29.940487],[-85.924338,30.236241],[-86.29677,30.362211],[-86.630863,30.395073],[-86.910187,30.373165],[-87.518128,30.280057],[-87.37025,30.427934],[-87.446927,30.510088],[-87.408589,30.674397],[-87.633143,30.86609],[-87.600282,30.997536],[-85.497137,30.997536]]]}},{type:"Feature",id:"GA",properties:{name:"Georgia",value:77},geometry:{type:"Polygon",coordinates:[[[-83.109191,35.00118],[-83.322791,34.787579],[-83.339222,34.683517],[-83.005129,34.469916],[-82.901067,34.486347],[-82.747713,34.26727],[-82.714851,34.152254],[-82.55602,33.94413],[-82.325988,33.81816],[-82.194542,33.631944],[-81.926172,33.462159],[-81.937125,33.347144],[-81.761863,33.160928],[-81.493493,33.007573],[-81.42777,32.843265],[-81.416816,32.629664],[-81.279893,32.558464],[-81.121061,32.290094],[-81.115584,32.120309],[-80.885553,32.032678],[-81.132015,31.693108],[-81.175831,31.517845],[-81.279893,31.364491],[-81.290846,31.20566],[-81.400385,31.13446],[-81.444201,30.707258],[-81.718048,30.745597],[-81.948079,30.827751],[-82.041187,30.751074],[-82.002849,30.564858],[-82.046664,30.362211],[-82.167157,30.356734],[-82.216449,30.570335],[-83.498053,30.647012],[-84.867289,30.712735],[-85.004212,31.003013],[-85.113751,31.27686],[-85.042551,31.539753],[-85.141136,31.840985],[-85.053504,32.01077],[-85.058981,32.13674],[-84.889196,32.262709],[-85.004212,32.322956],[-84.960397,32.421541],[-85.069935,32.580372],[-85.184951,32.859696],[-85.431413,34.124869],[-85.606675,34.984749],[-84.319594,34.990226],[-83.618546,34.984749],[-83.109191,35.00118]]]}},{type:"Feature",id:"HI",properties:{name:"Hawaii",value:88},geometry:{type:"MultiPolygon",coordinates:[[[[-155.634835,18.948267],[-155.881297,19.035898],[-155.919636,19.123529],[-155.886774,19.348084],[-156.062036,19.73147],[-155.925113,19.857439],[-155.826528,20.032702],[-155.897728,20.147717],[-155.87582,20.26821],[-155.596496,20.12581],[-155.284311,20.021748],[-155.092618,19.868393],[-155.092618,19.736947],[-154.807817,19.523346],[-154.983079,19.348084],[-155.295265,19.26593],[-155.514342,19.134483],[-155.634835,18.948267]]],[[[-156.587823,21.029505],[-156.472807,20.892581],[-156.324929,20.952827],[-156.00179,20.793996],[-156.051082,20.651596],[-156.379699,20.580396],[-156.445422,20.60778],[-156.461853,20.783042],[-156.631638,20.821381],[-156.697361,20.919966],[-156.587823,21.029505]]],[[[-156.982162,21.210244],[-157.080747,21.106182],[-157.310779,21.106182],[-157.239579,21.221198],[-156.982162,21.210244]]],[[[-157.951581,21.697691],[-157.842042,21.462183],[-157.896811,21.325259],[-158.110412,21.303352],[-158.252813,21.582676],[-158.126843,21.588153],[-157.951581,21.697691]]],[[[-159.468693,22.228955],[-159.353678,22.218001],[-159.298908,22.113939],[-159.33177,21.966061],[-159.446786,21.872953],[-159.764448,21.987969],[-159.726109,22.152277],[-159.468693,22.228955]]]]}},{type:"Feature",id:"ID",properties:{name:"Idaho",value:22},geometry:{type:"Polygon",coordinates:[[[-116.04751,49.000239],[-116.04751,47.976051],[-115.724371,47.696727],[-115.718894,47.42288],[-115.527201,47.302388],[-115.324554,47.258572],[-115.302646,47.187372],[-114.930214,46.919002],[-114.886399,46.809463],[-114.623506,46.705401],[-114.612552,46.639678],[-114.322274,46.645155],[-114.464674,46.272723],[-114.492059,46.037214],[-114.387997,45.88386],[-114.568736,45.774321],[-114.497536,45.670259],[-114.546828,45.560721],[-114.333228,45.456659],[-114.086765,45.593582],[-113.98818,45.703121],[-113.807441,45.604536],[-113.834826,45.522382],[-113.736241,45.330689],[-113.571933,45.128042],[-113.45144,45.056842],[-113.456917,44.865149],[-113.341901,44.782995],[-113.133778,44.772041],[-113.002331,44.448902],[-112.887315,44.394132],[-112.783254,44.48724],[-112.471068,44.481763],[-112.241036,44.569394],[-112.104113,44.520102],[-111.868605,44.563917],[-111.819312,44.509148],[-111.616665,44.547487],[-111.386634,44.75561],[-111.227803,44.580348],[-111.047063,44.476286],[-111.047063,42.000709],[-112.164359,41.995232],[-114.04295,41.995232],[-117.027882,42.000709],[-117.027882,43.830007],[-116.896436,44.158624],[-116.97859,44.240778],[-117.170283,44.257209],[-117.241483,44.394132],[-117.038836,44.750133],[-116.934774,44.782995],[-116.830713,44.930872],[-116.847143,45.02398],[-116.732128,45.144473],[-116.671881,45.319735],[-116.463758,45.61549],[-116.545912,45.752413],[-116.78142,45.823614],[-116.918344,45.993399],[-116.92382,46.168661],[-117.055267,46.343923],[-117.038836,46.426077],[-117.044313,47.762451],[-117.033359,49.000239],[-116.04751,49.000239]]]}},{type:"Feature",id:"IL",properties:{name:"Illinois",value:83},geometry:{type:"Polygon",coordinates:[[[-90.639984,42.510065],[-88.788778,42.493634],[-87.802929,42.493634],[-87.83579,42.301941],[-87.682436,42.077386],[-87.523605,41.710431],[-87.529082,39.34987],[-87.63862,39.169131],[-87.512651,38.95553],[-87.49622,38.780268],[-87.62219,38.637868],[-87.655051,38.506421],[-87.83579,38.292821],[-87.950806,38.27639],[-87.923421,38.15042],[-88.000098,38.101128],[-88.060345,37.865619],[-88.027483,37.799896],[-88.15893,37.657496],[-88.065822,37.482234],[-88.476592,37.389126],[-88.514931,37.285064],[-88.421823,37.153617],[-88.547792,37.071463],[-88.914747,37.224817],[-89.029763,37.213863],[-89.183118,37.038601],[-89.133825,36.983832],[-89.292656,36.994786],[-89.517211,37.279587],[-89.435057,37.34531],[-89.517211,37.537003],[-89.517211,37.690357],[-89.84035,37.903958],[-89.949889,37.88205],[-90.059428,38.013497],[-90.355183,38.216144],[-90.349706,38.374975],[-90.179921,38.632391],[-90.207305,38.725499],[-90.10872,38.845992],[-90.251121,38.917192],[-90.470199,38.961007],[-90.585214,38.867899],[-90.661891,38.928146],[-90.727615,39.256762],[-91.061708,39.470363],[-91.368417,39.727779],[-91.494386,40.034488],[-91.50534,40.237135],[-91.417709,40.379535],[-91.401278,40.560274],[-91.121954,40.669813],[-91.09457,40.823167],[-90.963123,40.921752],[-90.946692,41.097014],[-91.111001,41.239415],[-91.045277,41.414677],[-90.656414,41.463969],[-90.344229,41.589939],[-90.311367,41.743293],[-90.179921,41.809016],[-90.141582,42.000709],[-90.168967,42.126679],[-90.393521,42.225264],[-90.420906,42.329326],[-90.639984,42.510065]]]}},{type:"Feature",id:"IN",properties:{name:"Indiana",value:100},geometry:{type:"Polygon",coordinates:[[[-85.990061,41.759724],[-84.807042,41.759724],[-84.807042,41.694001],[-84.801565,40.500028],[-84.817996,39.103408],[-84.894673,39.059592],[-84.812519,38.785745],[-84.987781,38.780268],[-85.173997,38.68716],[-85.431413,38.730976],[-85.42046,38.533806],[-85.590245,38.451652],[-85.655968,38.325682],[-85.83123,38.27639],[-85.924338,38.024451],[-86.039354,37.958727],[-86.263908,38.051835],[-86.302247,38.166851],[-86.521325,38.040881],[-86.504894,37.931343],[-86.729448,37.893004],[-86.795172,37.991589],[-87.047111,37.893004],[-87.129265,37.788942],[-87.381204,37.93682],[-87.512651,37.903958],[-87.600282,37.975158],[-87.682436,37.903958],[-87.934375,37.893004],[-88.027483,37.799896],[-88.060345,37.865619],[-88.000098,38.101128],[-87.923421,38.15042],[-87.950806,38.27639],[-87.83579,38.292821],[-87.655051,38.506421],[-87.62219,38.637868],[-87.49622,38.780268],[-87.512651,38.95553],[-87.63862,39.169131],[-87.529082,39.34987],[-87.523605,41.710431],[-87.42502,41.644708],[-87.118311,41.644708],[-86.822556,41.759724],[-85.990061,41.759724]]]}},{type:"Feature",id:"IA",properties:{name:"Iowa",value:44},geometry:{type:"Polygon",coordinates:[[[-91.368417,43.501391],[-91.215062,43.501391],[-91.204109,43.353514],[-91.056231,43.254929],[-91.176724,43.134436],[-91.143862,42.909881],[-91.067185,42.75105],[-90.711184,42.636034],[-90.639984,42.510065],[-90.420906,42.329326],[-90.393521,42.225264],[-90.168967,42.126679],[-90.141582,42.000709],[-90.179921,41.809016],[-90.311367,41.743293],[-90.344229,41.589939],[-90.656414,41.463969],[-91.045277,41.414677],[-91.111001,41.239415],[-90.946692,41.097014],[-90.963123,40.921752],[-91.09457,40.823167],[-91.121954,40.669813],[-91.401278,40.560274],[-91.417709,40.379535],[-91.527248,40.412397],[-91.729895,40.615043],[-91.833957,40.609566],[-93.257961,40.582182],[-94.632673,40.571228],[-95.7664,40.587659],[-95.881416,40.719105],[-95.826646,40.976521],[-95.925231,41.201076],[-95.919754,41.453015],[-96.095016,41.540646],[-96.122401,41.67757],[-96.062155,41.798063],[-96.127878,41.973325],[-96.264801,42.039048],[-96.44554,42.488157],[-96.631756,42.707235],[-96.544125,42.855112],[-96.511264,43.052282],[-96.434587,43.123482],[-96.560556,43.222067],[-96.527695,43.397329],[-96.582464,43.479483],[-96.451017,43.501391],[-91.368417,43.501391]]]}},{type:"Feature",id:"KS",properties:{name:"Kansas",value:76},geometry:{type:"Polygon",coordinates:[[[-101.90605,40.001626],[-95.306337,40.001626],[-95.207752,39.908518],[-94.884612,39.831841],[-95.109167,39.541563],[-94.983197,39.442978],[-94.824366,39.20747],[-94.610765,39.158177],[-94.616242,37.000263],[-100.087706,37.000263],[-102.042974,36.994786],[-102.053927,40.001626],[-101.90605,40.001626]]]}},{type:"Feature",id:"KY",properties:{name:"Kentucky",value:29},geometry:{type:"Polygon",coordinates:[[[-83.903347,38.769315],[-83.678792,38.632391],[-83.519961,38.703591],[-83.142052,38.626914],[-83.032514,38.725499],[-82.890113,38.758361],[-82.846298,38.588575],[-82.731282,38.561191],[-82.594358,38.424267],[-82.621743,38.123036],[-82.50125,37.931343],[-82.342419,37.783465],[-82.293127,37.668449],[-82.101434,37.553434],[-81.969987,37.537003],[-82.353373,37.268633],[-82.720328,37.120755],[-82.720328,37.044078],[-82.868205,36.978355],[-82.879159,36.890724],[-83.070852,36.852385],[-83.136575,36.742847],[-83.673316,36.600446],[-83.689746,36.584015],[-84.544149,36.594969],[-85.289013,36.627831],[-85.486183,36.616877],[-86.592525,36.655216],[-87.852221,36.633308],[-88.071299,36.677123],[-88.054868,36.496384],[-89.298133,36.507338],[-89.418626,36.496384],[-89.363857,36.622354],[-89.215979,36.578538],[-89.133825,36.983832],[-89.183118,37.038601],[-89.029763,37.213863],[-88.914747,37.224817],[-88.547792,37.071463],[-88.421823,37.153617],[-88.514931,37.285064],[-88.476592,37.389126],[-88.065822,37.482234],[-88.15893,37.657496],[-88.027483,37.799896],[-87.934375,37.893004],[-87.682436,37.903958],[-87.600282,37.975158],[-87.512651,37.903958],[-87.381204,37.93682],[-87.129265,37.788942],[-87.047111,37.893004],[-86.795172,37.991589],[-86.729448,37.893004],[-86.504894,37.931343],[-86.521325,38.040881],[-86.302247,38.166851],[-86.263908,38.051835],[-86.039354,37.958727],[-85.924338,38.024451],[-85.83123,38.27639],[-85.655968,38.325682],[-85.590245,38.451652],[-85.42046,38.533806],[-85.431413,38.730976],[-85.173997,38.68716],[-84.987781,38.780268],[-84.812519,38.785745],[-84.894673,39.059592],[-84.817996,39.103408],[-84.43461,39.103408],[-84.231963,38.895284],[-84.215533,38.807653],[-83.903347,38.769315]]]}},{type:"Feature",id:"LA",properties:{name:"Louisiana",value:94},geometry:{type:"Polygon",coordinates:[[[-93.608485,33.018527],[-91.16577,33.002096],[-91.072662,32.887081],[-91.143862,32.843265],[-91.154816,32.640618],[-91.006939,32.514649],[-90.985031,32.218894],[-91.105524,31.988862],[-91.341032,31.846462],[-91.401278,31.621907],[-91.499863,31.643815],[-91.516294,31.27686],[-91.636787,31.265906],[-91.565587,31.068736],[-91.636787,30.997536],[-89.747242,30.997536],[-89.845827,30.66892],[-89.681519,30.449842],[-89.643181,30.285534],[-89.522688,30.181472],[-89.818443,30.044549],[-89.84035,29.945964],[-89.599365,29.88024],[-89.495303,30.039072],[-89.287179,29.88024],[-89.30361,29.754271],[-89.424103,29.699501],[-89.648657,29.748794],[-89.621273,29.655686],[-89.69795,29.513285],[-89.506257,29.387316],[-89.199548,29.348977],[-89.09001,29.2011],[-89.002379,29.179192],[-89.16121,29.009407],[-89.336472,29.042268],[-89.484349,29.217531],[-89.851304,29.310638],[-89.851304,29.480424],[-90.032043,29.425654],[-90.021089,29.283254],[-90.103244,29.151807],[-90.23469,29.129899],[-90.333275,29.277777],[-90.563307,29.283254],[-90.645461,29.129899],[-90.798815,29.086084],[-90.963123,29.179192],[-91.09457,29.190146],[-91.220539,29.436608],[-91.445094,29.546147],[-91.532725,29.529716],[-91.620356,29.73784],[-91.883249,29.710455],[-91.888726,29.836425],[-92.146142,29.715932],[-92.113281,29.622824],[-92.31045,29.535193],[-92.617159,29.579009],[-92.97316,29.715932],[-93.2251,29.776178],[-93.767317,29.726886],[-93.838517,29.688547],[-93.926148,29.787132],[-93.690639,30.143133],[-93.767317,30.334826],[-93.696116,30.438888],[-93.728978,30.575812],[-93.630393,30.679874],[-93.526331,30.93729],[-93.542762,31.15089],[-93.816609,31.556184],[-93.822086,31.775262],[-94.041164,31.994339],[-94.041164,33.018527],[-93.608485,33.018527]]]}},{type:"Feature",id:"ME",properties:{name:"Maine",value:44},geometry:{type:"Polygon",coordinates:[[[-70.703921,43.057759],[-70.824413,43.128959],[-70.807983,43.227544],[-70.966814,43.34256],[-71.032537,44.657025],[-71.08183,45.303304],[-70.649151,45.440228],[-70.720352,45.511428],[-70.556043,45.664782],[-70.386258,45.735983],[-70.41912,45.796229],[-70.260289,45.889337],[-70.309581,46.064599],[-70.210996,46.327492],[-70.057642,46.415123],[-69.997395,46.694447],[-69.225147,47.461219],[-69.044408,47.428357],[-69.033454,47.242141],[-68.902007,47.176418],[-68.578868,47.285957],[-68.376221,47.285957],[-68.233821,47.357157],[-67.954497,47.198326],[-67.790188,47.066879],[-67.779235,45.944106],[-67.801142,45.675736],[-67.456095,45.604536],[-67.505388,45.48952],[-67.417757,45.379982],[-67.488957,45.281397],[-67.346556,45.128042],[-67.16034,45.160904],[-66.979601,44.804903],[-67.187725,44.646072],[-67.308218,44.706318],[-67.406803,44.596779],[-67.549203,44.624164],[-67.565634,44.531056],[-67.75185,44.54201],[-68.047605,44.328409],[-68.118805,44.476286],[-68.222867,44.48724],[-68.173574,44.328409],[-68.403606,44.251732],[-68.458375,44.377701],[-68.567914,44.311978],[-68.82533,44.311978],[-68.830807,44.459856],[-68.984161,44.426994],[-68.956777,44.322932],[-69.099177,44.103854],[-69.071793,44.043608],[-69.258008,43.923115],[-69.444224,43.966931],[-69.553763,43.840961],[-69.707118,43.82453],[-69.833087,43.720469],[-69.986442,43.742376],[-70.030257,43.851915],[-70.254812,43.676653],[-70.194565,43.567114],[-70.358873,43.528776],[-70.369827,43.435668],[-70.556043,43.320652],[-70.703921,43.057759]]]}},{type:"Feature",id:"MD",properties:{name:"Maryland",value:66},geometry:{type:"MultiPolygon",coordinates:[[[[-75.994645,37.95325],[-76.016553,37.95325],[-76.043938,37.95325],[-75.994645,37.95325]]],[[[-79.477979,39.722302],[-75.786521,39.722302],[-75.693413,38.462606],[-75.047134,38.451652],[-75.244304,38.029928],[-75.397659,38.013497],[-75.671506,37.95325],[-75.885106,37.909435],[-75.879629,38.073743],[-75.961783,38.139466],[-75.846768,38.210667],[-76.000122,38.374975],[-76.049415,38.303775],[-76.257538,38.320205],[-76.328738,38.500944],[-76.263015,38.500944],[-76.257538,38.736453],[-76.191815,38.829561],[-76.279446,39.147223],[-76.169907,39.333439],[-76.000122,39.366301],[-75.972737,39.557994],[-76.098707,39.536086],[-76.104184,39.437501],[-76.367077,39.311532],[-76.443754,39.196516],[-76.460185,38.906238],[-76.55877,38.769315],[-76.514954,38.539283],[-76.383508,38.380452],[-76.399939,38.259959],[-76.317785,38.139466],[-76.3616,38.057312],[-76.591632,38.216144],[-76.920248,38.292821],[-77.018833,38.446175],[-77.205049,38.358544],[-77.276249,38.479037],[-77.128372,38.632391],[-77.040741,38.791222],[-76.909294,38.895284],[-77.035264,38.993869],[-77.117418,38.933623],[-77.248864,39.026731],[-77.456988,39.076023],[-77.456988,39.223901],[-77.566527,39.306055],[-77.719881,39.322485],[-77.834897,39.601809],[-78.004682,39.601809],[-78.174467,39.694917],[-78.267575,39.61824],[-78.431884,39.623717],[-78.470222,39.514178],[-78.765977,39.585379],[-78.963147,39.437501],[-79.094593,39.470363],[-79.291763,39.300578],[-79.488933,39.20747],[-79.477979,39.722302]]]]}},{type:"Feature",id:"MA",properties:{name:"Massachusetts",value:39},geometry:{type:"Polygon",coordinates:[[[-70.917521,42.887974],[-70.818936,42.871543],[-70.780598,42.696281],[-70.824413,42.55388],[-70.983245,42.422434],[-70.988722,42.269079],[-70.769644,42.247172],[-70.638197,42.08834],[-70.660105,41.962371],[-70.550566,41.929509],[-70.539613,41.814493],[-70.260289,41.715908],[-69.937149,41.809016],[-70.008349,41.672093],[-70.484843,41.5516],[-70.660105,41.546123],[-70.764167,41.639231],[-70.928475,41.611847],[-70.933952,41.540646],[-71.120168,41.496831],[-71.196845,41.67757],[-71.22423,41.710431],[-71.328292,41.781632],[-71.383061,42.01714],[-71.530939,42.01714],[-71.799309,42.006186],[-71.799309,42.022617],[-73.053528,42.039048],[-73.486206,42.050002],[-73.508114,42.08834],[-73.267129,42.745573],[-72.456542,42.729142],[-71.29543,42.696281],[-71.185891,42.789389],[-70.917521,42.887974]]]}},{type:"Feature",id:"MI",properties:{name:"Michigan",value:70},geometry:{type:"MultiPolygon",coordinates:[[[[-83.454238,41.732339],[-84.807042,41.694001],[-84.807042,41.759724],[-85.990061,41.759724],[-86.822556,41.759724],[-86.619909,41.891171],[-86.482986,42.115725],[-86.357016,42.252649],[-86.263908,42.444341],[-86.209139,42.718189],[-86.231047,43.013943],[-86.526801,43.594499],[-86.433693,43.813577],[-86.499417,44.07647],[-86.269385,44.34484],[-86.220093,44.569394],[-86.252954,44.689887],[-86.088646,44.73918],[-86.066738,44.903488],[-85.809322,44.947303],[-85.612152,45.128042],[-85.628583,44.766564],[-85.524521,44.750133],[-85.393075,44.930872],[-85.387598,45.237581],[-85.305444,45.314258],[-85.031597,45.363551],[-85.119228,45.577151],[-84.938489,45.75789],[-84.713934,45.768844],[-84.461995,45.653829],[-84.215533,45.637398],[-84.09504,45.494997],[-83.908824,45.484043],[-83.596638,45.352597],[-83.4871,45.358074],[-83.317314,45.144473],[-83.454238,45.029457],[-83.322791,44.88158],[-83.273499,44.711795],[-83.333745,44.339363],[-83.536392,44.246255],[-83.585684,44.054562],[-83.82667,43.988839],[-83.958116,43.758807],[-83.908824,43.671176],[-83.667839,43.589022],[-83.481623,43.714992],[-83.262545,43.972408],[-82.917498,44.070993],[-82.747713,43.994316],[-82.643651,43.851915],[-82.539589,43.435668],[-82.523158,43.227544],[-82.413619,42.975605],[-82.517681,42.614127],[-82.681989,42.559357],[-82.687466,42.690804],[-82.797005,42.652465],[-82.922975,42.351234],[-83.125621,42.236218],[-83.185868,42.006186],[-83.437807,41.814493],[-83.454238,41.732339]]],[[[-85.508091,45.730506],[-85.49166,45.610013],[-85.623106,45.588105],[-85.568337,45.75789],[-85.508091,45.730506]]],[[[-87.589328,45.095181],[-87.742682,45.199243],[-87.649574,45.341643],[-87.885083,45.363551],[-87.791975,45.500474],[-87.781021,45.675736],[-87.989145,45.796229],[-88.10416,45.922199],[-88.531362,46.020784],[-88.662808,45.987922],[-89.09001,46.135799],[-90.119674,46.338446],[-90.229213,46.508231],[-90.415429,46.568478],[-90.026566,46.672539],[-89.851304,46.793032],[-89.413149,46.842325],[-89.128348,46.990202],[-88.996902,46.995679],[-88.887363,47.099741],[-88.575177,47.247618],[-88.416346,47.373588],[-88.180837,47.455742],[-87.956283,47.384542],[-88.350623,47.077833],[-88.443731,46.973771],[-88.438254,46.787555],[-88.246561,46.929956],[-87.901513,46.908048],[-87.633143,46.809463],[-87.392158,46.535616],[-87.260711,46.486323],[-87.008772,46.530139],[-86.948526,46.469893],[-86.696587,46.437031],[-86.159846,46.667063],[-85.880522,46.68897],[-85.508091,46.678016],[-85.256151,46.754694],[-85.064458,46.760171],[-85.02612,46.480847],[-84.82895,46.442508],[-84.63178,46.486323],[-84.549626,46.4206],[-84.418179,46.502754],[-84.127902,46.530139],[-84.122425,46.179615],[-83.990978,46.031737],[-83.793808,45.993399],[-83.7719,46.091984],[-83.580208,46.091984],[-83.476146,45.987922],[-83.563777,45.911245],[-84.111471,45.976968],[-84.374364,45.933153],[-84.659165,46.053645],[-84.741319,45.944106],[-84.70298,45.850998],[-84.82895,45.872906],[-85.015166,46.00983],[-85.338305,46.091984],[-85.502614,46.097461],[-85.661445,45.966014],[-85.924338,45.933153],[-86.209139,45.960537],[-86.324155,45.905768],[-86.351539,45.796229],[-86.663725,45.703121],[-86.647294,45.834568],[-86.784218,45.861952],[-86.838987,45.725029],[-87.069019,45.719552],[-87.17308,45.659305],[-87.326435,45.423797],[-87.611236,45.122565],[-87.589328,45.095181]]],[[[-88.805209,47.976051],[-89.057148,47.850082],[-89.188594,47.833651],[-89.177641,47.937713],[-88.547792,48.173221],[-88.668285,48.008913],[-88.805209,47.976051]]]]}},{type:"Feature",id:"MN",properties:{name:"Minnesota",value:11},geometry:{type:"Polygon",coordinates:[[[-92.014696,46.705401],[-92.091373,46.749217],[-92.29402,46.667063],[-92.29402,46.075553],[-92.354266,46.015307],[-92.639067,45.933153],[-92.869098,45.719552],[-92.885529,45.577151],[-92.770513,45.566198],[-92.644544,45.440228],[-92.75956,45.286874],[-92.737652,45.117088],[-92.808852,44.750133],[-92.545959,44.569394],[-92.337835,44.552964],[-92.233773,44.443425],[-91.927065,44.333886],[-91.877772,44.202439],[-91.592971,44.032654],[-91.43414,43.994316],[-91.242447,43.775238],[-91.269832,43.616407],[-91.215062,43.501391],[-91.368417,43.501391],[-96.451017,43.501391],[-96.451017,45.297827],[-96.681049,45.412843],[-96.856311,45.604536],[-96.582464,45.818137],[-96.560556,45.933153],[-96.598895,46.332969],[-96.719387,46.437031],[-96.801542,46.656109],[-96.785111,46.924479],[-96.823449,46.968294],[-96.856311,47.609096],[-97.053481,47.948667],[-97.130158,48.140359],[-97.16302,48.545653],[-97.097296,48.682577],[-97.228743,49.000239],[-95.152983,49.000239],[-95.152983,49.383625],[-94.955813,49.372671],[-94.824366,49.295994],[-94.69292,48.775685],[-94.588858,48.715438],[-94.260241,48.699007],[-94.221903,48.649715],[-93.838517,48.627807],[-93.794701,48.518268],[-93.466085,48.545653],[-93.466085,48.589469],[-93.208669,48.644238],[-92.984114,48.62233],[-92.726698,48.540176],[-92.655498,48.436114],[-92.50762,48.447068],[-92.370697,48.222514],[-92.304974,48.315622],[-92.053034,48.359437],[-92.009219,48.266329],[-91.713464,48.200606],[-91.713464,48.112975],[-91.565587,48.041775],[-91.264355,48.080113],[-91.083616,48.178698],[-90.837154,48.238944],[-90.749522,48.091067],[-90.579737,48.123929],[-90.377091,48.091067],[-90.141582,48.112975],[-89.873212,47.987005],[-89.615796,48.008913],[-89.637704,47.954144],[-89.971797,47.828174],[-90.437337,47.729589],[-90.738569,47.625527],[-91.171247,47.368111],[-91.357463,47.20928],[-91.642264,47.028541],[-92.091373,46.787555],[-92.014696,46.705401]]]}},{type:"Feature",id:"MS",properties:{name:"Mississippi",value:66},geometry:{type:"Polygon",coordinates:[[[-88.471115,34.995703],[-88.202745,34.995703],[-88.098683,34.891641],[-88.241084,33.796253],[-88.471115,31.895754],[-88.394438,30.367688],[-88.503977,30.323872],[-88.744962,30.34578],[-88.843547,30.411504],[-89.084533,30.367688],[-89.418626,30.252672],[-89.522688,30.181472],[-89.643181,30.285534],[-89.681519,30.449842],[-89.845827,30.66892],[-89.747242,30.997536],[-91.636787,30.997536],[-91.565587,31.068736],[-91.636787,31.265906],[-91.516294,31.27686],[-91.499863,31.643815],[-91.401278,31.621907],[-91.341032,31.846462],[-91.105524,31.988862],[-90.985031,32.218894],[-91.006939,32.514649],[-91.154816,32.640618],[-91.143862,32.843265],[-91.072662,32.887081],[-91.16577,33.002096],[-91.089093,33.13902],[-91.143862,33.347144],[-91.056231,33.429298],[-91.231493,33.560744],[-91.072662,33.867453],[-90.891923,34.026284],[-90.952169,34.135823],[-90.744046,34.300131],[-90.749522,34.365854],[-90.568783,34.420624],[-90.585214,34.617794],[-90.481152,34.661609],[-90.409952,34.831394],[-90.251121,34.908072],[-90.311367,34.995703],[-88.471115,34.995703]]]}},{type:"Feature",id:"MO",properties:{name:"Missouri",value:36},geometry:{type:"Polygon",coordinates:[[[-91.833957,40.609566],[-91.729895,40.615043],[-91.527248,40.412397],[-91.417709,40.379535],[-91.50534,40.237135],[-91.494386,40.034488],[-91.368417,39.727779],[-91.061708,39.470363],[-90.727615,39.256762],[-90.661891,38.928146],[-90.585214,38.867899],[-90.470199,38.961007],[-90.251121,38.917192],[-90.10872,38.845992],[-90.207305,38.725499],[-90.179921,38.632391],[-90.349706,38.374975],[-90.355183,38.216144],[-90.059428,38.013497],[-89.949889,37.88205],[-89.84035,37.903958],[-89.517211,37.690357],[-89.517211,37.537003],[-89.435057,37.34531],[-89.517211,37.279587],[-89.292656,36.994786],[-89.133825,36.983832],[-89.215979,36.578538],[-89.363857,36.622354],[-89.418626,36.496384],[-89.484349,36.496384],[-89.539119,36.496384],[-89.533642,36.249922],[-89.730812,35.997983],[-90.377091,35.997983],[-90.218259,36.184199],[-90.064905,36.304691],[-90.152536,36.496384],[-94.473842,36.501861],[-94.616242,36.501861],[-94.616242,37.000263],[-94.610765,39.158177],[-94.824366,39.20747],[-94.983197,39.442978],[-95.109167,39.541563],[-94.884612,39.831841],[-95.207752,39.908518],[-95.306337,40.001626],[-95.552799,40.264519],[-95.7664,40.587659],[-94.632673,40.571228],[-93.257961,40.582182],[-91.833957,40.609566]]]}},{type:"Feature",id:"MT",properties:{name:"Montana",value:99},geometry:{type:"Polygon",coordinates:[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}},{type:"Feature",id:"NE",properties:{name:"Nebraska",value:55},geometry:{type:"Polygon",coordinates:[[[-103.324578,43.002989],[-101.626726,42.997512],[-98.499393,42.997512],[-98.466531,42.94822],[-97.951699,42.767481],[-97.831206,42.866066],[-97.688806,42.844158],[-97.217789,42.844158],[-96.692003,42.657942],[-96.626279,42.515542],[-96.44554,42.488157],[-96.264801,42.039048],[-96.127878,41.973325],[-96.062155,41.798063],[-96.122401,41.67757],[-96.095016,41.540646],[-95.919754,41.453015],[-95.925231,41.201076],[-95.826646,40.976521],[-95.881416,40.719105],[-95.7664,40.587659],[-95.552799,40.264519],[-95.306337,40.001626],[-101.90605,40.001626],[-102.053927,40.001626],[-102.053927,41.003906],[-104.053011,41.003906],[-104.053011,43.002989],[-103.324578,43.002989]]]}},{type:"Feature",id:"NV",properties:{name:"Nevada",value:65},geometry:{type:"Polygon",coordinates:[[[-117.027882,42.000709],[-114.04295,41.995232],[-114.048427,37.000263],[-114.048427,36.195153],[-114.152489,36.025367],[-114.251074,36.01989],[-114.371566,36.140383],[-114.738521,36.102045],[-114.678275,35.516012],[-114.596121,35.324319],[-114.574213,35.138103],[-114.634459,35.00118],[-115.85034,35.970598],[-116.540435,36.501861],[-117.498899,37.21934],[-118.71478,38.101128],[-120.001861,38.999346],[-119.996384,40.264519],[-120.001861,41.995232],[-118.698349,41.989755],[-117.027882,42.000709]]]}},{type:"Feature",id:"NH",properties:{name:"New Hampshire",value:32},geometry:{type:"Polygon",coordinates:[[[-71.08183,45.303304],[-71.032537,44.657025],[-70.966814,43.34256],[-70.807983,43.227544],[-70.824413,43.128959],[-70.703921,43.057759],[-70.818936,42.871543],[-70.917521,42.887974],[-71.185891,42.789389],[-71.29543,42.696281],[-72.456542,42.729142],[-72.544173,42.80582],[-72.533219,42.953697],[-72.445588,43.008466],[-72.456542,43.150867],[-72.379864,43.572591],[-72.204602,43.769761],[-72.116971,43.994316],[-72.02934,44.07647],[-72.034817,44.322932],[-71.700724,44.41604],[-71.536416,44.585825],[-71.629524,44.750133],[-71.4926,44.914442],[-71.503554,45.013027],[-71.361154,45.270443],[-71.131122,45.243058],[-71.08183,45.303304]]]}},{type:"Feature",id:"NJ",properties:{name:"New Jersey",value:50},geometry:{type:"Polygon",coordinates:[[[-74.236547,41.14083],[-73.902454,40.998429],[-74.022947,40.708151],[-74.187255,40.642428],[-74.274886,40.489074],[-74.001039,40.412397],[-73.979131,40.297381],[-74.099624,39.760641],[-74.411809,39.360824],[-74.614456,39.245808],[-74.795195,38.993869],[-74.888303,39.158177],[-75.178581,39.240331],[-75.534582,39.459409],[-75.55649,39.607286],[-75.561967,39.629194],[-75.507197,39.683964],[-75.414089,39.804456],[-75.145719,39.88661],[-75.129289,39.963288],[-74.82258,40.127596],[-74.773287,40.215227],[-75.058088,40.417874],[-75.069042,40.543843],[-75.195012,40.576705],[-75.205966,40.691721],[-75.052611,40.866983],[-75.134765,40.971045],[-74.882826,41.179168],[-74.828057,41.288707],[-74.69661,41.359907],[-74.236547,41.14083]]]}},{type:"Feature",id:"NM",properties:{name:"New Mexico",value:79},geometry:{type:"Polygon",coordinates:[[[-107.421329,37.000263],[-106.868158,36.994786],[-104.337812,36.994786],[-103.001438,37.000263],[-103.001438,36.501861],[-103.039777,36.501861],[-103.045254,34.01533],[-103.067161,33.002096],[-103.067161,31.999816],[-106.616219,31.999816],[-106.643603,31.901231],[-106.528588,31.786216],[-108.210008,31.786216],[-108.210008,31.331629],[-109.04798,31.331629],[-109.042503,37.000263],[-107.421329,37.000263]]]}},{type:"Feature",id:"NY",properties:{name:"New York",value:55},geometry:{type:"Polygon",coordinates:[[[-73.343806,45.013027],[-73.332852,44.804903],[-73.387622,44.618687],[-73.294514,44.437948],[-73.321898,44.246255],[-73.436914,44.043608],[-73.349283,43.769761],[-73.404052,43.687607],[-73.245221,43.523299],[-73.278083,42.833204],[-73.267129,42.745573],[-73.508114,42.08834],[-73.486206,42.050002],[-73.55193,41.294184],[-73.48073,41.21203],[-73.727192,41.102491],[-73.655992,40.987475],[-73.22879,40.905321],[-73.141159,40.965568],[-72.774204,40.965568],[-72.587988,40.998429],[-72.28128,41.157261],[-72.259372,41.042245],[-72.100541,40.992952],[-72.467496,40.845075],[-73.239744,40.625997],[-73.562884,40.582182],[-73.776484,40.593136],[-73.935316,40.543843],[-74.022947,40.708151],[-73.902454,40.998429],[-74.236547,41.14083],[-74.69661,41.359907],[-74.740426,41.431108],[-74.89378,41.436584],[-75.074519,41.60637],[-75.052611,41.754247],[-75.173104,41.869263],[-75.249781,41.863786],[-75.35932,42.000709],[-79.76278,42.000709],[-79.76278,42.252649],[-79.76278,42.269079],[-79.149363,42.55388],[-79.050778,42.690804],[-78.853608,42.783912],[-78.930285,42.953697],[-79.012439,42.986559],[-79.072686,43.260406],[-78.486653,43.375421],[-77.966344,43.369944],[-77.75822,43.34256],[-77.533665,43.233021],[-77.391265,43.276836],[-76.958587,43.271359],[-76.695693,43.34256],[-76.41637,43.523299],[-76.235631,43.528776],[-76.230154,43.802623],[-76.137046,43.961454],[-76.3616,44.070993],[-76.312308,44.196962],[-75.912491,44.366748],[-75.764614,44.514625],[-75.282643,44.848718],[-74.828057,45.018503],[-74.148916,44.991119],[-73.343806,45.013027]]]}},{type:"Feature",id:"NC",properties:{name:"North Carolina",value:78},geometry:{type:"Polygon",coordinates:[[[-80.978661,36.562108],[-80.294043,36.545677],[-79.510841,36.5402],[-75.868676,36.551154],[-75.75366,36.151337],[-76.032984,36.189676],[-76.071322,36.140383],[-76.410893,36.080137],[-76.460185,36.025367],[-76.68474,36.008937],[-76.673786,35.937736],[-76.399939,35.987029],[-76.3616,35.943213],[-76.060368,35.992506],[-75.961783,35.899398],[-75.781044,35.937736],[-75.715321,35.696751],[-75.775568,35.581735],[-75.89606,35.570781],[-76.147999,35.324319],[-76.482093,35.313365],[-76.536862,35.14358],[-76.394462,34.973795],[-76.279446,34.940933],[-76.493047,34.661609],[-76.673786,34.694471],[-76.991448,34.667086],[-77.210526,34.60684],[-77.555573,34.415147],[-77.82942,34.163208],[-77.971821,33.845545],[-78.179944,33.916745],[-78.541422,33.851022],[-79.675149,34.80401],[-80.797922,34.820441],[-80.781491,34.935456],[-80.934845,35.105241],[-81.038907,35.044995],[-81.044384,35.149057],[-82.276696,35.198349],[-82.550543,35.160011],[-82.764143,35.066903],[-83.109191,35.00118],[-83.618546,34.984749],[-84.319594,34.990226],[-84.29221,35.225734],[-84.09504,35.247642],[-84.018363,35.41195],[-83.7719,35.559827],[-83.498053,35.565304],[-83.251591,35.718659],[-82.994175,35.773428],[-82.775097,35.997983],[-82.638174,36.063706],[-82.610789,35.965121],[-82.216449,36.156814],[-82.03571,36.118475],[-81.909741,36.304691],[-81.723525,36.353984],[-81.679709,36.589492],[-80.978661,36.562108]]]}},{type:"Feature",id:"ND",properties:{name:"North Dakota",value:98},geometry:{type:"Polygon",coordinates:[[[-97.228743,49.000239],[-97.097296,48.682577],[-97.16302,48.545653],[-97.130158,48.140359],[-97.053481,47.948667],[-96.856311,47.609096],[-96.823449,46.968294],[-96.785111,46.924479],[-96.801542,46.656109],[-96.719387,46.437031],[-96.598895,46.332969],[-96.560556,45.933153],[-104.047534,45.944106],[-104.042057,47.861036],[-104.047534,49.000239],[-97.228743,49.000239]]]}},{type:"Feature",id:"OH",properties:{name:"Ohio",value:22},geometry:{type:"Polygon",coordinates:[[[-80.518598,41.978802],[-80.518598,40.636951],[-80.666475,40.582182],[-80.595275,40.472643],[-80.600752,40.319289],[-80.737675,40.078303],[-80.830783,39.711348],[-81.219646,39.388209],[-81.345616,39.344393],[-81.455155,39.410117],[-81.57017,39.267716],[-81.685186,39.273193],[-81.811156,39.0815],[-81.783771,38.966484],[-81.887833,38.873376],[-82.03571,39.026731],[-82.221926,38.785745],[-82.172634,38.632391],[-82.293127,38.577622],[-82.331465,38.446175],[-82.594358,38.424267],[-82.731282,38.561191],[-82.846298,38.588575],[-82.890113,38.758361],[-83.032514,38.725499],[-83.142052,38.626914],[-83.519961,38.703591],[-83.678792,38.632391],[-83.903347,38.769315],[-84.215533,38.807653],[-84.231963,38.895284],[-84.43461,39.103408],[-84.817996,39.103408],[-84.801565,40.500028],[-84.807042,41.694001],[-83.454238,41.732339],[-83.065375,41.595416],[-82.933929,41.513262],[-82.835344,41.589939],[-82.616266,41.431108],[-82.479343,41.381815],[-82.013803,41.513262],[-81.739956,41.485877],[-81.444201,41.672093],[-81.011523,41.852832],[-80.518598,41.978802],[-80.518598,41.978802]]]}},{type:"Feature",id:"OK",properties:{name:"Oklahoma",value:1},geometry:{type:"Polygon",coordinates:[[[-100.087706,37.000263],[-94.616242,37.000263],[-94.616242,36.501861],[-94.430026,35.395519],[-94.484796,33.637421],[-94.868182,33.74696],[-94.966767,33.861976],[-95.224183,33.960561],[-95.289906,33.87293],[-95.547322,33.878407],[-95.602092,33.933176],[-95.8376,33.834591],[-95.936185,33.889361],[-96.149786,33.840068],[-96.346956,33.686714],[-96.423633,33.774345],[-96.631756,33.845545],[-96.850834,33.845545],[-96.922034,33.960561],[-97.173974,33.736006],[-97.256128,33.861976],[-97.371143,33.823637],[-97.458774,33.905791],[-97.694283,33.982469],[-97.869545,33.851022],[-97.946222,33.987946],[-98.088623,34.004376],[-98.170777,34.113915],[-98.36247,34.157731],[-98.488439,34.064623],[-98.570593,34.146777],[-98.767763,34.135823],[-98.986841,34.223454],[-99.189488,34.2125],[-99.260688,34.404193],[-99.57835,34.415147],[-99.698843,34.382285],[-99.923398,34.573978],[-100.000075,34.563024],[-100.000075,36.501861],[-101.812942,36.501861],[-103.001438,36.501861],[-103.001438,37.000263],[-102.042974,36.994786],[-100.087706,37.000263]]]}},{type:"Feature",id:"OR",properties:{name:"Oregon",value:87},geometry:{type:"Polygon",coordinates:[[[-123.211348,46.174138],[-123.11824,46.185092],[-122.904639,46.08103],[-122.811531,45.960537],[-122.762239,45.659305],[-122.247407,45.549767],[-121.809251,45.708598],[-121.535404,45.725029],[-121.217742,45.670259],[-121.18488,45.604536],[-120.637186,45.746937],[-120.505739,45.697644],[-120.209985,45.725029],[-119.963522,45.823614],[-119.525367,45.911245],[-119.125551,45.933153],[-118.988627,45.998876],[-116.918344,45.993399],[-116.78142,45.823614],[-116.545912,45.752413],[-116.463758,45.61549],[-116.671881,45.319735],[-116.732128,45.144473],[-116.847143,45.02398],[-116.830713,44.930872],[-116.934774,44.782995],[-117.038836,44.750133],[-117.241483,44.394132],[-117.170283,44.257209],[-116.97859,44.240778],[-116.896436,44.158624],[-117.027882,43.830007],[-117.027882,42.000709],[-118.698349,41.989755],[-120.001861,41.995232],[-121.037003,41.995232],[-122.378853,42.011663],[-123.233256,42.006186],[-124.213628,42.000709],[-124.356029,42.115725],[-124.432706,42.438865],[-124.416275,42.663419],[-124.553198,42.838681],[-124.454613,43.002989],[-124.383413,43.271359],[-124.235536,43.55616],[-124.169813,43.8081],[-124.060274,44.657025],[-124.076705,44.772041],[-123.97812,45.144473],[-123.939781,45.659305],[-123.994551,45.944106],[-123.945258,46.113892],[-123.545441,46.261769],[-123.370179,46.146753],[-123.211348,46.174138]]]}},{type:"Feature",id:"PA",properties:{name:"Pennsylvania",value:37},geometry:{type:"Polygon",coordinates:[[[-79.76278,42.252649],[-79.76278,42.000709],[-75.35932,42.000709],[-75.249781,41.863786],[-75.173104,41.869263],[-75.052611,41.754247],[-75.074519,41.60637],[-74.89378,41.436584],[-74.740426,41.431108],[-74.69661,41.359907],[-74.828057,41.288707],[-74.882826,41.179168],[-75.134765,40.971045],[-75.052611,40.866983],[-75.205966,40.691721],[-75.195012,40.576705],[-75.069042,40.543843],[-75.058088,40.417874],[-74.773287,40.215227],[-74.82258,40.127596],[-75.129289,39.963288],[-75.145719,39.88661],[-75.414089,39.804456],[-75.616736,39.831841],[-75.786521,39.722302],[-79.477979,39.722302],[-80.518598,39.722302],[-80.518598,40.636951],[-80.518598,41.978802],[-80.518598,41.978802],[-80.332382,42.033571],[-79.76278,42.269079],[-79.76278,42.252649]]]}},{type:"Feature",id:"RI",properties:{name:"Rhode Island",value:78},geometry:{type:"MultiPolygon",coordinates:[[[[-71.196845,41.67757],[-71.120168,41.496831],[-71.317338,41.474923],[-71.196845,41.67757]]],[[[-71.530939,42.01714],[-71.383061,42.01714],[-71.328292,41.781632],[-71.22423,41.710431],[-71.344723,41.726862],[-71.448785,41.578985],[-71.481646,41.370861],[-71.859555,41.321569],[-71.799309,41.414677],[-71.799309,42.006186],[-71.530939,42.01714]]]]}},{type:"Feature",id:"SC",properties:{name:"South Carolina",value:54},geometry:{type:"Polygon",coordinates:[[[-82.764143,35.066903],[-82.550543,35.160011],[-82.276696,35.198349],[-81.044384,35.149057],[-81.038907,35.044995],[-80.934845,35.105241],[-80.781491,34.935456],[-80.797922,34.820441],[-79.675149,34.80401],[-78.541422,33.851022],[-78.716684,33.80173],[-78.935762,33.637421],[-79.149363,33.380005],[-79.187701,33.171881],[-79.357487,33.007573],[-79.582041,33.007573],[-79.631334,32.887081],[-79.866842,32.755634],[-79.998289,32.613234],[-80.206412,32.552987],[-80.430967,32.399633],[-80.452875,32.328433],[-80.660998,32.246279],[-80.885553,32.032678],[-81.115584,32.120309],[-81.121061,32.290094],[-81.279893,32.558464],[-81.416816,32.629664],[-81.42777,32.843265],[-81.493493,33.007573],[-81.761863,33.160928],[-81.937125,33.347144],[-81.926172,33.462159],[-82.194542,33.631944],[-82.325988,33.81816],[-82.55602,33.94413],[-82.714851,34.152254],[-82.747713,34.26727],[-82.901067,34.486347],[-83.005129,34.469916],[-83.339222,34.683517],[-83.322791,34.787579],[-83.109191,35.00118],[-82.764143,35.066903]]]}},{type:"Feature",id:"SD",properties:{name:"South Dakota",value:0},geometry:{type:"Polygon",coordinates:[[[-104.047534,45.944106],[-96.560556,45.933153],[-96.582464,45.818137],[-96.856311,45.604536],[-96.681049,45.412843],[-96.451017,45.297827],[-96.451017,43.501391],[-96.582464,43.479483],[-96.527695,43.397329],[-96.560556,43.222067],[-96.434587,43.123482],[-96.511264,43.052282],[-96.544125,42.855112],[-96.631756,42.707235],[-96.44554,42.488157],[-96.626279,42.515542],[-96.692003,42.657942],[-97.217789,42.844158],[-97.688806,42.844158],[-97.831206,42.866066],[-97.951699,42.767481],[-98.466531,42.94822],[-98.499393,42.997512],[-101.626726,42.997512],[-103.324578,43.002989],[-104.053011,43.002989],[-104.058488,44.996596],[-104.042057,44.996596],[-104.047534,45.944106]]]}},{type:"Feature",id:"TN",properties:{name:"Tennessee",value:66},geometry:{type:"Polygon",coordinates:[[[-88.054868,36.496384],[-88.071299,36.677123],[-87.852221,36.633308],[-86.592525,36.655216],[-85.486183,36.616877],[-85.289013,36.627831],[-84.544149,36.594969],[-83.689746,36.584015],[-83.673316,36.600446],[-81.679709,36.589492],[-81.723525,36.353984],[-81.909741,36.304691],[-82.03571,36.118475],[-82.216449,36.156814],[-82.610789,35.965121],[-82.638174,36.063706],[-82.775097,35.997983],[-82.994175,35.773428],[-83.251591,35.718659],[-83.498053,35.565304],[-83.7719,35.559827],[-84.018363,35.41195],[-84.09504,35.247642],[-84.29221,35.225734],[-84.319594,34.990226],[-85.606675,34.984749],[-87.359296,35.00118],[-88.202745,34.995703],[-88.471115,34.995703],[-90.311367,34.995703],[-90.212782,35.023087],[-90.114197,35.198349],[-90.130628,35.439335],[-89.944412,35.603643],[-89.911551,35.756997],[-89.763673,35.811767],[-89.730812,35.997983],[-89.533642,36.249922],[-89.539119,36.496384],[-89.484349,36.496384],[-89.418626,36.496384],[-89.298133,36.507338],[-88.054868,36.496384]]]}},{type:"Feature",id:"TX",properties:{name:"Texas",value:29},geometry:{type:"Polygon",coordinates:[[[-101.812942,36.501861],[-100.000075,36.501861],[-100.000075,34.563024],[-99.923398,34.573978],[-99.698843,34.382285],[-99.57835,34.415147],[-99.260688,34.404193],[-99.189488,34.2125],[-98.986841,34.223454],[-98.767763,34.135823],[-98.570593,34.146777],[-98.488439,34.064623],[-98.36247,34.157731],[-98.170777,34.113915],[-98.088623,34.004376],[-97.946222,33.987946],[-97.869545,33.851022],[-97.694283,33.982469],[-97.458774,33.905791],[-97.371143,33.823637],[-97.256128,33.861976],[-97.173974,33.736006],[-96.922034,33.960561],[-96.850834,33.845545],[-96.631756,33.845545],[-96.423633,33.774345],[-96.346956,33.686714],[-96.149786,33.840068],[-95.936185,33.889361],[-95.8376,33.834591],[-95.602092,33.933176],[-95.547322,33.878407],[-95.289906,33.87293],[-95.224183,33.960561],[-94.966767,33.861976],[-94.868182,33.74696],[-94.484796,33.637421],[-94.380734,33.544313],[-94.183564,33.593606],[-94.041164,33.54979],[-94.041164,33.018527],[-94.041164,31.994339],[-93.822086,31.775262],[-93.816609,31.556184],[-93.542762,31.15089],[-93.526331,30.93729],[-93.630393,30.679874],[-93.728978,30.575812],[-93.696116,30.438888],[-93.767317,30.334826],[-93.690639,30.143133],[-93.926148,29.787132],[-93.838517,29.688547],[-94.002825,29.68307],[-94.523134,29.546147],[-94.70935,29.622824],[-94.742212,29.787132],[-94.873659,29.672117],[-94.966767,29.699501],[-95.016059,29.557101],[-94.911997,29.496854],[-94.895566,29.310638],[-95.081782,29.113469],[-95.383014,28.867006],[-95.985477,28.604113],[-96.045724,28.647929],[-96.226463,28.582205],[-96.23194,28.642452],[-96.478402,28.598636],[-96.593418,28.724606],[-96.664618,28.697221],[-96.401725,28.439805],[-96.593418,28.357651],[-96.774157,28.406943],[-96.801542,28.226204],[-97.026096,28.039988],[-97.256128,27.694941],[-97.404005,27.333463],[-97.513544,27.360848],[-97.540929,27.229401],[-97.425913,27.262263],[-97.480682,26.99937],[-97.557359,26.988416],[-97.562836,26.840538],[-97.469728,26.758384],[-97.442344,26.457153],[-97.332805,26.353091],[-97.30542,26.161398],[-97.217789,25.991613],[-97.524498,25.887551],[-97.650467,26.018997],[-97.885976,26.06829],[-98.198161,26.057336],[-98.466531,26.221644],[-98.669178,26.238075],[-98.822533,26.369522],[-99.030656,26.413337],[-99.173057,26.539307],[-99.266165,26.840538],[-99.446904,27.021277],[-99.424996,27.174632],[-99.50715,27.33894],[-99.479765,27.48134],[-99.605735,27.640172],[-99.709797,27.656603],[-99.879582,27.799003],[-99.934351,27.979742],[-100.082229,28.14405],[-100.29583,28.280974],[-100.399891,28.582205],[-100.498476,28.66436],[-100.629923,28.905345],[-100.673738,29.102515],[-100.799708,29.244915],[-101.013309,29.370885],[-101.062601,29.458516],[-101.259771,29.535193],[-101.413125,29.754271],[-101.851281,29.803563],[-102.114174,29.792609],[-102.338728,29.869286],[-102.388021,29.765225],[-102.629006,29.732363],[-102.809745,29.524239],[-102.919284,29.190146],[-102.97953,29.184669],[-103.116454,28.987499],[-103.280762,28.982022],[-103.527224,29.135376],[-104.146119,29.381839],[-104.266611,29.513285],[-104.507597,29.639255],[-104.677382,29.924056],[-104.688336,30.181472],[-104.858121,30.389596],[-104.896459,30.570335],[-105.005998,30.685351],[-105.394861,30.855136],[-105.602985,31.085167],[-105.77277,31.167321],[-105.953509,31.364491],[-106.205448,31.468553],[-106.38071,31.731446],[-106.528588,31.786216],[-106.643603,31.901231],[-106.616219,31.999816],[-103.067161,31.999816],[-103.067161,33.002096],[-103.045254,34.01533],[-103.039777,36.501861],[-103.001438,36.501861],[-101.812942,36.501861]]]}},{type:"Feature",id:"UT",properties:{name:"Utah",value:87},geometry:{type:"Polygon",coordinates:[[[-112.164359,41.995232],[-111.047063,42.000709],[-111.047063,40.998429],[-109.04798,40.998429],[-109.053457,39.125316],[-109.058934,38.27639],[-109.042503,38.166851],[-109.042503,37.000263],[-110.499369,37.00574],[-114.048427,37.000263],[-114.04295,41.995232],[-112.164359,41.995232]]]}},{type:"Feature",id:"VT",properties:{name:"Vermont",value:55},geometry:{type:"Polygon",coordinates:[[[-71.503554,45.013027],[-71.4926,44.914442],[-71.629524,44.750133],[-71.536416,44.585825],[-71.700724,44.41604],[-72.034817,44.322932],[-72.02934,44.07647],[-72.116971,43.994316],[-72.204602,43.769761],[-72.379864,43.572591],[-72.456542,43.150867],[-72.445588,43.008466],[-72.533219,42.953697],[-72.544173,42.80582],[-72.456542,42.729142],[-73.267129,42.745573],[-73.278083,42.833204],[-73.245221,43.523299],[-73.404052,43.687607],[-73.349283,43.769761],[-73.436914,44.043608],[-73.321898,44.246255],[-73.294514,44.437948],[-73.387622,44.618687],[-73.332852,44.804903],[-73.343806,45.013027],[-72.308664,45.002073],[-71.503554,45.013027]]]}},{type:"Feature",id:"VA",properties:{name:"Virginia",value:55},geometry:{type:"MultiPolygon",coordinates:[[[[-75.397659,38.013497],[-75.244304,38.029928],[-75.375751,37.860142],[-75.512674,37.799896],[-75.594828,37.569865],[-75.802952,37.197433],[-75.972737,37.120755],[-76.027507,37.257679],[-75.939876,37.564388],[-75.671506,37.95325],[-75.397659,38.013497]]],[[[-78.349729,39.464886],[-77.82942,39.130793],[-77.719881,39.322485],[-77.566527,39.306055],[-77.456988,39.223901],[-77.456988,39.076023],[-77.248864,39.026731],[-77.117418,38.933623],[-77.040741,38.791222],[-77.128372,38.632391],[-77.248864,38.588575],[-77.325542,38.446175],[-77.281726,38.342113],[-77.013356,38.374975],[-76.964064,38.216144],[-76.613539,38.15042],[-76.514954,38.024451],[-76.235631,37.887527],[-76.3616,37.608203],[-76.246584,37.389126],[-76.383508,37.285064],[-76.399939,37.159094],[-76.273969,37.082417],[-76.410893,36.961924],[-76.619016,37.120755],[-76.668309,37.065986],[-76.48757,36.95097],[-75.994645,36.923586],[-75.868676,36.551154],[-79.510841,36.5402],[-80.294043,36.545677],[-80.978661,36.562108],[-81.679709,36.589492],[-83.673316,36.600446],[-83.136575,36.742847],[-83.070852,36.852385],[-82.879159,36.890724],[-82.868205,36.978355],[-82.720328,37.044078],[-82.720328,37.120755],[-82.353373,37.268633],[-81.969987,37.537003],[-81.986418,37.454849],[-81.849494,37.285064],[-81.679709,37.20291],[-81.55374,37.208387],[-81.362047,37.339833],[-81.225123,37.235771],[-80.967707,37.290541],[-80.513121,37.482234],[-80.474782,37.421987],[-80.29952,37.509618],[-80.294043,37.690357],[-80.184505,37.849189],[-79.998289,37.997066],[-79.921611,38.177805],[-79.724442,38.364021],[-79.647764,38.594052],[-79.477979,38.457129],[-79.313671,38.413313],[-79.209609,38.495467],[-78.996008,38.851469],[-78.870039,38.763838],[-78.404499,39.169131],[-78.349729,39.464886]]]]}},{type:"Feature",id:"WA",properties:{name:"Washington",value:77},geometry:{type:"MultiPolygon",coordinates:[[[[-117.033359,49.000239],[-117.044313,47.762451],[-117.038836,46.426077],[-117.055267,46.343923],[-116.92382,46.168661],[-116.918344,45.993399],[-118.988627,45.998876],[-119.125551,45.933153],[-119.525367,45.911245],[-119.963522,45.823614],[-120.209985,45.725029],[-120.505739,45.697644],[-120.637186,45.746937],[-121.18488,45.604536],[-121.217742,45.670259],[-121.535404,45.725029],[-121.809251,45.708598],[-122.247407,45.549767],[-122.762239,45.659305],[-122.811531,45.960537],[-122.904639,46.08103],[-123.11824,46.185092],[-123.211348,46.174138],[-123.370179,46.146753],[-123.545441,46.261769],[-123.72618,46.300108],[-123.874058,46.239861],[-124.065751,46.327492],[-124.027412,46.464416],[-123.895966,46.535616],[-124.098612,46.74374],[-124.235536,47.285957],[-124.31769,47.357157],[-124.427229,47.740543],[-124.624399,47.88842],[-124.706553,48.184175],[-124.597014,48.381345],[-124.394367,48.288237],[-123.983597,48.162267],[-123.704273,48.167744],[-123.424949,48.118452],[-123.162056,48.167744],[-123.036086,48.080113],[-122.800578,48.08559],[-122.636269,47.866512],[-122.515777,47.882943],[-122.493869,47.587189],[-122.422669,47.318818],[-122.324084,47.346203],[-122.422669,47.576235],[-122.395284,47.800789],[-122.230976,48.030821],[-122.362422,48.123929],[-122.373376,48.288237],[-122.471961,48.468976],[-122.422669,48.600422],[-122.488392,48.753777],[-122.647223,48.775685],[-122.795101,48.8907],[-122.756762,49.000239],[-117.033359,49.000239]]],[[[-122.718423,48.310145],[-122.586977,48.35396],[-122.608885,48.151313],[-122.767716,48.227991],[-122.718423,48.310145]]],[[[-123.025132,48.583992],[-122.915593,48.715438],[-122.767716,48.556607],[-122.811531,48.419683],[-123.041563,48.458022],[-123.025132,48.583992]]]]}},{type:"Feature",id:"WV",properties:{name:"West Virginia",value:57},geometry:{type:"Polygon",coordinates:[[[-80.518598,40.636951],[-80.518598,39.722302],[-79.477979,39.722302],[-79.488933,39.20747],[-79.291763,39.300578],[-79.094593,39.470363],[-78.963147,39.437501],[-78.765977,39.585379],[-78.470222,39.514178],[-78.431884,39.623717],[-78.267575,39.61824],[-78.174467,39.694917],[-78.004682,39.601809],[-77.834897,39.601809],[-77.719881,39.322485],[-77.82942,39.130793],[-78.349729,39.464886],[-78.404499,39.169131],[-78.870039,38.763838],[-78.996008,38.851469],[-79.209609,38.495467],[-79.313671,38.413313],[-79.477979,38.457129],[-79.647764,38.594052],[-79.724442,38.364021],[-79.921611,38.177805],[-79.998289,37.997066],[-80.184505,37.849189],[-80.294043,37.690357],[-80.29952,37.509618],[-80.474782,37.421987],[-80.513121,37.482234],[-80.967707,37.290541],[-81.225123,37.235771],[-81.362047,37.339833],[-81.55374,37.208387],[-81.679709,37.20291],[-81.849494,37.285064],[-81.986418,37.454849],[-81.969987,37.537003],[-82.101434,37.553434],[-82.293127,37.668449],[-82.342419,37.783465],[-82.50125,37.931343],[-82.621743,38.123036],[-82.594358,38.424267],[-82.331465,38.446175],[-82.293127,38.577622],[-82.172634,38.632391],[-82.221926,38.785745],[-82.03571,39.026731],[-81.887833,38.873376],[-81.783771,38.966484],[-81.811156,39.0815],[-81.685186,39.273193],[-81.57017,39.267716],[-81.455155,39.410117],[-81.345616,39.344393],[-81.219646,39.388209],[-80.830783,39.711348],[-80.737675,40.078303],[-80.600752,40.319289],[-80.595275,40.472643],[-80.666475,40.582182],[-80.518598,40.636951]]]}},{type:"Feature",id:"WI",properties:{name:"Wisconsin",value:99},geometry:{type:"Polygon",coordinates:[[[-90.415429,46.568478],[-90.229213,46.508231],[-90.119674,46.338446],[-89.09001,46.135799],[-88.662808,45.987922],[-88.531362,46.020784],[-88.10416,45.922199],[-87.989145,45.796229],[-87.781021,45.675736],[-87.791975,45.500474],[-87.885083,45.363551],[-87.649574,45.341643],[-87.742682,45.199243],[-87.589328,45.095181],[-87.627666,44.974688],[-87.819359,44.95278],[-87.983668,44.722749],[-88.043914,44.563917],[-87.928898,44.536533],[-87.775544,44.640595],[-87.611236,44.837764],[-87.403112,44.914442],[-87.238804,45.166381],[-87.03068,45.22115],[-87.047111,45.089704],[-87.189511,44.969211],[-87.468835,44.552964],[-87.545512,44.322932],[-87.540035,44.158624],[-87.644097,44.103854],[-87.737205,43.8793],[-87.704344,43.687607],[-87.791975,43.561637],[-87.912467,43.249452],[-87.885083,43.002989],[-87.76459,42.783912],[-87.802929,42.493634],[-88.788778,42.493634],[-90.639984,42.510065],[-90.711184,42.636034],[-91.067185,42.75105],[-91.143862,42.909881],[-91.176724,43.134436],[-91.056231,43.254929],[-91.204109,43.353514],[-91.215062,43.501391],[-91.269832,43.616407],[-91.242447,43.775238],[-91.43414,43.994316],[-91.592971,44.032654],[-91.877772,44.202439],[-91.927065,44.333886],[-92.233773,44.443425],[-92.337835,44.552964],[-92.545959,44.569394],[-92.808852,44.750133],[-92.737652,45.117088],[-92.75956,45.286874],[-92.644544,45.440228],[-92.770513,45.566198],[-92.885529,45.577151],[-92.869098,45.719552],[-92.639067,45.933153],[-92.354266,46.015307],[-92.29402,46.075553],[-92.29402,46.667063],[-92.091373,46.749217],[-92.014696,46.705401],[-91.790141,46.694447],[-91.09457,46.864232],[-90.837154,46.95734],[-90.749522,46.88614],[-90.886446,46.754694],[-90.55783,46.584908],[-90.415429,46.568478]]]}},{type:"Feature",id:"WY",properties:{name:"Wyoming",value:5},geometry:{type:"Polygon",coordinates:[[[-109.080842,45.002073],[-105.91517,45.002073],[-104.058488,44.996596],[-104.053011,43.002989],[-104.053011,41.003906],[-105.728954,40.998429],[-107.919731,41.003906],[-109.04798,40.998429],[-111.047063,40.998429],[-111.047063,42.000709],[-111.047063,44.476286],[-111.05254,45.002073],[-109.080842,45.002073]]]}}]},Mr=({data:t,geoJsonNode:e,formatOptions:r,chartId:o})=>{const h=Te.useRef();let n=bt(t),l,s,x,L=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,b,_,g,H,D=0,j=1,K,J=new Map,U=new Map,V=new Map,N=Number.MAX_VALUE,$=Number.MIN_VALUE,X=0,se=0,re,oe;Te.useEffect(()=>{he()},[r,o]);const he=()=>{({chartFormatOptions:l,svg:H,width:s,height:x}=Jt(h,r)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=Qa(l,x,s),jt(h,s,x,l),g=la(H,S),_t(h,u,s,l),Le(t),pe(),ue(),O()},Le=w=>{try{let p=new Set,C=new Set;w.forEach(i=>{i.data.forEach((y,f)=>{f===D&&(p.add(y.value.toString()),X+=y.value),f===j&&(C.add(y.value.toString()),se+=y.value)})});let c=l.colorScaleForMaps&&l.colorScaleForMaps.startColorForMaps?l.colorScaleForMaps.startColorForMaps:"#c1d8f3",d=l.colorScaleForMaps&&l.colorScaleForMaps.endColorForMaps?l.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(p.size===1)re=()=>c;else{const i=T.interpolateLab(c,d);re=T.scaleOrdinal().domain(Array.from(p)).range(Array.from(p).map((y,f)=>i(f/(p.size-1))))}if(C.size===1)oe=()=>c;else{const i=T.interpolateLab(l.colorScaleForMapsBubble.startColorForMapsBubble,l.colorScaleForMapsBubble.endColorForMapsBubble);oe=T.scaleOrdinal().domain(Array.from(C)).range(Array.from(C).map((y,f)=>i(f/(C.size-1))))}}catch(p){be("Maps.tsx","dataPreparation",p)}},pe=w=>{K=Cr},ue=()=>{try{n?.forEach(w=>{V.set(w.legend,w)}),e.mappings.forEach(w=>{U.set(w.actualName,w.mappedName)}),e.groups.forEach(w=>{w.groupedRegions.forEach(p=>{J.set(p,w.groupName)})}),K.features.forEach(w=>{const p=w.properties.name;let C;if(U.has(p)){const c=U.get(p);w.properties.displayName=c,C=c}if(J.has(p)){const c=J.get(p);w.properties.displayName=c,C=c}else C=p;if(V.has(C)){const c=V.get(C);w.properties.data=c;let d;c.data&&c.data[1]&&(d=c.data[1]?c.data[1].value:0,N=Math.min(N,d),$=Math.max($,d)),c.data&&c.data[0]&&(d=c.data[0].value,L=Math.min(L,d),A=Math.max(A,d))}else w.properties.data=void 0})}catch(w){be("Maps.tsx","generateDataForMaps",w)}},O=()=>{try{let w=0;const p=T.geoAlbersUsa().fitSize([_,b],K),C=T.geoPath().projection(p),c=g.append("g").attr("class","paths");if(c.selectAll(o+" .path-group").data(K.features).enter().append("path").attr("id",d=>d.properties.name).attr("fill",(d,i)=>q(d)).attr("stroke",d=>d.properties.data?"unset":"#CCCCCC").attr("fill-opacity",l.plotArea.opacity).attr("stroke-width","0.4px").attr("d",d=>(w+=C.area(d),C(d))).on("mousemove",(d,i)=>{let y=i.properties.data;if(y){let f=y.data.map(a=>({key:a.dimension,value:je("None",l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.value)}));ot([{key:"Region",value:y.properties.alias},...f],l,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(d,i)=>{rt()}),l.plotArea.dataLabels){const d=w/K.features.length,i=l.plotArea.dataLabelName,y=l.plotArea.dataLabelValue,f=a=>l.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?C.area(a)<d*.25:!1;c.selectAll(".text-container").data(K.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>C.centroid(a)[0]-50).attr("y",a=>{const m=C.centroid(a);return i&&y?m[1]-15:m[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let m=a.properties.data;if((i||y)&&m&&!f(a)){if(f(a))return null;const P=m?.properties.alias||a.properties.displayName,ie=l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/X*100)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let Q="";return l.plotArea.dataLabelName&&(Q+=`<div style=
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(se.bold)?se.bold:"normal"};
155
- font-style:${a.properties.data.properties.labelFontStyle.includes(se.italic)?se.italic:"normal"};
156
- text-decoration:${a.properties.data.properties.labelFontStyle.includes(se.underline)?se.underline:"none"};
154
+ font-weight:${a.properties.data.properties.labelFontStyle.includes(ne.bold)?ne.bold:"normal"};
155
+ font-style:${a.properties.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:"normal"};
156
+ text-decoration:${a.properties.data.properties.labelFontStyle.includes(ne.underline)?ne.underline:"none"};
157
157
  color:${a.properties.data.properties.labelFontColor};">
158
158
  ${P??""}
159
159
  </div>`),l.plotArea.dataLabelValue&&(Q+=`<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(se.bold)?se.bold:"normal"};
163
- font-style:${a.properties.data.properties.valueFontStyle.includes(se.italic)?se.italic:"normal"};
164
- text-decoration:${a.properties.data.properties.valueFontStyle.includes(se.underline)?se.underline:"none"};
162
+ font-weight:${a.properties.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"normal"};
163
+ font-style:${a.properties.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:"normal"};
164
+ text-decoration:${a.properties.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:"none"};
165
165
  color:${a.properties.data.properties.valueFontColor};">
166
- ${ae??""}
167
- </div>`),Q}return null})}if(l.bubbleformatting.showBubble){let c=Math.min(H,p);const i=T.scaleLinear().domain([E,z]).range([c*.01,c*.07]);g.selectAll("myCircles").data(K.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,f)=>l.colorScaleForMapsBubble.showColorForMapsBubble=="2"?oe(y.properties.data&&y.properties.data.data[j]?.value||0):l.bubbleformatting.bubbleColor).attr("stroke",l.bubbleformatting&&l.bubbleformatting.bubbleBorderColor).attr("stroke-width",l.bubbleformatting&&l.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",l.bubbleformatting&&et(l.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(y,f){st([{key:"Region",value:f.properties?.data?.propeties?.Alias},{key:f.properties.data?.data[1]?.dimension,value:l.toolTip.toolTipNumberFormat==",.0%"?Math.round(f.properties.data?.data[1]?.value/ce*100)+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(f.properties.data?.data[1]?.value)}],l,void 0,f.currentTarget.__data__.data.properties),T.select(this).style("r",(f.properties.data?i(f.properties.data?.data[1]?.value||0):0)*1.2)}).on("mouseout",function(y,f){rt(),T.select(this).style("r",f.properties.data?i(f.properties.data?.data[1]?.value||0):0)})}}catch(F){ge("Maps.tsx","drawMap",F)}},J=F=>{try{let b=F.properties.data;switch(parseInt(l.colorScaleForMaps.showColorForMaps)){case 1:return b?b.properties.color:"#E6E6E6";case 2:return l.colorScaleForMaps.defaultColor;case 3:return F.properties.data?ne(F.properties.data?.data[V]?.value):"#E6E6E6"}}catch(b){ge("Maps.tsx","getMapColor",b)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{id:o,className:"chartSVG",style:{width:"100%",height:"100%"},ref:h})})},na="OrganizationChart.tsx",Fr=({data:t,formatOptions:e,legendSequence:r})=>{let o=t.LegendList??[];const h=crypto.randomUUID(),n=Te.useRef(),l=Te.useRef();let s,x,m,A=40,u=Ht,S,p=new Map,H=new Map,g=zt.left,G=[],V=0,j=0,K,Z=new Map,Y,N=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,z;Te.useEffect(()=>{q()},[h,t,e]);const q=()=>{({chartFormatOptions:s,svg:S,width:x,height:m}=Jt(n,e)),oe(),Y=ce(Z),{margins:u,innerHeight,innerWidth,legendListWidth:K,chartTitleHeight:A}=Na(s,x,m,Y,u),jt(n,x,m,s),_t(n,A,x,s),xe(),J(G),ne()},ce=d=>{const c=[];d.forEach((f,a)=>{c.push(a)});const i=c.reduce((f,a)=>f.length>a.length?f:a,""),y=It(i,et(s.legends.legendFontSize),s.legends.legendFontFamily);return[y.width,y.height]},ne=()=>{let d=[];Z.forEach((c,i)=>{const y=`linear-gradient(90deg, ${c.join(", ")})`;d.push({properties:{...o[0],name:i,alias:i,color:y}})}),Pa(s,S,d,x,m,K,A,h,u,nt.rectangle,void 0)},oe=()=>{try{const i=e?.plotArea?.sortBy??"default";g=s.plotArea.chartDirection||zt.left;var d=0,c=0;const y={...t.ChartData,UID:void 0};let f=O(y).filter(a=>a.value!==null);i!=="default"&&(f=f.sort((a,L)=>i==="asc"?a.value-L.value:L.value-a.value)),ue(f),Ae(f),G=pe(f),s.heatMap.showHeatMap&&(z=T.scaleSequential().domain([E,N]).interpolator(T.interpolateRgb(s.heatMap.heatMapMinColor,s.heatMap.heatMapMaxColor)))}catch(i){ge(na,"dataPreparation",i)}},xe=()=>{try{if(s.plotArea.fitChart)j=m,V=x,l.current.style.width="calc(100% - 10px)",l.current.style.height="calc(100% - 10px)";else{let d=function(){let c=this;var i=c.scrollLeft,y=c.scrollTop;T.select(`#clipPath${h}`).select("rect").attr("x",i).attr("y",y)};V=0,G.forEach(c=>{c.label==r[r.length-1]&&(V+=b(c,!1))}),j=(r.length+1)*et(s.nodes.nodeHeight)*10+(r.length+1)*70,l.current.style.width=`${V}px`,l.current.style.height=`${j}px`,T.select(l.current).append("defs").attr("id",`defs${h}`).append("clipPath").attr("id",`clipPath${h}`).append("rect").attr("width",x-u.left-u.right).attr("height",m-u.top-u.bottom-15).attr("transform",`translate(${u.left},${u.top})`),document.querySelector("#floating-div"+h).addEventListener("scroll",d),T.select(l.current).attr("clip-path",`url(#clipPath${h})`)}}catch(d){ge(na,"scrollWidthHeightCalculation",d)}},Ae=d=>{try{d.forEach((c,i)=>{if(c.id!=0){let y=d[p.get(c.parentId)].UID;y===void 0?c.UID=c.nodeLabel:c.UID=y+"-"+c.nodeLabel}})}catch(c){ge(na,"generateUID",c)}},pe=d=>{try{return o.forEach(c=>{H.set(c.name,c)}),Object.keys(d).forEach(c=>{const i=d[c],y=H.get(i.UID??i.nodeLabel)??o[0];if(d[c]={...i,styleObject:y},i.label)if(Z.has(i.label)){const f=Z.get(i.label);Z.set(i.label,[...f,y.color??"#eedddd"])}else Z.set(i.label,[y.color??"#eedddd"]);N=Math.max(N,i.value),E=Math.min(E,i.value)}),d}catch(c){ge(na,"addStyleObjectToChartData",c)}},ue=d=>{try{d.forEach((c,i)=>{p.set(c.id,i)})}catch(c){ge(na,"createIdIndexMap",c)}},O=d=>{try{const c=T.hierarchy(d).descendants();return c.forEach((i,y)=>{i.id=i.id||"id"+y}),c.map((i,y)=>{const f={...i.data};return delete f.children,i.parent&&(f.parentValue=i.parent.data.value||0),{...f,parentId:i.parent?.data?.id}})}catch(c){ge(na,"getFlattenedData",c)}},J=d=>{try{let c=s.connector.lineType||"straight",i=s.nodes.nodeType||ei.rectangle,y=parseInt(s.connector.connectorLineThickness);T.select(l.current).selectAll("*").remove(),new xl.OrgChart().container(`#floating-${h}`).svgWidth(V).svgHeight(j).nodeHeight(a=>F(a)).nodeWidth(a=>b(a,!0)).layout(g).diagonal((a,L,P,ae={sy:0})=>{if(g=="top"||g=="bottom"||!g)switch(c){case ca.curve:return`M ${a.x} ${a.y} C ${(a.x+L.x)/2} ${a.y}, ${(a.x+L.x)/2} ${L.y}, ${L.x} ${L.y}`;case ca.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${L.y} H ${L.x}`;case ca.diagonal:return`M ${a.x} ${a.y} L ${(a.x+L.x)/2} ${a.y} L ${(a.x+L.x)/2} ${L.y} L ${L.x} ${L.y}`;case ca.s_curve:const Q=(a.y+L.y)/2;return`M ${a.x},${a.y} C ${a.x},${Q} ${L.x},${Q} ${L.x},${L.y}`;case ca.arc:const be=L.x-a.x,Le=L.y-a.y,Fe=Math.sqrt(be*be+Le*Le);return`M ${a.x},${a.y} A ${Fe},${Fe} 0 0,1 ${L.x},${L.y}`;case ca.reverse_elbow:if(g==zt.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${L.x} V ${L.y}`;if(g==zt.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${L.x} V ${L.y}`;case ca.zigzag:if(g==zt.top){const me=(a.y+L.y)/2;return`M ${a.x},${a.y} L ${a.x},${me-10} L ${L.x},${me+10} L ${L.x},${L.y}`}else if(g==zt.bottom){const me=(a.y+L.y)/2;return`
166
+ ${ie??""}
167
+ </div>`),Q}return null})}if(l.bubbleformatting.showBubble){let d=Math.min(_,b);const i=T.scaleLinear().domain([N,$]).range([d*.01,d*.07]);g.selectAll("myCircles").data(K.features).join("circle").attr("cx",y=>C.centroid(y)[0]).attr("cy",y=>C.centroid(y)[1]).attr("r",y=>y.properties.data?i(y.properties.data?.data[1]?.value||0):0).attr("fill",(y,f)=>l.colorScaleForMapsBubble.showColorForMapsBubble=="2"?oe(y.properties.data&&y.properties.data.data[j]?.value||0):l.bubbleformatting.bubbleColor).attr("stroke",l.bubbleformatting&&l.bubbleformatting.bubbleBorderColor).attr("stroke-width",l.bubbleformatting&&l.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",l.bubbleformatting&&et(l.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(y,f){ot([{key:"Region",value:f.properties?.data?.propeties?.Alias},{key:f.properties.data?.data[1]?.dimension,value:l.toolTip.toolTipNumberFormat==",.0%"?Math.round(f.properties.data?.data[1]?.value/se*100)+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(f.properties.data?.data[1]?.value)}],l,void 0,f.currentTarget.__data__.data.properties),T.select(this).style("r",(f.properties.data?i(f.properties.data?.data[1]?.value||0):0)*1.2)}).on("mouseout",function(y,f){rt(),T.select(this).style("r",f.properties.data?i(f.properties.data?.data[1]?.value||0):0)})}}catch(w){be("Maps.tsx","drawMap",w)}},q=w=>{try{let p=w.properties.data;switch(parseInt(l.colorScaleForMaps.showColorForMaps)){case 1:return p?p.properties.color:"#E6E6E6";case 2:return l.colorScaleForMaps.defaultColor;case 3:return w.properties.data?re(w.properties.data?.data[D]?.value):"#E6E6E6"}}catch(p){be("Maps.tsx","getMapColor",p)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{id:o,className:"chartSVG",style:{width:"100%",height:"100%"},ref:h})})},na="OrganizationChart.tsx",Sr=({data:t,formatOptions:e,legendSequence:r})=>{let o=t.LegendList??[];const h=crypto.randomUUID(),n=Te.useRef(),l=Te.useRef();let s,x,L,A=40,u=Ht,S,b=new Map,_=new Map,g=zt.left,H=[],D=0,j=0,K,J=new Map,U,V=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,$;Te.useEffect(()=>{X()},[h,t,e]);const X=()=>{({chartFormatOptions:s,svg:S,width:x,height:L}=Jt(n,e)),oe(),U=se(J),{margins:u,innerHeight,innerWidth,legendListWidth:K,chartTitleHeight:A}=Na(s,x,L,U,u),jt(n,x,L,s),_t(n,A,x,s),he(),q(H),re()},se=c=>{const d=[];c.forEach((f,a)=>{d.push(a)});const i=d.reduce((f,a)=>f.length>a.length?f:a,""),y=It(i,et(s.legends.legendFontSize),s.legends.legendFontFamily);return[y.width,y.height]},re=()=>{let c=[];J.forEach((d,i)=>{const y=`linear-gradient(90deg, ${d.join(", ")})`;c.push({properties:{...o[0],name:i,alias:i,color:y}})}),Pa(s,S,c,x,L,K,A,h,u,nt.rectangle,void 0)},oe=()=>{try{const i=e?.plotArea?.sortBy??"default";g=s.plotArea.chartDirection||zt.left;var c=0,d=0;const y={...t.ChartData,UID:void 0};let f=O(y).filter(a=>a.value!==null);i!=="default"&&(f=f.sort((a,m)=>i==="asc"?a.value-m.value:m.value-a.value)),ue(f),Le(f),H=pe(f),s.heatMap.showHeatMap&&($=T.scaleSequential().domain([N,V]).interpolator(T.interpolateRgb(s.heatMap.heatMapMinColor,s.heatMap.heatMapMaxColor)))}catch(i){be(na,"dataPreparation",i)}},he=()=>{try{if(s.plotArea.fitChart)j=L,D=x,l.current.style.width="calc(100% - 10px)",l.current.style.height="calc(100% - 10px)";else{let c=function(){let d=this;var i=d.scrollLeft,y=d.scrollTop;T.select(`#clipPath${h}`).select("rect").attr("x",i).attr("y",y)};D=0,H.forEach(d=>{d.label==r[r.length-1]&&(D+=p(d,!1))}),j=(r.length+1)*et(s.nodes.nodeHeight)*10+(r.length+1)*70,l.current.style.width=`${D}px`,l.current.style.height=`${j}px`,T.select(l.current).append("defs").attr("id",`defs${h}`).append("clipPath").attr("id",`clipPath${h}`).append("rect").attr("width",x-u.left-u.right).attr("height",L-u.top-u.bottom-15).attr("transform",`translate(${u.left},${u.top})`),document.querySelector("#floating-div"+h).addEventListener("scroll",c),T.select(l.current).attr("clip-path",`url(#clipPath${h})`)}}catch(c){be(na,"scrollWidthHeightCalculation",c)}},Le=c=>{try{c.forEach((d,i)=>{if(d.id!=0){let y=c[b.get(d.parentId)].UID;y===void 0?d.UID=d.nodeLabel:d.UID=y+"-"+d.nodeLabel}})}catch(d){be(na,"generateUID",d)}},pe=c=>{try{return o.forEach(d=>{_.set(d.name,d)}),Object.keys(c).forEach(d=>{const i=c[d],y=_.get(i.UID??i.nodeLabel)??o[0];if(c[d]={...i,styleObject:y},i.label)if(J.has(i.label)){const f=J.get(i.label);J.set(i.label,[...f,y.color??"#eedddd"])}else J.set(i.label,[y.color??"#eedddd"]);V=Math.max(V,i.value),N=Math.min(N,i.value)}),c}catch(d){be(na,"addStyleObjectToChartData",d)}},ue=c=>{try{c.forEach((d,i)=>{b.set(d.id,i)})}catch(d){be(na,"createIdIndexMap",d)}},O=c=>{try{const d=T.hierarchy(c).descendants();return d.forEach((i,y)=>{i.id=i.id||"id"+y}),d.map((i,y)=>{const f={...i.data};return delete f.children,i.parent&&(f.parentValue=i.parent.data.value||0),{...f,parentId:i.parent?.data?.id}})}catch(d){be(na,"getFlattenedData",d)}},q=c=>{try{let d=s.connector.lineType||"straight",i=s.nodes.nodeType||ei.rectangle,y=parseInt(s.connector.connectorLineThickness);T.select(l.current).selectAll("*").remove(),new hl.OrgChart().container(`#floating-${h}`).svgWidth(D).svgHeight(j).nodeHeight(a=>w(a)).nodeWidth(a=>p(a,!0)).layout(g).diagonal((a,m,P,ie={sy:0})=>{if(g=="top"||g=="bottom"||!g)switch(d){case ca.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ca.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${m.y} H ${m.x}`;case ca.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ca.s_curve:const Q=(a.y+m.y)/2;return`M ${a.x},${a.y} C ${a.x},${Q} ${m.x},${Q} ${m.x},${m.y}`;case ca.arc:const Ae=m.x-a.x,ge=m.y-a.y,we=Math.sqrt(Ae*Ae+ge*ge);return`M ${a.x},${a.y} A ${we},${we} 0 0,1 ${m.x},${m.y}`;case ca.reverse_elbow:if(g==zt.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${m.x} V ${m.y}`;if(g==zt.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${m.x} V ${m.y}`;case ca.zigzag:if(g==zt.top){const fe=(a.y+m.y)/2;return`M ${a.x},${a.y} L ${a.x},${fe-10} L ${m.x},${fe+10} L ${m.x},${m.y}`}else if(g==zt.bottom){const fe=(a.y+m.y)/2;return`
168
168
  M ${a.x},${a.y}
169
- L ${a.x},${me+10}
170
- L ${L.x},${me-10}
171
- L ${L.x},${L.y}
172
- `}default:if(g==zt.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${L.x} V ${L.y}`;if(g=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${L.x} V ${L.y}`}}).hdiagonal((a,L,P,ae={sx:0})=>{if(g===zt.left||g===zt.right)switch(c){case ca.curve:return`M ${a.x} ${a.y} C ${(a.x+L.x)/2} ${a.y}, ${(a.x+L.x)/2} ${L.y}, ${L.x} ${L.y}`;case ca.elbow:if(g==zt.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${L.y} H ${L.x}`;if(g==zt.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${L.y} H ${L.x}`;case ca.diagonal:return`M ${a.x} ${a.y} L ${(a.x+L.x)/2} ${a.y} L ${(a.x+L.x)/2} ${L.y} L ${L.x} ${L.y}`;case ca.s_curve:const Q=(a.x+L.x)/2;return`M ${a.x},${a.y} C ${Q},${a.y} ${Q},${L.y} ${L.x},${L.y}`;case ca.arc:if(g==zt.left){const be=L.x-a.x,Le=L.y-a.y,Fe=Math.sqrt(be*be+Le*Le);return`M ${a.x},${a.y} A ${Fe},${Fe} 0 0,1 ${L.x},${L.y}`}else if(g==zt.right){const be=a.x-L.x,Le=L.y-a.y,Fe=Math.sqrt(be*be+Le*Le);return`M ${a.x},${a.y} A ${Fe},${Fe} 0 0,0 ${L.x},${L.y}`}case"reverse-elbow":if(g==zt.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${L.y} H ${L.x}`;if(g==zt.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${L.y} H ${L.x}`;case"zigzag":if(g==zt.left){const be=(a.x+L.x)/2;return`
169
+ L ${a.x},${fe+10}
170
+ L ${m.x},${fe-10}
171
+ L ${m.x},${m.y}
172
+ `}default:if(g==zt.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${m.x} V ${m.y}`;if(g=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${m.x} V ${m.y}`}}).hdiagonal((a,m,P,ie={sx:0})=>{if(g===zt.left||g===zt.right)switch(d){case ca.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ca.elbow:if(g==zt.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${m.y} H ${m.x}`;if(g==zt.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${m.y} H ${m.x}`;case ca.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ca.s_curve:const Q=(a.x+m.x)/2;return`M ${a.x},${a.y} C ${Q},${a.y} ${Q},${m.y} ${m.x},${m.y}`;case ca.arc:if(g==zt.left){const Ae=m.x-a.x,ge=m.y-a.y,we=Math.sqrt(Ae*Ae+ge*ge);return`M ${a.x},${a.y} A ${we},${we} 0 0,1 ${m.x},${m.y}`}else if(g==zt.right){const Ae=a.x-m.x,ge=m.y-a.y,we=Math.sqrt(Ae*Ae+ge*ge);return`M ${a.x},${a.y} A ${we},${we} 0 0,0 ${m.x},${m.y}`}case"reverse-elbow":if(g==zt.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${m.y} H ${m.x}`;if(g==zt.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${m.y} H ${m.x}`;case"zigzag":if(g==zt.left){const Ae=(a.x+m.x)/2;return`
173
173
  M ${a.x},${a.y}
174
- L ${be-10},${a.y}
175
- L ${be+10},${L.y}
176
- L ${L.x},${L.y}
177
- `}else{const be=(a.x+L.x)/2;return`
174
+ L ${Ae-10},${a.y}
175
+ L ${Ae+10},${m.y}
176
+ L ${m.x},${m.y}
177
+ `}else{const Ae=(a.x+m.x)/2;return`
178
178
  M ${a.x},${a.y}
179
- L ${be+10},${a.y}
180
- L ${be-10},${L.y}
181
- L ${L.x},${L.y}
182
- `}default:return g==zt.left?`M ${a.x} ${a.y} H ${a.x-25} V ${L.y} H ${L.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${L.y} H ${L.x}`}else return`M ${a.x} ${a.y} L ${L.x} ${L.y}`}).linkUpdate(function(a){try{if(y){const L=s.plotArea.connectorType||"arrow",P=["arrow","diamond","dot"].includes(L)&&s.connector.lineType!=="reverse-elbow";T.select(this).attr("stroke-width",s.connector.connectorLineThickness).attr("stroke-dasharray",s.connector.connectorStyle===Ha.solid?0:s.connector.connectorStyle===Ha.dotted?1:4).style("stroke",s.connector.connectorLineColor).attr("marker-start",P?`url(#${L})`:null).attr("marker-end",null)}else T.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(L){ge(na,"drawOrganizationChart.linkUpdate",L)}}).nodeContent((a,L)=>{try{let P=`${a.data.styleObject.borderRadius}px`,ae="",Q="",be="",Le="",Fe="";switch(i){case ei.rounded:P="10px";break;case ei.pill:P="999px";break;case ei.extra_rounded:P="20px";break;case ei.squircle:P="25%";break;default:P="1px";break}return Fe=`
179
+ L ${Ae+10},${a.y}
180
+ L ${Ae-10},${m.y}
181
+ L ${m.x},${m.y}
182
+ `}default:return g==zt.left?`M ${a.x} ${a.y} H ${a.x-25} V ${m.y} H ${m.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${m.y} H ${m.x}`}else return`M ${a.x} ${a.y} L ${m.x} ${m.y}`}).linkUpdate(function(a){try{if(y){const m=s.plotArea.connectorType||"arrow",P=["arrow","diamond","dot"].includes(m)&&s.connector.lineType!=="reverse-elbow";T.select(this).attr("stroke-width",s.connector.connectorLineThickness).attr("stroke-dasharray",s.connector.connectorStyle===Ha.solid?0:s.connector.connectorStyle===Ha.dotted?1:4).style("stroke",s.connector.connectorLineColor).attr("marker-start",P?`url(#${m})`:null).attr("marker-end",null)}else T.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(m){be(na,"drawOrganizationChart.linkUpdate",m)}}).nodeContent((a,m)=>{try{let P=`${a.data.styleObject.borderRadius}px`,ie="",Q="",Ae="",ge="",we="";switch(i){case ei.rounded:P="10px";break;case ei.pill:P="999px";break;case ei.extra_rounded:P="20px";break;case ei.squircle:P="25%";break;default:P="1px";break}return we=`
183
183
  border-width: ${a.data.styleObject.borderWidth}px
184
184
  border-style:${s.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"}
185
185
  border-color:${a.data.styleObject.borderColor};
@@ -197,9 +197,9 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),K=V<j[0]+10?V:j[0]+
197
197
  justify-content: center;
198
198
  align-items: center;
199
199
  text-align: center;
200
- background-color: ${s.heatMap.showHeatMap?z(a.data.value):s.nodes.nodesSingleColor?s.nodes.nodesColor:a.data.styleObject.color};
200
+ background-color: ${s.heatMap.showHeatMap?$(a.data.value):s.nodes.nodesSingleColor?s.nodes.nodesColor:a.data.styleObject.color};
201
201
  z-index: 99;
202
- transform: ${ae};
202
+ transform: ${ie};
203
203
  transition: unset;">
204
204
 
205
205
  ${Q}
@@ -207,30 +207,30 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),K=V<j[0]+10?V:j[0]+
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(se.bold)?"Bolder":"normal"};
211
- font-style:${a.data.styleObject.labelFontStyle.includes(se.italic)?se.italic:"normal"};
212
- text-decoration:${a.data.styleObject.labelFontStyle.includes(se.underline)?se.underline:"none"};
210
+ font-weight:${a.data.styleObject.labelFontStyle.includes(ne.bold)?"Bolder":"normal"};
211
+ font-style:${a.data.styleObject.labelFontStyle.includes(ne.italic)?ne.italic:"normal"};
212
+ text-decoration:${a.data.styleObject.labelFontStyle.includes(ne.underline)?ne.underline:"none"};
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
- ${L===0?a.data.styleObject.alias:s.nodes.nodesLabelVisibility?`${a.data.label} : ${k(a.data.styleObject.alias)}`:`${k(a.data.styleObject.alias)}`}
218
+ ${m===0?a.data.styleObject.alias:s.nodes.nodesLabelVisibility?`${a.data.label} : ${C(a.data.styleObject.alias)}`:`${C(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(se.bold)?"Bolder":"normal"};
224
- font-style:${a.data.styleObject.valueFontStyle.includes(se.italic)?se.italic:"normal"};
225
- text-decoration:${a.data.styleObject.valueFontStyle.includes(se.underline)?se.underline:"none"};
223
+ font-weight:${a.data.styleObject.valueFontStyle.includes(ne.bold)?"Bolder":"normal"};
224
+ font-style:${a.data.styleObject.valueFontStyle.includes(ne.italic)?ne.italic:"normal"};
225
+ text-decoration:${a.data.styleObject.valueFontStyle.includes(ne.underline)?ne.underline:"none"};
226
226
  font-size:${a.data.styleObject.valueFontSize}px;">
227
227
  ${s.nodes.dataLabelNumberFormat==",.0%"?a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":je(s.nodes.nodesDisplayUnits,s.nodes.dataLabelNumberFormat,s.nodes.dataLabelDecimalPrecision)(a.data.value)}
228
228
  <br>
229
229
  ${s.nodes.percentageVisibility?+a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":""}
230
230
  </div>
231
231
 
232
- ${be}
233
- </div>`}catch(P){return ge(na,"drawOrganizationChart.nodeContent",P),""}}).buttonContent(({node:a,state:L})=>{try{if(y)return`
232
+ ${Ae}
233
+ </div>`}catch(P){return be(na,"drawOrganizationChart.nodeContent",P),""}}).buttonContent(({node:a,state:m})=>{try{if(y)return`
234
234
  <div
235
235
  style="
236
236
  color: black;
@@ -256,14 +256,14 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),K=V<j[0]+10?V:j[0]+
256
256
  font-size: 7px;
257
257
  font-weight: bold;
258
258
  ">${a.data._directSubordinates}</span>`}
259
- </div>`}catch(P){return ge(na,"drawOrganizationChart.buttonContent",P),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,L)=>20).duration(0).setActiveNodeCentered(!1).data(d).compact(!1).expandAll().fit(!1).render()}catch(c){ge(na,"drawOrganizationChart",c)}},F=d=>{try{let c;if(d.data.styleObject)return s.nodes.percentageVisibility?c=d.data.styleObject.nodeHeight*10+10:c=d.data.styleObject.nodeHeight*10,c}catch(c){ge(na,"calculateNodeHeight",c)}},b=(d,c)=>{try{let i={};c?i=d.data:i=d;let y,f;if(s.nodes.nodesLabelVisibility?f=50:f=20,i.styleObject)return s.nodes.nodesLabelOverflow?i.id==0?y=i.styleObject.nodeWidth*10+50:y=i.styleObject.nodeWidth*10:y=f+k(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,y}catch(i){ge(na,"calculateNodeWidth",i)}},k=d=>{try{let c=d.split("-");return c[c.length-1]}catch(c){ge(na,"getLabelText",c)}};return $e.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[$e.jsx("svg",{id:h,className:"chartSVG",style:{width:"100%",height:"100%"},ref:n}),$e.jsx("div",{id:`floating-div${h}`,className:"floatingDiv",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"auto"},children:$e.jsx("svg",{id:`floating-${h}`,className:"chartSVG",ref:l})})]})},wr=({data:t,formatOptions:e,chartId:r,addLocalFilterFromLib:o,onElementClick:h,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=Te.useRef(h);s.current=h;const x=Te.useRef(n);x.current=n;const m=new Map((t.ChartData??[]).map((ee,De)=>[ee.legend,De]));let A=t.LegendList;const u=Te.useRef();let S,p=[0,0];const H=re.BubbleChart;let g,G,V=40,j=Ht,K,Z,Y,N,E=[],z=[],q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a;Te.useEffect(()=>{L()},[e,t,r]);const L=()=>{({chartFormatOptions:S,svg:N,width:g,height:G}=Jt(u,e)),p=Ia(S,A??[],"alias"),t=ke(t),Q(),{longestMeasure:d,customYaxisIntervalValue:c,customYaxisMaxValue:i,customYaxisMinValue:y}=ji(S,ne,oe),{longestDimension:J,customXaxisIntervalValue:F,customXaxisMaxValue:b,customXaxisMinValue:k}=Ji(S,q,ce),{margins:j,yLabel:xe,xLabel:Ae,yTitle:pe,xTitle:ue,chartTitleHeight:V,legendMargin:O,innerHeight:K,innerWidth:Z}=_i(g,G,d,S,J,p),jt(u,g,G,S),Y=la(N,j),mt(Y,e,0,Z,K,H),_t(u,V,g,S),be(),Le(),Fe(),Zi(e,!1,N,j,Ae,G,ue,"Bubble",xe,Z,K),Xi(K,e,0,!1,N,j,pe,xe),me(),te(),P(),el(N,S.legends.legendPosition,S,G,g,j,K,ue,Ae,t.length)},P=()=>{try{let ee=5,De=30,Ve={minimumValue:ne,maximumValue:oe};const Ye=Y.append("g").attr("class","circles").attr("class","parentGroup"),ie=S.animation.animationEnabled,ye=Ye.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",Pe=>Pe.legendName.replace(/ /g,"-")).attr("fill",Pe=>Pe.legendColor!==we.white?Pe.legendColor:"none").append("path").attr("class","path").attr("id",function(Pe,Me){T.select(this).attr("d",T.symbol().type(T.symbolCircle).size(ae(ee,De,Ve,Pe.measure,10)*et(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(Pe){return`translate(${f(Pe.dimension)}, ${a(Pe.measure)})`}).attr(Qe.SeriesId,Pe=>`${m.get(Pe.legendName)}_${Pe.legendName}`).attr(Qe.DimValue,Pe=>String(Pe.dimension)).attr("opacity",ie?0:S.plotArea.fillOpacity).style("visibility",(Pe,Me)=>Pe.dimension[0]===0||Pe.measure===0&&S.plotArea.hideZeroValues||Pe.dimension<k||Pe.dimension>b||Pe.measure<y||Pe.measure>i?"hidden":"visible").on("click",At(x,s,(Pe,Me)=>({seriesId:`${m.get(Me.legendName)}_${Me.legendName}`,dimValue:String(Me.dimension),legendUniqueId:`${m.get(Me.legendName)}_${Me.legendName}`,seriesDisplayName:Me.legendName}))).on("mousemove",(Pe,Me)=>{st([{key:S.xAxisTitle.xAxisTitleText,value:je(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(Me.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:je(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(Me.measure)},{key:"Legend",value:Me.legendName}],S,Pe,{alias:Me.legendName},ht(l,String(Me.dimension),{alias:Me.legendName}))}).on("mouseout",()=>{rt()});ie&&ye.transition().duration(S.animation.animationDuration).ease(Xe[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(ee){ge("BubbleChart","initCircles",ee)}};function ae(ee,De,Ve,Ye,ie){try{if(Ye==null)return ie;var ye=Ve.minimumValue,Pe=Ve.maximumValue,Me=De*De*2*Math.PI,Ce=ee*ee*2*Math.PI,ve=ie;if(ye==Pe)ve=De;else{var he=Ye,fe=(he-ye)/(Pe-ye)*(Me-Ce)+Ce;fe<Ce&&(fe=Ce),ve=Math.sqrt(fe/(Math.PI*2))}return ve}catch(de){return ge("BubbleChart","getBubbleSize",de),ie}}const Q=()=>{try{E=[],z=[],ne=void 0,oe=void 0,q=void 0,ce=void 0,t.forEach(ee=>{ee.measureName&&(E.push(ee.measure),(ee.measure<ne||ne===void 0)&&(ne=ee.measure),(ee.measure>oe||oe===void 0)&&(oe=ee.measure)),ee.dimensionName&&(z.push(ee.dimension),(ee.dimension<q||q===void 0)&&(q=ee.dimension),(ee.dimension>ce||ce===void 0)&&(ce=ee.dimension))})}catch(ee){ge("BubbleChart","iterateOverChartData",ee)}},be=()=>{try{let ee=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):q>0?0:q*1.1,De=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):ce*1.1,Ve=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):ne>0?0:ne*1.1,Ye=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):oe*1.1;f=T.scaleLinear().domain([ee,De]).range([0,Z]),a=T.scaleLinear().domain([Ve,Ye]).range([K,0])}catch(ee){ge("BubbleChart","initScale",ee)}},Le=()=>{try{let{xAxisLabelArray:ee,customTickValue:De,autoLabelFlag:Ve}=xi(ce,q,Z,e,k,b,Z,!1);const Ye=T.axisBottom(f).tickFormat(je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(ia(e,K,0,!0)).tickValues(ee.length>0?ee:null).ticks(De).tickPadding(8).tickSizeOuter(0);Qi(Y,S,0,Ae,Ye,K,Z,j,a)}catch(ee){ge("BubbleChart","drawXAxis",ee)}},Fe=()=>{try{let{yAxisLabelArray:ee,customTickValue:De}=qi(oe,ne,K,e,y,i);const Ve=T.axisLeft(a).tickFormat(je(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(Pt(e,Z)).tickValues(ee.length>0?ee:null).ticks(De).tickPadding(8).tickSizeOuter(0);Ki(Y,S,0,xe,Ve,K)}catch(ee){ge("BubbleChart","drawYAxis",ee)}},me=()=>{try{if(S.plotArea.xCoordinate!=Yt.None){let ee;switch(S.plotArea.xCoordinate){case Yt.Mean:ee=T.mean(t,De=>De.dimension);break;case Yt.Median:ee=T.median(t,De=>De.dimension);break;case Yt.Custom:ee=et(S.plotArea.xscaleposition);break}Y.append("line").attr("x1",f(ee)).attr("y1",0).attr("x2",f(ee)).attr("y2",K).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Yt.None){let ee;switch(S.plotArea.yCoordinate){case Yt.Mean:ee=T.mean(t,De=>De.measure);break;case Yt.Median:ee=T.median(t,De=>De.measure);break;case Yt.Custom:ee=et(S.plotArea.yscaleposition);break}Y.append("line").attr("x1",0).attr("y1",a(ee)).attr("x2",Z).attr("y2",a(ee)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(ee){ge("BubbleChart","drawReferenceLines",ee)}},te=()=>{try{let ee=A?.map(De=>{let Ve={...De,legendFontStyle:De.fontStyle,fontSize:De.fontSize+"px",legendFontFamily:De.fontFamily};return{legend:De.name,properties:Ve,data:{}}});Pa(S,N,ee||[],g,G,p[0],V,r,j,nt.circle,!1,o)}catch(ee){ge("BubbleChart","initLegendList",ee)}},ke=ee=>{try{if(!ee||!ee.ChartData||!ee.ChartData[0])return[];const De=[];return ee.ChartData.forEach(Ye=>{Ye.data.forEach(ie=>{De.push({dimension:parseFloat(ie.dimension),dimensionName:Ye.legend??"Dimension",measure:ie.value,measureName:Ye.legend??"Measure",legendName:Ye.legend,legendColor:Ye.properties?.color??we.black,tooltip:""})})}),De}catch(De){return console.error("BubbleChart - Data conversion failed",De),[]}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:u,id:r,style:{width:"100%",height:"100%"}})})},ua="ScatterChart.tsx",Dr=({data:t,formatOptions:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{const l=Te.useRef(o);l.current=o;const s=Te.useRef(h);s.current=h;const x=t.ColorElements??[],m=t.ShapeElements??[],A=new Map(x.map((Pe,Me)=>[Pe.name,Me]));let u=[];const S=Te.useRef();let p,H=[0,0],g,G,V=40,j=Ht,K,Z,Y,N,E=Number.POSITIVE_INFINITY,z=Number.NEGATIVE_INFINITY,q=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,ne=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P=new Map,ae=new Map;Te.useEffect(()=>{Q()},[e,t,r]);const Q=()=>{({chartFormatOptions:p,svg:N,width:g,height:G}=Jt(S,e));let Pe=[...m,...x];H=Ia(p,Pe,"alias"),Le(),{longestMeasure:d,customYaxisIntervalValue:c,customYaxisMaxValue:i,customYaxisMinValue:y}=ji(p,q,ce),{longestDimension:J,customXaxisIntervalValue:F,customXaxisMaxValue:b,customXaxisMinValue:k}=Ji(p,E,z),{margins:j,yLabel:xe,xLabel:Ae,yTitle:pe,xTitle:ue,chartTitleHeight:V,legendMargin:O,innerHeight:K,innerWidth:Z}=_i(g,G,d,p,J,H),jt(S,g,G,p),Y=la(N,j),mt(Y,e,0,Z,K,"Scatter",r),_t(S,V,g,p),Fe(),me(),te(),Zi(e,!1,N,j,Ae,G,ue,"Scatter",xe,Z,K),Xi(K,e,0,!1,N,j,pe,xe),ke(),be(),ee(),De(),el(N,p.legends.legendPosition,p,G,g,j,K,ue,Ae,u.length)},be=()=>{try{let Pe=function(he){return he=="Square"?T.symbolSquare:he=="Circle"?T.symbolCircle:he=="Cross"?T.symbolCross:he=="Triangle"?T.symbolTriangle:he=="Star"?T.symbolStar:he=="Diamond"?T.symbolDiamond:he=="Wye"?T.symbolWye:T.symbolCircle};const Me=Y.append("g").attr("class","circles").attr("class","parentGroup"),Ce=p.animation.animationEnabled,ve=Me.append("g").selectAll(".bubbleScatter").data(u).enter().append("g").attr("fill",he=>he.color).attr("colorId",he=>he.colorName.replace(/ /g,"-")).attr("shapeId",he=>he.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(he,fe){T.select(this).attr("d",T.symbol().type(Pe(he.shape)).size((he.sizeValue?L(he.sizeValue):10)*2*et(p.plotArea.scatterSizeIndex)))}).attr("transform",function(he){return`translate(${f(he.dimension)}, ${a(he.measure)})`}).attr(Qe.SeriesId,he=>`${A.get(he.colorName)}_${he.colorName}`).attr(Qe.DimValue,he=>String(he.dimension)).attr("opacity",Ce?0:p.plotArea.fillOpacity).style("visibility",(he,fe)=>he.dimension[0]===0||he.measure===0&&p.plotArea.hideZeroValues||he.dimension<k||he.dimension>b||he.measure<y||he.measure>i?"hidden":"visible").on("click",At(s,l,(he,fe)=>({seriesId:`${A.get(fe.colorName)}_${fe.colorName}`,dimValue:String(fe.dimension),legendUniqueId:`${A.get(fe.colorName)}_${fe.colorName}`,seriesDisplayName:fe.colorName}))).on("mousemove",(he,fe)=>{st([{key:p.xAxisTitle.xAxisTitleText,value:je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(fe.dimension)},{key:p.yAxisTitle.yAxisTitleText,value:je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(fe.measure)},{key:"Color",value:fe.colorName},...fe.shapeName?[{key:"Shape",value:fe.shapeName}]:[]],p,he,{alias:fe.colorName},ht(n,String(fe.dimension),{alias:fe.colorName}))}).on("mouseout",()=>{rt()});Ce&&ve.transition().duration(p.animation.animationDuration).ease(Xe[p.animation.animationEffect]).attr("opacity",p.plotArea.fillOpacity)}catch(Pe){ge(ua,"initCircles",Pe)}},Le=()=>{try{let Pe=function(Me,Ce,ve){q=Math.min(q,Me.value),ce=Math.max(ce,Me.value),E=Math.min(E,Me.dimension),z=Math.max(z,Me.dimension),ne=Math.min(ne,Me.value2??10),oe=Math.max(oe,Me.value2??10),u.push({dimension:Me.dimension,measure:Me.value,sizeValue:Me.value2,colorName:Ce,shapeName:ve,shape:ae.get(ve)||"Circle",color:P.get(Ce)||"#6ba2b8ff"})};x.forEach(Me=>{P.set(Me.name,Me.color)}),m.forEach(Me=>{ae.set(Me.name,Me.markerShape)}),t.ChartData.forEach(Me=>{Me.children&&Me.children.length>0&&Me.children.forEach(Ce=>{Ce.data.forEach(ve=>{Pe(ve,Me.legend,Ce.legend)})}),Me.data&&Me.data.length>0&&Me.data.forEach(Ce=>{Pe(Ce,Me.legend)})})}catch(Pe){ge(ua,"iterateOverChartData",Pe)}},Fe=()=>{try{let Pe=p.yAxisLabel.yAxisIntervalsVisibility&&p.yAxisLabel.yAxisMinText!==""?parseFloat(p.yAxisLabel.yAxisMinText):q>0?0:q*1.1,Me=p.yAxisLabel.yAxisIntervalsVisibility&&p.yAxisLabel.yAxisMaxText!==""?parseFloat(p.yAxisLabel.yAxisMaxText):ce*1.1;a=T.scaleLinear().domain([Pe,Me]).range([K,0]),L=T.scaleLinear().domain([ne,oe]).range([1,10])}catch(Pe){ge(ua,"initScale",Pe)}},me=()=>{try{const Me=(parseFloat(e.plotArea.ticksHeight)||100)/100*K;let{xAxisLabelArray:Ce,customTickValue:ve}=xi(z,E,Z,e,k,b,K,!1);Ce.length>0?f=T.scaleLinear().domain([Ce[0],Ce[Ce.length-1]]).range([0,Z]):f=T.scaleLinear().domain([k,b]).range([0,Z]);const he=T.axisBottom(f).tickFormat(je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(p.plotArea.gridLinesVisibility&&p.plotArea.gridLinesVertical?p.xAxisLabel.xAxisPosition==="0"?-Me:p.xAxisLabel.xAxisPosition==="1"?Me:0:0).tickValues(Ce.length>0?Ce:null).ticks(ve).tickPadding(8).tickSizeOuter(0);Qi(Y,p,0,Ae,he,K,Z,j,a)}catch(Pe){ge(ua,"drawXAxis",Pe)}},te=()=>{try{const Me=(parseFloat(e.plotArea.ticksWidth)||100)/100*Z;let{yAxisLabelArray:Ce,customTickValue:ve}=qi(ce,q,K,e,y,i);const he=T.axisLeft(a).tickFormat(je(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(p.plotArea.gridLinesVisibility&&p.plotArea.gridLinesHorizontal?-Me:0).tickValues(Ce.length>0?Ce:null).ticks(ve).tickPadding(8).tickSizeOuter(0);Ki(Y,p,0,xe,he,K)}catch(Pe){ge(ua,"drawYAxis",Pe)}},ke=()=>{try{if(p.plotArea.xCoordinate!=Yt.None){let Pe;switch(p.plotArea.xCoordinate){case Yt.Mean:Pe=T.mean(u,Me=>Me.dimension);break;case Yt.Median:Pe=T.median(u,Me=>Me.dimension);break;case Yt.Custom:Pe=et(p.plotArea.xscaleposition);break}Y.append("line").attr("x1",f(Pe)).attr("y1",0).attr("x2",f(Pe)).attr("y2",K).attr("stroke",p.plotArea.refLineBorderColor).attr("stroke-width",p.plotArea.refLineBorderThickness)}if(p.plotArea.yCoordinate!=Yt.None){let Pe;switch(p.plotArea.yCoordinate){case Yt.Mean:Pe=T.mean(u,Me=>Me.value);break;case Yt.Median:Pe=T.median(u,Me=>Me.value);break;case Yt.Custom:Pe=et(p.plotArea.yscaleposition);break}Y.append("line").attr("x1",0).attr("y1",a(Pe)).attr("x2",Z).attr("y2",a(Pe)).attr("stroke",p.plotArea.refLineBorderColor).attr("stroke-width",p.plotArea.refLineBorderThickness)}}catch(Pe){ge(ua,"drawReferenceLines",Pe)}},ee=()=>{try{p.legends.legendAlignment===void 0&&(p.legends.legendAlignment="Top"),p.legends.legendAlignmentTopBottom===void 0&&(p.legends.legendAlignmentTopBottom="Start");let Pe=p.legends.legendPosition,Me=p.legends.legendAlignment,Ce=p.legends.legendAlignmentTopBottom;switch(Pe){case Be.none:break;case Be.right:Ve(x,g-O-30,V+5,O+25,G-V-10);break;case Be.top:Ve(x,5,V+5,g-10,30);break;case Be.left:Ve(x,5,V+5,O+25,G-V-10);break;case Be.bottom:Ve(x,5,G-35,g-10,30);break}}catch(Pe){ge(ua,"drawColors",Pe)}},De=()=>{try{p.legends.legendAlignment===void 0&&(p.legends.legendAlignment=Fa.top),p.legends.legendAlignmentTopBottom===void 0&&(p.legends.legendAlignmentTopBottom=wa.start);let Pe=p.legends.legendPosition;if(m.length>0)switch(Pe){case Be.none:break;case Be.right:Ye(m,g-O-30,G/2+10,O+25,G-V-10);break;case Be.top:Ye(m,g/2+5,V+5,g-10,30);break;case Be.left:Ye(m,5,G/2+10,O+25,G-V-10);break;case Be.bottom:Ye(m,g/2+5,G-35,g-10,30);break}}catch(Pe){ge(ua,"drawShapes",Pe)}},Ve=(Pe,Me,Ce,ve,he)=>{try{let de=p.legends.legendPosition,le=p.legends.legendFontStyle,B=N.append("foreignObject").attr("visibility",p.legends.legendVisibility?"visible":"hidden").attr("x",Me).attr("y",Ce).attr("width",ve).attr("height",he).style("user-select","none"),U=(de==Be.top||de==Be.bottom)&&m.length>0?"50%":"100%";var fe=B.append("xhtml:div").style("width",U).style("display","flex").style("height",de==Be.top||de==Be.bottom?he-1+"px":"calc(50% - 5px)").style("border",p.legends.legendBorder?`${p.legends.legendBorderThickness+"px solid"+p.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+r).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",de==Be.top||de==Be.bottom?p.legends.legendAlignmentTopBottom==wa.start?"flex-Start":p.legends.legendAlignmentTopBottom==wa.middle?"center":"flex-end":p.legends.legendAlignment==Fa.top?"flex-Start":p.legends.legendAlignment==Fa.middle?"center":"flex-end").style("flex-direction",de==Be.top||de==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Pe.forEach((R,v)=>{let w=fe.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("width","fit-content").style("flex-wrap","nowrap").style("white-space","nowrap").style("font-size",p.legends.legendFontSize+"px").style("font-family",p.legends.legendFontFamily).on("mousemove",function(I){p.legends.onHoverEffect&&(N.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),N.selectAll('[colorId="'+ye(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(I){N.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),N.selectAll('[colorId="'+ye(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(de==Be.bottom||de==Be.top)&&w.style("margin-right","16px").style("white-space","nowrap"),w.append("div").style("height","10px").style("width","10px").style("background",R.color).style("border-radius","1px");let D=p.legends.legendColorMode=="1"?R.color?R.color:we.black:p.legends.legendSelectedUnicolor;w.append("div").style("margin-left","5px").style("color",D).attr("title",R.name).style("font-size",p.legends.legendFontSize+"px").style("font-family",p.legends.legendFontFamily).style("font-style",le.includes(se.italic)?se.italic:"").style("text-decoration",le.includes(se.underline)?se.underline:"").style("font-weight",le.includes(se.bold)?se.bold:"").style("white-space","nowrap").html(R.name)})}catch(de){ge(ua,"colorListWithScroll",de)}},Ye=(Pe,Me,Ce,ve,he)=>{try{let de=p.legends.legendPosition,le=p.legends.legendFontStyle,B=N.append("foreignObject").attr("visibility",p.legends.legendVisibility?"visible":"hidden").attr("x",Me).attr("y",Ce).attr("width",ve).attr("height",he).style("user-select","none"),U=p.legends.legendPosition==Be.top||p.legends.legendPosition==Be.bottom?"calc(50% - 5px)":"calc(100%)";var fe=B.append("xhtml:div").style("width",U).style("display","flex").style("height",de==Be.top||de==Be.bottom?he-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",p.legends.legendBorder?`${p.legends.legendBorderThickness+"px solid"+p.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+r).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",de==Be.top||de==Be.bottom?p.legends.legendAlignmentTopBottom==wa.start?"flex-Start":p.legends.legendAlignmentTopBottom==wa.middle?"center":"flex-end":p.legends.legendAlignment==Fa.top?"flex-Start":p.legends.legendAlignment==Fa.middle?"center":"flex-end").style("flex-direction",de==Be.top||de==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Pe.forEach((R,v)=>{let w=fe.append("div").style("width","fit-content").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("mousemove",function(I){p.legends.onHoverEffect&&(N.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),N.selectAll('[shapeId="'+ye(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(I){p.legends.onHoverEffect&&(N.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),N.selectAll('[shapeId="'+ye(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(de==Be.top||de==Be.bottom)&&w.style("margin-right","16px").style("white-space","nowrap"),ie(w,R.markerShape);let D=p.legends.legendColorMode=="1"?we.black:p.legends.legendSelectedUnicolor;w.append("div").style("margin-left","5px").style("color",D).attr("title",R.name).style("font-size",p.legends.legendFontSize+"px").style("font-family",p.legends.legendFontFamily).style("font-style",le.includes(se.italic)?se.italic:"").style("text-decoration",le.includes(se.underline)?se.underline:"").style("font-weight",le.includes(se.bold)?se.bold:"").style("white-space","nowrap").html(R.name)})}catch(de){ge(ua,"shapeListWithScroll",de)}},ie=(Pe,Me)=>{try{const ve={none:T.symbolCircle,circle:T.symbolCircle,square:T.symbolSquare,triangle:T.symbolTriangle,cross:T.symbolCross,diamond:T.symbolDiamond,star:T.symbolStar,wye:T.symbolWye}[Me?.toLowerCase()]||T.symbolCircle;Pe.append("svg").attr("width",14).attr("height",14).append("path").attr("d",T.symbol().type(ve).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(Ce){ge(ua,"shapesForScatterPlot",Ce)}},ye=(Pe="")=>{try{return Pe.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(Me){ge(ua,"getJQuerySelector",Me)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:r,style:{width:"100%",height:"100%"}})})},Vr=({isDateType:t,formatOptions:e,data:r,isAdvancedAnalyticsWaterFall:o=!1,onElementClick:h,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=crypto.randomUUID?.();let x=0,m;const A=re.WaterfallChart,u=Te.useRef(),S=Te.useRef(h);S.current=h;const p=Te.useRef(n);p.current=n;const H=o??!1,g=H?[]:bt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1,j=!1,K=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q=[],be=[],Le,Fe=0;const me=2;let te={dimensionList:G,chartType:A,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(le){ge("WaterfallChart","createWaterfallChart",le)}},[e]);const ke=()=>{({formatOptions:e,svg:c,width:b,height:k}=Ct(u,e)),ee(),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:N,yLabel:E,xLabel:z,yTitle:q,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:oe,secondaryAxisTitleWidth:xe,legendMargin:Ae,secondaryYLabel:pe}=vt(b,k,ue,O,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,K,t),Me(N),kt(c,b,k,e),i=Mt(c,N),mt(i,e,d,J,F,A,s),Ve(),ie(),Gt(i,e,d,E,L,F),Ce(g,k,c,N,J),St(e,V,c,N,z,k,ce,te.chartType,E,J,F),Ft(F,e,d,V,c,N,q,E),Ut(c,j,N,e,d,F,J,pe,xe),wt(c,e,b,oe)},ee=()=>{if(H){let v=de(r);v=v.filter(D=>D.up+D.down+D.base!=0),te.dimensionList=v.map(D=>D.xKey),te.legendList=te.dimensionList,be=T.stack().keys(["base","dimensionTotal","up","down"])(v);const w=[];be.forEach(D=>D.forEach(I=>w.push(I[1]))),te.yMaxLeft=T.max(w)??0,te.yMinLeft=T.min(w)??0;return}g.forEach(v=>{v.data.forEach(w=>{})}),Q=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ae=te.dimensionList:ae=te.dimensionList.slice(Fe,Fe+me),e.plotArea.hideZeroValues&&(te.hideZeroValues=!0);let le=H?de(r):he(),B=JSON.parse(JSON.stringify(le));le.forEach(v=>{if(!v.Dimension&&(v.Up<1e-9&&v.Up!==0||v.Down<1e-9&&v.Down!==0)){let w=B.findIndex(D=>D.Legend===v.Legend);w!==-1&&B.splice(w,1)}}),le=B,le.forEach(v=>v.dimension?te.legendList.push(v.dimension):te.legendList.push(v.legend)),be=T.stack().keys(["base","dimensionTotal","up","down"])(le);let U=[],R=[];be.forEach(v=>{v.key=="base"?v.opacity=0:v.opacity=1,v.forEach(w=>U.push(w)),!R.includes(v.dimension)&&v.dimensionTotal===0&&v.total===0&&R.push(v.dimension)}),te.yMaxLeft=T.max(U,v=>v[1]),te.yMinLeft=T.min(U,v=>v[1]),e.xAxisLabel.hideZeroValues&&(R.length>0&&R.forEach(v=>{te.legendList=te.legendList.filter(w=>w!==v)}),te.dimensionList=te.legendList),t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(v=>v):te.dimensionList,De(le)},De=le=>{try{let B=[],U=[],R=[];le&&le.forEach((w,D)=>{w.dimension&&(B.push(w.dimension),U.push({dimension:w.dimension,chartDataIndex:D,selfIndex:U.length}))}),t?R=gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(w=>w):R=B;let v=JSON.parse(JSON.stringify(te.legendList));U.forEach((w,D)=>{v[w.chartDataIndex]=R[w.selfIndex]}),te.legendList.forEach((w,D)=>{te.formattedDimensionListMap.set(w,v[D])})}catch(B){throw B}},Ve=()=>{let le=ot(Y||te.yMaxLeft,te.yMinLeft,F,e,te,Z,Y).yAxisLabelArray;te.yMaxLeft=le[le.length-1],te.yMinLeft=le[0],y=T.scaleLinear().domain([te.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:0:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:te.yMaxLeft*1.1]).range([F,0]),a=[0,J],Ye()},Ye=()=>{x=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(J/te.legendList.length),f=T.scaleBand().domain(te.legendList).range(a).padding(.4)},ie=()=>{ye();{let le=ot(Y||te.yMaxLeft,te.yMinLeft,F,e,te,Z,Y);L=T.axisLeft(y).tickFormat(B=>_e(B,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-J+0:0).tickValues(le.autoLabelFlag?void 0:le.yAxisLabelArray).ticks(le.customTickValue).tickPadding(8).tickSizeOuter(0)}m=T.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,H?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},ye=()=>{P=T.axisBottom(f).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.gridLinesVertical?-F:parseFloat(e.plotArea.ticksHeight)*(F/100)*(e.xAxisLabel.xAxisPosition=="1"?1:-1):0).tickSizeOuter(0).tickValues(Lt(te.legendList,J))},Pe=le=>{let B;if(be.forEach((U,R)=>U.forEach(v=>v.key=U.key)),Le){let U=Q.map(R=>R.legend);B=T.stack().keys(U)(Le),B.forEach((R,v)=>{B[v].color=Q[v].properties.color})}B&&B.forEach(U=>{U.forEach(R=>{R.Key=U.key})}),[0,1].forEach(U=>{if(U===1&&(be=B),be){let R=i.selectAll(`.parentGroup-${U}`).data([null]);R=R.enter().append("g").attr("class",`parentGroup parentGroup-${U}`).merge(R);let v=R.selectAll(`.bar-group-${U}`).data(be);v=v.enter().append("g").attr("class",`bar-group-${U}`).attr("fill",M=>M.color?M.color:m(M.key)!==we.white?m(M.key):"none").attr("opacity",M=>M.opacity).merge(v);let D=v.selectAll("rect").data(M=>M,M=>M.key||M.Key);const I=e.animation.animationEnabled,W=D.enter().append("rect").attr("class","rect").attr("class",M=>M.key?M.key.replace(/ /g,"-"):M.Key.replace(/ /g,"-")).attr("x",M=>f(H?M.data.xKey:M.data.dimension||M.data.legend)).attr("y",y(0)??0).attr("clip-path",`url(#${s}-clip)`).attr("height",0).attr("width",f.bandwidth()).attr("visibility",M=>U===0&&M.data.dimension&&Le?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(M,_)=>{const X=H?Aa.base:Aa.dimensionTotal,$={markerShape:"square",markerColor:_.key===X?e.plotArea.totalColor:_.key===Aa.down?e.plotArea.negativeColor:e.plotArea.positiveColor};st([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():_.properties?.currentMeasure?_.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(_.key===Aa.up?"+":_.key===Aa.down?"-":"")+_e(_.key===Aa.dimensionTotal?_.data.dimensionTotal:_[1]-_[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(H?_.key!==Aa.base?_.data.xKey:Aa.total:_.Key?_.Key.includes("~$~")?_.Key.split("~$~")[1]:_.Key:_.data.legend?_.data.legend.includes("~$~")?_.data.legend.split("~$~")[1]:_.data.legend:Aa.total).trim()||""}],e,void 0,$,ht(l,String(te.formattedDimensionListMap.get(H?_.data.xKey:_.data.dimension||_.data.legend)??(H?_.data.xKey:_.data.dimension||_.data.legend)??""),{...$,alias:_.properties?.alias??_.properties?.currentMeasure??String(_.Key??_.key??"")}))}).on("mouseout",()=>{rt()}).attr(Qe.SeriesId,M=>String(M.key??M.Key??"")).attr(Qe.DimValue,M=>String(H?M.data.xKey||"":M.data.dimension||M.data.legend||"")).on("click",At(p,S,(M,_)=>{const X=String(_.key??_.Key??""),$=String(H?_.data.xKey||"":_.data.dimension||_.data.legend||"");return{seriesId:X,dimValue:$,legendUniqueId:X,seriesDisplayName:X}}));if((I?W.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):W).attr("y",M=>M[1]?y(M[1]):0).attr("height",M=>M[1]?y(M[0])-y(M[1]):0),D.exit().remove(),D=W.merge(D),e.plotArea.plotAreaDataLabel=="2"&&U!=1){const M=v.selectAll("text").data($=>$),_=M.enter().append("text").text($=>_e($[1]-$[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",$=>f(H?$.data.xKey:$.data.dimension||$.data.legend)+f.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",$=>$[1]-$[0]!==0&&y($[1])?"visible":"hidden");(I?_.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):_).attr("y",$=>$[1]?y($[1])-15:0),M.exit().remove()}}}),i.selectAll(".parentGroup").raise()},Me=le=>{J=b-le.left-le.right,F=k-le.bottom-le.top},Ce=(le,B,U,R,v)=>{if(!e.plotArea.fitChart){const w=le[0].data.length-me,D=B-20;ae=te.dimensionList.slice(Fe,Fe+me),Ye(),Q=JSON.parse(JSON.stringify(le)),Q.forEach((C,M)=>Q[M].data=C.data.filter(_=>ae.includes(_.dimension))),ye(),U.append("rect").attr("x",R.left).attr("y",D).attr("width",v).attr("height",8).attr("fill","#ddd").attr("rx",4);const I=v*me/te.dimensionList.length,W=U.append("rect").attr("x",R.left).attr("y",D).attr("width",I).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",C=>{let M=Math.min(Math.max(C.x,R.left),R.left+v-I);W.attr("x",M),Fe=Math.round((M-R.left)/(v-I)*w),ae=te.dimensionList.slice(Fe,Fe+me),Ye(),Q=JSON.parse(JSON.stringify(le)),Q.forEach((_,X)=>Q[X].data=_.data.filter($=>ae.includes($.dimension))),ye(),ve()}));U.on("wheel",C=>{C.preventDefault();const M=Math.abs(C.deltaX)>Math.abs(C.deltaY)?C.deltaX:C.deltaY;Fe+=M>0?1:-1,Fe=Math.max(0,Math.min(Fe,w));const _=R.left+(v-I)*Fe/w;W.attr("x",_),Ye(),Q=JSON.parse(JSON.stringify(le)),Q.forEach((X,$)=>Q[$].data=X.data.filter(Se=>ae.includes(Se.dimension))),ye(),ve()})}ve()},ve=()=>{qt(i,te,z,e,d,y,P,ne,k,x,t,J,F,te.legendList,f),Pe()},he=()=>{try{if(g.length<1)return[];if(te.dimensionList.length<2)return[];let le=[],B=[],U=[],R="";if(R.length>1){let W=R;g.forEach(C=>{W===C.properties.currentLegend?B.push(C):U.push(C)})}B.length>0&&(Q=B);let v=0,w=0;for(let W=0;W<Q.length;++W)v=v+Q[W].data[0].value;let D="";for(let W=1;W<ae.length;++W){let C={};C.dimension=ae[W-1],C.total=v,C.base=0,C.dimensionTotal=v,C.up=0,C.down=0,le.push(C);for(let M=0;M<Q.length;++M){let _={};for(let X=0;X<M;X++)D=D+" ";w=Q[M].data[W].value-Q[M].data[W-1].value,w!==0&&(_.legend=D+Q[M].properties.legend,_.dimensionTotal=0,w<0?(_.base=v+w,_.down=-w,_.up=0,_.total=v-w):(_.base=v,_.down=0,_.up=w,_.total=v+w),v=v+w,le.push(_))}}let I={};return I.dimension=ae[ae.length-1],I.dimensionTotal=v,I.base=0,I.total=v,I.up=0,I.down=0,le.push(I),U.length>0&&(Q=U,Le=pt(ae,U,!1)),le}catch(le){throw le}},fe=le=>le==null||le===""?0:Number(le),de=le=>(le[0]?.Column1==""?le.filter(U=>U.Column1&&U.Column1!=="*"):o?le.Data:le).map(U=>({xKey:U.Column1||U.Dimension||U.Legend,base:fe(U.Column3||U.Total),up:fe(U.Column4||U.Up),down:fe(U.Column5||U.Down),total:fe(U.Column6||U.total),dimensionTotal:fe(U.Column2||U.Base)}));return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:u,id:s,style:{width:"100%",height:"100%"}})})},Nr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,onElementClick:n,vfxPickModeActive:l,tooltipFormatter:s})=>{const x=crypto.randomUUID();let m=0;const A=re.TornadoChart,u=r.IsadvanceanalyticsChart??r.IsCalCSensitivity,S=Te.useRef(),p=Te.useRef(n);p.current=n;const H=Te.useRef(l);H.current=l;let g=bt(r.ChartData,r.DimensionList,!0);g=Xl(g,r,u);const G=r.DimensionList,V=!0,j=!1,K=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe=[],me=0,te=2,ke=!1,ee={dimensionList:G,chartType:A,chartData:[],formatOptions:e,legendList:r.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{De()}catch(B){ge("Tornadochart","createTornadoChart",B)}},[e]);const De=()=>{({formatOptions:e,svg:i,width:b,height:k}=Ct(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ee.yMinLeft,ee.yMaxLeft,ee.yMinRight,ee.yMaxRight),{margin:N,yLabel:E,xLabel:z,yTitle:q,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:oe,secondaryAxisTitleWidth:xe,legendMargin:Ae,secondaryYLabel:pe,visibleBars:te,columnWidth:m,scrollbarVisible:ke}=vt(b,k,ue,O,ee.yMaxLeft,e,u?ee.legendList.map(B=>B.alias.split(" - ")[0]):ee.legendList.map(B=>B.alias),ee.dimensionList,ee.yMaxRight,j,K,t,!0,ee),ve(N),kt(i,b,k,e),y=Mt(i,N),mt(y,e,c,J,F,A),ie(),Me(),Ya(e,y,z,F,J,Q),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,d,m,f,a,L,void 0,void 0,c,A,e,E,q,ee.dimensionList,J,P,ee.formattedDimensionListMap,x,N,F)),St(e,V,i,N,z,k,ce,ee.chartType,E,J,F),Ft(F,e,c,V,i,N,q,E,J),Ut(i,j,N,e,c,F,J,pe,xe),wt(i,e,b,oe),Dt(k,i,ne,oe,b,Ae,e,Ve(g,ee.legendList,u,e),x,c,N,nt.rectangle),de(g,k,b,i,N,J,ke,te,ee,me,!1,he,V)},Ve=(B,U,R,v)=>B.map((w,D)=>{const I=U[D];if(!I)return{...w,properties:{}};let W=I.alias;R&&I.alias&&(W=I.alias.split(" - ")[0].trim());let C=I.color;return R&&W&&(W.includes("+ve")?C=v.plotArea.plotAreaCalculatedHigh:W.includes("-ve")&&(C=v.plotArea.plotAreaCalculatedLow)),{...w,properties:{...I,alias:W,color:C}}}).filter(w=>w.properties&&Object.keys(w.properties).length>0),Ye=()=>{let B;if(u)ee.chartData=g,ee.yMaxLeft=Math.min(...g.map(R=>R.data[0].value)),ee.yMaxRight=Math.max(...g.map(R=>R.data[0].value));else{const R=g[0]?.properties?.measureUniqueId;let v=0,w=-1/0;B=g.map((D,I)=>{const W=D.properties.measureUniqueId===R,C=D.data.map(_=>{const X=W?-Math.abs(_.value):Math.abs(_.value);return{..._,value:X}}),M=C.map(_=>_.value);return W?v=Math.min(v,Math.min(...M)):w=Math.max(w,Math.max(...M)),{...D,data:C}}),ee.chartData=B,ee.yMaxLeft=v,ee.yMaxRight=w}const U=t?gt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList):ee.dimensionList;ee.dimensionList.forEach((R,v)=>{ee.formattedDimensionListMap.set(R,U[v])}),Fe=JSON.parse(JSON.stringify(u?g:B)),g=Fe,Le=ee.dimensionList,e.plotArea.hideZeroValues&&(ee.hideZeroValues=!0)},ie=()=>{let B=ee.yMaxLeft,U=ee.yMaxRight,R=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,v,w=!1,D=!1;B>U?(v=B,w=!0):(v=U,D=!0);let I=e.annotation.annotationVisibility!="5"?B/v!==1?Math.abs(B/v)*100<10?3:0:Math.abs(U/v)*100<10?3:0:0,W=0,C=0;B<0&&U>0?(W=B*(1.2+(D?I:0)),C=U*(1.2+(w?I:0))):B>=0&&U>=0?(W=0,C=U*(1.2+(w?I:0))):B<=0&&U<=0?(W=B*(1.2+(D?I:0)),C=0):(W=B*1.2,C=U*1.2),W=Math.floor(W),C=Math.ceil(C),L=T.scaleLinear().domain([W,C]).range([R,J-R]),a=L,P=[0,J],ye()},ye=()=>{f=T.scalePoint().domain(Le).range([F,0]).padding(.5)},Pe=()=>{ae=T.axisLeft(f).tickSize(Pt(e,J-L(0),0)).tickSizeOuter(0).tickValues(Lt(Le,F)),be=T.axisRight(f).tickSize(Pt(e,L(0),0)).tickSizeOuter(0).tickValues(Lt(Le,J))},Me=()=>{Q=T.axisBottom(L).tickFormat(B=>_e(B,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision,!0)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.ticksHeight=="100"?-F:-e.plotArea.ticksHeight*(F/100):0).tickValues(ot(ee.yMaxRight,ee.yMaxLeft,F,e,ee,Z,Y,V,J).yAxisLabelArray).ticks(ot(Y||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,Y,V,J).customTickValue??J/30).tickPadding(8).tickSizeOuter(0)},Ce=()=>{y.selectAll(".parentGroup").remove();const B=e.plotArea.plotAreaCalculatedHigh,U=e.plotArea.plotAreaCalculatedLow,R=y.append("g").attr("class","parentGroup"),v=e.animation.animationEnabled,w=R.selectAll("rect").data(Fe.flatMap(I=>I.data.map(W=>({...W,legendText:u?I.legend.split("ve) - ")[1]?.trim()??I.legend:ee.dimensionList[0]==re.TornadoDefaultEntry?bi.default:I.legend.split("-")[1]?.trim()??I.legend,properties:I.properties})))).enter().append("rect").attr("class","rect").attr("y",I=>(I.legendText?f(I.legendText):f(re.TornadoDefaultEntry))-m/2).attr("height",m).attr("x",a(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",I=>I.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",I=>`${I.properties.stackBorderWidth}px`).attr("hoverId",I=>((u?I.legend.split(" - ")[0]:I.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",I=>I.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?I.properties.stackBorderColor:"none").style("fill",I=>u?I.value>0?B!==we.white?B:"none":U!==we.white?U:"none":I.properties.color).on("mousemove",(I,W)=>{st([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():r.IsCalCSensitivity?W.properties.currentMeasure.split("~$~")[1]:W.dimension},{key:"Legend",value:W.legendText},{key:"Value",value:_e(Math.abs(W.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,I,r.IsCalCSensitivity?W.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:W.properties,ht(s,String(ee.formattedDimensionListMap.get(W.legend)??W.legend??""),W.properties))}).on("mouseout",rt).attr(Qe.SeriesId,I=>String(I.properties?.legendUniqueId??"")).attr(Qe.DimValue,I=>String(I.legend??I.legendText??"")).on("click",At(H,p,(I,W)=>({seriesId:String(W.properties?.legendUniqueId??""),dimValue:String(W.legend??W.legendText??""),legendUniqueId:String(W.properties?.legendUniqueId??""),seriesDisplayName:String(W.properties?.alias||W.properties?.name||W.legendText||"")})));(v?w.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):w).attr("x",I=>I.value>=0?a(0):a(I.value)).attr("width",I=>Math.abs(a(I.value)-a(0)))},ve=B=>{J=b-B.left-B.right,F=k-B.bottom-B.top},he=(B,U,R)=>{Fe=U,Le=B,te=R,le()};function fe(B){const U=new Map;return B.forEach(R=>{let v=U.get(R.properties.legendUniqueId);if(v){let w=v.data??[];w.push(R.data[0]),U.set(R.properties.legendUniqueId,{...v,data:w})}else v={...R,data:[R.data[0]]},U.set(R.properties.legendUniqueId,v)}),U.size>0?Array.from(U.keys()).map(R=>U.get(R)):B}function de(B,U,R,v,w,D,I,W,C,M,_,X,$=!1){const Se=(ze,Ie,Oe,lt,ut)=>{try{if(ut&&(ze=M+ze),!C||!Array.isArray(C.dimensionList)||!Array.isArray(B))return;ze=ze==null?0:Number(ze),Ie=Ie==null?0:Number(Ie),Oe=Oe==null?0:Number(Oe),M=Ba(Math.round(ze),0,Math.max(0,Ie)),W=typeof W=="number"?W:0;const tt=M,Re=tt+W;let He=C.dimensionList.slice(tt,Re);const it=He[0]==re.TornadoDefaultEntry;let Je=JSON.parse(JSON.stringify(B||[]));Je=Je.filter(Ke=>it?!0:He.includes(Ke.legend.split(" - ")[1]));const Ze=w?.left??0,Ge=w?.top??0,Ee=Number(D)||0,Ne=Number(F)||0,Ue=Number(Oe)||0,xt=Ie===0?1:Ie;if($){const Ke=Ge+(Ne-Ue)*(Ie===0?0:M)/xt;lt&&typeof lt.attr=="function"&&lt.attr("y",Ke)}else{const Ke=Ze+(Ee-Ue)*(Ie===0?0:M)/xt;lt&&typeof lt.attr=="function"&&lt.attr("x",Ke)}X(He,Je,W)}catch(tt){typeof ge=="function"&&ge("ColumnChart","updateFromScrollPosition",tt)}};if(I){const ze=U-w.top-w.bottom,Ie=Math.max(0,G.length-W),Oe=U-8;v.append("rect").attr("id","scrollbarTrack").attr("x",$?R-8:w.left).attr("y",$?w.top:Oe).attr("width",$?8:D).attr("height",$?ze:8).attr("fill","#ccc");const lt=($?ze:D)*W/C.dimensionList.length,ut=v.append("rect").attr("x",$?R-8:w.left).attr("y",$?w.top:Oe).attr("width",$?8:lt).attr("height",$?lt:8).attr("fill","#999").style("cursor",$?"ns-resize":"ew-resize");ut.call(T.drag().on("drag",tt=>{if($){const He=(Ba(tt.y,w.top,w.top+ze-lt)-w.top)/(ze-lt)*(Ie||1);Se(He,Ie,lt,ut,!1),ut.attr("y",w.top+(ze-lt)*(Ie===0?0:M)/(Ie===0?1:Ie))}else{const He=(Ba(tt.x,w.left,w.left+D-lt)-w.left)/(D-lt)*(Ie||1);Se(He,Ie,lt,ut,!1),ut.attr("x",w.left+(D-lt)*(Ie===0?0:M)/(Ie===0?1:Ie))}})),v.on("wheel",tt=>{tt.preventDefault();const He=(Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?tt.deltaX:tt.deltaY)>0?1:-1;if(Se(He,Ie,lt,ut,!0),$){const it=w.top+(ze-lt)*(Ie===0?0:M)/(Ie===0?1:Ie);ut.attr("y",it)}else{const it=w.left+(D-lt)*(Ie===0?0:M)/(Ie===0?1:Ie);ut.attr("x",it)}})}else v.on("wheel",null);Se(0,0,0,null,!0)}const le=()=>{ye(),Pe(),Ua(e,y,z,F,J,ae,be,a,ee.yMaxLeft,Le,A,t,b,ne,m,f),Ce();const B=fe(Fe);Da(B??[],f,a,null,N,dt,[],[],e,A,k,b,J,Le,F,x,i,h,f,m,o,u,V,u)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:x,style:{width:"100%",height:"100%"}})})},Pr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l})=>{const s=crypto.randomUUID();let x=0;const m=re.DotPlot,A=Te.useRef(),u=bt(r.ChartData,r.DimensionList),S=r.DimensionList,p=!0,H=!1;let g=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V,j,K,Z,Y,N,E,z,q,ce,ne,oe,xe,Ae,pe,ue,O,J,F,b,k,d,c,i,y=[],f=0,a=2,L=!1,P=[];const ae=!1;let Q={dimensionList:S,chartType:m,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{be()}catch(Ce){ge("StackStackHorizontalBarchart","createDotPlot",Ce)}},[e]);const be=()=>{({formatOptions:e,svg:O,width:pe,height:ue}=Ct(A,e)),Le(),{maxNumberForPrimaryAxis:ne,maxNumberForSecondaryAxis:oe}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:V,yLabel:j,xLabel:K,yTitle:Z,xTitle:Y,dimensionHeightWidthArray:N,chartTitleHeight:E,secondaryAxisTitleWidth:z,legendMargin:q,secondaryYLabel:ce,visibleBars:a,columnWidth:x,scrollbarVisible:L}=vt(pe,ue,ne,oe,Q.yMaxLeft,e,Q.legendList,Q.dimensionList,Q.yMaxRight,H,ae,t,p,Q),De(V),kt(O,pe,ue,e),J=Mt(O,V),mt(J,e,0,xe,Ae,m),Fe(),te(),Ya(e,J,j,Ae,xe,d),St(e,p,O,V,K,ue,Y,Q.chartType,j,xe,Ae),Ft(Ae,e,0,p,O,V,Z,j),wt(O,e,pe,E),Dt(ue,O,N,E,pe,q,e,u,s,0,V,nt.rectangle,m,n),Bt(u,ue,pe,O,V,xe,L,a,Q,f,!1,Ve,p)},Le=()=>{const Ce=[],ve=[];let he=[],fe=-1/0,de=1/0,le=-1/0,B=1/0;u.forEach(U=>{ve.push(U.properties.legendUniqueId),U.data.forEach(R=>{Ce.push(R),fe=Math.max(fe,R.value),de=Math.min(de,R.value)})}),Q.chartData=Ce,Q.legendList=ve,Q.yMaxLeft=fe,Q.yMinLeft=de>0?0:de,Q.yMaxRight=le,Q.yMinRight=B,he=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(U=>U):Q.dimensionList,he=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(U=>U):Q.dimensionList,Q.dimensionList.forEach((U,R)=>{Q.formattedDimensionListMap.set(U,he[R]),Q.formattedDimensionListMap.set(U,he[R])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=Q.dimensionList:i=Q.dimensionList.slice(f,f+a),e.plotArea.hideZeroValues&&(Q.hideZeroValues=!0)},Fe=()=>{let Ce=ot(G||Q.yMaxLeft,Q.yMinLeft,Ae,e,Q,g,G,p,xe).yAxisLabelArray;Q.yMaxLeft=Ce[Ce.length-1],Q.yMinLeft=Ce[0],F=T.scaleLinear().domain([Q.yMinLeft>=0?g!==void 0&&!Number.isNaN(g)?g:0:Q.yMinLeft<0?Q.yMinLeft*1.1:Q.yMinLeft*.9,Q.yMaxLeft<=0?0:G!==void 0&&!Number.isNaN(G)?G:Q.yMaxLeft*1.1]).range([0,xe]),k=[Ae,0],me()},me=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,x]).paddingInner(Q.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),b=T.scalePoint().domain(i).range(k).padding(.5)},te=()=>{ke();{let Ce=ot(G||Q.yMaxLeft,Q.yMinLeft,Ae,e,Q,g,G,p,xe);d=T.axisBottom(F).tickFormat(ve=>_e(ve,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-Ae:0).tickValues(Ce.autoLabelFlag?void 0:Ce.yAxisLabelArray).ticks(Ce.customTickValue).tickPadding(8).tickSizeOuter(0)}},ke=()=>{c=T.axisLeft(b).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*xe*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(i,Ae))},ee=Ce=>{Ce.forEach(de=>{de.data.forEach(le=>{le.markerShape=de.properties.markerShape||"Circle",le.markerSize=de.properties.markerSize||6,le.markerColor=de.properties.markerColor||de.properties.color,le.alias=de.properties.alias,le.lineStyle=de.properties.lineStyle,le.lineWidth=de.properties.lineWidth,le.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const ve=T.group(Ce.flatMap(de=>de.data.map(le=>({...le,color:de.properties.color}))),de=>de.dimension),he=J.selectAll(".cleveland-line-group").data(Array.from(ve),([de])=>de);he.enter().append("g").attr("class","cleveland-line-group").append("line").merge(he.select("line")).attr("y1",([de])=>b(de)).attr("y2",([de])=>b(de)).attr("x1",([,de])=>F(Math.min(de[0]?.value??0,de[1]?.value??0))).attr("x2",([,de])=>F(Math.max(de[0]?.value??0,de[1]?.value??0))).attr("stroke",de=>de[1][0].lineColor).attr("stroke-width",de=>de[1][0].lineStyle!=="None"?de[1][0].lineWidth:0).attr("stroke-dasharray",de=>{switch(de[1][0].lineStyle){case yt.dotted:return"1,4";case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",de=>de[1][0].lineStyle===yt.dotted?sa.round:""),he.exit().remove(),Ce.forEach(de=>{let le=J.selectAll(".parentGroup").data([de],w=>w.properties.legendUniqueId);le=le.enter().append("g").attr("class","parentGroup").attr("hoverId",(de.properties.alias||de.properties.name||"Legend").replace(/\s+/g,"-")).merge(le);let B=le.selectAll(".column-group").data(de.data,w=>w.dimension),U=B.enter().append("g").attr("class","column-group");const R=e.animation.animationEnabled,v=U.append("path").attr("class","cleveland-dot").attr("opacity",R?0:.9);v.merge(B.select("path")).attr("d",w=>T.symbol().type($i(w.markerShape)).size((w.markerSize||6)*70)()).attr("transform",w=>{const D=F(w.value),I=b(w.dimension);return`translate(${D},${I})`}).attr("fill",w=>de.properties.color).attr("data-series-id",()=>de.properties.legendUniqueId??de.properties.alias).attr("data-dim-value",w=>String(w.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(w,D)=>{st([{key:e.xAxisTitle.xAxisTitleText,value:Q.formattedDimensionListMap.get(D.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:_e(D.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:D.alias}],e,w,de.properties,ht(l,String(D.dimension??""),{...de.properties,formattedDimensionValue:String(Q.formattedDimensionListMap.get(D.dimension)??D.dimension??"")}))}).on("mouseout",()=>{T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll(".halo").remove(),rt()}),R&&v.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("opacity",.9),B.exit().remove()}),J.selectAll(".parentGroup").raise()},De=Ce=>{xe=pe-Ce.left-Ce.right,Ae=ue-Ce.bottom-Ce.top},Ve=(Ce,ve,he)=>{y=ve,i=Ce,a=he,Ye()},Ye=()=>{me(),ke(),Ua(e,J,K,Ae,xe,c,void 0,F,Q.yMaxLeft,i,m,t,pe,N,x,b),ie(),ee(y),Da(y,b,F,void 0,V,dt,[],[],e,m,ue,pe,xe,i,Ae,s,O,h,b,x,o,!1,p),ye()},ie=()=>{let Ce=pt(i,y,ae);P=T.stack().keys(Q.legendList).offset(T.stackOffsetDiverging)(Ce),y.forEach((he,fe)=>he.data.forEach((de,le)=>{de[0]=P[fe][le][0],de[1]=P[fe][le][1]}));let ve=e.annotation.annotationSetLabelColor;P.forEach((he,fe)=>he.forEach(de=>{de.key=he.key,he.color=JSON.parse(JSON.stringify(u[fe].properties.color)),de.data.labelPosition=u[fe].properties.dataLabelPosition,de.data.labelColor=ve=="2"?JSON.parse(JSON.stringify(u[fe].properties.color)):u[fe].properties.labelColor,de.hideZero=JSON.parse(JSON.stringify(u[fe].properties.hideZeroValues))}))},ye=()=>{try{const Ce=Number(e.connector?.connectorVisibility);if(!e.connector||Ce===2)return;const ve=[],he=[],fe=[];let de;const le=[];if(Ce===1)de=1;else if(Ce===3){const I=Number(e.connector.connectorFollow);I===1?de=Number(e.connector.connectorStepSize):I===2&&((e.connector.connectorExclude||[]).forEach(W=>fe.push(W)),de=1)}const B=[],U=[],R=[],v=e.connector?.connectorCustomRange||[];fe.forEach(I=>{const W=I.split("-");W.length&&B.push(W[0])});const D=(P?.[0]||[]).map((I,W)=>({Dimension:I.data.Dimension,Total:I.data.Total,CustomTotal:I.data.Total-(R[W]??0),Index:W}));if(de!=null){for(let I=0;I<D.length;I++)(de===1||I%de===0&&de!==1)&&ve.push(D[I]);for(let I=de;I<D.length;I+=de){const W=Math.min(I+de,D.length);let C=-1/0;for(let M=I;M<W;M++)D[M].Total>C&&(C=D[M].Total);C!==-1/0&&le.push(C)}for(let I=1;I<ve.length;I++)he.push(ve[I])}else{const I=[];(v||[]).forEach(W=>{if(W?.from&&W?.to){const C=D.some(_=>_.Dimension===W.from),M=D.some(_=>_.Dimension===W.to);C&&M&&I.push({from:W.from,to:W.to})}}),I.forEach(W=>{const C=D.findIndex(_=>_.Dimension===W.from),M=D.findIndex(_=>_.Dimension===W.to);if(C>=0&&M>=0){const _=Math.min(C,M),X=Math.max(C,M);ve.push(D[_]);let $=D[_]?.Total??-1/0;for(let Se=_;Se<=X;Se++)D[Se].Total>$&&($=D[Se].Total);$!==-1/0&&le.push($),he.push(D[X])}})}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!==we.white?e.connector.connectorMarkerColor:"none"),Pe(ve,le,he,de,B),Me(ve,le,he,de,B)}catch(Ce){console.error(Ce)}},Pe=(Ce,ve,he,fe,de)=>{try{J.append("g").selectAll("path").data(Ce).enter().filter((le,B)=>fe!=null?B<Ce.length-1:B<Ce.length).append("path").attr("d",(le,B)=>e.total.totalVisibility?`M ${F(le.Total)+50},
260
- ${b(le.Dimension)+b.bandwidth()/2-5}
261
- H ${60+Math.max(F(ve[B]),F(he[B].Total),F(le.Total))}
262
- V ${b(he[B].Dimension)+b.bandwidth()/2+5}
263
- H ${30+F(he[B].Total)}`:`M ${F(le.Total)+30},
264
- ${b(le.Dimension)+b.bandwidth()/2-5}
265
- H ${45+Math.max(F(ve[B]),F(he[B].Total),F(le.Total))}
266
- V ${b(he[B].Dimension)+b.bandwidth()/2+5}
267
- H ${10+F(he[B].Total)}
268
- `).style("stroke",e.connector.connectorLineColor!==we.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",le=>de.includes(le.Dimension)||le.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(le){console.error(le)}},Me=(Ce,ve,he,fe,de)=>{try{let le=e.connector.connectorFontStyle,B=e.connector.connectorNumberFormat,U=Ae/30<i.length?Math.round(Ae/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(B=".2s"),J.append("g").selectAll("text1").data(Ce).enter().filter((R,v)=>fe!=null?v<Ce.length-1:v<Ce.length).append("text").attr("y",(R,v)=>fe==null?b(he[v].Dimension)/2+b(R.Dimension)/2+15:fe==1?U<6&&b.bandwidth()>40?b(he[v].Dimension)+b.bandwidth()/2+b.bandwidth()/2+13:b(he[v].Dimension)+b.bandwidth()/2+b.bandwidth()/2+7:b(he[v].Dimension)+b.bandwidth()/2+b.bandwidth()/2*fe+12).attr("x",(R,v)=>e.total.totalVisibility?70+Math.max(F(ve[v]),F(he[v].Total),F(R.Total)):50+Math.max(F(ve[v]),F(he[v].Total),F(R.Total))).text((R,v)=>(R.CustomTotal==0&&he[v].CustomTotal!=0&&(R.CustomTotal=1),hi(he[v].Total,R.Total,parseInt(e.connector.connectorDecimalPrecision),B,parseInt(R.Dimension),parseInt(he[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!==we.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",le.includes("Italic")?"Italic":"").style("text-decoration",le.includes("Underline")?"Underline":"").style("font-weight",le.includes("Bold")?"Bold":"").style("visibility",R=>de.includes(R.Dimension)||R.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(le){console.error(le)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:A,id:s,style:{width:"100%",height:"100%"}})})},Kt=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function xa(t,e=1){const r=t.replace("#",""),o=parseInt(r.substring(0,2),16),h=parseInt(r.substring(2,4),16),n=parseInt(r.substring(4,6),16);return isNaN(o)||isNaN(h)||isNaN(n)?t:`rgba(${o},${h},${n},${e})`}function al(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function pa(t,e,r,o=Kt){const{ChartData:h,DimensionList:n,LegendList:l}=t,s=n?.length?n:h[0]?.data?.map(m=>m.dimension)??[],x=Number(r.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?Er(h,s,x,o,l):e==="scatter"?Rr(h,o):e==="bubble"?zr(h,o):Ir(h,s,e,r,x,o)}function Ir(t,e,r,o,h,n){const l=t.map((s,x)=>{const m=s.properties?.color??n[x%n.length],A=s.properties?.opacity??1,u=new Map;s.data?.forEach(G=>u.set(G.dimension,G.value));const S=e.map(G=>u.get(G)??0),p=s.Axis==="Secondary"||s.properties?.axis==="Secondary"?"y1":"y",H=Number(s.properties?.lineWidth??o.plotArea?.lineWidth??2);return r==="line"||r==="area"?{type:"line",label:s.properties.alias,data:S,borderColor:m,backgroundColor:r==="area"?xa(m,h*A):xa(m,.1),fill:r==="area",borderWidth:H,borderDash:al(s.properties?.lineStyle),pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3,tension:Number(o.cjsOptions?.cjsTension??.4),yAxisID:p}:r==="radar"?{label:s.properties.alias,data:S,borderColor:m,backgroundColor:xa(m,h*A),fill:!0,borderWidth:H,pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3}:{type:"bar",label:s.properties.alias,data:S,backgroundColor:xa(m,h*A),borderColor:m,borderWidth:Number(s.properties?.stackBorderWidth??0),borderRadius:Number(o.cjsOptions?.cjsBorderRadius??o.plotArea?.cornerRadius??0),yAxisID:p}});return{labels:e,datasets:l}}function Er(t,e,r,o,h){const l=(t.length?t:[]).map(s=>{const x=e.map(A=>s.data?.find(S=>S.dimension===A)?.value??0),m=e.map((A,u)=>{const S=h?.[u]?.color;return xa(S??o[u%o.length],r)});return{label:s.properties.alias,data:x,backgroundColor:m,borderColor:m.map(A=>A.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:l}}function Rr(t,e){return{datasets:t.map((o,h)=>{const n=o.properties?.color??e[h%e.length],l=o.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||h,y:s.value??0}))??[];return{label:o.properties.alias,data:l,backgroundColor:xa(n,.7),borderColor:n,pointRadius:5}})}}function zr(t,e){return{datasets:t.map((o,h)=>{const n=o.properties?.color??e[h%e.length],l=o.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||h,y:s.value??0,r:Number(s.markerSize??o.properties?.markerSize??8)}))??[];return{label:o.properties.alias,data:l,backgroundColor:xa(n,.6),borderColor:n}})}}function ti(t,e,r,o=Kt){const{ChartData:h,DimensionList:n}=t,l=n?.length?n:h[0]?.data?.map(A=>A.dimension)??[],s=new Map;l.forEach(A=>{const u=h.reduce((S,p)=>{const H=p.data?.find(g=>g.dimension===A);return S+Math.abs(H?.value??0)},0);s.set(A,u)});const x=Number(r.plotArea?.fillOpacity??.8),m=h.map((A,u)=>{const S=A.properties?.color??o[u%o.length],p=A.properties?.opacity??1,H=new Map;A.data?.forEach(V=>H.set(V.dimension,V.value));const g=l.map(V=>{const j=H.get(V)??0,K=s.get(V)??0;return K>0?parseFloat((j/K*100).toFixed(4)):0}),G=Number(A.properties?.lineWidth??r.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:A.properties.alias,data:g,borderColor:S,backgroundColor:e==="area"?xa(S,x*p):xa(S,.1),fill:e==="area",borderWidth:G,borderDash:al(A.properties?.lineStyle),pointRadius:r.marker?.markerVisibility?Number(r.marker?.markerSize??4):3,tension:Number(r.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:A.properties.alias,data:g,backgroundColor:xa(S,x*p),borderColor:S,borderWidth:Number(A.properties?.stackBorderWidth??0),borderRadius:Number(r.cjsOptions?.cjsBorderRadius??r.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:l,datasets:m}}function Ra(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function ai(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function $r(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function Yr(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function il(t,e,r){const o=parseInt(r??"0",10);return e==="Thousands"?(t/1e3).toFixed(o)+"K":e==="Millions"?(t/1e6).toFixed(o)+"M":e==="Billions"?(t/1e9).toFixed(o)+"B":t.toFixed(o)}function Ur(t,e){return t.find(r=>r.alias==e)}function Zt(t,e,r=!1,o,h){const n=e==="pie"||e==="doughnut"||e==="polarArea",l=e==="horizontalBar";let s=0;const x=300,m=t.plotArea?.gridLinesColor??"#e0e0e0",A=t.legends?.legendFontColor??"#333333",u={responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!1},legend:{display:t.legends?.legendVisibility!==!1&&t.legends?.legendPosition!=="None",position:Yr(t.legends?.legendPosition),labels:{color:A,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??qe,style:Ra(t.legends?.legendFontStyle),weight:ai(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,p,H){if(o){const g=new Date().getTime();if(g-s<x){const V=Ur(h,p.text);V&&o(V),s=0}else s=g}}},tooltip:{enabled:t.toolTip?.toolTipVisibility!==!1,backgroundColor:t.toolTip?.toolTipTheme==="Dark"?"#222222":"#ffffff",titleColor:t.toolTip?.toolTipTheme==="Dark"?"#ffffff":"#333333",bodyColor:t.toolTip?.toolTipTheme==="Dark"?"#cccccc":"#555555",borderColor:m,borderWidth:1,padding:10,callbacks:{label(S){const p=typeof S.raw=="number"?S.raw:S.raw?.y??0,H=_e(p,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${H}`}}},datalabels:Br(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:$r(t.animation?.animationEffect)}:!1};if(!n){const S={display:!0,title:{display:t.xAxisTitle?.xAxisTitleVisibility!==!1,text:t.xAxisTitle?.xAxisTitleText??"Dimension",color:t.xAxisTitle?.xAxisTitleColor??"#000000",font:{size:parseInt(t.xAxisTitle?.xAxisTitleFontSize??"11",10),family:t.xAxisTitle?.xAxisTitleFontFamily??qe,style:Ra(t.xAxisTitle?.xAxisTitleFontStyle)}},ticks:{display:t.xAxisLabel?.xAxisLabelVisibility!==!1,color:t.xAxisLabel?.xAxisLabelColor??"#000000",font:{size:parseInt(t.xAxisLabel?.xAxisLabelFontSize??"11",10),family:t.xAxisLabel?.xAxisLabelFontFamily??qe,style:Ra(t.xAxisLabel?.xAxisLabelFontStyle),weight:ai(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:m},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")}},p={display:!0,position:"left",title:{display:t.yAxisTitle?.yAxisTitleVisibility!==!1,text:t.yAxisTitle?.yAxisTitleText??"Measure",color:t.yAxisTitle?.yAxisTitleColor??"#000000",font:{size:parseInt(t.yAxisTitle?.yAxisTitleFontSize??"11",10),family:t.yAxisTitle?.yAxisTitleFontFamily??qe,style:Ra(t.yAxisTitle?.yAxisTitleFontStyle)}},ticks:{display:t.yAxisLabel?.yAxisLabelVisibility!==!1,color:t.yAxisLabel?.yAxisLabelColor??"#000000",font:{size:parseInt(t.yAxisLabel?.yAxisLabelFontSize??"11",10),family:t.yAxisLabel?.yAxisLabelFontFamily??qe,style:Ra(t.yAxisLabel?.yAxisLabelFontStyle),weight:ai(t.yAxisLabel?.yAxisLabelFontStyle)},callback(g){return il(g,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)}},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")}};l?(u.scales={x:{...p,position:"bottom"},y:{...S,position:"left",reverse:!0}},u.scales.x.title&&(u.scales.x.title.text=t.yAxisTitle?.yAxisTitleText??"Measure"),u.scales.y.title&&(u.scales.y.title.text=t.xAxisTitle?.xAxisTitleText??"Dimension")):u.scales={x:S,y:p},r&&(u.scales.y1={display:!0,position:"right",title:{display:t.secondaryYAxisTitle?.secondaryYAxisTitleVisibility!==!1,text:t.secondaryYAxisTitle?.secondaryYAxisTitleText??"",color:t.secondaryYAxisTitle?.secondaryYAxisTitleColor??"#000000",font:{size:parseInt(t.secondaryYAxisTitle?.secondaryYAxisTitleFontSize??"11",10),family:t.secondaryYAxisTitle?.secondaryYAxisTitleFontFamily??qe}},ticks:{display:t.secondaryYAxisLabel?.secondaryYAxisLabelVisibility!==!1,color:t.secondaryYAxisLabel?.secondaryYAxisLabelColor??"#000000",font:{size:parseInt(t.secondaryYAxisLabel?.secondaryYAxisLabelFontSize??"11",10),family:t.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily??qe,style:Ra(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:ai(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(g){return il(g,t.secondaryYAxisLabel?.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel?.secondaryYAxisLabelDecimalPrecision)}},grid:{drawOnChartArea:!1},border:{color:t.secondaryYAxisLabel?.secondaryYAxisColor??"#000000",width:parseFloat(t.secondaryYAxisLabel?.secondaryYAxisWidth??"0.5")}}),e.toLowerCase().includes("stack")&&(u.scales?.x&&(u.scales.x.stacked=!0),u.scales?.y&&(u.scales.y.stacked=!0))}return u}function ll(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 Br(t,e="bar"){const r=t.annotation,o=e==="pie"||e==="doughnut"||e==="polarArea",h=e==="horizontalBar",n=r?.annotationVisibility??"5";if(n==="5"||!n)return{display:!1};const l=r?.annotationPosition??"1",s=r?.annotationHideZeroValues!==!1,x=parseInt(r?.annotationFontSize??"9",10)||9,m=r?.annotationFontFamily??qe,A=Ra(r?.annotationFontStyle),u=ai(r?.annotationFontStyle),S=r?.annotationColor??"#000000",p=r?.annotationSetLabelColor==="2",H=r?.annotationDecimalPrecision??"2",g=r?.annotationNumberFormat??",",G=r?.annotationDisplayUnits??"None";function V(N){const E=N.dataset?.data?.length??0,z=N.dataIndex??0;switch(n){case"1":return!0;case"2":return z===0;case"3":return z===E-1;case"4":return z===0||z===E-1;default:return!1}}function j(N){const E=N.dataset?.data?.[N.dataIndex];return ll(E)}function K(N){if(o)return l==="2"?"center":"end";const E=j(N);switch(l){case"2":return"center";case"3":return E<0?"end":"start";case"1":return E>0?"end":"start";case"4":default:return E>0?"end":"start"}}function Z(N){if(o)return l==="2"?"center":"end";const E=j(N);if(h)switch(l){case"2":return"center";case"3":return"right";case"1":case"4":default:return E<0?"left":"right"}switch(l){case"2":return"center";case"3":return E>0?"top":"bottom";case"1":case"4":default:return E<0?"bottom":"top"}}function Y(N,E){const z=ll(N);if(s&&z===0)return null;const q=_e(z,G,g,H);if(o){const ce=E?.chart?.data?.labels?.[E.dataIndex]??"";return ce?`${ce}
269
- ${q}`:q}return q}return{display:V,anchor:K,align:Z,offset:o?l==="2"?0:8:l==="2"?0:4,color:p?N=>{const E=N.dataset?.backgroundColor,z=N.dataset?.borderColor,q=Array.isArray(E)?E[N.dataIndex]:E;return typeof q=="string"&&q?q:typeof z=="string"&&z?z:S}:S,font:{size:x,family:m,style:A,weight:u},formatter:Y,clip:!1}}ft.Chart.register(ft.BarController,ft.LineController,ft.PieController,ft.DoughnutController,ft.ScatterController,ft.BubbleController,ft.RadarController,ft.PolarAreaController,ft.CategoryScale,ft.LinearScale,ft.RadialLinearScale,ft.PointElement,ft.BarElement,ft.LineElement,ft.ArcElement,ft.Title,ft.Tooltip,ft.Legend,ft.Filler,pl);const Xt=({chartType:t,data:e,options:r,formatOptions:o,clientWidth:h,clientHeight:n,className:l,isChartStacked:s})=>{const x=Te.useRef(null),m=Te.useRef(null),A=Te.useRef(!1);Te.useEffect(()=>{if(x.current)return m.current?.destroy(),m.current=new ft.Chart(x.current,{type:t,data:e,options:r}),A.current=!0,()=>{m.current?.destroy(),m.current=null}},[t,s]),Te.useEffect(()=>{if(A.current){A.current=!1;return}const j=m.current;j&&(j.data=e,j.options=r,j.update())},[e,r]);const u=o.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(o.chartTitle?.chartTitleFontStyle)?o.chartTitle.chartTitleFontStyle:[],p=o.chartTitle?.chartTitleColor&&o.chartTitle.chartTitleColor!=="#ffffff"&&o.chartTitle.chartTitleColor!=="#FFFFFF00"?o.chartTitle.chartTitleColor:"rgba(119,119,119)",H=o.chartTitle?.chartTitleFontSize?`${o.chartTitle.chartTitleFontSize}px`:"16px",g=o.chartTitle?.dynamicTitleText||o.chartTitle?.chartTitleText||"",G=o.chartTitle?.chartTitleHTML||g,V=o.chartTitle?.chartTitleVisibility!==!1;return $e.jsxs("div",{className:l,style:{width:"100%",height:"100%",backgroundColor:u,position:"relative",display:"flex",flexDirection:"column"},children:[V&&g&&$e.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:o.chartTitle?.chartTitleText,style:{color:p,fontSize:H,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:G}}),$e.jsx("div",{style:{flex:1,minHeight:0},children:$e.jsx("canvas",{ref:x,style:{width:"100%",height:"100%"}})})]})},rl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Te.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"bar",x,l,s);return h&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"bar",data:m,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Wr=t=>$e.jsx(rl,{...t,isChartStacked:!0}),nl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n=Kt,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Te.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"horizontalBar",x,l,s);return u.indexAxis="y",h&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"bar",data:m,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Hr=t=>$e.jsx(nl,{...t,isChartStacked:!0}),sl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n=Kt,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Te.useMemo(()=>pa(t,"line",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"line",x,l,s);return h&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"line",data:m,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Gr=t=>$e.jsx(sl,{...t,isChartStacked:!0}),ol=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Te.useMemo(()=>pa(t,"area",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"area",x,l,s);return h&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"line",data:m,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},_r=t=>$e.jsx(ol,{...t,isChartStacked:!0}),jr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"pie",e,h),[t,e,h]),x=Te.useMemo(()=>Zt(e,"pie",!1,n,l),[e]);return $e.jsx(Xt,{chartType:"pie",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Jr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"doughnut",e,h),[t,e,h]),x=Te.useMemo(()=>{const m=Zt(e,"doughnut",!1,n,l),A=e.plotArea?.innerRadius;return A!=null&&(m.cutout=`${A}%`),m},[e]);return $e.jsx(Xt,{chartType:"doughnut",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Zr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt})=>{const n=Te.useMemo(()=>pa(t,"scatter",e,h),[t,e,h]),l=Te.useMemo(()=>Zt(e,"scatter",!1),[e]);return $e.jsx(Xt,{chartType:"scatter",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:o})},Xr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(m=>m.properties),[t]),s=Te.useMemo(()=>pa(t,"bubble",e,h),[t,e,h]),x=Te.useMemo(()=>Zt(e,"bubble",!1,n,l),[e]);return $e.jsx(Xt,{chartType:"bubble",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},qr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt})=>{const n=Te.useMemo(()=>pa(t,"radar",e,h),[t,e,h]),l=Te.useMemo(()=>{const s=Zt(e,"radar",!1);return delete s.scales,s.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0"},ticks:{color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe}},pointLabels:{color:e.xAxisLabel?.xAxisLabelColor??"#333333",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"11",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe}}}},s},[e]);return $e.jsx(Xt,{chartType:"radar",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:o})},Kr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"polarArea",e,h),[t,e,h]),x=Te.useMemo(()=>{const m=Zt(e,"polarArea",!1,n,l);delete m.scales;const A=e.xAxisLabel?.xAxisLabelFontStyle,u=Array.isArray(A)?A.includes("Italic")||A.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??qe,style:u?"italic":"normal"}}}},m},[e]);return $e.jsx(Xt,{chartType:"polarArea",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Qr=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"bar",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=Te.useMemo(()=>{const A=Zt(e,"bar",!1,n,l);return A.scales??={},A.scales.x??={},A.scales.y??={},A.scales.x.stacked=!0,A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"bar",data:s,options:m,formatOptions:e,clientWidth:r,clientHeight:o})},Or=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"horizontalBar",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=Te.useMemo(()=>{const A=Zt(e,"horizontalBar",!1,n,l);return A.indexAxis="y",A.scales??={},A.scales.x??={},A.scales.y??={},A.scales.x.stacked=!0,A.scales.y.stacked=!0,A.scales.x.min=x?-100:0,A.scales.x.max=100,A.scales.x.ticks={...A.scales.x.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"bar",data:s,options:m,formatOptions:e,clientWidth:r,clientHeight:o})},en=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"line",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=Te.useMemo(()=>{const A=Zt(e,"line",!1,n,l);return A.scales??={},A.scales.y??={},A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"line",data:s,options:m,formatOptions:e,clientWidth:r,clientHeight:o})},tn=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"area",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=Te.useMemo(()=>{const A=Zt(e,"area",!1,n,l);return A.scales??={},A.scales.y??={},A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"line",data:s,options:m,formatOptions:e,clientWidth:r,clientHeight:o})};We.AreaChart=yr,We.BubbleChart=wr,We.CJSAreaChart=ol,We.CJSBubbleChart=Xr,We.CJSColumnChart=rl,We.CJSDonutChart=Jr,We.CJSHorizontalBarChart=nl,We.CJSLineChart=sl,We.CJSNormalizedStackAreaChart=tn,We.CJSNormalizedStackColumnChart=Qr,We.CJSNormalizedStackHorizontalBarChart=Or,We.CJSNormalizedStackLineChart=en,We.CJSPieChart=jr,We.CJSPolarAreaChart=Kr,We.CJSRadarChart=qr,We.CJSScatterChart=Zr,We.CJSStackAreaChart=_r,We.CJSStackColumnChart=Wr,We.CJSStackHorizontalBarChart=Hr,We.CJSStackLineChart=Gr,We.CJS_DEFAULT_COLORS=Kt,We.ChartJSWrapper=Xt,We.ColumnChart=ql,We.ColumnHistogramChart=ar,We.CustomColumnChart=Kl,We.DonutChart=br,We.DotPlot=Pr,We.HorizontalBarChart=nr,We.HorizontalHistogramChart=dr,We.LayeredColumnChart=Ql,We.LayeredHorizontalBarChart=cr,We.LineChart=ir,We.Maps=Sr,We.NormalizedStackAreaChart=hr,We.NormalizedStackColumnChart=er,We.NormalizedStackHorizontalBarChart=or,We.NormalizedStackLineChart=rr,We.OrganizationChart=Fr,We.PieChart=pr,We.PieofPie=Ar,We.ProgressChart=mr,We.PyramidChart=Lr,We.RadialBarChart=Tr,We.SankeyChart=Cr,We.ScatterChart=Dr,We.Speedometer=fr,We.StackAreaChart=ur,We.StackColumnChart=Ol,We.StackHorizontalBarChart=sr,We.StackLineChart=lr,We.TornadoChart=Nr,We.Treemap=gr,We.VennChart=kr,We.WaterfallChart=Vr,We.WordCloud=vr,We.hexToRgba=xa,We.mapFormatOptionsToChartJS=Zt,We.transformToChartJSData=pa,We.transformToNormalizedChartJSData=ti,Object.defineProperty(We,Symbol.toStringTag,{value:"Module"})}));
259
+ </div>`}catch(P){return be(na,"drawOrganizationChart.buttonContent",P),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,m)=>20).duration(0).setActiveNodeCentered(!1).data(c).compact(!1).expandAll().fit(!1).render()}catch(d){be(na,"drawOrganizationChart",d)}},w=c=>{try{let d;if(c.data.styleObject)return s.nodes.percentageVisibility?d=c.data.styleObject.nodeHeight*10+10:d=c.data.styleObject.nodeHeight*10,d}catch(d){be(na,"calculateNodeHeight",d)}},p=(c,d)=>{try{let i={};d?i=c.data:i=c;let y,f;if(s.nodes.nodesLabelVisibility?f=50:f=20,i.styleObject)return s.nodes.nodesLabelOverflow?i.id==0?y=i.styleObject.nodeWidth*10+50:y=i.styleObject.nodeWidth*10:y=f+C(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,y}catch(i){be(na,"calculateNodeWidth",i)}},C=c=>{try{let d=c.split("-");return d[d.length-1]}catch(d){be(na,"getLabelText",d)}};return $e.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[$e.jsx("svg",{id:h,className:"chartSVG",style:{width:"100%",height:"100%"},ref:n}),$e.jsx("div",{id:`floating-div${h}`,className:"floatingDiv",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"auto"},children:$e.jsx("svg",{id:`floating-${h}`,className:"chartSVG",ref:l})})]})},Fr=({data:t,formatOptions:e,chartId:r,addLocalFilterFromLib:o,onElementClick:h,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=Te.useRef(h);s.current=h;const x=Te.useRef(n);x.current=n;const L=new Map((t.ChartData??[]).map((ce,me)=>[ce.legend,me]));let A=t.LegendList;const u=Te.useRef();let S,b=[0,0];const _=le.BubbleChart;let g,H,D=40,j=Ht,K,J,U,V,N=[],$=[],X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a;Te.useEffect(()=>{m()},[e,t,r]);const m=()=>{({chartFormatOptions:S,svg:V,width:g,height:H}=Jt(u,e)),b=Ia(S,A??[],"alias"),t=ke(t),Q(),{longestMeasure:c,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=_i(S,re,oe),{longestDimension:q,customXaxisIntervalValue:w,customXaxisMaxValue:p,customXaxisMinValue:C}=ji(S,X,se),{margins:j,yLabel:he,xLabel:Le,yTitle:pe,xTitle:ue,chartTitleHeight:D,legendMargin:O,innerHeight:K,innerWidth:J}=Gi(g,H,c,S,q,b),jt(u,g,H,S),U=la(V,j),mt(U,e,0,J,K,_),_t(u,D,g,S),Ae(),ge(),we(),Ji(e,!1,V,j,Le,H,ue,"Bubble",he,J,K),Zi(K,e,0,!1,V,j,pe,he),fe(),ae(),P(),Oi(V,S.legends.legendPosition,S,H,g,j,K,ue,Le,t.length)},P=()=>{try{let ce=5,me=30,Ve={minimumValue:re,maximumValue:oe};const Ye=U.append("g").attr("class","circles").attr("class","parentGroup"),te=S.animation.animationEnabled,de=Ye.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",Pe=>Pe.legendName.replace(/ /g,"-")).attr("fill",Pe=>Pe.legendColor!==De.white?Pe.legendColor:"none").append("path").attr("class","path").attr("id",function(Pe,Ce){T.select(this).attr("d",T.symbol().type(T.symbolCircle).size(ie(ce,me,Ve,Pe.measure,10)*et(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(Pe){return`translate(${f(Pe.dimension)}, ${a(Pe.measure)})`}).attr(Qe.SeriesId,Pe=>`${L.get(Pe.legendName)}_${Pe.legendName}`).attr(Qe.DimValue,Pe=>String(Pe.dimension)).attr("opacity",te?0:S.plotArea.fillOpacity).style("visibility",(Pe,Ce)=>Pe.dimension[0]===0||Pe.measure===0&&S.plotArea.hideZeroValues||Pe.dimension<C||Pe.dimension>p||Pe.measure<y||Pe.measure>i?"hidden":"visible").on("click",At(x,s,(Pe,Ce)=>({seriesId:`${L.get(Ce.legendName)}_${Ce.legendName}`,dimValue:String(Ce.dimension),legendUniqueId:`${L.get(Ce.legendName)}_${Ce.legendName}`,seriesDisplayName:Ce.legendName}))).on("mousemove",(Pe,Ce)=>{ot([{key:S.xAxisTitle.xAxisTitleText,value:je(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(Ce.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:je(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(Ce.measure)},{key:"Legend",value:Ce.legendName}],S,Pe,{alias:Ce.legendName},ht(l,String(Ce.dimension),{alias:Ce.legendName}))}).on("mouseout",()=>{rt()});te&&de.transition().duration(S.animation.animationDuration).ease(Xe[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(ce){be("BubbleChart","initCircles",ce)}};function ie(ce,me,Ve,Ye,te){try{if(Ye==null)return te;var de=Ve.minimumValue,Pe=Ve.maximumValue,Ce=me*me*2*Math.PI,Me=ce*ce*2*Math.PI,ve=te;if(de==Pe)ve=me;else{var xe=Ye,Fe=(xe-de)/(Pe-de)*(Ce-Me)+Me;Fe<Me&&(Fe=Me),ve=Math.sqrt(Fe/(Math.PI*2))}return ve}catch(ye){return be("BubbleChart","getBubbleSize",ye),te}}const Q=()=>{try{N=[],$=[],re=void 0,oe=void 0,X=void 0,se=void 0,t.forEach(ce=>{ce.measureName&&(N.push(ce.measure),(ce.measure<re||re===void 0)&&(re=ce.measure),(ce.measure>oe||oe===void 0)&&(oe=ce.measure)),ce.dimensionName&&($.push(ce.dimension),(ce.dimension<X||X===void 0)&&(X=ce.dimension),(ce.dimension>se||se===void 0)&&(se=ce.dimension))})}catch(ce){be("BubbleChart","iterateOverChartData",ce)}},Ae=()=>{try{let ce=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):X>0?0:X*1.1,me=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):se*1.1,Ve=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):re>0?0:re*1.1,Ye=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):oe*1.1;f=T.scaleLinear().domain([ce,me]).range([0,J]),a=T.scaleLinear().domain([Ve,Ye]).range([K,0])}catch(ce){be("BubbleChart","initScale",ce)}},ge=()=>{try{let{xAxisLabelArray:ce,customTickValue:me,autoLabelFlag:Ve}=hi(se,X,J,e,C,p,J,!1);const Ye=T.axisBottom(f).tickFormat(je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(ia(e,K,0,!0)).tickValues(ce.length>0?ce:null).ticks(me).tickPadding(8).tickSizeOuter(0);Ki(U,S,0,Le,Ye,K,J,j,a)}catch(ce){be("BubbleChart","drawXAxis",ce)}},we=()=>{try{let{yAxisLabelArray:ce,customTickValue:me}=Xi(oe,re,K,e,y,i);const Ve=T.axisLeft(a).tickFormat(je(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(Pt(e,J)).tickValues(ce.length>0?ce:null).ticks(me).tickPadding(8).tickSizeOuter(0);qi(U,S,0,he,Ve,K)}catch(ce){be("BubbleChart","drawYAxis",ce)}},fe=()=>{try{if(S.plotArea.xCoordinate!=Yt.None){let ce;switch(S.plotArea.xCoordinate){case Yt.Mean:ce=T.mean(t,me=>me.dimension);break;case Yt.Median:ce=T.median(t,me=>me.dimension);break;case Yt.Custom:ce=et(S.plotArea.xscaleposition);break}U.append("line").attr("x1",f(ce)).attr("y1",0).attr("x2",f(ce)).attr("y2",K).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Yt.None){let ce;switch(S.plotArea.yCoordinate){case Yt.Mean:ce=T.mean(t,me=>me.measure);break;case Yt.Median:ce=T.median(t,me=>me.measure);break;case Yt.Custom:ce=et(S.plotArea.yscaleposition);break}U.append("line").attr("x1",0).attr("y1",a(ce)).attr("x2",J).attr("y2",a(ce)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(ce){be("BubbleChart","drawReferenceLines",ce)}},ae=()=>{try{let ce=A?.map(me=>{let Ve={...me,legendFontStyle:me.fontStyle,fontSize:me.fontSize+"px",legendFontFamily:me.fontFamily};return{legend:me.name,properties:Ve,data:{}}});Pa(S,V,ce||[],g,H,b[0],D,r,j,nt.circle,!1,o)}catch(ce){be("BubbleChart","initLegendList",ce)}},ke=ce=>{try{if(!ce||!ce.ChartData||!ce.ChartData[0])return[];const me=[];return ce.ChartData.forEach(Ye=>{Ye.data.forEach(te=>{me.push({dimension:parseFloat(te.dimension),dimensionName:Ye.legend??"Dimension",measure:te.value,measureName:Ye.legend??"Measure",legendName:Ye.legend,legendColor:Ye.properties?.color??De.black,tooltip:""})})}),me}catch(me){return console.error("BubbleChart - Data conversion failed",me),[]}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:u,id:r,style:{width:"100%",height:"100%"}})})},ua="ScatterChart.tsx",wr=({data:t,formatOptions:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{const l=Te.useRef(o);l.current=o;const s=Te.useRef(h);s.current=h;const x=t.ColorElements??[],L=t.ShapeElements??[],A=new Map(x.map((Pe,Ce)=>[Pe.name,Ce]));let u=[];const S=Te.useRef();let b,_=[0,0],g,H,D=40,j=Ht,K,J,U,V,N=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,X=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,re=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P=new Map,ie=new Map;Te.useEffect(()=>{Q()},[e,t,r]);const Q=()=>{({chartFormatOptions:b,svg:V,width:g,height:H}=Jt(S,e));let Pe=[...L,...x];_=Ia(b,Pe,"alias"),ge(),{longestMeasure:c,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=_i(b,X,se),{longestDimension:q,customXaxisIntervalValue:w,customXaxisMaxValue:p,customXaxisMinValue:C}=ji(b,N,$),{margins:j,yLabel:he,xLabel:Le,yTitle:pe,xTitle:ue,chartTitleHeight:D,legendMargin:O,innerHeight:K,innerWidth:J}=Gi(g,H,c,b,q,_),jt(S,g,H,b),U=la(V,j),mt(U,e,0,J,K,"Scatter",r),_t(S,D,g,b),we(),fe(),ae(),Ji(e,!1,V,j,Le,H,ue,"Scatter",he,J,K),Zi(K,e,0,!1,V,j,pe,he),ke(),Ae(),ce(),me(),Oi(V,b.legends.legendPosition,b,H,g,j,K,ue,Le,u.length)},Ae=()=>{try{let Pe=function(xe){return xe=="Square"?T.symbolSquare:xe=="Circle"?T.symbolCircle:xe=="Cross"?T.symbolCross:xe=="Triangle"?T.symbolTriangle:xe=="Star"?T.symbolStar:xe=="Diamond"?T.symbolDiamond:xe=="Wye"?T.symbolWye:T.symbolCircle};const Ce=U.append("g").attr("class","circles").attr("class","parentGroup"),Me=b.animation.animationEnabled,ve=Ce.append("g").selectAll(".bubbleScatter").data(u).enter().append("g").attr("fill",xe=>xe.color).attr("colorId",xe=>xe.colorName.replace(/ /g,"-")).attr("shapeId",xe=>xe.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(xe,Fe){T.select(this).attr("d",T.symbol().type(Pe(xe.shape)).size((xe.sizeValue?m(xe.sizeValue):10)*2*et(b.plotArea.scatterSizeIndex)))}).attr("transform",function(xe){return`translate(${f(xe.dimension)}, ${a(xe.measure)})`}).attr(Qe.SeriesId,xe=>`${A.get(xe.colorName)}_${xe.colorName}`).attr(Qe.DimValue,xe=>String(xe.dimension)).attr("opacity",Me?0:b.plotArea.fillOpacity).style("visibility",(xe,Fe)=>xe.dimension[0]===0||xe.measure===0&&b.plotArea.hideZeroValues||xe.dimension<C||xe.dimension>p||xe.measure<y||xe.measure>i?"hidden":"visible").on("click",At(s,l,(xe,Fe)=>({seriesId:`${A.get(Fe.colorName)}_${Fe.colorName}`,dimValue:String(Fe.dimension),legendUniqueId:`${A.get(Fe.colorName)}_${Fe.colorName}`,seriesDisplayName:Fe.colorName}))).on("mousemove",(xe,Fe)=>{ot([{key:b.xAxisTitle.xAxisTitleText,value:je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(Fe.dimension)},{key:b.yAxisTitle.yAxisTitleText,value:je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(Fe.measure)},{key:"Color",value:Fe.colorName},...Fe.shapeName?[{key:"Shape",value:Fe.shapeName}]:[]],b,xe,{alias:Fe.colorName},ht(n,String(Fe.dimension),{alias:Fe.colorName}))}).on("mouseout",()=>{rt()});Me&&ve.transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",b.plotArea.fillOpacity)}catch(Pe){be(ua,"initCircles",Pe)}},ge=()=>{try{let Pe=function(Ce,Me,ve){X=Math.min(X,Ce.value),se=Math.max(se,Ce.value),N=Math.min(N,Ce.dimension),$=Math.max($,Ce.dimension),re=Math.min(re,Ce.value2??10),oe=Math.max(oe,Ce.value2??10),u.push({dimension:Ce.dimension,measure:Ce.value,sizeValue:Ce.value2,colorName:Me,shapeName:ve,shape:ie.get(ve)||"Circle",color:P.get(Me)||"#6ba2b8ff"})};x.forEach(Ce=>{P.set(Ce.name,Ce.color)}),L.forEach(Ce=>{ie.set(Ce.name,Ce.markerShape)}),t.ChartData.forEach(Ce=>{Ce.children&&Ce.children.length>0&&Ce.children.forEach(Me=>{Me.data.forEach(ve=>{Pe(ve,Ce.legend,Me.legend)})}),Ce.data&&Ce.data.length>0&&Ce.data.forEach(Me=>{Pe(Me,Ce.legend)})})}catch(Pe){be(ua,"iterateOverChartData",Pe)}},we=()=>{try{let Pe=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMinText!==""?parseFloat(b.yAxisLabel.yAxisMinText):X>0?0:X*1.1,Ce=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMaxText!==""?parseFloat(b.yAxisLabel.yAxisMaxText):se*1.1;a=T.scaleLinear().domain([Pe,Ce]).range([K,0]),m=T.scaleLinear().domain([re,oe]).range([1,10])}catch(Pe){be(ua,"initScale",Pe)}},fe=()=>{try{const Ce=(parseFloat(e.plotArea.ticksHeight)||100)/100*K;let{xAxisLabelArray:Me,customTickValue:ve}=hi($,N,J,e,C,p,K,!1);Me.length>0?f=T.scaleLinear().domain([Me[0],Me[Me.length-1]]).range([0,J]):f=T.scaleLinear().domain([C,p]).range([0,J]);const xe=T.axisBottom(f).tickFormat(je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesVertical?b.xAxisLabel.xAxisPosition==="0"?-Ce:b.xAxisLabel.xAxisPosition==="1"?Ce:0:0).tickValues(Me.length>0?Me:null).ticks(ve).tickPadding(8).tickSizeOuter(0);Ki(U,b,0,Le,xe,K,J,j,a)}catch(Pe){be(ua,"drawXAxis",Pe)}},ae=()=>{try{const Ce=(parseFloat(e.plotArea.ticksWidth)||100)/100*J;let{yAxisLabelArray:Me,customTickValue:ve}=Xi(se,X,K,e,y,i);const xe=T.axisLeft(a).tickFormat(je(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesHorizontal?-Ce:0).tickValues(Me.length>0?Me:null).ticks(ve).tickPadding(8).tickSizeOuter(0);qi(U,b,0,he,xe,K)}catch(Pe){be(ua,"drawYAxis",Pe)}},ke=()=>{try{if(b.plotArea.xCoordinate!=Yt.None){let Pe;switch(b.plotArea.xCoordinate){case Yt.Mean:Pe=T.mean(u,Ce=>Ce.dimension);break;case Yt.Median:Pe=T.median(u,Ce=>Ce.dimension);break;case Yt.Custom:Pe=et(b.plotArea.xscaleposition);break}U.append("line").attr("x1",f(Pe)).attr("y1",0).attr("x2",f(Pe)).attr("y2",K).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}if(b.plotArea.yCoordinate!=Yt.None){let Pe;switch(b.plotArea.yCoordinate){case Yt.Mean:Pe=T.mean(u,Ce=>Ce.value);break;case Yt.Median:Pe=T.median(u,Ce=>Ce.value);break;case Yt.Custom:Pe=et(b.plotArea.yscaleposition);break}U.append("line").attr("x1",0).attr("y1",a(Pe)).attr("x2",J).attr("y2",a(Pe)).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}}catch(Pe){be(ua,"drawReferenceLines",Pe)}},ce=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment="Top"),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom="Start");let Pe=b.legends.legendPosition,Ce=b.legends.legendAlignment,Me=b.legends.legendAlignmentTopBottom;switch(Pe){case Be.none:break;case Be.right:Ve(x,g-O-30,D+5,O+25,H-D-10);break;case Be.top:Ve(x,5,D+5,g-10,30);break;case Be.left:Ve(x,5,D+5,O+25,H-D-10);break;case Be.bottom:Ve(x,5,H-35,g-10,30);break}}catch(Pe){be(ua,"drawColors",Pe)}},me=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment=Fa.top),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom=wa.start);let Pe=b.legends.legendPosition;if(L.length>0)switch(Pe){case Be.none:break;case Be.right:Ye(L,g-O-30,H/2+10,O+25,H-D-10);break;case Be.top:Ye(L,g/2+5,D+5,g-10,30);break;case Be.left:Ye(L,5,H/2+10,O+25,H-D-10);break;case Be.bottom:Ye(L,g/2+5,H-35,g-10,30);break}}catch(Pe){be(ua,"drawShapes",Pe)}},Ve=(Pe,Ce,Me,ve,xe)=>{try{let ye=b.legends.legendPosition,ee=b.legends.legendFontStyle,Y=V.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",Ce).attr("y",Me).attr("width",ve).attr("height",xe).style("user-select","none"),W=(ye==Be.top||ye==Be.bottom)&&L.length>0?"50%":"100%";var Fe=Y.append("xhtml:div").style("width",W).style("display","flex").style("height",ye==Be.top||ye==Be.bottom?xe-1+"px":"calc(50% - 5px)").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+r).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",ye==Be.top||ye==Be.bottom?b.legends.legendAlignmentTopBottom==wa.start?"flex-Start":b.legends.legendAlignmentTopBottom==wa.middle?"center":"flex-end":b.legends.legendAlignment==Fa.top?"flex-Start":b.legends.legendAlignment==Fa.middle?"center":"flex-end").style("flex-direction",ye==Be.top||ye==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Pe.forEach((I,v)=>{let F=Fe.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("width","fit-content").style("flex-wrap","nowrap").style("white-space","nowrap").style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).on("mousemove",function(R){b.legends.onHoverEffect&&(V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),V.selectAll('[colorId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(R){V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),V.selectAll('[colorId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(ye==Be.bottom||ye==Be.top)&&F.style("margin-right","16px").style("white-space","nowrap"),F.append("div").style("height","10px").style("width","10px").style("background",I.color).style("border-radius","1px");let z=b.legends.legendColorMode=="1"?I.color?I.color:De.black:b.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",z).attr("title",I.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",ee.includes(ne.italic)?ne.italic:"").style("text-decoration",ee.includes(ne.underline)?ne.underline:"").style("font-weight",ee.includes(ne.bold)?ne.bold:"").style("white-space","nowrap").html(I.name)})}catch(ye){be(ua,"colorListWithScroll",ye)}},Ye=(Pe,Ce,Me,ve,xe)=>{try{let ye=b.legends.legendPosition,ee=b.legends.legendFontStyle,Y=V.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",Ce).attr("y",Me).attr("width",ve).attr("height",xe).style("user-select","none"),W=b.legends.legendPosition==Be.top||b.legends.legendPosition==Be.bottom?"calc(50% - 5px)":"calc(100%)";var Fe=Y.append("xhtml:div").style("width",W).style("display","flex").style("height",ye==Be.top||ye==Be.bottom?xe-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+r).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",ye==Be.top||ye==Be.bottom?b.legends.legendAlignmentTopBottom==wa.start?"flex-Start":b.legends.legendAlignmentTopBottom==wa.middle?"center":"flex-end":b.legends.legendAlignment==Fa.top?"flex-Start":b.legends.legendAlignment==Fa.middle?"center":"flex-end").style("flex-direction",ye==Be.top||ye==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Pe.forEach((I,v)=>{let F=Fe.append("div").style("width","fit-content").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("mousemove",function(R){b.legends.onHoverEffect&&(V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),V.selectAll('[shapeId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(R){b.legends.onHoverEffect&&(V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),V.selectAll('[shapeId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(ye==Be.top||ye==Be.bottom)&&F.style("margin-right","16px").style("white-space","nowrap"),te(F,I.markerShape);let z=b.legends.legendColorMode=="1"?De.black:b.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",z).attr("title",I.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",ee.includes(ne.italic)?ne.italic:"").style("text-decoration",ee.includes(ne.underline)?ne.underline:"").style("font-weight",ee.includes(ne.bold)?ne.bold:"").style("white-space","nowrap").html(I.name)})}catch(ye){be(ua,"shapeListWithScroll",ye)}},te=(Pe,Ce)=>{try{const ve={none:T.symbolCircle,circle:T.symbolCircle,square:T.symbolSquare,triangle:T.symbolTriangle,cross:T.symbolCross,diamond:T.symbolDiamond,star:T.symbolStar,wye:T.symbolWye}[Ce?.toLowerCase()]||T.symbolCircle;Pe.append("svg").attr("width",14).attr("height",14).append("path").attr("d",T.symbol().type(ve).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(Me){be(ua,"shapesForScatterPlot",Me)}},de=(Pe="")=>{try{return Pe.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(Ce){be(ua,"getJQuerySelector",Ce)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:r,style:{width:"100%",height:"100%"}})})},Dr=({isDateType:t,formatOptions:e,data:r,isAdvancedAnalyticsWaterFall:o=!1,onElementClick:h,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=crypto.randomUUID?.();let x=0,L;const A=le.WaterfallChart,u=Te.useRef(),S=Te.useRef(h);S.current=h;const b=Te.useRef(n);b.current=n;const _=o??!1,g=_?[]:bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1,j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q=[],Ae=[],ge,we=0;const fe=2;let ae={dimensionList:H,chartType:A,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(ee){be("WaterfallChart","createWaterfallChart",ee)}},[e]);const ke=()=>{({formatOptions:e,svg:d,width:p,height:C}=kt(u,e)),ce(),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ae.yMinLeft,ae.yMaxLeft,ae.yMinRight,ae.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe}=Tt(p,C,ue,O,ae.yMaxLeft,e,ae.legendList,ae.dimensionList,ae.yMaxRight,j,K,t),Ce(V),vt(d,p,C,e),i=Ct(d,V),mt(i,e,c,q,w,A,s),Ve(),te(),Gt(i,e,c,N,m,w),Me(g,C,d,V,q),Mt(e,D,d,V,$,C,se,ae.chartType,N,q,w),St(w,e,c,D,d,V,X,N),Ut(d,j,V,e,c,w,q,pe,he),Ft(d,e,p,oe)},ce=()=>{if(_){let v=ye(r);v=v.filter(z=>z.up+z.down+z.base!=0),ae.dimensionList=v.map(z=>z.xKey),ae.legendList=ae.dimensionList,Ae=T.stack().keys(["base","dimensionTotal","up","down"])(v);const F=[];Ae.forEach(z=>z.forEach(R=>F.push(R[1]))),ae.yMaxLeft=T.max(F)??0,ae.yMinLeft=T.min(F)??0;return}g.forEach(v=>{v.data.forEach(F=>{})}),Q=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ie=ae.dimensionList:ie=ae.dimensionList.slice(we,we+fe),e.plotArea.hideZeroValues&&(ae.hideZeroValues=!0);let ee=_?ye(r):xe(),Y=JSON.parse(JSON.stringify(ee));ee.forEach(v=>{if(!v.Dimension&&(v.Up<1e-9&&v.Up!==0||v.Down<1e-9&&v.Down!==0)){let F=Y.findIndex(z=>z.Legend===v.Legend);F!==-1&&Y.splice(F,1)}}),ee=Y,ee.forEach(v=>v.dimension?ae.legendList.push(v.dimension):ae.legendList.push(v.legend)),Ae=T.stack().keys(["base","dimensionTotal","up","down"])(ee);let W=[],I=[];Ae.forEach(v=>{v.key=="base"?v.opacity=0:v.opacity=1,v.forEach(F=>W.push(F)),!I.includes(v.dimension)&&v.dimensionTotal===0&&v.total===0&&I.push(v.dimension)}),ae.yMaxLeft=T.max(W,v=>v[1]),ae.yMinLeft=T.min(W,v=>v[1]),e.xAxisLabel.hideZeroValues&&(I.length>0&&I.forEach(v=>{ae.legendList=ae.legendList.filter(F=>F!==v)}),ae.dimensionList=ae.legendList),t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(v=>v):ae.dimensionList,me(ee)},me=ee=>{try{let Y=[],W=[],I=[];ee&&ee.forEach((F,z)=>{F.dimension&&(Y.push(F.dimension),W.push({dimension:F.dimension,chartDataIndex:z,selfIndex:W.length}))}),t?I=gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(F=>F):I=Y;let v=JSON.parse(JSON.stringify(ae.legendList));W.forEach((F,z)=>{v[F.chartDataIndex]=I[F.selfIndex]}),ae.legendList.forEach((F,z)=>{ae.formattedDimensionListMap.set(F,v[z])})}catch(Y){throw Y}},Ve=()=>{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U).yAxisLabelArray;ae.yMaxLeft=ee[ee.length-1],ae.yMinLeft=ee[0],y=T.scaleLinear().domain([ae.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:ae.yMinLeft<0?ae.yMinLeft*1.1:ae.yMinLeft*.9,ae.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:ae.yMaxLeft*1.1]).range([w,0]),a=[0,q],Ye()},Ye=()=>{x=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(q/ae.legendList.length),f=T.scaleBand().domain(ae.legendList).range(a).padding(.4)},te=()=>{de();{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U);m=T.axisLeft(y).tickFormat(Y=>_e(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-q+0:0).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue).tickPadding(8).tickSizeOuter(0)}L=T.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,_?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},de=()=>{P=T.axisBottom(f).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.gridLinesVertical?-w:parseFloat(e.plotArea.ticksHeight)*(w/100)*(e.xAxisLabel.xAxisPosition=="1"?1:-1):0).tickSizeOuter(0).tickValues(Lt(ae.legendList,q))},Pe=ee=>{let Y;if(Ae.forEach((W,I)=>W.forEach(v=>v.key=W.key)),ge){let W=Q.map(I=>I.legend);Y=T.stack().keys(W)(ge),Y.forEach((I,v)=>{Y[v].color=Q[v].properties.color})}Y&&Y.forEach(W=>{W.forEach(I=>{I.Key=W.key})}),[0,1].forEach(W=>{if(W===1&&(Ae=Y),Ae){let I=i.selectAll(`.parentGroup-${W}`).data([null]);I=I.enter().append("g").attr("class",`parentGroup parentGroup-${W}`).merge(I);let v=I.selectAll(`.bar-group-${W}`).data(Ae);v=v.enter().append("g").attr("class",`bar-group-${W}`).attr("fill",M=>M.color?M.color:L(M.key)!==De.white?L(M.key):"none").attr("opacity",M=>M.opacity).merge(v);let z=v.selectAll("rect").data(M=>M,M=>M.key||M.Key);const R=e.animation.animationEnabled,E=z.enter().append("rect").attr("class","rect").attr("class",M=>M.key?M.key.replace(/ /g,"-"):M.Key.replace(/ /g,"-")).attr("x",M=>f(_?M.data.xKey:M.data.dimension||M.data.legend)).attr("y",y(0)??0).attr("clip-path",`url(#${s}-clip)`).attr("height",0).attr("width",f.bandwidth()).attr("visibility",M=>W===0&&M.data.dimension&&ge?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(M,G)=>{const Z=_?Aa.base:Aa.dimensionTotal,B={markerShape:"square",markerColor:G.key===Z?e.plotArea.totalColor:G.key===Aa.down?e.plotArea.negativeColor:e.plotArea.positiveColor};ot([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():G.properties?.currentMeasure?G.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(G.key===Aa.up?"+":G.key===Aa.down?"-":"")+_e(G.key===Aa.dimensionTotal?G.data.dimensionTotal:G[1]-G[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(_?G.key!==Aa.base?G.data.xKey:Aa.total:G.Key?G.Key.includes("~$~")?G.Key.split("~$~")[1]:G.Key:G.data.legend?G.data.legend.includes("~$~")?G.data.legend.split("~$~")[1]:G.data.legend:Aa.total).trim()||""}],e,void 0,B,ht(l,String(ae.formattedDimensionListMap.get(_?G.data.xKey:G.data.dimension||G.data.legend)??(_?G.data.xKey:G.data.dimension||G.data.legend)??""),{...B,alias:G.properties?.alias??G.properties?.currentMeasure??String(G.Key??G.key??"")}))}).on("mouseout",()=>{rt()}).attr(Qe.SeriesId,M=>String(M.key??M.Key??"")).attr(Qe.DimValue,M=>String(_?M.data.xKey||"":M.data.dimension||M.data.legend||"")).on("click",At(b,S,(M,G)=>{const Z=String(G.key??G.Key??""),B=String(_?G.data.xKey||"":G.data.dimension||G.data.legend||"");return{seriesId:Z,dimValue:B,legendUniqueId:Z,seriesDisplayName:Z}}));if((R?E.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):E).attr("y",M=>M[1]?y(M[1]):0).attr("height",M=>M[1]?y(M[0])-y(M[1]):0),z.exit().remove(),z=E.merge(z),e.plotArea.plotAreaDataLabel=="2"&&W!=1){const M=v.selectAll("text").data(B=>B),G=M.enter().append("text").text(B=>_e(B[1]-B[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",B=>f(_?B.data.xKey:B.data.dimension||B.data.legend)+f.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",B=>B[1]-B[0]!==0&&y(B[1])?"visible":"hidden");(R?G.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):G).attr("y",B=>B[1]?y(B[1])-15:0),M.exit().remove()}}}),i.selectAll(".parentGroup").raise()},Ce=ee=>{q=p-ee.left-ee.right,w=C-ee.bottom-ee.top},Me=(ee,Y,W,I,v)=>{if(!e.plotArea.fitChart){const F=ee[0].data.length-fe,z=Y-20;ie=ae.dimensionList.slice(we,we+fe),Ye(),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((k,M)=>Q[M].data=k.data.filter(G=>ie.includes(G.dimension))),de(),W.append("rect").attr("x",I.left).attr("y",z).attr("width",v).attr("height",8).attr("fill","#ddd").attr("rx",4);const R=v*fe/ae.dimensionList.length,E=W.append("rect").attr("x",I.left).attr("y",z).attr("width",R).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",k=>{let M=Math.min(Math.max(k.x,I.left),I.left+v-R);E.attr("x",M),we=Math.round((M-I.left)/(v-R)*F),ie=ae.dimensionList.slice(we,we+fe),Ye(),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((G,Z)=>Q[Z].data=G.data.filter(B=>ie.includes(B.dimension))),de(),ve()}));W.on("wheel",k=>{k.preventDefault();const M=Math.abs(k.deltaX)>Math.abs(k.deltaY)?k.deltaX:k.deltaY;we+=M>0?1:-1,we=Math.max(0,Math.min(we,F));const G=I.left+(v-R)*we/F;E.attr("x",G),Ye(),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((Z,B)=>Q[B].data=Z.data.filter(Se=>ie.includes(Se.dimension))),de(),ve()})}ve()},ve=()=>{qt(i,ae,$,e,c,y,P,re,C,x,t,q,w,ae.legendList,f),Pe()},xe=()=>{try{if(g.length<1)return[];if(ae.dimensionList.length<2)return[];let ee=[],Y=[],W=[],I="";if(I.length>1){let E=I;g.forEach(k=>{E===k.properties.currentLegend?Y.push(k):W.push(k)})}Y.length>0&&(Q=Y);let v=0,F=0;for(let E=0;E<Q.length;++E)v=v+Q[E].data[0].value;let z="";for(let E=1;E<ie.length;++E){let k={};k.dimension=ie[E-1],k.total=v,k.base=0,k.dimensionTotal=v,k.up=0,k.down=0,ee.push(k);for(let M=0;M<Q.length;++M){let G={};for(let Z=0;Z<M;Z++)z=z+" ";F=Q[M].data[E].value-Q[M].data[E-1].value,F!==0&&(G.legend=z+Q[M].properties.legend,G.dimensionTotal=0,F<0?(G.base=v+F,G.down=-F,G.up=0,G.total=v-F):(G.base=v,G.down=0,G.up=F,G.total=v+F),v=v+F,ee.push(G))}}let R={};return R.dimension=ie[ie.length-1],R.dimensionTotal=v,R.base=0,R.total=v,R.up=0,R.down=0,ee.push(R),W.length>0&&(Q=W,ge=pt(ie,W,!1)),ee}catch(ee){throw ee}},Fe=ee=>ee==null||ee===""?0:Number(ee),ye=ee=>(ee[0]?.Column1==""?ee.filter(W=>W.Column1&&W.Column1!=="*"):o?ee.Data:ee).map(W=>({xKey:W.Column1||W.Dimension||W.Legend,base:Fe(W.Column3||W.Total),up:Fe(W.Column4||W.Up),down:Fe(W.Column5||W.Down),total:Fe(W.Column6||W.total),dimensionTotal:Fe(W.Column2||W.Base)}));return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:u,id:s,style:{width:"100%",height:"100%"}})})},Vr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,onElementClick:n,vfxPickModeActive:l,tooltipFormatter:s})=>{const x=crypto.randomUUID();let L=0;const A=le.TornadoChart,u=r.IsadvanceanalyticsChart??r.IsCalCSensitivity,S=Te.useRef(),b=Te.useRef(n);b.current=n;const _=Te.useRef(l);_.current=l;let g=bt(r.ChartData,r.DimensionList,!0);g=Zl(g,r,u);const H=r.DimensionList,D=!0,j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we=[],fe=0,ae=2,ke=!1,ce={dimensionList:H,chartType:A,chartData:[],formatOptions:e,legendList:r.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{me()}catch(Y){be("Tornadochart","createTornadoChart",Y)}},[e]);const me=()=>{({formatOptions:e,svg:i,width:p,height:C}=kt(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ce.yMinLeft,ce.yMaxLeft,ce.yMinRight,ce.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe,visibleBars:ae,columnWidth:L,scrollbarVisible:ke}=Tt(p,C,ue,O,ce.yMaxLeft,e,u?ce.legendList.map(Y=>Y.alias.split(" - ")[0]):ce.legendList.map(Y=>Y.alias),ce.dimensionList,ce.yMaxRight,j,K,t,!0,ce),ve(V),vt(i,p,C,e),y=Ct(i,V),mt(y,e,d,q,w,A),te(),Ce(),Ya(e,y,$,w,q,Q),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,c,L,f,a,m,void 0,void 0,d,A,e,N,X,ce.dimensionList,q,P,ce.formattedDimensionListMap,x,V,w)),Mt(e,D,i,V,$,C,se,ce.chartType,N,q,w),St(w,e,d,D,i,V,X,N,q),Ut(i,j,V,e,d,w,q,pe,he),Ft(i,e,p,oe),Dt(C,i,re,oe,p,Le,e,Ve(g,ce.legendList,u,e),x,d,V,nt.rectangle),ye(g,C,p,i,V,q,ke,ae,ce,fe,!1,xe,D)},Ve=(Y,W,I,v)=>Y.map((F,z)=>{const R=W[z];if(!R)return{...F,properties:{}};let E=R.alias;I&&R.alias&&(E=R.alias.split(" - ")[0].trim());let k=R.color;return I&&E&&(E.includes("+ve")?k=v.plotArea.plotAreaCalculatedHigh:E.includes("-ve")&&(k=v.plotArea.plotAreaCalculatedLow)),{...F,properties:{...R,alias:E,color:k}}}).filter(F=>F.properties&&Object.keys(F.properties).length>0),Ye=()=>{let Y;if(u)ce.chartData=g,ce.yMaxLeft=Math.min(...g.map(I=>I.data[0].value)),ce.yMaxRight=Math.max(...g.map(I=>I.data[0].value));else{const I=g[0]?.properties?.measureUniqueId;let v=0,F=-1/0;Y=g.map((z,R)=>{const E=z.properties.measureUniqueId===I,k=z.data.map(G=>{const Z=E?-Math.abs(G.value):Math.abs(G.value);return{...G,value:Z}}),M=k.map(G=>G.value);return E?v=Math.min(v,Math.min(...M)):F=Math.max(F,Math.max(...M)),{...z,data:k}}),ce.chartData=Y,ce.yMaxLeft=v,ce.yMaxRight=F}const W=t?gt(e.xAxisLabel.xAxisNumberFormat,ce.dimensionList):ce.dimensionList;ce.dimensionList.forEach((I,v)=>{ce.formattedDimensionListMap.set(I,W[v])}),we=JSON.parse(JSON.stringify(u?g:Y)),g=we,ge=ce.dimensionList,e.plotArea.hideZeroValues&&(ce.hideZeroValues=!0)},te=()=>{let Y=ce.yMaxLeft,W=ce.yMaxRight,I=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,v,F=!1,z=!1;Y>W?(v=Y,F=!0):(v=W,z=!0);let R=e.annotation.annotationVisibility!="5"?Y/v!==1?Math.abs(Y/v)*100<10?3:0:Math.abs(W/v)*100<10?3:0:0,E=0,k=0;Y<0&&W>0?(E=Y*(1.2+(z?R:0)),k=W*(1.2+(F?R:0))):Y>=0&&W>=0?(E=0,k=W*(1.2+(F?R:0))):Y<=0&&W<=0?(E=Y*(1.2+(z?R:0)),k=0):(E=Y*1.2,k=W*1.2),E=Math.floor(E),k=Math.ceil(k),m=T.scaleLinear().domain([E,k]).range([I,q-I]),a=m,P=[0,q],de()},de=()=>{f=T.scalePoint().domain(ge).range([w,0]).padding(.5)},Pe=()=>{ie=T.axisLeft(f).tickSize(Pt(e,q-m(0),0)).tickSizeOuter(0).tickValues(Lt(ge,w)),Ae=T.axisRight(f).tickSize(Pt(e,m(0),0)).tickSizeOuter(0).tickValues(Lt(ge,q))},Ce=()=>{Q=T.axisBottom(m).tickFormat(Y=>_e(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision,!0)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.ticksHeight=="100"?-w:-e.plotArea.ticksHeight*(w/100):0).tickValues(st(ce.yMaxRight,ce.yMaxLeft,w,e,ce,J,U,D,q).yAxisLabelArray).ticks(st(U||ce.yMaxLeft,ce.yMinLeft,w,e,ce,J,U,D,q).customTickValue??q/30).tickPadding(8).tickSizeOuter(0)},Me=()=>{y.selectAll(".parentGroup").remove();const Y=e.plotArea.plotAreaCalculatedHigh,W=e.plotArea.plotAreaCalculatedLow,I=y.append("g").attr("class","parentGroup"),v=e.animation.animationEnabled,F=I.selectAll("rect").data(we.flatMap(R=>R.data.map(E=>({...E,legendText:u?R.legend.split("ve) - ")[1]?.trim()??R.legend:ce.dimensionList[0]==le.TornadoDefaultEntry?pi.default:R.legend.split("-")[1]?.trim()??R.legend,properties:R.properties})))).enter().append("rect").attr("class","rect").attr("y",R=>(R.legendText?f(R.legendText):f(le.TornadoDefaultEntry))-L/2).attr("height",L).attr("x",a(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",R=>R.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",R=>`${R.properties.stackBorderWidth}px`).attr("hoverId",R=>((u?R.legend.split(" - ")[0]:R.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",R=>R.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?R.properties.stackBorderColor:"none").style("fill",R=>u?R.value>0?Y!==De.white?Y:"none":W!==De.white?W:"none":R.properties.color).on("mousemove",(R,E)=>{ot([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():r.IsCalCSensitivity?E.properties.currentMeasure.split("~$~")[1]:E.dimension},{key:"Legend",value:E.legendText},{key:"Value",value:_e(Math.abs(E.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,R,r.IsCalCSensitivity?E.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:E.properties,ht(s,String(ce.formattedDimensionListMap.get(E.legend)??E.legend??""),E.properties))}).on("mouseout",rt).attr(Qe.SeriesId,R=>String(R.properties?.legendUniqueId??"")).attr(Qe.DimValue,R=>String(R.legend??R.legendText??"")).on("click",At(_,b,(R,E)=>({seriesId:String(E.properties?.legendUniqueId??""),dimValue:String(E.legend??E.legendText??""),legendUniqueId:String(E.properties?.legendUniqueId??""),seriesDisplayName:String(E.properties?.alias||E.properties?.name||E.legendText||"")})));(v?F.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):F).attr("x",R=>R.value>=0?a(0):a(R.value)).attr("width",R=>Math.abs(a(R.value)-a(0)))},ve=Y=>{q=p-Y.left-Y.right,w=C-Y.bottom-Y.top},xe=(Y,W,I)=>{we=W,ge=Y,ae=I,ee()};function Fe(Y){const W=new Map;return Y.forEach(I=>{let v=W.get(I.properties.legendUniqueId);if(v){let F=v.data??[];F.push(I.data[0]),W.set(I.properties.legendUniqueId,{...v,data:F})}else v={...I,data:[I.data[0]]},W.set(I.properties.legendUniqueId,v)}),W.size>0?Array.from(W.keys()).map(I=>W.get(I)):Y}function ye(Y,W,I,v,F,z,R,E,k,M,G,Z,B=!1){const Se=(ze,Ie,Oe,lt,ut)=>{try{if(ut&&(ze=M+ze),!k||!Array.isArray(k.dimensionList)||!Array.isArray(Y))return;ze=ze==null?0:Number(ze),Ie=Ie==null?0:Number(Ie),Oe=Oe==null?0:Number(Oe),M=Ba(Math.round(ze),0,Math.max(0,Ie)),E=typeof E=="number"?E:0;const tt=M,Re=tt+E;let He=k.dimensionList.slice(tt,Re);const it=He[0]==le.TornadoDefaultEntry;let Je=JSON.parse(JSON.stringify(Y||[]));Je=Je.filter(Ke=>it?!0:He.includes(Ke.legend.split(" - ")[1]));const Ze=F?.left??0,Ge=F?.top??0,Ee=Number(z)||0,Ne=Number(w)||0,Ue=Number(Oe)||0,xt=Ie===0?1:Ie;if(B){const Ke=Ge+(Ne-Ue)*(Ie===0?0:M)/xt;lt&&typeof lt.attr=="function"&&lt.attr("y",Ke)}else{const Ke=Ze+(Ee-Ue)*(Ie===0?0:M)/xt;lt&&typeof lt.attr=="function"&&lt.attr("x",Ke)}Z(He,Je,E)}catch(tt){typeof be=="function"&&be("ColumnChart","updateFromScrollPosition",tt)}};if(R){const ze=W-F.top-F.bottom,Ie=Math.max(0,H.length-E),Oe=W-8;v.append("rect").attr("id","scrollbarTrack").attr("x",B?I-8:F.left).attr("y",B?F.top:Oe).attr("width",B?8:z).attr("height",B?ze:8).attr("fill","#ccc");const lt=(B?ze:z)*E/k.dimensionList.length,ut=v.append("rect").attr("x",B?I-8:F.left).attr("y",B?F.top:Oe).attr("width",B?8:lt).attr("height",B?lt:8).attr("fill","#999").style("cursor",B?"ns-resize":"ew-resize");ut.call(T.drag().on("drag",tt=>{if(B){const He=(Ba(tt.y,F.top,F.top+ze-lt)-F.top)/(ze-lt)*(Ie||1);Se(He,Ie,lt,ut,!1),ut.attr("y",F.top+(ze-lt)*(Ie===0?0:M)/(Ie===0?1:Ie))}else{const He=(Ba(tt.x,F.left,F.left+z-lt)-F.left)/(z-lt)*(Ie||1);Se(He,Ie,lt,ut,!1),ut.attr("x",F.left+(z-lt)*(Ie===0?0:M)/(Ie===0?1:Ie))}})),v.on("wheel",tt=>{tt.preventDefault();const He=(Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?tt.deltaX:tt.deltaY)>0?1:-1;if(Se(He,Ie,lt,ut,!0),B){const it=F.top+(ze-lt)*(Ie===0?0:M)/(Ie===0?1:Ie);ut.attr("y",it)}else{const it=F.left+(z-lt)*(Ie===0?0:M)/(Ie===0?1:Ie);ut.attr("x",it)}})}else v.on("wheel",null);Se(0,0,0,null,!0)}const ee=()=>{de(),Pe(),Ua(e,y,$,w,q,ie,Ae,a,ce.yMaxLeft,ge,A,t,p,re,L,f),Me();const Y=Fe(we);Da(Y??[],f,a,null,V,dt,[],[],e,A,C,p,q,ge,w,x,i,h,f,L,o,u,D,u)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:x,style:{width:"100%",height:"100%"}})})},Nr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l})=>{const s=crypto.randomUUID();let x=0;const L=le.DotPlot,A=Te.useRef(),u=bt(r.ChartData,r.DimensionList),S=r.DimensionList,b=!0,_=!1;let g=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,j,K,J,U,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y=[],f=0,a=2,m=!1,P=[];const ie=!1;let Q={dimensionList:S,chartType:L,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ae()}catch(Me){be("StackStackHorizontalBarchart","createDotPlot",Me)}},[e]);const Ae=()=>{({formatOptions:e,svg:O,width:pe,height:ue}=kt(A,e)),ge(),{maxNumberForPrimaryAxis:re,maxNumberForSecondaryAxis:oe}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:D,yLabel:j,xLabel:K,yTitle:J,xTitle:U,dimensionHeightWidthArray:V,chartTitleHeight:N,secondaryAxisTitleWidth:$,legendMargin:X,secondaryYLabel:se,visibleBars:a,columnWidth:x,scrollbarVisible:m}=Tt(pe,ue,re,oe,Q.yMaxLeft,e,Q.legendList,Q.dimensionList,Q.yMaxRight,_,ie,t,b,Q),me(D),vt(O,pe,ue,e),q=Ct(O,D),mt(q,e,0,he,Le,L),we(),ae(),Ya(e,q,j,Le,he,c),Mt(e,b,O,D,K,ue,U,Q.chartType,j,he,Le),St(Le,e,0,b,O,D,J,j),Ft(O,e,pe,N),Dt(ue,O,V,N,pe,X,e,u,s,0,D,nt.rectangle,L,n),Bt(u,ue,pe,O,D,he,m,a,Q,f,!1,Ve,b)},ge=()=>{const Me=[],ve=[];let xe=[],Fe=-1/0,ye=1/0,ee=-1/0,Y=1/0;u.forEach(W=>{ve.push(W.properties.legendUniqueId),W.data.forEach(I=>{Me.push(I),Fe=Math.max(Fe,I.value),ye=Math.min(ye,I.value)})}),Q.chartData=Me,Q.legendList=ve,Q.yMaxLeft=Fe,Q.yMinLeft=ye>0?0:ye,Q.yMaxRight=ee,Q.yMinRight=Y,xe=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(W=>W):Q.dimensionList,xe=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(W=>W):Q.dimensionList,Q.dimensionList.forEach((W,I)=>{Q.formattedDimensionListMap.set(W,xe[I]),Q.formattedDimensionListMap.set(W,xe[I])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=Q.dimensionList:i=Q.dimensionList.slice(f,f+a),e.plotArea.hideZeroValues&&(Q.hideZeroValues=!0)},we=()=>{let Me=st(H||Q.yMaxLeft,Q.yMinLeft,Le,e,Q,g,H,b,he).yAxisLabelArray;Q.yMaxLeft=Me[Me.length-1],Q.yMinLeft=Me[0],w=T.scaleLinear().domain([Q.yMinLeft>=0?g!==void 0&&!Number.isNaN(g)?g:0:Q.yMinLeft<0?Q.yMinLeft*1.1:Q.yMinLeft*.9,Q.yMaxLeft<=0?0:H!==void 0&&!Number.isNaN(H)?H:Q.yMaxLeft*1.1]).range([0,he]),C=[Le,0],fe()},fe=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,x]).paddingInner(Q.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),p=T.scalePoint().domain(i).range(C).padding(.5)},ae=()=>{ke();{let Me=st(H||Q.yMaxLeft,Q.yMinLeft,Le,e,Q,g,H,b,he);c=T.axisBottom(w).tickFormat(ve=>_e(ve,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-Le:0).tickValues(Me.autoLabelFlag?void 0:Me.yAxisLabelArray).ticks(Me.customTickValue).tickPadding(8).tickSizeOuter(0)}},ke=()=>{d=T.axisLeft(p).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*he*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(i,Le))},ce=Me=>{Me.forEach(ye=>{ye.data.forEach(ee=>{ee.markerShape=ye.properties.markerShape||"Circle",ee.markerSize=ye.properties.markerSize||6,ee.markerColor=ye.properties.markerColor||ye.properties.color,ee.alias=ye.properties.alias,ee.lineStyle=ye.properties.lineStyle,ee.lineWidth=ye.properties.lineWidth,ee.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const ve=T.group(Me.flatMap(ye=>ye.data.map(ee=>({...ee,color:ye.properties.color}))),ye=>ye.dimension),xe=q.selectAll(".cleveland-line-group").data(Array.from(ve),([ye])=>ye);xe.enter().append("g").attr("class","cleveland-line-group").append("line").merge(xe.select("line")).attr("y1",([ye])=>p(ye)).attr("y2",([ye])=>p(ye)).attr("x1",([,ye])=>w(Math.min(ye[0]?.value??0,ye[1]?.value??0))).attr("x2",([,ye])=>w(Math.max(ye[0]?.value??0,ye[1]?.value??0))).attr("stroke",ye=>ye[1][0].lineColor).attr("stroke-width",ye=>ye[1][0].lineStyle!=="None"?ye[1][0].lineWidth:0).attr("stroke-dasharray",ye=>{switch(ye[1][0].lineStyle){case yt.dotted:return"1,4";case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",ye=>ye[1][0].lineStyle===yt.dotted?sa.round:""),xe.exit().remove(),Me.forEach(ye=>{let ee=q.selectAll(".parentGroup").data([ye],F=>F.properties.legendUniqueId);ee=ee.enter().append("g").attr("class","parentGroup").attr("hoverId",(ye.properties.alias||ye.properties.name||"Legend").replace(/\s+/g,"-")).merge(ee);let Y=ee.selectAll(".column-group").data(ye.data,F=>F.dimension),W=Y.enter().append("g").attr("class","column-group");const I=e.animation.animationEnabled,v=W.append("path").attr("class","cleveland-dot").attr("opacity",I?0:.9);v.merge(Y.select("path")).attr("d",F=>T.symbol().type(zi(F.markerShape)).size((F.markerSize||6)*70)()).attr("transform",F=>{const z=w(F.value),R=p(F.dimension);return`translate(${z},${R})`}).attr("fill",F=>ye.properties.color).attr("data-series-id",()=>ye.properties.legendUniqueId??ye.properties.alias).attr("data-dim-value",F=>String(F.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(F,z)=>{ot([{key:e.xAxisTitle.xAxisTitleText,value:Q.formattedDimensionListMap.get(z.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:_e(z.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:z.alias}],e,F,ye.properties,ht(l,String(z.dimension??""),{...ye.properties,formattedDimensionValue:String(Q.formattedDimensionListMap.get(z.dimension)??z.dimension??"")}))}).on("mouseout",()=>{T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll(".halo").remove(),rt()}),I&&v.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("opacity",.9),Y.exit().remove()}),q.selectAll(".parentGroup").raise()},me=Me=>{he=pe-Me.left-Me.right,Le=ue-Me.bottom-Me.top},Ve=(Me,ve,xe)=>{y=ve,i=Me,a=xe,Ye()},Ye=()=>{fe(),ke(),Ua(e,q,K,Le,he,d,void 0,w,Q.yMaxLeft,i,L,t,pe,V,x,p),te(),ce(y),Da(y,p,w,void 0,D,dt,[],[],e,L,ue,pe,he,i,Le,s,O,h,p,x,o,!1,b),de()},te=()=>{let Me=pt(i,y,ie);P=T.stack().keys(Q.legendList).offset(T.stackOffsetDiverging)(Me),y.forEach((xe,Fe)=>xe.data.forEach((ye,ee)=>{ye[0]=P[Fe][ee][0],ye[1]=P[Fe][ee][1]}));let ve=e.annotation.annotationSetLabelColor;P.forEach((xe,Fe)=>xe.forEach(ye=>{ye.key=xe.key,xe.color=JSON.parse(JSON.stringify(u[Fe].properties.color)),ye.data.labelPosition=u[Fe].properties.dataLabelPosition,ye.data.labelColor=ve=="2"?JSON.parse(JSON.stringify(u[Fe].properties.color)):u[Fe].properties.labelColor,ye.hideZero=JSON.parse(JSON.stringify(u[Fe].properties.hideZeroValues))}))},de=()=>{try{const Me=Number(e.connector?.connectorVisibility);if(!e.connector||Me===2)return;const ve=[],xe=[],Fe=[];let ye;const ee=[];if(Me===1)ye=1;else if(Me===3){const R=Number(e.connector.connectorFollow);R===1?ye=Number(e.connector.connectorStepSize):R===2&&((e.connector.connectorExclude||[]).forEach(E=>Fe.push(E)),ye=1)}const Y=[],W=[],I=[],v=e.connector?.connectorCustomRange||[];Fe.forEach(R=>{const E=R.split("-");E.length&&Y.push(E[0])});const z=(P?.[0]||[]).map((R,E)=>({Dimension:R.data.Dimension,Total:R.data.Total,CustomTotal:R.data.Total-(I[E]??0),Index:E}));if(ye!=null){for(let R=0;R<z.length;R++)(ye===1||R%ye===0&&ye!==1)&&ve.push(z[R]);for(let R=ye;R<z.length;R+=ye){const E=Math.min(R+ye,z.length);let k=-1/0;for(let M=R;M<E;M++)z[M].Total>k&&(k=z[M].Total);k!==-1/0&&ee.push(k)}for(let R=1;R<ve.length;R++)xe.push(ve[R])}else{const R=[];(v||[]).forEach(E=>{if(E?.from&&E?.to){const k=z.some(G=>G.Dimension===E.from),M=z.some(G=>G.Dimension===E.to);k&&M&&R.push({from:E.from,to:E.to})}}),R.forEach(E=>{const k=z.findIndex(G=>G.Dimension===E.from),M=z.findIndex(G=>G.Dimension===E.to);if(k>=0&&M>=0){const G=Math.min(k,M),Z=Math.max(k,M);ve.push(z[G]);let B=z[G]?.Total??-1/0;for(let Se=G;Se<=Z;Se++)z[Se].Total>B&&(B=z[Se].Total);B!==-1/0&&ee.push(B),xe.push(z[Z])}})}q.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==De.white?e.connector.connectorMarkerColor:"none"),Pe(ve,ee,xe,ye,Y),Ce(ve,ee,xe,ye,Y)}catch(Me){console.error(Me)}},Pe=(Me,ve,xe,Fe,ye)=>{try{q.append("g").selectAll("path").data(Me).enter().filter((ee,Y)=>Fe!=null?Y<Me.length-1:Y<Me.length).append("path").attr("d",(ee,Y)=>e.total.totalVisibility?`M ${w(ee.Total)+50},
260
+ ${p(ee.Dimension)+p.bandwidth()/2-5}
261
+ H ${60+Math.max(w(ve[Y]),w(xe[Y].Total),w(ee.Total))}
262
+ V ${p(xe[Y].Dimension)+p.bandwidth()/2+5}
263
+ H ${30+w(xe[Y].Total)}`:`M ${w(ee.Total)+30},
264
+ ${p(ee.Dimension)+p.bandwidth()/2-5}
265
+ H ${45+Math.max(w(ve[Y]),w(xe[Y].Total),w(ee.Total))}
266
+ V ${p(xe[Y].Dimension)+p.bandwidth()/2+5}
267
+ H ${10+w(xe[Y].Total)}
268
+ `).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",ee=>ye.includes(ee.Dimension)||ee.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}},Ce=(Me,ve,xe,Fe,ye)=>{try{let ee=e.connector.connectorFontStyle,Y=e.connector.connectorNumberFormat,W=Le/30<i.length?Math.round(Le/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(Y=".2s"),q.append("g").selectAll("text1").data(Me).enter().filter((I,v)=>Fe!=null?v<Me.length-1:v<Me.length).append("text").attr("y",(I,v)=>Fe==null?p(xe[v].Dimension)/2+p(I.Dimension)/2+15:Fe==1?W<6&&p.bandwidth()>40?p(xe[v].Dimension)+p.bandwidth()/2+p.bandwidth()/2+13:p(xe[v].Dimension)+p.bandwidth()/2+p.bandwidth()/2+7:p(xe[v].Dimension)+p.bandwidth()/2+p.bandwidth()/2*Fe+12).attr("x",(I,v)=>e.total.totalVisibility?70+Math.max(w(ve[v]),w(xe[v].Total),w(I.Total)):50+Math.max(w(ve[v]),w(xe[v].Total),w(I.Total))).text((I,v)=>(I.CustomTotal==0&&xe[v].CustomTotal!=0&&(I.CustomTotal=1),ui(xe[v].Total,I.Total,parseInt(e.connector.connectorDecimalPrecision),Y,parseInt(I.Dimension),parseInt(xe[v].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",ee.includes("Italic")?"Italic":"").style("text-decoration",ee.includes("Underline")?"Underline":"").style("font-weight",ee.includes("Bold")?"Bold":"").style("visibility",I=>ye.includes(I.Dimension)||I.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:A,id:s,style:{width:"100%",height:"100%"}})})},Kt=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function xa(t,e=1){const r=t.replace("#",""),o=parseInt(r.substring(0,2),16),h=parseInt(r.substring(2,4),16),n=parseInt(r.substring(4,6),16);return isNaN(o)||isNaN(h)||isNaN(n)?t:`rgba(${o},${h},${n},${e})`}function tl(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function pa(t,e,r,o=Kt){const{ChartData:h,DimensionList:n,LegendList:l}=t,s=n?.length?n:h[0]?.data?.map(L=>L.dimension)??[],x=Number(r.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?Ir(h,s,x,o,l):e==="scatter"?Er(h,o):e==="bubble"?Rr(h,o):Pr(h,s,e,r,x,o)}function Pr(t,e,r,o,h,n){const l=t.map((s,x)=>{const L=s.properties?.color??n[x%n.length],A=s.properties?.opacity??1,u=new Map;s.data?.forEach(H=>u.set(H.dimension,H.value));const S=e.map(H=>u.get(H)??0),b=s.Axis==="Secondary"||s.properties?.axis==="Secondary"?"y1":"y",_=Number(s.properties?.lineWidth??o.plotArea?.lineWidth??2);return r==="line"||r==="area"?{type:"line",label:s.properties.alias,data:S,borderColor:L,backgroundColor:r==="area"?xa(L,h*A):xa(L,.1),fill:r==="area",borderWidth:_,borderDash:tl(s.properties?.lineStyle),pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3,tension:Number(o.cjsOptions?.cjsTension??.4),yAxisID:b}:r==="radar"?{label:s.properties.alias,data:S,borderColor:L,backgroundColor:xa(L,h*A),fill:!0,borderWidth:_,pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3}:{type:"bar",label:s.properties.alias,data:S,backgroundColor:xa(L,h*A),borderColor:L,borderWidth:Number(s.properties?.stackBorderWidth??0),borderRadius:Number(o.cjsOptions?.cjsBorderRadius??o.plotArea?.cornerRadius??0),yAxisID:b}});return{labels:e,datasets:l}}function Ir(t,e,r,o,h){const l=(t.length?t:[]).map(s=>{const x=e.map(A=>s.data?.find(S=>S.dimension===A)?.value??0),L=e.map((A,u)=>{const S=h?.[u]?.color;return xa(S??o[u%o.length],r)});return{label:s.properties.alias,data:x,backgroundColor:L,borderColor:L.map(A=>A.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:l}}function Er(t,e){return{datasets:t.map((o,h)=>{const n=o.properties?.color??e[h%e.length],l=o.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||h,y:s.value??0}))??[];return{label:o.properties.alias,data:l,backgroundColor:xa(n,.7),borderColor:n,pointRadius:5}})}}function Rr(t,e){return{datasets:t.map((o,h)=>{const n=o.properties?.color??e[h%e.length],l=o.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||h,y:s.value??0,r:Number(s.markerSize??o.properties?.markerSize??8)}))??[];return{label:o.properties.alias,data:l,backgroundColor:xa(n,.6),borderColor:n}})}}function ti(t,e,r,o=Kt){const{ChartData:h,DimensionList:n}=t,l=n?.length?n:h[0]?.data?.map(A=>A.dimension)??[],s=new Map;l.forEach(A=>{const u=h.reduce((S,b)=>{const _=b.data?.find(g=>g.dimension===A);return S+Math.abs(_?.value??0)},0);s.set(A,u)});const x=Number(r.plotArea?.fillOpacity??.8),L=h.map((A,u)=>{const S=A.properties?.color??o[u%o.length],b=A.properties?.opacity??1,_=new Map;A.data?.forEach(D=>_.set(D.dimension,D.value));const g=l.map(D=>{const j=_.get(D)??0,K=s.get(D)??0;return K>0?parseFloat((j/K*100).toFixed(4)):0}),H=Number(A.properties?.lineWidth??r.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:A.properties.alias,data:g,borderColor:S,backgroundColor:e==="area"?xa(S,x*b):xa(S,.1),fill:e==="area",borderWidth:H,borderDash:tl(A.properties?.lineStyle),pointRadius:r.marker?.markerVisibility?Number(r.marker?.markerSize??4):3,tension:Number(r.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:A.properties.alias,data:g,backgroundColor:xa(S,x*b),borderColor:S,borderWidth:Number(A.properties?.stackBorderWidth??0),borderRadius:Number(r.cjsOptions?.cjsBorderRadius??r.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:l,datasets:L}}function Ra(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function ai(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function zr(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function $r(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function al(t,e,r){const o=parseInt(r??"0",10);return e==="Thousands"?(t/1e3).toFixed(o)+"K":e==="Millions"?(t/1e6).toFixed(o)+"M":e==="Billions"?(t/1e9).toFixed(o)+"B":t.toFixed(o)}function Yr(t,e){return t.find(r=>r.alias==e)}function Zt(t,e,r=!1,o,h){const n=e==="pie"||e==="doughnut"||e==="polarArea",l=e==="horizontalBar";let s=0;const x=300,L=t.plotArea?.gridLinesColor??"#e0e0e0",A=t.legends?.legendFontColor??"#333333",u={responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!1},legend:{display:t.legends?.legendVisibility!==!1&&t.legends?.legendPosition!=="None",position:$r(t.legends?.legendPosition),labels:{color:A,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??qe,style:Ra(t.legends?.legendFontStyle),weight:ai(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,b,_){if(o){const g=new Date().getTime();if(g-s<x){const D=Yr(h,b.text);D&&o(D),s=0}else s=g}}},tooltip:{enabled:t.toolTip?.toolTipVisibility!==!1,backgroundColor:t.toolTip?.toolTipTheme==="Dark"?"#222222":"#ffffff",titleColor:t.toolTip?.toolTipTheme==="Dark"?"#ffffff":"#333333",bodyColor:t.toolTip?.toolTipTheme==="Dark"?"#cccccc":"#555555",borderColor:L,borderWidth:1,padding:10,callbacks:{label(S){const b=typeof S.raw=="number"?S.raw:S.raw?.y??0,_=_e(b,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${_}`}}},datalabels:Ur(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:zr(t.animation?.animationEffect)}:!1};if(!n){const S={display:!0,title:{display:t.xAxisTitle?.xAxisTitleVisibility!==!1,text:t.xAxisTitle?.xAxisTitleText??"Dimension",color:t.xAxisTitle?.xAxisTitleColor??"#000000",font:{size:parseInt(t.xAxisTitle?.xAxisTitleFontSize??"11",10),family:t.xAxisTitle?.xAxisTitleFontFamily??qe,style:Ra(t.xAxisTitle?.xAxisTitleFontStyle)}},ticks:{display:t.xAxisLabel?.xAxisLabelVisibility!==!1,color:t.xAxisLabel?.xAxisLabelColor??"#000000",font:{size:parseInt(t.xAxisLabel?.xAxisLabelFontSize??"11",10),family:t.xAxisLabel?.xAxisLabelFontFamily??qe,style:Ra(t.xAxisLabel?.xAxisLabelFontStyle),weight:ai(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:L},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")}},b={display:!0,position:"left",title:{display:t.yAxisTitle?.yAxisTitleVisibility!==!1,text:t.yAxisTitle?.yAxisTitleText??"Measure",color:t.yAxisTitle?.yAxisTitleColor??"#000000",font:{size:parseInt(t.yAxisTitle?.yAxisTitleFontSize??"11",10),family:t.yAxisTitle?.yAxisTitleFontFamily??qe,style:Ra(t.yAxisTitle?.yAxisTitleFontStyle)}},ticks:{display:t.yAxisLabel?.yAxisLabelVisibility!==!1,color:t.yAxisLabel?.yAxisLabelColor??"#000000",font:{size:parseInt(t.yAxisLabel?.yAxisLabelFontSize??"11",10),family:t.yAxisLabel?.yAxisLabelFontFamily??qe,style:Ra(t.yAxisLabel?.yAxisLabelFontStyle),weight:ai(t.yAxisLabel?.yAxisLabelFontStyle)},callback(g){return al(g,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesHorizontal!==!1,color:L},border:{color:t.yAxisLabel?.yAxisColor??"#cccccc",width:parseFloat(t.yAxisLabel?.yAxisWidth??"0.5")}};l?(u.scales={x:{...b,position:"bottom"},y:{...S,position:"left",reverse:!0}},u.scales.x.title&&(u.scales.x.title.text=t.yAxisTitle?.yAxisTitleText??"Measure"),u.scales.y.title&&(u.scales.y.title.text=t.xAxisTitle?.xAxisTitleText??"Dimension")):u.scales={x:S,y:b},r&&(u.scales.y1={display:!0,position:"right",title:{display:t.secondaryYAxisTitle?.secondaryYAxisTitleVisibility!==!1,text:t.secondaryYAxisTitle?.secondaryYAxisTitleText??"",color:t.secondaryYAxisTitle?.secondaryYAxisTitleColor??"#000000",font:{size:parseInt(t.secondaryYAxisTitle?.secondaryYAxisTitleFontSize??"11",10),family:t.secondaryYAxisTitle?.secondaryYAxisTitleFontFamily??qe}},ticks:{display:t.secondaryYAxisLabel?.secondaryYAxisLabelVisibility!==!1,color:t.secondaryYAxisLabel?.secondaryYAxisLabelColor??"#000000",font:{size:parseInt(t.secondaryYAxisLabel?.secondaryYAxisLabelFontSize??"11",10),family:t.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily??qe,style:Ra(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:ai(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(g){return al(g,t.secondaryYAxisLabel?.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel?.secondaryYAxisLabelDecimalPrecision)}},grid:{drawOnChartArea:!1},border:{color:t.secondaryYAxisLabel?.secondaryYAxisColor??"#000000",width:parseFloat(t.secondaryYAxisLabel?.secondaryYAxisWidth??"0.5")}}),e.toLowerCase().includes("stack")&&(u.scales?.x&&(u.scales.x.stacked=!0),u.scales?.y&&(u.scales.y.stacked=!0))}return u}function il(t){if(typeof t=="number")return t;if(t!==null&&typeof t=="object"){if(typeof t.y=="number")return t.y;if(typeof t.x=="number")return t.x}return parseFloat(t)||0}function Ur(t,e="bar"){const r=t.annotation,o=e==="pie"||e==="doughnut"||e==="polarArea",h=e==="horizontalBar",n=r?.annotationVisibility??"5";if(n==="5"||!n)return{display:!1};const l=r?.annotationPosition??"1",s=r?.annotationHideZeroValues!==!1,x=parseInt(r?.annotationFontSize??"9",10)||9,L=r?.annotationFontFamily??qe,A=Ra(r?.annotationFontStyle),u=ai(r?.annotationFontStyle),S=r?.annotationColor??"#000000",b=r?.annotationSetLabelColor==="2",_=r?.annotationDecimalPrecision??"2",g=r?.annotationNumberFormat??",",H=r?.annotationDisplayUnits??"None";function D(V){const N=V.dataset?.data?.length??0,$=V.dataIndex??0;switch(n){case"1":return!0;case"2":return $===0;case"3":return $===N-1;case"4":return $===0||$===N-1;default:return!1}}function j(V){const N=V.dataset?.data?.[V.dataIndex];return il(N)}function K(V){if(o)return l==="2"?"center":"end";const N=j(V);switch(l){case"2":return"center";case"3":return N<0?"end":"start";case"1":return N>0?"end":"start";case"4":default:return N>0?"end":"start"}}function J(V){if(o)return l==="2"?"center":"end";const N=j(V);if(h)switch(l){case"2":return"center";case"3":return"right";case"1":case"4":default:return N<0?"left":"right"}switch(l){case"2":return"center";case"3":return N>0?"top":"bottom";case"1":case"4":default:return N<0?"bottom":"top"}}function U(V,N){const $=il(V);if(s&&$===0)return null;const X=_e($,H,g,_);if(o){const se=N?.chart?.data?.labels?.[N.dataIndex]??"";return se?`${se}
269
+ ${X}`:X}return X}return{display:D,anchor:K,align:J,offset:o?l==="2"?0:8:l==="2"?0:4,color:b?V=>{const N=V.dataset?.backgroundColor,$=V.dataset?.borderColor,X=Array.isArray(N)?N[V.dataIndex]:N;return typeof X=="string"&&X?X:typeof $=="string"&&$?$:S}:S,font:{size:x,family:L,style:A,weight:u},formatter:U,clip:!1}}ft.Chart.register(ft.BarController,ft.LineController,ft.PieController,ft.DoughnutController,ft.ScatterController,ft.BubbleController,ft.RadarController,ft.PolarAreaController,ft.CategoryScale,ft.LinearScale,ft.RadialLinearScale,ft.PointElement,ft.BarElement,ft.LineElement,ft.ArcElement,ft.Title,ft.Tooltip,ft.Legend,ft.Filler,xl);const Xt=({chartType:t,data:e,options:r,formatOptions:o,clientWidth:h,clientHeight:n,className:l,isChartStacked:s})=>{const x=Te.useRef(null),L=Te.useRef(null),A=Te.useRef(!1);Te.useEffect(()=>{if(x.current)return L.current?.destroy(),L.current=new ft.Chart(x.current,{type:t,data:e,options:r}),A.current=!0,()=>{L.current?.destroy(),L.current=null}},[t,s]),Te.useEffect(()=>{if(A.current){A.current=!1;return}const j=L.current;j&&(j.data=e,j.options=r,j.update())},[e,r]);const u=o.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(o.chartTitle?.chartTitleFontStyle)?o.chartTitle.chartTitleFontStyle:[],b=o.chartTitle?.chartTitleColor&&o.chartTitle.chartTitleColor!=="#ffffff"&&o.chartTitle.chartTitleColor!=="#FFFFFF00"?o.chartTitle.chartTitleColor:"rgba(119,119,119)",_=o.chartTitle?.chartTitleFontSize?`${o.chartTitle.chartTitleFontSize}px`:"16px",g=o.chartTitle?.dynamicTitleText||o.chartTitle?.chartTitleText||"",H=o.chartTitle?.chartTitleHTML||g,D=o.chartTitle?.chartTitleVisibility!==!1;return $e.jsxs("div",{className:l,style:{width:"100%",height:"100%",backgroundColor:u,position:"relative",display:"flex",flexDirection:"column"},children:[D&&g&&$e.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:o.chartTitle?.chartTitleText,style:{color:b,fontSize:_,fontFamily:o.chartTitle?.chartTitleFontFamily,fontStyle:S.includes("Italic")?"italic":"normal",fontWeight:S.includes("Bold")?"bold":"normal",textDecoration:S.includes("Underline")?"underline":"none",whiteSpace:"pre",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"1.3em",userSelect:"none",padding:"2px 4px",flexShrink:0},dangerouslySetInnerHTML:{__html:H}}),$e.jsx("div",{style:{flex:1,minHeight:0},children:$e.jsx("canvas",{ref:x,style:{width:"100%",height:"100%"}})})]})},ll=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"bar",x,l,s);return h&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"bar",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Br=t=>$e.jsx(ll,{...t,isChartStacked:!0}),rl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n=Kt,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"horizontalBar",x,l,s);return u.indexAxis="y",h&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"bar",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Wr=t=>$e.jsx(rl,{...t,isChartStacked:!0}),nl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n=Kt,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"line",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"line",x,l,s);return h&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"line",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Hr=t=>$e.jsx(nl,{...t,isChartStacked:!0}),sl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"area",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"area",x,l,s);return h&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"line",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Gr=t=>$e.jsx(sl,{...t,isChartStacked:!0}),_r=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"pie",e,h),[t,e,h]),x=Te.useMemo(()=>Zt(e,"pie",!1,n,l),[e]);return $e.jsx(Xt,{chartType:"pie",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},jr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"doughnut",e,h),[t,e,h]),x=Te.useMemo(()=>{const L=Zt(e,"doughnut",!1,n,l),A=e.plotArea?.innerRadius;return A!=null&&(L.cutout=`${A}%`),L},[e]);return $e.jsx(Xt,{chartType:"doughnut",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Jr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt})=>{const n=Te.useMemo(()=>pa(t,"scatter",e,h),[t,e,h]),l=Te.useMemo(()=>Zt(e,"scatter",!1),[e]);return $e.jsx(Xt,{chartType:"scatter",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:o})},Zr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Te.useMemo(()=>pa(t,"bubble",e,h),[t,e,h]),x=Te.useMemo(()=>Zt(e,"bubble",!1,n,l),[e]);return $e.jsx(Xt,{chartType:"bubble",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Xr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt})=>{const n=Te.useMemo(()=>pa(t,"radar",e,h),[t,e,h]),l=Te.useMemo(()=>{const s=Zt(e,"radar",!1);return delete s.scales,s.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0"},ticks:{color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe}},pointLabels:{color:e.xAxisLabel?.xAxisLabelColor??"#333333",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"11",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe}}}},s},[e]);return $e.jsx(Xt,{chartType:"radar",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:o})},qr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"polarArea",e,h),[t,e,h]),x=Te.useMemo(()=>{const L=Zt(e,"polarArea",!1,n,l);delete L.scales;const A=e.xAxisLabel?.xAxisLabelFontStyle,u=Array.isArray(A)?A.includes("Italic")||A.includes("italic"):!1;return L.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0",display:e.plotArea?.gridLinesVisibility!==!1},ticks:{display:e.xAxisLabel?.xAxisLabelVisibility!==!1,color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe,style:u?"italic":"normal"}}}},L},[e]);return $e.jsx(Xt,{chartType:"polarArea",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Kr=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"bar",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"bar",!1,n,l);return A.scales??={},A.scales.x??={},A.scales.y??={},A.scales.x.stacked=!0,A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"bar",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})},Qr=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"horizontalBar",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"horizontalBar",!1,n,l);return A.indexAxis="y",A.scales??={},A.scales.x??={},A.scales.y??={},A.scales.x.stacked=!0,A.scales.y.stacked=!0,A.scales.x.min=x?-100:0,A.scales.x.max=100,A.scales.x.ticks={...A.scales.x.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"bar",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})},Or=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"line",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"line",!1,n,l);return A.scales??={},A.scales.y??={},A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"line",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})},en=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"area",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"area",!1,n,l);return A.scales??={},A.scales.y??={},A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"line",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})};We.AreaChart=dr,We.BubbleChart=Fr,We.CJSAreaChart=sl,We.CJSBubbleChart=Zr,We.CJSColumnChart=ll,We.CJSDonutChart=jr,We.CJSHorizontalBarChart=rl,We.CJSLineChart=nl,We.CJSNormalizedStackAreaChart=en,We.CJSNormalizedStackColumnChart=Kr,We.CJSNormalizedStackHorizontalBarChart=Qr,We.CJSNormalizedStackLineChart=Or,We.CJSPieChart=_r,We.CJSPolarAreaChart=qr,We.CJSRadarChart=Xr,We.CJSScatterChart=Jr,We.CJSStackAreaChart=Gr,We.CJSStackColumnChart=Br,We.CJSStackHorizontalBarChart=Wr,We.CJSStackLineChart=Hr,We.CJS_DEFAULT_COLORS=Kt,We.ChartJSWrapper=Xt,We.ColumnChart=Xl,We.ColumnHistogramChart=tr,We.CustomColumnChart=ql,We.DonutChart=pr,We.DotPlot=Nr,We.HorizontalBarChart=rr,We.HorizontalHistogramChart=cr,We.LayeredColumnChart=Kl,We.LayeredHorizontalBarChart=or,We.LineChart=ar,We.Maps=Mr,We.NormalizedStackAreaChart=ur,We.NormalizedStackColumnChart=Ol,We.NormalizedStackHorizontalBarChart=sr,We.NormalizedStackLineChart=lr,We.OrganizationChart=Sr,We.PieChart=xr,We.PieofPie=gr,We.ProgressChart=Lr,We.PyramidChart=Ar,We.RadialBarChart=fr,We.SankeyChart=kr,We.ScatterChart=wr,We.Speedometer=mr,We.StackAreaChart=yr,We.StackColumnChart=Ql,We.StackHorizontalBarChart=nr,We.StackLineChart=ir,We.TornadoChart=Vr,We.Treemap=br,We.VennChart=vr,We.WaterfallChart=Dr,We.WordCloud=Tr,We.hexToRgba=xa,We.mapFormatOptionsToChartJS=Zt,We.transformToChartJSData=pa,We.transformToNormalizedChartJSData=ti,Object.defineProperty(We,Symbol.toStringTag,{value:"Module"})}));