pace-chart-lib 1.0.74 → 1.0.75

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.
@@ -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===oe?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 te: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 q:return(b.displayName||"Context")+".Provider";case j:return(b._context.displayName||"Context")+".Consumer";case Z:var v=b.render;return b=b.displayName,b||(b=v.displayName||v.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case P:return v=b.displayName||null,v!==null?v:t(b.type)||"Memo";case z:v=b._payload,b=b._init;try{return t(b(v))}catch{}}return null}function e(b){return""+b}function r(b){try{e(b);var v=!1}catch{v=!0}if(v){v=console;var d=v.error,c=typeof Symbol=="function"&&Symbol.toStringTag&&b[Symbol.toStringTag]||b.constructor.name||"Object";return d.call(v,"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 v=t(b);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function h(){var b=de.A;return b===null?null:b.getOwner()}function n(){return Error("react-stack-top-frame")}function l(b){if(se.call(b,"key")){var v=Object.getOwnPropertyDescriptor(b,"key").get;if(v&&v.isReactWarning)return!1}return b.key!==void 0}function s(b,v){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)",v))}d.isReactWarning=!0,Object.defineProperty(b,"key",{get:d,configurable:!0})}function x(){var b=t(this.type);return xe[b]||(xe[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,v,d,c,i,y,f,a){return d=y.ref,b={$$typeof:p,type:b,key:v,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,v,d,c,i,y,f,a){var L=v.children;if(L!==void 0)if(c)if(he(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(se.call(v,"key")){L=t(b);var I=Object.keys(v).filter(function(K){return K!=="key"});c=0<I.length?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}",F[L+c]||(I=0<I.length?"{"+I.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
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===se?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 B: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 $: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===$)return"<...>";try{var k=t(b);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function h(){var b=ce.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 xe[b]||(xe[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(he(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:
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,I,L),F[L+c]=!0)}if(L=null,d!==void 0&&(r(d),L=""+d),l(v)&&(r(v.key),L=""+v.key),"key"in v){d={};for(var ae in v)ae!=="key"&&(d[ae]=v[ae])}else d=v;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=fe,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"),q=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),de=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Object.prototype.hasOwnProperty,he=Array.isArray,Ae=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(b){return b()}};var pe,xe={},Q=S["react-stack-bottom-frame"].bind(S,n)(),J=Ae(o(n)),F={};ja.Fragment=g,ja.jsx=function(b,v,d,c,i){var y=1e4>de.recentlyCreatedOwnerStacks++;return A(b,v,d,!1,c,i,y?Error("react-stack-top-frame"):Q,y?Ae(o(b)):J)},ja.jsxs=function(b,v,d,c,i){var y=1e4>de.recentlyCreatedOwnerStacks++;return A(b,v,d,!0,c,i,y?Error("react-stack-top-frame"):Q,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"},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 Fe=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(Fe||{});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:Fe.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:Fe.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:qe,chartTitleFontStyle:[],chartTitleColor:Fe.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:Fe.black,xAxisColorInverted:Fe.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:qe,xAxisLabelFontStyle:[],xAxisLabelColor:Fe.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:Fe.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:Fe.transparent,yAxisColorInverted:Fe.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:qe,yAxisLabelFontStyle:[],yAxisLabelColor:Fe.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:Fe.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:Fe.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:qe,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:Fe.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:Fe.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:Fe.black,vennLabelColor:Fe.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:Fe.black},plotArea:{plotAreaColor:Fe.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:Fe.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:Fe.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:Fe.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:qe,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:Fe.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:Fe.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:Fe.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:Fe.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:Fe.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:Fe.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:Fe.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:Fe.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:Fe.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:qe,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:Fe.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:Fe.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:Fe.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:Fe.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:Fe.black,connectorFontColor:Fe.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:Fe.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:qe,footerNoteFontStyle:[],footerNoteFontColor:Fe.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:Fe.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:Fe.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:qe,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:Fe.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:qe,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:Fe.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:Fe.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:Fe.black,bubbleBorderColor:Fe.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:Fe.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:Fe.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:qe,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:Fe.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:qe,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:Fe.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),q=V<j[0]+10?V:j[0]+10,Z=u?bt(n.xAxisLabel.xAxisNumberFormat,s).map(b=>b):s,Y=Z?Z[0]+"":"",N=Y.length;Z&&Z.forEach(b=>{b=b+"";let v=b.trim()?.length||0;v>N&&(N=v,Y=b.trim())});let P=Tt(Y,n.xAxisLabel.xAxisLabelFontSize,n.xAxisLabel.xAxisLabelFontFamily,n.xAxisLabel.xAxisLabelRotation),z=P[0]+5,te=P[3]+10,oe;n.xAxisLabel.labelTextWrap?n.xAxisLabel.multiLineLabelWrap?oe=n.xAxisLabel.maxXAxisLabelWidth:oe=te<G*.15?te:G*.15:oe=te;let de=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;de=de>G*.1?G*.1:de;let se=p?0:n.xAxisLabel.xAxisLabelVisibility?oe:0,he=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;he=he>g*.1?g*.1:he;const Ae=r*1.1,pe=h*1.1;let xe=n.yAxisLabel.yAxisLabelVisibility?Ni(Ae,pe,n,!1,A)+5:kl(n,T.max(l,b=>b?.length||0)||0)+10,Q=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:q,dimensionHeightWidthArray:P,actualDimesionWidth:z,maxDimensionWidth:te,xTitle:de,xLabel:se,yTitle:he,yLabel:xe,secondaryYLabel:Q,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 q=0,Z=0;const Y=m&&!S?H.secondaryYLabel+H.secondaryAxisTitleWidth:0;switch(G){case Be.none:case Be.none:Z=15+Y,q=g+5;break;case Be.top:Z=j?g+5:15+Y,q=j?5+Y+H.xTitle:g+5;break;case Be.right:Z=j?g+5+H.legendMargin:H.legendMargin+Y+20,q=j?5+Y+H.xTitle+H.legendMargin:g+5;break;case Be.bottom:Z=j?g+5:15+Y,q=j?5+Y+H.xTitle:g+5;break;case Be.left:q=H.legendMargin+g+33,Z=15+Y;break;default:Z=15+Y,q=g+5}const N=n.chartPadding?.paddingArrayLTRB;return N&&(q+=N[0],Z+=N[2]),n.dataTableProperties&&n.dataTableProperties.dataTable&&A&&!S&&(q=q+35),{left:q,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,q=S?g.yTitle+g.yLabel:g.xTitle+g.xLabel;let Z=0,Y=0;switch(V){case Be.none:Z=g.chartTitleHeight+5,Y=q+5+j;break;case Be.top:Z=35+g.chartTitleHeight,Y=q+j;break;case Be.right:Z=g.chartTitleHeight+5,Y=q+5+j;break;case Be.bottom:Y=30+q+j,Z=g.chartTitleHeight+5;break;case Be.left:Z=g.chartTitleHeight+5,Y=q+5+j;break;default:Z=g.chartTitleHeight+5,Y=q+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 P=n.chartPadding?.paddingArrayLTRB;return P&&(Z+=P[1],Y+=P[3]),{top:Z,bottom:Y,chartTitleHeight:g.chartTitleHeight,xAxisRelatedMargin:q,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,q=e-G.top-G.bottom,Z,Y=!1;({visibleBars:V,columnWidth:Z,scrollbarVisible:Y}=$l(S?q:j,n,p));const N={top:G.top,bottom:G.bottom,left:g.left,right:g.right};if(S){const P=A?30:0;N.right=N.right+P}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 q=t.yAxisLabel.yAxisMaxText;n=q.length>0?parseFloat(q):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 q=H<A?r:l;V=V<q?q:V}if(n){let q=p>m?n:e;V=V<q?q:V}n&&l&&(V=p>H?n:l);let j=u<S?h:o;if(x){let q=G<S?h:x;j=j<q?q:j}if(s){let q=g>S?s:h;j=j<q?q: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!==Fe.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 q="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 q=0;q<parseInt(p)&&(j+=u,parseFloat(j.toFixed(5))<=t);q++)S.push(j);else for(let q=0;q<V&&(j+=u,j<=t);q++)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!==Fe.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!==Fe.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!==Fe.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!==Fe.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?bt(o.xAxisLabel.xAxisNumberFormat,g.map(Q=>Q)).map(Q=>Q):g:g.forEach(Q=>{G.push(e.formattedDimensionListMap.get(Q))});let j=!o.plotArea.fitChart&&(e.chartType==re.AreaChart||e.chartType==re.StackAreaChart||e.chartType==re.NormalizedStackAreaChart);t||(t=t);let q=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!==Fe.white?o.xAxisLabel.xAxisBackgroundColor:"none":o.chartArea.chartAreaColor);const P=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",te;o.xAxisLabel.labelTextWrap?o.xAxisLabel.multiLineLabelWrap?te=o.xAxisLabel.maxXAxisLabelWidth:te=V<x*.15?V:x*.15:te=o.xAxisLabel.xAxisLabelRotation==0?m:V;const oe=H.step(),de=parseInt(o.xAxisLabel.xAxisLabelFontSize)*1.2,se=Math.floor(oe/de),he=o.xAxisLabel.xAxisLabelRotation==0;let Ae=P.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(te)).style("height",oe+"px").attr("transform",(Q,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:oe/2}`:-te/2+" , "+(Y==="1"?"-15":"8")})`);he||Ae.style("overflow","visible"),Pi()==="safari"&&Ae.attr("width",o.xAxisLabel.labelTextWrap?V<x*.125?V:x*.125:r).attr("height","20px");let xe=Ae.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",Pi()==="safari"||Y==="1"?"":o.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(o.xAxisLabel.labelTextWrap&&!o.xAxisLabel.multiLineLabelWrap||!o.xAxisLabel.labelTextWrap)&&xe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),o.xAxisLabel.labelTextWrap&&o.xAxisLabel.multiLineLabelWrap&&xe.style("-webkit-line-clamp",se.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),xe.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",q.includes("Italic")?"Italic":"").style("text-decoration",q.includes("Underline")?"Underline":"").style("font-weight",q.includes("Bold")?"Bold":"").style("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===re.ColumnHistogramChart?xe.attr("title",(Q,J)=>_e(Q,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((Q,J)=>_e(Q,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)):xe.attr("title",(Q,J)=>(""+G[J]).trim()).html((Q,J)=>(""+G[J]).trim()),P.selectAll("text").style("visibility",(o.xAxisLabel.xAxisLabelVisibility,"hidden")),P.selectAll("line").style("stroke",o.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility||o.plotArea.gridLinesVertical?"visible":"hidden"),P.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}`}},bt=(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,q,Z,Y,N,P){try{const z=m===re.TornadoChart;let te=new Map,oe=x.annotation.annotationType??"1",de=x.annotation.annotationPosition.toString()!="4"?x.annotation.annotationPosition:null,se=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const he=x.annotation.connectorType?.toLowerCase()==="curve";if(x.annotation.annotationVisibility){let Ae=[oe=="1"?"connector":""],pe=[],xe=n.annotation(),Q=x.annotation.connectorType,J=x.annotation.annotationVisibility,F=x.annotation.annotationFontStyle,b=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates)),v=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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||L.properties.annotationPosition,Labelcolor:L.properties[se],hoverText:La(L,P),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 I=0;I<t[0].data.length;I++)a.data[I]&&pe.push({Dimension:a.data[I].dimension,Measure:a.data[I].value,Legend:a.data[I].legend,LabelPosition:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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:de||a.properties.annotationPosition,Labelcolor:a.properties[se],hoverText:La(a,P),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 I={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:v,curve:si[x.annotation.connectorCurve],points:he?$a(0,0):[[0,0],[0,0]]},disable:Ae,subject:{height:15,width:15},color:a.Labelcolor,type:di(n,parseFloat(oe)),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(I)}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(I)}),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,te=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}]))):te=new Map(b.map(a=>[a.legendUniqueId,a])),d.forEach(a=>{const L=a.data.legendUniqueId;if(b.length!=0){const I=te.get(L);I&&(a.dx=I.dx,a.dy=I.dy,a.data.isVisible=I.isVisible??!0,I?.connectorPoints&&I.connectorPoints.length>=(he?3:2)?a.connector.points=I.connectorPoints:a.connector.points=he?$a(a.dx,a.dy):[[0,0],[0,0]])}c.push(a)}),xe.editMode(x.annotation.annotationDraggable&&Z).accessors({x:function(a){if(N){let L=a.x.axis===at.primary?r:o,I=a.x.axis;return Ei(x,a.x.measure?a.x.measure:0,a.position,L,y,void 0,m,Y,I)}else if(m===re.ColumnChart){const L=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,I=j(L);return I!=null?e(a.x)+I-(q-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,I=j&&m!==re.DotPlot?j(L):0;return z?j(a.y)+j.bandwidth()/2:j?e(a.y)+I-(q-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(I=>I.data.x==a.data.x&&I.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(I=>[...I])||[])}),V){const L=c.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(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-${v}`).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(I=>I.data.x==a.data.x&&I.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,xe,v,N);if(x.animation?.animationEnabled){const a=x.animation.animationDuration,L=Xe[x.animation.animationEffect],I=xe.accessors(),ae=m===re.LineChart,K=m===re.DotPlot,be=(Le,we=0)=>{const Te=I.x(Le.data),ee=I.y(Le.data);return`translate(${Te+we}, ${ee})`};if(K)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],we=Math.min(Le[0],Le[1]),Te=Math.max(Le[0],Le[1])-we,ee=(ke,O=100)=>{for(let De=0;De<=O;De++){const Ve=De/O;if((L??T.easeLinear)(Ve)>=ke)return Ve}return 1};f.selectAll(".annotation").attr("opacity",0).each(function(ke){const O=I.x(ke.data)??we,De=Te>0?Math.max(0,Math.min(1,(O-we)/Te)):0,Ve=ee(De)*a;T.select(this).transition().delay(Ve).duration(0).attr("opacity",1)})}else f.selectAll(".annotation").attr("transform",function(Le){if(N){const we=r?r(0):0,Te=I.y(Le.data);return`translate(${we}, ${Te})`}else{const we=I.x(Le.data),Te=Le.data?.y?.axis===at.primary?r:o??r,ee=Te?Te(0):0;return`translate(${we}, ${ee})`}}).transition().duration(a).ease(L).attr("transform",function(Le){const we=I.x(Le.data),Te=I.y(Le.data);return`translate(${we}, ${Te})`})}}}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,q,Z,Y){try{let N=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let P=[N=="1"?"connector":""],z=[],te=new Map,oe=n.annotation(),de=u.annotation.connectorType,se=u.annotation.annotationVisibility,he=u.annotation.annotationFontStyle,Ae=[],pe=[],xe=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const Q=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(se){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 I=0;I<t[y].data.length;I++)z.push(i.data[I]);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 I=0;I<t[y].data.length;I++)z.push({dimension:i.data[I].dimension,value:i.data[I].value,legend:i.data[I].legend,labelPosition:i.data[I].labelPosition,labelColor:i.data[I].labelColor,axis:i.data[I].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(I=>I.key===i.properties.legend);a!==-1&&l[a].forEach((I,ae)=>{switch(String(l[a].individualAnnotationVisibility)){case"1":z.push(l[a][ae]);break;case"2":break;case"3":let K=l[a][0];z.find(Te=>Te.key==K.key)||z.push(K);break;case"4":let be=l[a][l[0].length-1];z.find(Te=>Te.key==be.key)||z.push(be);break;case"5":let Le=l[a][0],we=l[a][l[0].length-1];if(!z.find(Te=>Te.key==Le.key||Te.key==we.key)){z.push(l[a][0]),z.push(l[a][l[0].length-1]);break}}});break;case re.StackAreaChart:const L=s.findIndex(I=>I.key===i.properties.legend);L!=-1&&s[L].forEach((I,ae)=>{switch(String(s[L].individualAnnotationVisibility)){case"1":z.push(s[L][ae]);break;case"2":break;case"3":let K=s[L][0];z.find(Te=>Te.key==K.key)||z.push(K);break;case"4":let be=s[L][s[0].length-1];z.find(Te=>Te.key==be.key)||z.push(be);break;case"5":let Le=s[L][0],we=s[L][s[0].length-1];if(!z.find(Te=>Te.key==Le.key||Te.key==we.key)){z.push(Le),z.push(we);break}}});break}});break}let v=0;z.forEach((i,y)=>{v<i.value&&(v=i.value)});let d=v*.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:xe,curve:si[u.annotation.connectorCurve],points:Q?$a(0,0):[[0,0],[0,0]]},disable:P,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,te=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}]))):te=new Map(J.map(i=>[i.legendUniqueId,i])),F.forEach(i=>{const y=i.data.legendUniqueId;if(J.length!=0){const f=te.get(y);f&&(i.dx=f.dx,i.dy=f.dy,i.data.isVisible=f.isVisible??!0,f?.connectorPoints&&f.connectorPoints.length>=(Q?3:2)?i.connector.points=f.connectorPoints:i.connector.points=Q?$a(i.dx,i.dy):[[0,0],[0,0]],u.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&b.push(i)}),oe.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])||[])}),q){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}));q(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-${xe}`).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,he,oe,xe,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=Xe[u.animation.animationEffect],f=oe.accessors();c.selectAll(".annotation").attr("transform",function(a){const L=f.x(a.data),I=a.data.type||a.type,K=(a.data?.x?.axis||a.data?.axis)===at.primary?r:o;let be;return I===re.StackColumnChart||I===re.StackAreaChart?be=K(a.data.prevValue??0):be=K(0),`translate(${L}, ${be})`}).transition().duration(i).ease(y).attr("transform",function(a){const L=f.x(a.data),I=f.y(a.data);return`translate(${L}, ${I})`})}}}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,q,Z,Y){try{let N=function(f,a,L,I){a===0&&f.append("foreignObject").attr("x",-Z.left).attr("y",he).attr("class","blankClass").attr("width",Z.left).attr("height",y).append("xhtml:div").style("width",Z.left).style("height",`${y}px`).style("border-width",Q?`0px 0px ${P.dataTableAxisLabel?F:0}px 0px`:"0px 0px 0px 0px").style("border-style",Q?`solid ${b} ${b} solid`:"solid solid solid solid").style("border-color",Q?`black ${J} ${J} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const K=f.append("foreignObject").attr("x",-Z.left).attr("y",he+xe).attr("width",Z.left).attr("height",I).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",se).style("height",`${I}px`).style("padding-left",P.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>ka(S,a,void 0,te,oe,"width")).style("border-style",()=>ka(S,a,void 0,te,oe,"style")).style("border-color",()=>ka(S,a,void 0,te,oe,"color"));if(!P.disableLegendIcon)switch(u){case re.ColumnChart:case re.StackColumnChart:case re.NormalizedStackColumnChart:K.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,K,S);break;case re.AreaChart:case re.StackAreaChart:case re.NormalizedStackAreaChart:Hi(L,K,S);break}const be=L.properties.legend,Le=S?.legends?.legendColorMode=="1"?L?.properties?.color:S?.legends?.legendSelectedUnicolor,we=K.append("xhtml:div").style("max-width",se).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",P.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",be).text(be);P.legendsWrapText&&we.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const P=S.dataTableProperties,z=P.dataTableFontStyle,te=g.length,oe=o.length,de=V[0]?V[0]:0,se=l.step(),he=Y-A,Ae=2;let pe=20,xe=0;const Q=S.dataTableOuterBorder.borderButtonVisibility,J=S.dataTableOuterBorder.lineColor,F=S.dataTableOuterBorder.lineWidth,b=S.dataTableOuterBorder.lineStyle,v=f=>f===0?se+Ae+de/2:f===te-1?se+Ae-de/2:se,d=f=>_e(u.includes("100stack")?f.TooltipMeasure/f.TotalMeasure:f.TooltipMeasure||f.value,P.dataTableDisplayUnits,P.dataTableNumberFormat,P.dataTableDecimalPrecision),c=f=>f.style("font-size",P.dataTableFontSize+"px").style("font-family",P.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"+q).remove();const i=r.append("g").attr("id","dataTableG"+q);let y=0;P.dataTableAxisLabel&&(y=mi(g[0],void 0,S),pe=y),o.forEach((f,a)=>{xe+=!P.dataTableAxisLabel&&a===0?0:pe,pe=f.properties.height,P.dataTableLegends&&N(i,a,f,pe);const L=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+q+" .foreignObject").data(()=>f.data).enter().filter(I=>l(I.dimension)).append("g").attr("fill",Fe.transparent).attr("transform",(I,ae)=>`translate(${ae===0?0:l(I.dimension)-se/2},0)`);a===0&&P.dataTableAxisLabel&&L.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",he).attr("id",(I,ae)=>ae).attr("width",(I,ae)=>v(ae)).attr("height",`${y}px`).append("xhtml:div").style("width",(I,ae)=>v(ae)).style("height",`${y}px`).style("border-width",(I,ae)=>ka(S,ae,void 0,te,oe,"width","colHeaders")).style("border-style",(I,ae)=>ka(S,ae,void 0,te,oe,"style","colHeaders")).style("border-color",(I,ae)=>ka(S,ae,void 0,te,oe,"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",I=>j.get(Array.isArray(I.dimension)?I.dimension[0]:I.dimension)).text(I=>j.get(Array.isArray(I.dimension)?I.dimension[0]:I.dimension)),L.append("foreignObject").attr("x",0).attr("y",he+xe).attr("width",(I,ae)=>v(ae)).attr("height",pe).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(I,ae)=>v(ae)).style("height",`${pe}px`).style("line-height",`${pe}px`).style("border-width",(I,ae)=>ka(S,a,ae,te,oe,"width")).style("border-style",(I,ae)=>ka(S,a,ae,te,oe,"style")).style("border-color",(I,ae)=>ka(S,a,ae,te,oe,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(c).style("color",P.dataTableLabelColor).attr("title",I=>d(I)).text(I=>d(I))})}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,q=u?g:G,Z=o-1,Y=h-1;let N=G,P=G,z=G,te=G;switch(l?(N=V,z=j,te=e===0?V:G,P=e===Z?V:q):r===void 0?(te=V,P=G,N=e===0&&!S?V:G,z=e===Y?V:j):(N=e===0&&!S?V:G,z=e===Y?V:j,te=r===0?q:G,P=r===Z?V:q),n){case"width":return`${N.w}px ${P.w}px ${z.w}px ${te.w}px`;case"style":return`${N.s} ${P.s} ${z.s} ${te.s}`;case"color":return`${N.c} ${P.c} ${z.c} ${te.c}`}}catch(s){throw s}}function xt(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(q=>{j||(j=Fl(q,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,q,Z){try{let Y=x.annotation.annotationType??"1";if(x.annotation.annotationVisibility){let N=[Y=="1"?"connector":""],P=[],z=new Map,te=n.annotation(),oe=x.annotation.connectorType,de=x.annotation.annotationVisibility,se=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",he=x.annotation.annotationFontStyle,Ae=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";const pe=x.annotation.connectorType?.toLowerCase()==="curve";let xe=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates));xe=Li(xe,x,m);let Q=[],J=[];switch(xe.length!=0&&xe.forEach(d=>{d.dx=d.dx*u/d.width,d.dy=d.dy*A/d.height,d.width=u,d.height=A}),de){case"2":t.forEach(d=>P.push(d[0]));break;case"3":t.forEach(d=>P.push(d[d.length-1]));break;case"4":t.forEach(d=>P.push(d[0])),t.forEach(d=>P.push(d[d.length-1]));break;case"1":for(let d=0;d<t[0].length;d++)t.forEach(c=>P.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++)P.push(d[i]);break;case"2":break;case"3":P.push(d[0]);break;case"4":P.push(d[t[0].length-1]);break;case"5":P.push(d[0]),P.push(d[t[0].length-1]);break}});break}let F=0;P.forEach((d,c)=>{F<d.Measure&&(F=d.Measure)});let b=F*.1;x.annotation.annotationHideZeroValues&&(P=P.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)),P.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[se]?d.properties[se]:d.data.labelColor,type:di(n,parseFloat(Y)),height:A,width:u};p.includes(d.data.dimension)&&El(H,S,Z,d,r)&&Q.push(i)}),Q=Rt(Q,x,d=>Z?d.data.x:d.data.y),xe.length===0?(xe=Q,z=new Map(xe.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(xe.map(d=>[d.legendUniqueId,d])),Q.forEach(d=>{const c=d.data.legendUniqueId;if(xe.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)}),te.editMode(x.annotation.annotationDraggable&&q).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,xe.forEach(c=>{c.data.x==d.data.x&&c.data.y==d.data.y&&(v.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)}v.selectAll(".connector").attr("hoverId",c=>c.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]),v.selectAll(`.connector-${Ae}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),v.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(),v.selectAll(".annotation-note-label").filter(c=>c.data&&c.data.isVisible).style("display","block")}).on("noteclick",function(d){x.annotation.annotationDraggable&&q&&(d.data.isVisible=!1,xe.forEach(c=>{c.data.x==d.data.x&&c.data.y==d.data.y&&(v.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)}),v.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 v=fi(G,x,h,he,te,Ae,Z);if(x.animation?.animationEnabled){const d=x.animation.animationDuration,c=Xe[x.animation.animationEffect],i=te.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,I=(ae,K=100)=>{for(let be=0;be<=K;be++){const Le=be/K;if((c??T.easeLinear)(Le)>=ae)return Le}return 1};v.selectAll(".annotation").attr("opacity",0).each(function(ae){const K=i.x(ae.data)??a,be=L>0?Math.max(0,Math.min(1,(K-a)/L)):0,Le=I(be)*d;T.select(this).transition().delay(Le).duration(0).attr("opacity",1)})}else v.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!==Fe.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!==Fe.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!==Fe.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} />`,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=fe,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"),B=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),ce=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,he=Array.isArray,Ae=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(b){return b()}};var pe,xe={},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>ce.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>ce.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"},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 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,B=Z?Z[0]+"":"",N=B.length;Z&&Z.forEach(b=>{b=b+"";let k=b.trim()?.length||0;k>N&&(N=k,B=b.trim())});let E=Tt(B,n.xAxisLabel.xAxisLabelFontSize,n.xAxisLabel.xAxisLabelFontFamily,n.xAxisLabel.xAxisLabelRotation),$=E[0]+5,q=E[3]+10,se;n.xAxisLabel.labelTextWrap?n.xAxisLabel.multiLineLabelWrap?se=n.xAxisLabel.maxXAxisLabelWidth:se=q<G*.15?q:G*.15:se=q;let ce=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;ce=ce>G*.1?G*.1:ce;let oe=p?0:n.xAxisLabel.xAxisLabelVisibility?se:0,he=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;he=he>g*.1?g*.1:he;const Ae=r*1.1,pe=h*1.1;let xe=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:$,maxDimensionWidth:q,xTitle:ce,xLabel:oe,yTitle:he,yLabel:xe,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 B=m&&!S?H.secondaryYLabel+H.secondaryAxisTitleWidth:0;switch(G){case Be.none:case Be.none:Z=15+B,K=g+5;break;case Be.top:Z=j?g+5:15+B,K=j?5+B+H.xTitle:g+5;break;case Be.right:Z=j?g+5+H.legendMargin:H.legendMargin+B+20,K=j?5+B+H.xTitle+H.legendMargin:g+5;break;case Be.bottom:Z=j?g+5:15+B,K=j?5+B+H.xTitle:g+5;break;case Be.left:K=H.legendMargin+g+33,Z=15+B;break;default:Z=15+B,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,B=0;switch(V){case Be.none:Z=g.chartTitleHeight+5,B=K+5+j;break;case Be.top:Z=35+g.chartTitleHeight,B=K+j;break;case Be.right:Z=g.chartTitleHeight+5,B=K+5+j;break;case Be.bottom:B=30+K+j,Z=g.chartTitleHeight+5;break;case Be.left:Z=g.chartTitleHeight+5,B=K+5+j;break;default:Z=g.chartTitleHeight+5,B=K+5+j}n.xAxisLabel.xAxisPosition&&!S&&n.xAxisLabel.xAxisPosition=="1"&&(B=B-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],B+=E[3]),{top:Z,bottom:B,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,B=!1;({visibleBars:V,columnWidth:Z,scrollbarVisible:B}=$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:B}}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 B=0;B<=j;B++){const N=V+B*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 B=o.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const N=t.append("g").attr("id","x-axis");N.append("rect").attr("transform",`translate(1,${B==="0"?h>0?S-h:S:B==="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,${B=="0"?h>0?S-h:S:B=="1"?0:n(0)})`).call(l);let $=B==="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 se=H.step(),ce=parseInt(o.xAxisLabel.xAxisLabelFontSize)*1.2,oe=Math.floor(se/ce),he=o.xAxisLabel.xAxisLabelRotation==0;let Ae=E.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(q)).style("height",se+"px").attr("transform",(O,J)=>`rotate(${B==="1"?-o.xAxisLabel.xAxisLabelRotation:o.xAxisLabel.xAxisLabelRotation!=0?180-o.xAxisLabel.xAxisLabelRotation:0}) translate (${o.xAxisLabel.xAxisLabelRotation!=0?$+`, -${J==0&&j?15:se/2}`:-q/2+" , "+(B==="1"?"-15":"8")})`);he||Ae.style("overflow","visible"),Pi()==="safari"&&Ae.attr("width",o.xAxisLabel.labelTextWrap?V<x*.125?V:x*.125:r).attr("height","20px");let xe=Ae.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",Pi()==="safari"||B==="1"?"":o.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(o.xAxisLabel.labelTextWrap&&!o.xAxisLabel.multiLineLabelWrap||!o.xAxisLabel.labelTextWrap)&&xe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),o.xAxisLabel.labelTextWrap&&o.xAxisLabel.multiLineLabelWrap&&xe.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"),xe.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?xe.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)):xe.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,B,N,E){try{const $=m===re.TornadoChart;let q=new Map,se=x.annotation.annotationType??"1",ce=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 Ae=[se=="1"?"connector":""],pe=[],xe=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:ce||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:ce||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:ce||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:ce||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:ce||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:ce||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:ce||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:ce||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:ce||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:ce||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:$?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:he?$a(0,0):[[0,0],[0,0]]},disable:Ae,subject:{height:15,width:15},color:a.Labelcolor,type:di(n,parseFloat(se)),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>=(he?3:2)?a.connector.points=P.connectorPoints:a.connector.points=he?$a(a.dx,a.dy):[[0,0],[0,0]])}c.push(a)}),xe.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,B,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 $?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,xe,k,N);if(x.animation?.animationEnabled){const a=x.animation.animationDuration,L=Xe[x.animation.animationEffect],P=xe.accessors(),ae=m===re.LineChart,Q=m===re.DotPlot,be=(Le,Fe=0)=>{const Te=P.x(Le.data),te=P.y(Le.data);return`translate(${Te+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]),Te=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=Te>0?Math.max(0,Math.min(1,(ee-Fe)/Te)):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,Te=P.y(Le.data);return`translate(${Fe}, ${Te})`}else{const Fe=P.x(Le.data),Te=Le.data?.y?.axis===at.primary?r:o??r,te=Te?Te(0):0;return`translate(${Fe}, ${te})`}}).transition().duration(a).ease(L).attr("transform",function(Le){const Fe=P.x(Le.data),Te=P.y(Le.data);return`translate(${Fe}, ${Te})`})}}}catch($){throw $}}function Il(t,e,r,o,h,n,l,s,x,m,A,u,S,p,H,g,G,V,j,K,Z,B){try{let N=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let E=[N=="1"?"connector":""],$=[],q=new Map,se=n.annotation(),ce=u.annotation.connectorType,oe=u.annotation.annotationVisibility,he=u.annotation.annotationFontStyle,Ae=[],pe=[],xe=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:$.push({...i.data[0],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(f=>$.push(f[0]));break;case re.StackAreaChart:s.forEach(f=>$.push(f[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case re.ColumnChart:case re.LineChart:case re.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case re.StackAreaChart:s.forEach(y=>$.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:$.push({...i.data[0],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(f=>$.push(f[0]));break;case re.StackAreaChart:s.forEach(f=>$.push(f[0]));break}}),t.forEach(i=>{switch(i.properties.type){case re.ColumnChart:case re.LineChart:case re.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case re.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case re.StackAreaChart:s.forEach(y=>$.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=>$.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=>$.push(a));break;case re.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 re.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 re.AreaChart:case re.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 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":$.push(l[a][ae]);break;case"2":break;case"3":let Q=l[a][0];$.find(Te=>Te.key==Q.key)||$.push(Q);break;case"4":let be=l[a][l[0].length-1];$.find(Te=>Te.key==be.key)||$.push(be);break;case"5":let Le=l[a][0],Fe=l[a][l[0].length-1];if(!$.find(Te=>Te.key==Le.key||Te.key==Fe.key)){$.push(l[a][0]),$.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":$.push(s[L][ae]);break;case"2":break;case"3":let Q=s[L][0];$.find(Te=>Te.key==Q.key)||$.push(Q);break;case"4":let be=s[L][s[0].length-1];$.find(Te=>Te.key==be.key)||$.push(be);break;case"5":let Le=s[L][0],Fe=s[L][s[0].length-1];if(!$.find(Te=>Te.key==Le.key||Te.key==Fe.key)){$.push(Le),$.push(Fe);break}}});break}});break}let k=0;$.forEach((i,y)=>{k<i.value&&(k=i.value)});let d=k*.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!=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:xe,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)}),se.editMode(u.annotation.annotationDraggable&&B).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-${xe}`).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&&B&&(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,he,se,xe,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=Xe[u.animation.animationEffect],f=se.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,B){try{let N=function(f,a,L,P){a===0&&f.append("foreignObject").attr("x",-Z.left).attr("y",he).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",he+xe).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,se,"width")).style("border-style",()=>ka(S,a,void 0,q,se,"style")).style("border-color",()=>ka(S,a,void 0,q,se,"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,$=E.dataTableFontStyle,q=g.length,se=o.length,ce=V[0]?V[0]:0,oe=l.step(),he=B-A,Ae=2;let pe=20,xe=0;const O=S.dataTableOuterBorder.borderButtonVisibility,J=S.dataTableOuterBorder.lineColor,F=S.dataTableOuterBorder.lineWidth,b=S.dataTableOuterBorder.lineStyle,k=f=>f===0?oe+Ae+ce/2:f===q-1?oe+Ae-ce/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",$.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;E.dataTableAxisLabel&&(y=mi(g[0],void 0,S),pe=y),o.forEach((f,a)=>{xe+=!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",he).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,se,"width","colHeaders")).style("border-style",(P,ae)=>ka(S,ae,void 0,q,se,"style","colHeaders")).style("border-color",(P,ae)=>ka(S,ae,void 0,q,se,"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",he+xe).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,se,"width")).style("border-style",(P,ae)=>ka(S,a,ae,q,se,"style")).style("border-color",(P,ae)=>ka(S,a,ae,q,se,"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,B=h-1;let N=G,E=G,$=G,q=G;switch(l?(N=V,$=j,q=e===0?V:G,E=e===Z?V:K):r===void 0?(q=V,E=G,N=e===0&&!S?V:G,$=e===B?V:j):(N=e===0&&!S?V:G,$=e===B?V:j,q=r===0?K:G,E=r===Z?V:K),n){case"width":return`${N.w}px ${E.w}px ${$.w}px ${q.w}px`;case"style":return`${N.s} ${E.s} ${$.s} ${q.s}`;case"color":return`${N.c} ${E.c} ${$.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 B=x.annotation.annotationType??"1";if(x.annotation.annotationVisibility){let N=[B=="1"?"connector":""],E=[],$=new Map,q=n.annotation(),se=x.annotation.connectorType,ce=x.annotation.annotationVisibility,oe=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",he=x.annotation.annotationFontStyle,Ae=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";const pe=x.annotation.connectorType?.toLowerCase()==="curve";let xe=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates));xe=Li(xe,x,m);let O=[],J=[];switch(xe.length!=0&&xe.forEach(d=>{d.dx=d.dx*u/d.width,d.dy=d.dy*A/d.height,d.width=u,d.height=A}),ce){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(B)),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),xe.length===0?(xe=O,$=new Map(xe.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}]))):$=new Map(xe.map(d=>[d.legendUniqueId,d])),O.forEach(d=>{const c=d.data.legendUniqueId;if(xe.length!=0){const i=$.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,xe.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,xe.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,he,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(B){throw B}}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})
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,q=parseInt(t.xAxisLabel.xAxisPosition),Z=Lt(m,o),Y=u?bt(t.xAxisLabel.xAxisNumberFormat,Z.map(xe=>xe)).map(xe=>xe):Z;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let N;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?N=t.xAxisLabel.maxXAxisLabelWidth:N=r;let P=g.step();const z=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,te=Math.floor(P/z),oe=t.xAxisLabel.xAxisLabelRotation==0;let de=e.append("rect").attr("id","yAxisRect").attr("transform",A===re.TornadoChart?`translate(${-N-1},0)`:`translate(${q===0?-N-5:q===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!==Fe.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const se=e.append("g").attr("id","yAxisG").attr("transform",V?`translate(${s(0)},0)`:`translate(${q===0?0:q===1?h:s(0)},0)`).call(n);let pe=se.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",N).attr("height",P+"px").attr("transform",Rl(V,q,t,s,x,N,r,P)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",oe?"center":"start").style("align-items",oe?"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",te.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",(xe,Q)=>Y[Q]).html((xe,Q)=>Y[Q]),A===re.TornadoChart){if(l){const xe=e.append("g").attr("transform",`translate(${s(0)},0)`).call(l);xe.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),xe.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),xe.selectAll("text").style("visibility","hidden")}se.selectAll("text").style("visibility","hidden")}else se.selectAll("text").style("visibility","hidden");se.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),se.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!==Fe.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!==Fe.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 q=m,Z=q+s;let Y=x.dimensionList.slice(q,Z),N=JSON.parse(JSON.stringify(t||[]));N.forEach((he,Ae)=>{const pe=Array.isArray(he?.data)?he.data:[];N[Ae].data=pe.filter(xe=>Y.includes(xe?.dimension))});const P=h?.left??0,z=h?.top??0,te=Number(n)||0,oe=Number(innerHeight)||0,de=Number(G)||0,se=g===0?1:g;if(S){const he=z+(oe-de)*(g===0?0:m)/se;V&&typeof V.attr=="function"&&V.attr("y",he)}else{const he=P+(te-de)*(g===0?0:m)/se;V&&typeof V.attr=="function"&&V.attr("x",he)}u(Y,N,s)}catch(q){typeof ge=="function"&&ge("ColumnChart","updateFromScrollPosition",q)}};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",q=>{if(S){const Y=(Ba(q.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(q.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",q=>{q.preventDefault();const Y=(S?q.deltaY:q.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){try{if(l.total.totalVisibility){const p=l.annotation.annotationVisibility!="5"?10:0;let H=l.total.annotationType??"1",g=[H=="1"?"connector":""],G=h.annotation(),V=l.total.connectorType,j=l.total.totalFontStyle,q=l.total.connectorType?l.total.connectorType.toLowerCase():"None";n=[];let Z=[],Y=Array.from(t,([P,z])=>({Dimension:P,Measure:z}));l.total.totalHideZeroValues&&(Y=Y.filter(P=>P.Measure!==0)),Y.forEach((P,z)=>{let te={note:{label:P.Measure>=1e9&&l.total.totalNumberFormat===".2s"?Math.round(P.Measure/1e9)+"B":_e(P.Measure,l.total.totalDisplayUnits||l.plotArea.plotAreaDisplayUnits,l.total.totalNumberFormat,l.total.totalDecimalPrecision)},data:{y:P.Measure,x:P.Dimension},dx:0,dy:0,connector:{end:q,curve:si[l.total.connectorCurve]},disable:g,subject:{height:15,width:15},color:l.total.totalColor,type:di(h,parseFloat(H)),height:x,width:m};Z.push(te)}),G.editMode(l.total.annotationDraggable&&u).accessors({x:function(P){return S?r(P.y)+25:e(P.x)},y:function(P){return S?e(P.x)-5:r(P.y)-p-15}}).on("dragend",function(P){N.selectAll(".connector").style("stroke",l.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]),N.selectAll(`.connector-${q}`).attr("fill",l.total.connectorColor||"#ccc").style("stroke",l.total.connectorColor||"#ccc"),N.selectAll(".note-line").attr("hoverId",z=>z.data.currentLegend).style("stroke",l.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]).filter(z=>z._dx==0&&z._dy==0).remove()}).accessorsInverse({x:P=>e.invert(P.x),y:P=>r.invert(P.y)}).notePadding(0).annotations(Z);let N=Yl(A,l,o,j,G,q);l.animation?.animationEnabled&&N.selectAll(".annotation").each(function(P){const z=T.select(this),oe=z.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!oe)return;const de=parseFloat(oe[1]),se=parseFloat(oe[2]);if(S){const he=r(0);z.attr("transform",`translate(${he},${se})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${de},${se})`)}else{const he=r(0);z.attr("transform",`translate(${de},${he})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${de},${se})`)}})}}catch(p){throw p}}const Yl=(t,e,r,o,h,n)=>{t.selectAll(".annotation-group").remove();let l=t.append("g").attr("id","annotationGroup").attr("class","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!==Fe.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:Fe.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:Fe.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:Fe.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var Ke=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(Ke||{});const Ul="11px",Bl="1.6";function gt(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 q=m?m+A.bottom:0;oa(e,s,7,o+5,n+5,j-q,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(q=>q.data.forEach(Z=>{Z.markerShape=[re.CombinationLine,re.CombinationArea].includes(r)&&!s.plotArea.plotAreaHideLineAndMarkers?"None":q.properties.markerShape?q.properties.markerShape:"Circle",Z.currentMeasure=q.properties.currentMeasure,Z.markerColor=q.properties.markerColor?q.properties.markerColor:"Blue",Z.alias=q.properties.alias,Z.markerSize=q.properties.markerShape!="None"&&q.properties.markerSize&&q.properties.markerShape!="None"?r==="Area"?s.plotArea.plotAreaHideLineAndMarkers?q.properties.markerSize:0:q.properties.markerSize:0}));let G=t.selectAll(".lineGroup").data(e,q=>q.legend);G.enter().append("g").attr("class","parentGroup").attr("hoverId",q=>(q.properties.alias||q.properties.name||"Legend").replace(/\s+/g,"-")).merge(G).each(function(q){let Y=T.select(this).selectAll("path").data(q.data);const P=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 te=!o(z.dimension)&&o(z.dimension)!==0,oe=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 te?Vt.hidden:oe}).attr("transform",z=>{let te=z.axis==at.primary?h:n;const oe=o(z.dimension),de=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?z[1]>0?te(z[1]):te(z[0]):te(z.value);return`translate(${oe},${de})`}).on("mousemove",function(z,te){const oe=te,de=te,se=T.select(this.parentNode),he=String(x.formattedDimensionListMap.get(Array.isArray(oe.dimension)?oe.dimension[0]:oe.dimension)??""),Ae=H?.(he,te)??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(oe.dimension)?oe.dimension[0]:oe.dimension)},{key:s.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(s.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():te.properties?.currentMeasure?te.properties.currentMeasure:s.yAxisTitle.yAxisTitleText||oe.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(r)?oe[1]-oe[0]:oe.value,s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:de.alias.includes("~$~")?de.alias.split("~$~")[1]:de.alias}],s,z,te,Ae),se.selectAll(".halo").remove(),se.insert("circle",":first-child").attr("class","halo").attr("cx",o(oe.dimension)).attr("cy",()=>{const pe=oe.axis===at.primary?h:n;return[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?oe[1]>0?pe(oe[1]):pe(oe[0]):pe(oe.value)}).attr("fill",de.markerColor).attr("opacity",.5).attr("r",de.markerSize*10),T.select(this).transition().duration(100).attr("transform",()=>{const pe=oe.axis===at.primary?h:n,xe=o(oe.dimension),Q=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?oe[1]>0?pe(oe[1]):pe(oe[0]):pe(oe.value);return`translate(${xe},${Q}) scale(1.3)`})}).on("mouseout",function(z,te){const oe=te,de=T.select(this.parentNode);rt(),de.selectAll(".halo").remove(),T.select(this).transition().duration(100).attr("transform",()=>{const se=oe.axis===at.primary?h:n,he=o(oe.dimension),Ae=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?oe[1]>0?se(oe[1]):se(oe[0]):se(oe.value);return`translate(${he},${Ae}) scale(1)`})});if(s.animation.animationEnabled){const z=s.animation.animationDuration,te=Xe[s.animation.animationEffect]??T.easeLinear;if([re.AreaChart,re.StackAreaChart,re.NormalizedStackAreaChart,re.CombinationArea,re.CombinationStackArea].includes(r)){const de=[re.StackAreaChart,re.NormalizedStackAreaChart,re.CombinationStackArea];P.each(function(se){const he=se.axis===at.primary?h:n,Ae=o(se.dimension),pe=de.includes(r)?se[1]>0?he(se[1]):he(se[0]):he(se.value),xe=h(0);T.select(this).attr("transform",`translate(${Ae},${xe})`).transition().duration(z).ease(te).attr("transform",`translate(${Ae},${pe})`)})}else{const de=o.range(),se=Math.min(de[0],de[1]),he=Math.max(de[0],de[1])-se,Ae=(pe,xe=100)=>{for(let Q=0;Q<=xe;Q++){const J=Q/xe;if(te(J)>=pe)return J}return 1};P.attr("opacity",0).each(function(pe){const xe=o(pe.dimension)??se,Q=he>0?Math.max(0,Math.min(1,(xe-se)/he)):0,J=Ae(Q)*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 q=Math.abs(S[1]-l(j));q<G&&(G=q,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":Fe.white,A=s?"gray":"#d1d5db",u=(N,P=6)=>{if(!N)return"";const z=N.split(" ");let te="";for(let oe=0;oe<z.length;oe+=P)te+=z.slice(oe,oe+P).join(" ")+"<br/>";return te};T.selectAll(".chartTooltip").style("visibility",Vt.hidden);const S=T.select("#chartTooltipDiv").html("").append("div").attr("class",s?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",m).style("background",x).style("border","0px solid #d4d4d4").style("border-radius","4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",s?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),p=r||window.event,H=p.pageX,g=p.pageY,G=t.reduce((N,P)=>{const z=(()=>{switch(l){case"circle":return"border-radius: 50%;";case"square":return"";case"triangle":return"clip-path: polygon(50% 0%, 0% 100%, 100% 100%);";case"cross":return"clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);";case"star":return"clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);";case"diamond":return"clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);";case"wye":return"clip-path: polygon(50% 0%, 60% 40%, 100% 40%, 65% 60%, 75% 100%, 50% 75%, 25% 100%, 35% 60%, 0 40%, 40% 40%);";default:return"border-radius: 50%;"}})();return N+=`
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),B=u?gt(t.xAxisLabel.xAxisNumberFormat,Z.map(xe=>xe)).map(xe=>xe):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 $=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,q=Math.floor(E/$),se=t.xAxisLabel.xAxisLabelRotation==0;let ce=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",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",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",(xe,O)=>B[O]).html((xe,O)=>B[O]),A===re.TornadoChart){if(l){const xe=e.append("g").attr("transform",`translate(${s(0)},0)`).call(l);xe.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),xe.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),xe.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 B=x.dimensionList.slice(K,Z),N=JSON.parse(JSON.stringify(t||[]));N.forEach((he,Ae)=>{const pe=Array.isArray(he?.data)?he.data:[];N[Ae].data=pe.filter(xe=>B.includes(xe?.dimension))});const E=h?.left??0,$=h?.top??0,q=Number(n)||0,se=Number(innerHeight)||0,ce=Number(G)||0,oe=g===0?1:g;if(S){const he=$+(se-ce)*(g===0?0:m)/oe;V&&typeof V.attr=="function"&&V.attr("y",he)}else{const he=E+(q-ce)*(g===0?0:m)/oe;V&&typeof V.attr=="function"&&V.attr("x",he)}u(B,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 B=(Ba(K.y,h.top,h.top+H-V)-h.top)/(H-V)*(g||1);p(B,g,V,j,!1),j.attr("y",h.top+(H-V)*(g===0?0:m)/(g===0?1:g))}else{const B=(Ba(K.x,h.left,h.left+n-V)-h.left)/(n-V)*(g||1);p(B,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 B=(S?K.deltaY:K.deltaX)>0?1:-1;if(p(B,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,B=l.total.connectorType?l.total.connectorType.toLowerCase():"None";n=[];let N=[],E=Array.from(t,([q,se])=>({Dimension:q,Measure:se}));l.total.totalHideZeroValues&&(E=E.filter(q=>q.Measure!==0)),E.forEach((q,se)=>{let ce={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:B,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(ce)}),j.editMode(l.total.annotationDraggable&&u).accessors({x:function(q){if(!S)return e(q.x);if(q.y>=0){const ce=H?.get(q.x)??q.y;return r(ce)+25}const se=p?.get(q.x)??q.y;return r(se)-25},y:function(q){if(S){const ce=parseFloat(l.total.totalFontSize)||12;return l.annotation.annotationVisibility!=="5"?e(q.x)-ce-4:e(q.x)-ce/2}if(q.y>=0){const ce=H?.get(q.x)??q.y;return r(ce)-g-15}const se=p?.get(q.x)??q.y;return r(se)+g+5}}).on("dragend",function(q){$.selectAll(".connector").style("stroke",l.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]),$.selectAll(`.connector-${B}`).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:q=>e.invert(q.x),y:q=>r.invert(q.y)}).notePadding(0).annotations(N);let $=Yl(A,l,o,Z,j,B);l.animation?.animationEnabled&&$.selectAll(".annotation").each(function(q){const se=T.select(this),oe=se.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!oe)return;const he=parseFloat(oe[1]),Ae=parseFloat(oe[2]);if(S){const pe=r(0);se.attr("transform",`translate(${pe},${Ae})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${he},${Ae})`)}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},${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 B=T.select(this).selectAll("path").data(K.data);const E=B.enter().append("path").attr("fill",$=>$.markerColor).merge(B).attr("d",$=>T.symbol().type($i($.markerShape)).size($.markerSize*50)()).attr("visibility",$=>{const q=!o($.dimension)&&o($.dimension)!==0,se=s.marker.markerVisibility?Hl(e,$,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:se}).attr("transform",$=>{let q=$.axis==at.primary?h:n;const se=o($.dimension),ce=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?$[1]>0?q($[1]):q($[0]):q($.value);return`translate(${se},${ce})`}).on("mousemove",function($,q){const se=q,ce=q,oe=T.select(this.parentNode),he=String(x.formattedDimensionListMap.get(Array.isArray(se.dimension)?se.dimension[0]:se.dimension)??""),Ae=H?.(he,q)??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(se.dimension)?se.dimension[0]:se.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||se.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(r)?se[1]-se[0]:se.value,s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ce.alias.includes("~$~")?ce.alias.split("~$~")[1]:ce.alias}],s,$,q,Ae),oe.selectAll(".halo").remove(),oe.insert("circle",":first-child").attr("class","halo").attr("cx",o(se.dimension)).attr("cy",()=>{const pe=se.axis===at.primary?h:n;return[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?se[1]>0?pe(se[1]):pe(se[0]):pe(se.value)}).attr("fill",ce.markerColor).attr("opacity",.5).attr("r",ce.markerSize*10),T.select(this).transition().duration(100).attr("transform",()=>{const pe=se.axis===at.primary?h:n,xe=o(se.dimension),O=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?se[1]>0?pe(se[1]):pe(se[0]):pe(se.value);return`translate(${xe},${O}) scale(1.3)`})}).on("mouseout",function($,q){const se=q,ce=T.select(this.parentNode);rt(),ce.selectAll(".halo").remove(),T.select(this).transition().duration(100).attr("transform",()=>{const oe=se.axis===at.primary?h:n,he=o(se.dimension),Ae=[re.NormalizedStackAreaChart,re.StackAreaChart,re.StackLineChart,re.NormalizedStackLineChart,re.CombinationStackArea].includes(r)?se[1]>0?oe(se[1]):oe(se[0]):oe(se.value);return`translate(${he},${Ae}) scale(1)`})});if(s.animation.animationEnabled){const $=s.animation.animationDuration,q=Xe[s.animation.animationEffect]??T.easeLinear;if([re.AreaChart,re.StackAreaChart,re.NormalizedStackAreaChart,re.CombinationArea,re.CombinationStackArea].includes(r)){const ce=[re.StackAreaChart,re.NormalizedStackAreaChart,re.CombinationStackArea];E.each(function(oe){const he=oe.axis===at.primary?h:n,Ae=o(oe.dimension),pe=ce.includes(r)?oe[1]>0?he(oe[1]):he(oe[0]):he(oe.value),xe=h(0);T.select(this).attr("transform",`translate(${Ae},${xe})`).transition().duration($).ease(q).attr("transform",`translate(${Ae},${pe})`)})}else{const ce=o.range(),oe=Math.min(ce[0],ce[1]),he=Math.max(ce[0],ce[1])-oe,Ae=(pe,xe=100)=>{for(let O=0;O<=xe;O++){const J=O/xe;if(q(J)>=pe)return J}return 1};E.attr("opacity",0).each(function(pe){const xe=o(pe.dimension)??oe,O=he>0?Math.max(0,Math.min(1,(xe-oe)/he)):0,J=Ae(O)*$;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=(N,E=6)=>{if(!N)return"";const $=N.split(" ");let q="";for(let se=0;se<$.length;se+=E)q+=$.slice(se,se+E).join(" ")+"<br/>";return q};T.selectAll(".chartTooltip").style("visibility",Vt.hidden);const S=T.select("#chartTooltipDiv").html("").append("div").attr("class",s?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",m).style("background",x).style("border","0px solid #d4d4d4").style("border-radius","4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",s?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),p=r||window.event,H=p.pageX,g=p.pageY,G=t.reduce((N,E)=>{const $=(()=>{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),q=V<j[0]+10?V:j[0]+
52
52
  color:${A};
53
53
  white-space:nowrap;
54
54
  ">
55
- ${P.key||""}
55
+ ${E.key||""}
56
56
  </span>
57
57
  </div>
58
58
 
@@ -66,28 +66,28 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
66
66
  word-break:break-word;
67
67
  line-height:1.4;
68
68
  ">
69
- ${u(String(P.value),6)}
69
+ ${u(String(E.value),6)}
70
70
  </div>
71
71
 
72
72
  </div>
73
- `,N},"");S.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;">${G}</div>`);const V=S.node(),j=V.offsetWidth,q=V.offsetHeight;let Z=H+15,Y=g+15;Z+j>window.innerWidth&&(Z=H-j-10),Y+q>window.innerHeight&&(Y=g-q-10),S.style("left",`${Z}px`).style("top",`${Y}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 q=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 P=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${P}"]`).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 P=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${P}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(l==Be.top||l==Be.bottom)&&q.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let Z;if(!x){let P=V.properties.type;P==re.ColumnChart||P==re.StackColumnChart?Z=nt.rectangle:P==re.LineChart||P==re.StackLineChart?Z=nt.line:(P==re.AreaChart||P==re.StackAreaChart)&&(Z=nt.areaWithLine)}(x||Z)==nt.circle?jl(V,q):(x||Z)==nt.hollowCircle?Jl(V,q):(x||Z)==nt.line?Wi(V,q,m):(x||Z)==nt.areaWithLine?Hi(V,q,m):(x||Z)==nt.rectangle&&Zl(V,q);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:Fe.black:m.legends.legendSelectedUnicolor;q.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(ne.italic)?ne.italic:"").style("text-decoration",()=>(u?m.legends.legendFontStyle:V.properties.fontStyle).includes(ne.underline)?ne.underline:"").style("font-weight",()=>(u?m.legends.legendFontStyle:V.properties.fontStyle).includes(ne.bold)?ne.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",Fe.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 pt(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=fe.useRef(),H=fe.useRef(l);H.current=l;const g=fe.useRef(s);g.current=s;const G=fe.useRef(x);G.current=x;const V=pt(r.ChartData,r.DimensionList),j=r.DimensionList,q=!1;let Z=!1;const Y=!1;let N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,te=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te,ee,ke,O,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};fe.useEffect(()=>{try{Ne()}catch(E){ge("Columnchart","createColumnChart",E)}},[e]);const Ne=()=>{({formatOptions:e,svg:L,width:i,height:y}=Ct(p,e)),{formatOptions:e}=Qt(e,V,r.DataTableData??[]),Me(),{maxNumberForPrimaryAxis:b,maxNumberForSecondaryAxis:v}=Nt(e,ye.yMinLeft,ye.yMaxLeft,ye.yMinRight,ye.yMaxRight),{margin:oe,yLabel:de,xLabel:se,yTitle:he,xTitle:Ae,dimensionHeightWidthArray:pe,chartTitleHeight:xe,secondaryAxisTitleWidth:Q,legendMargin:J,secondaryYLabel:F,visibleBars:Ye,columnWidth:A,scrollbarVisible:u}=vt(i,y,b,v,ye.yMaxLeft,e,ye.legendList,ye.dimensionList,ye.yMaxRight,Z,Y,t,!1,ye),le(oe),{dataTable:f,dataTableHeight:a}=ea(e,de,he,V,ye.dimensionList,r),kt(L,i,y,e),I=Mt(L,oe),mt(I,e,a,d,c,S,m),Ce(),ue(),Gt(I,e,a,de,Te,c),Z&&ci(I,e,a,F,ke,c,d),St(e,q,L,oe,se,y,Ae,ye.chartType,de,d,c),Ft(c,e,a,q,L,oe,he,de),Ut(L,Z,oe,e,a,c,d,F,Q),wt(L,e,i,xe),Dt(y,L,pe,xe,i,J,e,V,m,a,oe,nt.rectangle,S,n),Bt(V,y,i,L,oe,d,u,Ye,ye,Ve,!1,B)},Me=()=>{const E=[],k=[];let w=[],D=-1/0,R=1/0,W=-1/0,C=1/0,M=1/0,_=-1/0;V.forEach(X=>{k.push(X.properties.legendUniqueId),_=-1/0,M=1/0,X.data.forEach(U=>{E.push(U),X.properties.axis==="Secondary"?(Z=!0,W=Math.max(W,U.value),C=Math.min(C,U.value)):(D=Math.max(D,U.value),R=Math.min(R,U.value)),_=Math.max(_,U.value),M=Math.min(M,U.value)}),X.properties.setColorScale&&ie.set(X.properties.legendUniqueId,T.scaleSequential().domain([M,_]).interpolator(ii.interpolateRgb(X.properties.startColor,X.properties.endColor)))}),ye.chartData=E,ye.legendList=k,ye.yMaxLeft=D,ye.yMinLeft=R>0?0:R,ye.yMaxRight=W,ye.yMinRight=C,w=t?bt(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList).map(X=>X):ye.dimensionList,ye.dimensionList.forEach((X,U)=>{ye.formattedDimensionListMap.set(X,w[U])}),De=JSON.parse(JSON.stringify(V)),O=ye.dimensionList,e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0)},Ce=()=>{let E=ot(P||ye.yMaxLeft,ye.yMinLeft,c,e,ye,N,P).yAxisLabelArray;ye.yMaxLeft=E[E.length-1],ye.yMinLeft=E[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:P!==void 0&&!Number.isNaN(P)?P:ye.yMaxLeft*1.1]).range([a>0?c-a:c,0]),Z&&(K=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?te||0:te||ye.yMaxRight*1.1]).range([a>0?c-a:c,0])),we=[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(O).range(we).padding(.5)},ue=()=>{{let E=ot(P||ye.yMaxLeft,ye.yMinLeft,c,e,ye,N,P);Te=T.axisLeft(ae).tickFormat(k=>_e(k,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,d)).tickValues(E.autoLabelFlag?void 0:E.yAxisLabelArray).ticks(E.customTickValue).tickPadding(8).tickSizeOuter(0)}if(Z){let E=oi(te||K.domain()[1],K.domain()[0],e,c);ke=T.axisRight(K).tickFormat(k=>_e(k,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(E.autoLabelFlag?void 0:E.secondaryYAxisLabelArray).ticks(E.secondaryCustomTickValue??c/30).tickSize(Pt(e,d)).tickPadding(8).tickSizeOuter(0)}},me=()=>{ee=(parseInt(e.xAxisLabel.xAxisPosition)==1?T.axisTop(be):T.axisBottom(be)).tickSize(ia(e,c,a)).tickSizeOuter(0).tickValues(Lt(O,d))},ce=E=>{E.forEach(k=>{k.data.forEach(w=>{w.hideZero=k.properties.hideZeroValues,w.axis=k.properties.axis,w.legendUniqueId=k.properties.legendUniqueId})}),O.forEach(k=>{I.append("rect").attr("id",`dim-background-${k}`).attr("class","dimension-background").attr("x",be(k)-be.step()/2).attr("width",be.step()).attr("y",0).attr("height",c).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),E.forEach(k=>{let w=I.selectAll(".parentGroup").data([k],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(k.data,M=>M.legend+M.dimension),R=D.enter().append("g").attr("class","column-group").attr("hoverId",(k.properties.alias||k.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)`),R.merge(D).attr("transform",M=>`translate(${be(M.dimension)-A/2}, 0)`);const W=R.append("rect").attr("x",M=>Le(M.legendUniqueId)).attr("width",Le.bandwidth()).attr("y",M=>(k.properties.axis===at.primary?ae:K)(0)).attr("height",0).attr("fill",M=>ie.get(k.properties.legendUniqueId)?.(M.value)??k.properties.color).attr("stroke-dasharray",M=>k.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",M=>`${k.properties.stackBorderWidth}px`).attr("stroke",M=>k.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?k.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(Ke.SeriesId,()=>k.properties.legendUniqueId).attr(Ke.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 _=k.properties.axis===at.primary?ae:K;return M.value>0?_(M.value):_(0)}).attr("height",M=>{const _=k.properties.axis===at.primary?ae:K;return Math.abs(_(M.value)-_(0))}),R.merge(D).on("mousemove",(M,_)=>{(k.properties.alias||k.properties.name||"Legend").replace(/ /g,"-");const X=String(ye.formattedDimensionListMap.get(Array.isArray(_.dimension)?_.dimension[0]:_.dimension)??""),U=ht(H.current,X,k.properties);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:X},{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:k.properties.alias}],e,M,k.properties,U)}).on("mouseout",(M,_)=>{(k.properties.alias||k.properties.name||"Legend").replace(/ /g,"-"),rt()}),R.merge(D).on("click",gt(G,g,(M,_)=>({seriesId:k.properties.legendUniqueId,dimValue:Array.isArray(_.dimension)?String(_.dimension[0]):String(_.dimension),legendUniqueId:k.properties.legendUniqueId,seriesDisplayName:k.properties.alias||k.properties.name||""}))),D.exit().remove()}),I.selectAll(".parentGroup").raise()},le=E=>{d=i-E.left-E.right,c=y-E.bottom-E.top},B=(E,k,w)=>{De=k,O=E,Ye=w,$()},$=()=>{ve(),me(),qt(I,ye,se,e,a,ae,ee,pe,y,A,t,d,c,O,be),ce(De),Da(V,be,ae,K,oe,dt,[],[],e,S,y,i,d,O,c,m,L,h,Le,A,o),ta(e.plotArea.fitChart,L,I,f,A,ae,be,Le,void 0,void 0,a,S,e,de,he,ye.dimensionList,d,we,ye.formattedDimensionListMap,m,oe,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=fe.useRef(),g=fe.useRef(l);g.current=l;const G=fe.useRef(s);G.current=s;const V=pt(r.ChartData,r.DimensionList),j=r.DimensionList,q=!1;let Z=!1;const Y=!1;let N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,te=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te=[],ee=[],ke=[],O=[],De=[],Ve=[],Ye=[],ie=[],ye,Ne,Me,Ce=new Map,ve,ue=[],me=[],ce=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};fe.useEffect(()=>{try{$()}catch(Re){ge("CustomColumnchart","createCustomColumnChart",Re)}},[e]);const $=()=>{({formatOptions:e,svg:L,width:i,height:y}=Ct(H,e)),E(),{formatOptions:e}=Qt(e,V,r.DataTableData??[]),tt(),{maxNumberForPrimaryAxis:b,maxNumberForSecondaryAxis:v}=Nt(e,B.yMinLeft,B.yMaxLeft,B.yMinRight,B.yMaxRight),{margin:oe,yLabel:de,xLabel:se,yTitle:he,xTitle:Ae,dimensionHeightWidthArray:pe,chartTitleHeight:xe,secondaryAxisTitleWidth:Q,legendMargin:J,secondaryYLabel:F,visibleBars:le,columnWidth:A,scrollbarVisible:u}=vt(i,y,b,v,B.yMaxLeft,e,B.legendList,B.dimensionList,B.yMaxRight,Z,Y,t,!1,B),ze(oe),{dataTable:f,dataTableHeight:a}=ea(e,de,he,V,B.dimensionList,r),kt(L,i,y,e),I=Mt(L,oe),mt(I,e,a,d,c,p,m),w(),R(),Gt(I,e,a,de,ye,c),Z&&ci(I,e,a,F,Me,c,d),St(e,q,L,oe,se,y,Ae,B.chartType,de,d,c),Ft(c,e,a,q,L,oe,he,de),Ut(L,Z,oe,e,a,c,d,F,Q),wt(L,e,i,xe),Dt(y,L,pe,xe,i,J,e,V,m,a,oe,null,p,n),Bt(V,y,i,L,oe,d,u,le,B,ce,!1,Ie)},E=()=>{const Re=[];let He=[],it=-1/0,Je=1/0,Ze=-1/0,Ge=1/0,Ee=[];V.forEach((Pe,Ue)=>{[re.StackColumnChart,re.StackAreaChart].includes(Pe.properties.type)?re.StackColumnChart===Pe.properties.type&&(Re.includes(re.StackColumnChart)||Re.push(re.StackColumnChart)):(Ee.push(Pe),Pe.properties.type!==re.LineChart&&Pe.properties.type!==re.AreaChart&&Re.push(Pe.properties.legendUniqueId)),Pe.properties.axis==="Secondary"&&(ee.push(Pe),Pe.properties.type==re.StackColumnChart&&Ve.push(Pe),Pe.properties.type==re.StackAreaChart&&De.push(Pe)),Pe.properties.axis===at.primary&&(Te.push(Pe),Pe.properties.type==re.StackColumnChart&&O.push(Pe),Pe.properties.type==re.StackAreaChart&&ke.push(Pe)),Pe.data=Pe.data.map(At=>{const Oe={...At,type:Pe.properties.type,axis:Pe.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Pe.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Pe.properties.labelColor,legendUniqueId:Pe.properties.legendUniqueId};return Oe.axis==="Secondary"?(Z=!0,Ze=Math.max(Ze,Oe.value),Ge=Math.min(Ge,Oe.value)):(it=Math.max(it,Oe.value),Je=Math.min(Je,Oe.value)),Oe})}),ue=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?bt(e.xAxisLabel.xAxisNumberFormat,B.dimensionList).map(Pe=>Pe):B.dimensionList,B.dimensionList.forEach((Pe,Ue)=>{B.formattedDimensionListMap.set(Pe,He[Ue])}),e.plotArea.fitChart?ve=B.dimensionList:ve=B.dimensionList.slice(ce,ce+le),e.plotArea.hideZeroValues&&(B.hideZeroValues=!0),k(ke,O,De,Ve,V)},k=(Re,He,it,Je,Ze)=>{const Ge=xt(ve,Re,!1),Ee=xt(ve,it,!1),Pe=xt(ve,He,!1),Ue=xt(ve,Je,!1);me=[];const At=[];if(Re.forEach(Oe=>{At.push({properties:{axis:Oe.properties.axis,type:Oe.properties.type,legend:Oe.properties.legend,annotation:Oe.properties.annotation,alias:Oe.properties.alias},stackData:Ge,data:Re})}),it.forEach(Oe=>{At.push({properties:{axis:Oe.properties.axis,type:Oe.properties.type,legend:Oe.properties.legend,annotation:Oe.properties.annotation,alias:Oe.properties.alias},stackData:Ee,data:it})}),He.forEach(Oe=>{At.push({properties:{axis:Oe.properties.axis,type:Oe.properties.type,legend:Oe.properties.legend,annotation:Oe.properties.annotation,alias:Oe.properties.alias},stackData:Pe,data:He})}),Je.forEach(Oe=>{At.push({properties:{axis:Oe.properties.axis,type:Oe.properties.type,legend:Oe.properties.legend,annotation:Oe.properties.annotation,alias:Oe.properties.alias},stackData:Ue,data:Je})}),At.push(...B.chartData),Ze.length){const Oe=[];Ze.forEach(pi=>{Oe.push(...At.filter(cl=>cl.properties?.type===pi.properties.type&&cl.properties.legend===pi.legend))}),me.push(...Oe)}else me.push(...At)},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:P!==void 0&&!Number.isNaN(P)?P:B.yMaxLeft*1.1]).range([a>0?c-a:c,0]),Z&&(K=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?(te||te==0)&&!Number.isNaN(te)?te:0:(te||te==0)&&!Number.isNaN(te)?te:B.yMaxRight*1.1]).range([a>0?c-a:c,0])),we=[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(we).padding(.5)},R=()=>{{let Re=ot(P||B.yMaxLeft,B.yMinLeft,c,e,B,N,P);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(P||B.yMaxRight,B.yMinRight,c,e,B,N,P);Me=T.axisRight(K).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=()=>{Ne=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),U(Je);break}});const He=ue.filter(Je=>Je.properties.type===re.LineChart);He.length&&_(He);const it=ue.filter(Je=>Je.properties.type===re.AreaChart);it.length&&X(it),I.selectAll(".parentGroup").raise()},M=Re=>{let He=I.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:K)(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(Ke.SeriesId,()=>Re.properties.legendUniqueId).attr(Ke.DimValue,Ee=>Array.isArray(Ee.dimension)?String(Ee.dimension[0]):String(Ee.dimension)).on("mousemove",(Ee,Pe)=>{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(Pe.dimension)?Pe.dimension[0]:Pe.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Pe.properties?.currentMeasure?Pe.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Pe.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(p)?Pe[1]-Pe[0]:Pe.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Pe.legend.includes("~$~")?Pe.legend.split("~$~")[1]:Pe.legend}],e,Ee,V.filter(Ue=>Ue.legend===Pe.legend)[0].properties,ht(x,String(B.formattedDimensionListMap.get(Array.isArray(Pe.dimension)?Pe.dimension[0]:Pe.dimension)??""),V.filter(Ue=>Ue.legend===Pe.legend)[0].properties))}).on("mouseout",rt).on("click",gt(G,g,(Ee,Pe)=>({seriesId:Re.properties.legendUniqueId,dimValue:Array.isArray(Pe.dimension)?String(Pe.dimension[0]):String(Pe.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 Pe=Re.properties.axis===at.primary?ae:K;return Ee.value>0?Pe(Ee.value):Pe(0)}).attr("height",Ee=>{const Pe=Re.properties.axis===at.primary?ae:K;return Math.abs(Pe(Ee.value)-Pe(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):K(Ge.value)).defined(Ge=>e?.plotArea?.hideZeroValues?!!Ge.value:!0).curve(Ot(e));let it=I.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!==Fe.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,K,null,e,B,te,z,N,P,!1,x)},X=Re=>{Re.forEach(Ue=>{Ue.data.forEach(At=>{At.hideZero=Ue.properties.hideZeroValues,At.axis=Ue.properties.axis,At.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=I.selectAll(".areas.parentGroup").data([1]),Ge=I.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),Pe=Ee.enter().append("g").attr("class","area-group");Pe.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!==Fe.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)),Pe.merge(Ee).select("path").attr("stroke",Ue=>Ue.properties.areaBorderColor!==Fe.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,K,null,e,B,te,z,N,P)},U=Re=>{Re.data.forEach(Pe=>{Pe.data.forEach(Ue=>{Ue.hideZero=Pe.properties.hideZeroValues,Ue.axis=Pe.properties.axis,Ue.legendUniqueId=Pe.properties.legendUniqueId})});const He=T.area().x(Pe=>be(Pe.data.dimension)?be(Pe.data.dimension):null).y0(Pe=>Pe.data.axis===at.primary?ae(Pe[0]):K(Pe[0])).y1(Pe=>Pe.data.axis===at.primary?ae(Pe[1]):K(Pe[1])).defined(Pe=>Pe.hideZero?!!Pe.key:!0).curve(Ot(e)),it=T.area().x(Pe=>be(Pe.data.dimension)?be(Pe.data.dimension):null).y0(()=>ae(0)).y1(()=>ae(0)).defined(Pe=>Pe.hideZero?!!Pe.key:!0).curve(Ot(e)),Je=e.animation.animationEnabled;let Ze=I.selectAll(".parentGroup").data([ie]);I.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(Pe=>Pe),Ee=Ge.enter().append("g").attr("class",Pe=>"area-group "+Pe.key.replace(/ /g,"-"));Ee.append("path").attr("hoverId",Pe=>(Re.data.filter(Ue=>Ue.legend===Pe.key)[0].properties.alias||Re.data.filter(Ue=>Ue.legend===Pe.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Pe=>Pe.color!==Fe.white?Pe.color:"none").attr("d",Pe=>Je?it(Pe):He(Pe)).each(function(Pe){Je&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",He(Pe))}),Ge.select("path").attr("d",Pe=>He(Pe)),Ee.merge(Ge).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Pe=>Pe.color!==Fe.white?Pe.color:"none").attr("stroke-dasharray",(Pe,Ue)=>V[Ue].properties.lineStyle==="dotted"?"0,3":V[Ue].properties.lineStyle==="dashed"?ba:"").attr("stroke-linecap",(Pe,Ue)=>V[Ue].properties.lineStyle==="dotted"?sa.round:"").attr("stroke-width",(Pe,Ue)=>V[Ue].properties.lineStyle!=="None"?V[Ue].properties.lineWidth:"0"),Ge.exit().remove(),Ca(Ze,Re.data,re.CombinationStackArea,be,ae,K,null,e,B,te,z,N,P)},Se=()=>{let Re=I.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]):K(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?P&&Ee[1]>P?ae(Ee[0])-ae(P):ae(Ee[0])-ae(Ee[1]):te&&Ee[1]>te?K(Ee[0])-K(te):K(Ee[0])-K(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):K(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,Pe,Ue)=>{const At=Array.from(V).findIndex(Oe=>Oe.legend===Ee.key);return V[At]?.properties?.color||"gray"}).attr("stroke",(Ee,Pe,Ue)=>{const At=Array.from(V).findIndex(pi=>pi.legend===Ee.key),Oe=V[At]?.properties;return Oe?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Oe.stackBorderColor:"none"}).attr("stroke-dasharray",(Ee,Pe,Ue)=>{const At=Array.from(V).findIndex(Oe=>Oe.legend===Ee.key);return V[At]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ee,Pe,Ue)=>{const At=Array.from(V).findIndex(Oe=>Oe.legend===Ee.key);return(V[At]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ee,Pe)=>{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(Pe.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Pe.properties?.currentMeasure?Pe.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Pe.value,value:_e(Pe.data[Pe.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Pe.key.includes("~$~")?Pe.key.split("~$~")[1]:Pe.key}],e,Ee,V.filter(Ue=>Ue.legend===Pe.key)[0].properties,ht(x,String(B.formattedDimensionListMap.get(Pe.data.dimension)??""),V.filter(Ue=>Ue.legend===Pe.key)[0].properties))}).on("mouseout",rt).attr(Ke.SeriesId,Ee=>Ee.key??"").attr(Ke.DimValue,Ee=>Array.isArray(Ee.data.dimension)?String(Ee.data.dimension[0]):String(Ee.data.dimension)).on("click",gt(G,g,(Ee,Pe)=>({seriesId:Pe.key??"",dimValue:Array.isArray(Pe.data.dimension)?String(Pe.data.dimension[0]):String(Pe.data.dimension),legendUniqueId:Pe.key??"",seriesDisplayName:Pe.alias||Pe.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]):K(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?P&&Ee[1]>P?ae(Ee[0])-ae(P):ae(Ee[0])-ae(Ee[1]):te&&Ee[1]>te?K(Ee[0])-K(te):K(Ee[0])-K(Ee[1])),He.exit().remove()},ze=Re=>{d=i-Re.left-Re.right,c=y-Re.bottom-Re.top},Ie=(Re,He,it)=>{ue=He,ve=Re,le=it,Qe(r,Ce,ve),k(ke,O,De,Ve,He),ue=JSON.parse(JSON.stringify(me)),ue.forEach((Je,Ze)=>{Je.properties.type===re.StackColumnChart||Je.properties.type===re.StackAreaChart?Je.data.forEach((Ge,Ee)=>ue[Ze].data[Ee].data=Ge.data.filter(Pe=>ve.includes(Pe.dimension))):ue[Ze].data=Je.data.filter(Ge=>ve.includes(Ge.dimension))}),lt()};function Qe(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(ue),qt(I,B,se,e,a,ae,Ne,pe,y,A,t,d,c,ve,be);const Re=()=>{Il(ue,be,ae,K,oe,dt,Ye,ie,[],[],A,e,y,i,d,ve,c,m,L,h,Le,o),qa(Ce,be,ae,oe,dt,[],e,p,y,i,L,o)};ta(e.plotArea.fitChart,L,I,f,A,ae,be,Le,void 0,void 0,a,p,e,de,he,B.dimensionList,d,we,B.formattedDimensionListMap,m,oe,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(Te.length>0){const He=(O.length>0?xt(ve,O,!1):xt(ve,ke,!1)).map(it=>it.total);B.yMaxLeft=Math.max(B.yMaxLeft,...He),B.yMinLeft=Math.min(B.yMinLeft,...He)}if(ee.length>0){const He=(Ve.length>0?xt(ve,Ve,!1):xt(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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1,j=!1,q=!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,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le=[];const we=new Map;let Te=0,ee=2,ke=!1,O={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};fe.useEffect(()=>{try{De()}catch(me){ge("LayeredColumnchart","createLayeredColumnChart",me)}},[e]);const De=()=>{({formatOptions:e,svg:i,width:b,height:v}=Ct(S,e)),Ve(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:xe,maxNumberForSecondaryAxis:Q}=Nt(e,O.yMinLeft,O.yMaxLeft,O.yMinRight,O.yMaxRight),{margin:N,yLabel:P,xLabel:z,yTitle:te,xTitle:oe,dimensionHeightWidthArray:de,chartTitleHeight:se,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:ee,columnWidth:A,scrollbarVisible:ke}=vt(b,v,xe,Q,O.yMaxLeft,e,O.legendList,O.dimensionList,O.yMaxRight,j,q,t,!1,O),Ce(N),{dataTable:d,dataTableHeight:c}=ea(e,P,te,g,O.dimensionList,r),kt(i,b,v,e),y=Mt(i,N),mt(y,e,c,J,F,u,m),Ye(),ye(),Gt(y,e,c,P,ae,F),St(e,V,i,N,z,v,oe,O.chartType,P,J,F),Ft(F,e,c,V,i,N,te,P),Ut(i,j,N,e,c,F,J,pe,he),wt(i,e,b,se),Dt(v,i,de,se,b,Ae,e,g,m,c,N,nt.rectangle,u,n),Bt(g,v,b,i,N,J,ke,ee,O,Te,!1,ue)},Ve=()=>{const me=[],ce=[];let le=[],B=-1/0,$=1/0,E=-1/0,k=1/0,w=-1/0,D=1/0;g.forEach(R=>{ce.push(R.properties.legendUniqueId),w=-1/0,D=1/0,R.data.forEach(W=>{me.push(W),w=Math.max(w,W.value),D=Math.min(D,W.value),B=Math.max(B,W.value),$=Math.min($,W.value)}),R.properties.setColorScale&&we.set(R.properties.legendUniqueId,T.scaleSequential().domain([D,w]).interpolator(T.interpolateRgb(R.properties.startColor,R.properties.endColor)))}),O.chartData=me,O.legendList=ce,O.yMaxLeft=B,O.yMinLeft=$>0?0:$,O.yMaxRight=E,O.yMinRight=k,le=t?bt(e.xAxisLabel.xAxisNumberFormat,O.dimensionList).map(R=>R):O.dimensionList,O.dimensionList.forEach((R,W)=>{O.formattedDimensionListMap.set(R,le[W])}),Le=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?be=O.dimensionList:be=O.dimensionList.slice(Te,Te+ee),e.plotArea.hideZeroValues&&(O.hideZeroValues=!0)},Ye=()=>{let me=ot(Y||O.yMaxLeft,O.yMinLeft,F,e,O,Z,Y).yAxisLabelArray;O.yMaxLeft=me[me.length-1],O.yMinLeft=me[0],f=T.scaleLinear().domain([O.yMinLeft>=0?Z!==void 0&&!Number.isNaN(Z)?Z:0:O.yMinLeft<0?O.yMinLeft*1.1:O.yMinLeft*.9,O.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:O.yMaxLeft*1.1]).range([c>0?F-c:F,0]),I=[0,J]},ie=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(O.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),L=T.scalePoint().domain(be).range(I).padding(.5)},ye=()=>{Ne();{let me=ot(Y||O.yMaxLeft,O.yMinLeft,F,e,O,Z,Y);ae=T.axisLeft(f).tickFormat(ce=>_e(ce,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,J)).tickValues(me.autoLabelFlag?void 0:me.yAxisLabelArray).ticks(me.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ne=()=>{K=T.axisBottom(L).tickSize(ia(e,F,c)).tickSizeOuter(0).tickValues(Lt(be,J))},Me=me=>{me.forEach(ce=>{ce.data.forEach(le=>{le.hideZero=ce.properties.hideZeroValues,le.properties=ce.properties,le.axis=ce.properties.axis})}),me.forEach((ce,le)=>{let B=y.selectAll(`.parentGroup-${ce.properties.legendUniqueId}`).data([ce],D=>D.properties.legendUniqueId);B=B.enter().append("g").attr("class",`column parentGroup parentGroup-${ce.properties.legendUniqueId}`).attr("clip-path",`url(#${m}-clip)`).merge(B);let $=B.selectAll(".column-group").data(ce.data,D=>D.dimension+"_"+ce.properties.legendUniqueId),E=$.enter().append("g").attr("class","column-group").attr("hoverId",(ce.properties.alias||ce.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)`);$.attr("transform",D=>le===0?`translate(${L(D.dimension)-A/2}, 0)`:`translate(${L(D.dimension)-A/(2+le*2)}, 0)`),E.merge($).attr("transform",D=>le===0?`translate(${L(D.dimension)-A/2}, 0)`:`translate(${L(D.dimension)-A/(2+le*2)}, 0)`);const k=E.append("rect").attr("x",()=>0).attr("width",le===0?A:A/2+le*2).attr("y",D=>(ce.properties.axis===at.primary?f:a)(0)).attr("height",0).attr("fill",D=>we.get(ce.properties.legendUniqueId)?.(D.value)??ce.properties.color).attr("stroke-dasharray",()=>ce.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${ce.properties.stackBorderWidth}px`).attr("stroke",()=>ce.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ce.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(Ke.SeriesId,()=>ce.properties.legendUniqueId).attr(Ke.DimValue,D=>Array.isArray(D.dimension)?String(D.dimension[0]):String(D.dimension));(e.animation.animationEnabled?k.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):k).attr("y",D=>{const R=ce.properties.axis===at.primary?f:a;return D.value>0?R(D.value):R(0)}).attr("height",D=>{const R=ce.properties.axis===at.primary?f:a;return Math.abs(R(D.value)-R(0))}),$.select("rect").transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("y",D=>{const R=ce.properties.axis===at.primary?f:a;return D.value>0?R(D.value):R(0)}).attr("height",D=>{const R=ce.properties.axis===at.primary?f:a;return Math.abs(R(D.value)-R(0))}),E.merge($).on("mousemove",(D,R)=>{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:O.formattedDimensionListMap.get(Array.isArray(R.dimension)?R.dimension[0]:R.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():R.properties?.currentMeasure?R.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||R.value,value:_e([re.NormalizedStackLineChart,re.NormalizedStackAreaChart,""].includes(u)?R[1]-R[0]:R.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:R.properties.alias}],e,D,R.properties,ht(x,String(O.formattedDimensionListMap.get(Array.isArray(R.dimension)?R.dimension[0]:R.dimension)??""),R.properties));let W=(ce.properties.alias||ce.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,R)=>{let W=(ce.properties.alias||ce.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()}),E.merge($).on("click",gt(H,p,(D,R)=>({seriesId:ce.properties.legendUniqueId,dimValue:Array.isArray(R.dimension)?String(R.dimension[0]):String(R.dimension),legendUniqueId:ce.properties.legendUniqueId,seriesDisplayName:ce.properties.alias||ce.properties.name||""}))),$.exit().remove()}),y.selectAll(".parentGroup").raise()},Ce=me=>{J=b-me.left-me.right,F=v-me.bottom-me.top},ve=()=>{ie(),Ne(),qt(y,O,z,e,c,f,K,de,v,A,t,J,F,be,L),Me(Le),Da(g,L,f,void 0,N,dt,[],[],e,u,v,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,P,te,O.dimensionList,J,I,O.formattedDimensionListMap,m,N,F))},ue=(me,ce,le)=>{Le=ce,be=me,ee=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=fe.useRef(),H=fe.useRef(s);H.current=s;const g=fe.useRef(x);g.current=x;const G=r.DimensionList,V=(pt(r.ChartData,r.DimensionList)||[]).reverse(),j=!1,q=!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,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I;const ae=new Map;let K,be,Le,we=[],Te=0,ee,ke=[],O=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};fe.useEffect(()=>{try{Ye()}catch(k){ge("StackStackColumnchart","createStackColumnChart",k)}},[e]);const Ye=()=>{({formatOptions:e,svg:i,width:b,height:v}=Ct(p,e)),ie(),{formatOptions:e}=Qt(e,V,r.DataTableData??[]),{maxNumberForPrimaryAxis:xe,maxNumberForSecondaryAxis:Q}=Nt(e,Ve.yMinLeft,Ve.yMaxLeft,Ve.yMinRight,Ve.yMaxRight),{margin:N,yLabel:P,xLabel:z,yTitle:te,xTitle:oe,dimensionHeightWidthArray:de,chartTitleHeight:se,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:ee,columnWidth:A,scrollbarVisible:u}=vt(b,v,xe,Q,Ve.yMaxLeft,e,Ve.legendList,Ve.dimensionList,Ve.yMaxRight,q,De,t,!1,Ve),ue(N),{dataTable:d,dataTableHeight:c}=ea(e,P,te,V,Ve.dimensionList,r),kt(i,b,v,e),y=Mt(i,N),mt(y,e,c,J,F,S,m),ye(),Me(),Gt(y,e,c,P,K,F),St(e,j,i,N,z,v,oe,Ve.chartType,P,J,F),Ft(F,e,c,j,i,N,te,P),Ut(i,q,N,e,c,F,J,pe,he),wt(i,e,b,se),Dt(v,i,de,se,b,Ae,e,[...V].reverse(),m,c,N,nt.rectangle,S,n),Bt(V,v,b,i,N,J,u,ee,Ve,Te,!1,me)},ie=()=>{const k=[],w=[];let D=-1/0,R=1/0;V.forEach((U,Se)=>{const ze=`${Se}~$~${U.properties.legend}`;U.properties.legend=ze,w.push(ze),D=-1/0,R=1/0;for(const Ie of U.data)D=Math.max(D,Ie.value),R=Math.min(R,Ie.value),k.push(Ie);U.properties.setColorScale&&ae.set(U.properties.legendUniqueId,T.scaleSequential().domain([R,D]).interpolator(ii.interpolateRgb(U.properties.startColor,U.properties.endColor)))}),Ve.chartData=k,Ve.legendList=w,we=JSON.parse(JSON.stringify(V));let W=xt(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 U of C)for(const[Se,ze]of U)M=Math.min(M,Se),_=Math.max(_,ze);Ve.yMinLeft=M>0?0:M,Ve.yMaxLeft=_;let X=t?bt(e.xAxisLabel.xAxisNumberFormat,Ve.dimensionList).map(U=>U):Ve.dimensionList;Ve.dimensionList.forEach((U,Se)=>{Ve.formattedDimensionListMap.set(U,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]),I=[0,J]},Ne=()=>{L=T.scalePoint().domain(Le).range([0,J]).padding(.5)},Me=()=>{{const k=ot(Y||Ve.yMaxLeft,Ve.yMinLeft,F,e,Ve,Z,Y);K=T.axisLeft(f).tickFormat(w=>_e(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,J)).tickValues(k.autoLabelFlag?void 0:k.yAxisLabelArray).ticks(k.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ce=()=>{be=T.axisBottom(L).tickSize(ia(e,F,c,!0)).tickSizeOuter(0).tickValues(Lt(Le,J))},ve=k=>{k.forEach(X=>{X.data.forEach(U=>{U.hideZero=X.properties.hideZeroValues,U.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,U)=>{const Se=Array.from(D.nodes()).indexOf(X[U].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,U,Se)=>{const{props:ze}=C(Se,U);return ae.get(ze.legendUniqueId)?.(X.data[X.key])??ze?.color??"gray"}).attr("stroke",(X,U,Se)=>{const{props:ze}=C(Se,U);return ze?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ze.stackBorderColor:"none"}).attr("stroke-dasharray",(X,U,Se)=>{const{props:ze}=C(Se,U);return ze?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(X,U,Se)=>{const{props:ze}=C(Se,U);return(ze?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(X,U,Se)=>{const{props:ze}=C(Se,U);return X.data[X.key]==0&&ze?.hideZeroValues?"hidden":"visible"}).attr(Ke.SeriesId,X=>X.key??"").attr(Ke.DimValue,X=>Array.isArray(X.data.dimension)?String(X.data.dimension[0]):String(X.data.dimension)).on("mousemove",(X,U)=>{const Se=String(Ve.formattedDimensionListMap.get(U.data.dimension)??""),ze=ht(l,Se,U.properties);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(U.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():U.properties?.currentMeasure?U.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||U.value,value:_e(U.data[U.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:U.properties.alias}],e,X,U.properties,ze)}).on("mouseout",(X,U)=>{rt()}).on("click",gt(g,H,(X,U)=>({seriesId:U.key??"",dimValue:Array.isArray(U.data.dimension)?String(U.data.dimension[0]):String(U.data.dimension),legendUniqueId:U.key??"",seriesDisplayName:U.properties?.alias||U.key||""})));(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()},ue=k=>{J=b-k.left-k.right,F=v-k.bottom-k.top},me=(k,w,D)=>{we=w,Le=k,ee=D,Ka(r,O,Le),ce()},ce=()=>{Ne(),Ce(),qt(y,Ve,z,e,c,f,be,de,v,A,t,J,F,Le,L),le(),ve(we),Va(ke,L,f,a,N,dt,[],[],e,S,v,b,J,Le,F,m,i,h,c,o),qa(O,L,f,N,dt,[],e,S,v,b,i,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,S,e,P,te,Le,J,I,Ve.formattedDimensionListMap,m,N,F)),B()},le=()=>{let k=xt(Le,we,De);ke=T.stack().keys(Ve.legendList).offset(T.stackOffsetDiverging)(k),we.forEach((D,R)=>D.data.forEach((W,C)=>{W[0]=ke[R][C][0],W[1]=ke[R][C][1]}));let w=e.annotation.annotationSetLabelColor;ke.forEach((D,R)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(V[R].properties.color)),W.data.labelPosition=V[R].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(V[R].properties.color)):V[R].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(V[R].properties.hideZeroValues)),W.properties=V[R].properties}))},B=()=>{try{const k=e?.connector,w=Number(k?.connectorVisibility);if(!k||w===2)return;let D,R=[];w===1?D=1:w===3&&(Number(k.connectorFollow)===1?D=Number(k.connectorStepSize)||void 0:Number(k.connectorFollow)===2&&(R=k.connectorExclude??[],D=1));const W=(R||[]).map(U=>String(U).split("-")[0]),C=(ke[0]??[]).map((U,Se)=>({Dimension:U.data.dimension,Total:U.data.total,CustomTotal:U.data.total,Index:Se})),M=[],_=[];let X=[];if(D){if(D===1)M.push(...C);else for(const U of C)U.Index%D===0&&M.push(U);for(let U=D;U<C.length;U+=D){const Se=Math.min(U+D,C.length);let ze=C[U]?.Total??Number.NEGATIVE_INFINITY;for(let Ie=U;Ie<Se;Ie++)C[Ie].Total>ze&&(ze=C[Ie].Total);Number.isFinite(ze)&&_.push(ze)}X=M.slice(1)}else{const U=k.connectorCustomRange??[],Se=new Map;C.forEach(ze=>Se.set(String(ze.Dimension),ze.Index));for(const ze of U){if(!ze?.from||!ze?.to)continue;const Ie=Se.get(String(ze.from)),Qe=Se.get(String(ze.to));if(Ie!=null&&Qe!=null){M.push(C[Ie]);const lt=Math.min(Ie,Qe),ut=Math.max(Ie,Qe);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 U){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",k.connectorMarkerColor!==Fe.white?k.connectorMarkerColor:"none"),$(M,_,X,D,W),E(M,_,X,D,W)}catch{}},$=(k,w,D,R,W)=>{try{const C=k.filter((U,Se)=>R!=null?Se<k.length-1:Se<k.length);let M=y.selectAll("path.connector-path").data(C,U=>String(U.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",(U,Se)=>e.total.totalVisibility?`M ${L(U.Dimension)+L.bandwidth()/2+5}, ${f(U.Total)-25} V ${-35+Math.min(f(w[Se]),f(D[Se].Total),f(U.Total))} H ${L(D[Se].Dimension)+L.bandwidth()/2-10} V ${-27+f(D[Se].Total)}`:`M ${L(U.Dimension)+L.bandwidth()/2+5}, ${f(U.Total)-5} V ${-30+Math.min(f(D[Se].Total),f(U.Total))} H ${L(D[Se].Dimension)+L.bandwidth()/2-10} V ${-10+f(D[Se].Total)}`).style("stroke",e.connector.connectorLineColor!==Fe.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",U=>W.includes(U.Dimension)||U.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},E=(k,w,D,R,W)=>{try{let C,M=e.connector.connectorFontStyle,_=e.connector.connectorNumberFormat,X=J/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(_=".2s");const U=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Se=Ti(U,A),ze=Se*(typeof L.padding=="function"?L.padding():0),Ie=k.map((tt,Re)=>({d:tt,i:Re})).filter(tt=>R!=null?tt.i<k.length-1:tt.i<k.length);let Qe=y.selectAll("text.connector-text").data(Ie,tt=>String(tt.d.Dimension));Qe.exit().remove(),Qe.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(Qe).attr("x",tt=>{const Re=tt.d,He=tt.i,it=D[He];return L(it.Dimension)-Se*R/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!==Fe.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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList).reverse(),G=r.DimensionList,V=!1,j=!1;let q=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y,N,P,z,te,oe,de,se,he,Ae,pe,xe,Q=!1,J,F,b,v,d,c,i,y,f,a,L,I;const ae=new Map;let K,be,Le,we=[],Te=0,ee=0,ke=[];const O=!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};fe.useEffect(()=>{try{Ve()}catch(le){ge("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",le)}},[e]);const Ve=()=>{({formatOptions:e,svg:i,width:b,height:v}=Ct(S,e)),Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:xe}=Nt(e,De.yMinLeft,De.yMaxLeft,De.yMinRight,De.yMaxRight),{margin:Y,yLabel:N,xLabel:P,yTitle:z,xTitle:te,dimensionHeightWidthArray:oe,chartTitleHeight:de,secondaryAxisTitleWidth:se,legendMargin:he,secondaryYLabel:Ae,visibleBars:ee,columnWidth:A,scrollbarVisible:Q}=vt(b,v,pe,xe,De.yMaxLeft,e,De.legendList,De.dimensionList,De.yMaxRight,j,O,t,!1,De),ve(Y),{dataTable:d,dataTableHeight:c}=ea(e,N,z,g,De.dimensionList,r),kt(i,b,v,e),y=Mt(i,Y),mt(y,e,c,J,F,u),ie(),Ne(),Gt(y,e,c,N,K,F),St(e,V,i,Y,P,v,te,De.chartType,N,J,F),Ft(F,e,c,V,i,Y,z,N),Ut(i,j,Y,e,c,F,J,Ae,se),wt(i,e,b,de),Dt(v,i,oe,de,b,he,e,[...g].reverse(),m,c,Y,nt.rectangle,u,n),Bt(g,v,b,i,Y,J,Q,ee,De,Te,!1,ue)},Ye=()=>{const le=[],B=[];let $=-1/0,E=1/0;g.forEach((W,C)=>{const M=`${C}~$~${W.properties.legend}`;W.properties.legend=M,B.push(M),$=-1/0,E=1/0;for(const _ of W.data)$=Math.max($,_.value),E=Math.min(E,_.value),le.push(_);W.properties.setColorScale&&ae.set(W.properties.legendUniqueId,T.scaleSequential().domain([E,$]).interpolator(T.interpolateRgb(W.properties.startColor,W.properties.endColor)))}),De.chartData=le,De.legendList=B,we=JSON.parse(JSON.stringify(g));let k=xt(De.dimensionList,g,O);Le=De.dimensionList;const w=T.stack().keys(De.legendList).offset(T.stackOffsetDiverging)(k);ce();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 R=t?bt(e.xAxisLabel.xAxisNumberFormat,De.dimensionList).map(W=>W):De.dimensionList;De.dimensionList.forEach((W,C)=>{De.formattedDimensionListMap.set(W,R[C])}),e.plotArea.hideZeroValues&&(De.hideZeroValues=!0)},ie=()=>{let le=ot(Z||De.yMaxLeft,De.yMinLeft,F,e,De,q,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]),I=[0,J],e.seriesLabel.seriesLabelVisibility){let B=aa(J,f,e,we,void 0,j,F,!0);B.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&B.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?I=[0,J-B.heightWidth[0]]:I=[B.heightWidth[0],J]}},ye=()=>{L=T.scalePoint().domain(Le).range(I).padding(.5)},Ne=()=>{K=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 $=B.selectAll(".column-group").data(C=>C);$=$.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($);let k=$.selectAll("rect").data(C=>C);const w=(C,M)=>{const _=Array.from($.nodes()).indexOf(C[M].parentNode);return{props:g[_]?.properties,groupIndex:_}},D=k.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(Ke.SeriesId,C=>C.key??"").attr(Ke.DimValue,C=>Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension)),R=e.animation.animationEnabled;(C=>R?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(k).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(De.formattedDimensionListMap.get(M.data.dimension)??""),M.properties))}).on("mouseout",(C,M)=>{rt()}).on("click",gt(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||""}))),$.exit().remove(),y.selectAll(".parentGroup").raise()},ve=le=>{J=b-le.left-le.right,F=v-le.bottom-le.top},ue=(le,B,$)=>{we=B,Le=le,ee=$,me()},me=()=>{ye(),Me(),ce(),qt(y,De,P,e,c,f,be,oe,v,A,t,J,F,Le,L),Ce(we),Va(ke,L,f,a,Y,dt,[],[],e,u,v,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,I,De.formattedDimensionListMap,m,Y,F))},ce=()=>{let le=xt(Le,we,O);ke=T.stack().keys(De.legendList).offset(T.stackOffsetDiverging)(le),we.forEach(($,E)=>$.data.forEach((k,w)=>{k[0]=ke[E][w][0],k[1]=ke[E][w][1]}));let B=e.annotation.annotationSetLabelColor;ke.forEach(($,E)=>$.forEach(k=>{k.key=$.key,$.color=JSON.parse(JSON.stringify(g[E].properties.color)),$.individualAnnotationVisibility=JSON.parse(JSON.stringify(g[E].properties.individualAnnotationVisibility)),k.data.labelPosition=g[E].properties.dataLabelPosition,k.data.labelColor=B=="2"?JSON.parse(JSON.stringify(g[E].properties.color)):g[E].properties.labelColor,k.hideZero=JSON.parse(JSON.stringify(g[E].properties.hideZeroValues)),k.properties=g[E].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 q=o.legends.legendPosition,Z=o.legends.legendVisibility,Y=!1;switch(Z||(q="None"),q){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 P=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:P,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!==Fe.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!==Fe.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 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!==Fe.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(ne.italic)?ne.italic:"").style("text-decoration",m.includes(ne.underline)?ne.underline:"").style("font-weight",m.includes(ne.bold)?ne.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=(Q,J)=>[[0,0],[Q/2,J/2],[Q,J]],q={solid:"unset",dotted:"2,2",dashed:"6,4"};let Z=t.annotation(),Y=JSON.parse(JSON.stringify(r.plotArea.dataLabelsCoordinates||[]));Y=Y.map(Q=>({dx:Q.dx??0,dy:Q.dy??0,ratioDistance:Q.ratioDistance,ratioAngle:Q.ratioAngle,connectorPoints:Q.connectorPoints||Q.connector?.points||[],radius:Q.radius??x,data:Q.data,width:n,height:l}));const N=e.reduce((Q,J)=>Q+(J?.data?.data?.[0]?.value??0),0),P=N===0?1:N,z=(Q,J)=>{const F=Q.data.data[0].value,b=(Q.x0+Q.x1)/2,v=Q.x1-Q.x0;return{note:{title:r.plotArea.dataLabelName?Q.data.legend:"",label:r.plotArea.dataLabelValue&&F!==0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(F/P)*100).toFixed(et(r.plotArea.dataLabelDecimalPrecision))+"%":je(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(F):"",align:"middle",wrap:1e3},data:{x:{legend:Q.data.legend},y:{value:F},midAngle:b,isVisible:!0,hoverId:Q?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:Q.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 te=e.filter(Q=>Q.x1-Q.x0>1e-4).map(z);const oe=Q=>(Q.data.y?.value??0)!==0;te=te.filter(oe),te=Rt(te,r,Q=>Q.data.y.value);let de=new Map(Y.map(Q=>[Q.data?.x?.legend,Q])),se=[];te.forEach(Q=>{const J=Q.data.x.legend,F=de.get(J);if(F){if(F.ratioDistance!=null&&F.ratioAngle!=null){const b=F.ratioDistance*x;Q.dx=Math.cos(F.ratioAngle)*b,Q.dy=Math.sin(F.ratioAngle)*b}else{const b=x/(F.radius||x);Q.dx=F.dx*b,Q.dy=F.dy*b}Q.data.isVisible=F.data?.isVisible??!0,F.connectorPoints?.length>=(H?3:2)?Q.connector.points=F.connectorPoints:Q.connector.points=H?j(Q.dx,Q.dy):[[0,0],[0,0]]}se.push(Q)}),Z.editMode(r.plotArea.annotationDraggable&&m).accessors({x(Q){return Math.cos(Q.midAngle-Math.PI/2)*(x-x*.35)},y(Q){return Math.sin(Q.midAngle-Math.PI/2)*(x-x*.35)}}).on("dragend",function(Q){se.forEach(F=>{if(F.data.x.legend===Q.data.x.legend){const b=Q._dx,v=Q._dy,d=Math.sqrt(b*b+v*v),c=Math.atan2(v,b);F.dx=b,F.dy=v,F.ratioDistance=d/x,F.ratioAngle=c,F.width=n,F.height=l,F.connectorPoints=Q.connector?.points||[]}});const J=se.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(se);const he=s.append("g").attr("class","annotation-group parentGroup").attr("transform",o).call(Z),Ae=r.plotArea.dataLabelNameFontStyle??[];he.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(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(Q){const J=T.select(this),F=T.format(".2s")(Math.abs(Q.data.y.value));J.append("tspan").attr("x",J.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("fill",r.plotArea.dataLabelValueColor??"#000").text(F)}),p==="diamond"){const Q=r.plotArea.connectorColor??"#ccc",J=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,${-J} ${J},0 0,${J} ${-J},0`).style("fill",Q).style("stroke",Q)})}if(he.selectAll("rect,.annotation-subject").remove(),r.animation?.animationEnabled){const Q=r.animation.animationDuration,J=Xe[r.animation.animationEffect],F=he.selectAll(".annotation-note-label");F.interrupt().style("opacity",0),setTimeout(()=>{F.transition().delay((b,v)=>v*30).duration(Q).ease(J).style("opacity",1)},50)}const xe=r.plotArea.connectorColor??"#ccc";he.selectAll(".connector").style("stroke",xe).attr("hoverId",Q=>Q.data.hoverId).attr("stroke-dasharray",q[r.plotArea.connectorStyle?.toLowerCase()]),he.selectAll(".connector-end").attr("hoverId",Q=>Q.data.hoverId).style("fill",xe).style("stroke",xe),he.selectAll(".annotation-note-title").attr("hoverId",Q=>Q.data.hoverId),he.selectAll(".annotation-note-label").attr("hoverId",Q=>Q.data.hoverId).filter(Q=>!Q.data.isVisible).style("display","none"),he.selectAll(".annotation-note-label").filter(Q=>r.plotArea.hideInsignificantValue&&Q.data.x1-Q.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",Fe.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=fe.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,q,Z,Y,N,P,z,te,oe,de,se,he,Ae,pe=[],xe=[],Q,J,F,b,v,d,c,i,y,f,a,L,I,ae=[],K=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};fe.useEffect(()=>{try{we()}catch(Me){ge("Columnchart","createColumnChart",Me)}},[e]);const we=()=>{({formatOptions:e,svg:v,width:Q,height:J}=Ct(l,e)),Te(),{maxNumberForPrimaryAxis:oe,maxNumberForSecondaryAxis:de}=Nt(e,Le.yMinLeft,Le.yMaxLeft,Le.yMinRight,Le.yMaxRight),{margin:G,yLabel:V,xLabel:j,yTitle:q,xTitle:Z,dimensionHeightWidthArray:Y,chartTitleHeight:N,secondaryAxisTitleWidth:P,legendMargin:z,secondaryYLabel:te}=vt(Q,J,oe,de,Le.yMaxLeft,e,Le.legendList,Le.dimensionList,Le.yMaxRight,A,u,t),ie(G),{dataTable:F,dataTableHeight:b}=ea(e,V,q,s,Le.dimensionList),kt(v,Q,J,e),d=Mt(v,G),mt(d,e,b,se,he,n),ee(),O(),De(),Gt(d,e,b,V,a,he),ye(s,J,v,G,se),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,v,d,F,h,c,i,y,void 0,void 0,b,n,e,V,q,Le.dimensionList,se,f,Le.formattedDimensionListMap,o,G,he)),St(e,m,v,G,j,J,Z,Le.chartType,V,se,he),Ft(he,e,b,m,v,G,q,V),Ut(v,A,G,e,b,he,se,te,P),wt(v,e,Q,N),Dt(J,v,Y,N,Q,z,e,s,o,b,G,nt.rectangle)},Te=()=>{const Me=[],Ce=[];let ve=[],ue=-1/0,me=1/0;s.forEach(B=>{Ce.push(B.legend),B.data.forEach($=>{Me.push($),ue=Math.max(ue,$.value),me=Math.min(me,$.value)})}),Le.chartData=Me,Le.legendList=Ce,Le.yMaxLeft=ue,Le.yMinLeft=me>0?0:me,ae=JSON.parse(JSON.stringify(s)),ae.forEach(B=>B.data.forEach($=>ve.push($.value)));let ce=S||S==0?S:0,le=p||p==0?p:ae[0]?.data?.length;Le.yMaxLeft=parseFloat((ce+"").length>(le+"").length?ce+"":le+""),Le.xMax=T.max(ve),Le.xMin=T.min(ve)},ee=()=>{switch(e.bins.binsCalculation){case"Automatic":Ae=se/50;break;case"Number of Bins":ke(!1);break;case"Bin Width":ke(!0)}},ke=Me=>{ae.forEach(me=>me.data.sort(function(ce,le){return ce.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 ue=Le.xMin;if(Me)for(pe=[ue];ue<Le.xMax;)ue+=ve,pe.push(ue);else for(pe=[ue];Math.round(ue)<Math.round(Le.xMax);)ue+=ve,pe.push(Math.round(ue))},O=()=>{i=T.scaleLinear().domain([Le.xMin,Le.xMax]).range([0,se]);const Me=pe.length>0?pe:i.ticks(Ae);let Ce=T.bin().value(ue=>ue).domain(i.domain()).thresholds(Me);ae.forEach(ue=>{let me=Ce(ue.data.map(ce=>ce.value));xe.push(me)}),ae.forEach((ue,me)=>xe[me].forEach(ce=>{ce.name=ue.properties.legend,ce.color=ue.properties.color,ce.opacity=ue.properties.opacity}));let ve=[];xe.forEach(ue=>ue.forEach(me=>ve.push(me.length))),Le.yMaxLeft=T.max(ve),Le.yMinLeft=T.min(ve),c=T.scaleLinear().range([he,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,he,e,Le,S,p,!1,se);a=T.axisLeft(c).tickFormat(Ce=>_e(Ce,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,se)).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,se,e,H,g,he,!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,he,b)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?L.ticks(Ae):L.tickValues(pe).ticks(se/50)},Ye=Me=>{const Ce=e.animation.animationEnabled,ve=d.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(xe).enter().append("g").selectAll("rect").data(me=>me).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(me){return"translate("+i(me.x0)+","+he+")"}).attr("width",function(me){return i(me.x1)-i(me.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(me.x1)-i(me.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",me=>me.color!==Fe.white?me.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(me,ce)=>{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:`${ce.x0}-${ce.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ce.properties?.currentMeasure?ce.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:_e(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(ce.length/ae[0].data.length):ce.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,me)}).on("mouseout",rt);(Ce?ve.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):ve).attr("transform",function(me){return"translate("+i(me.x0)+","+(c(me.length)>0?c(me.length):0)+")"}).attr("height",function(me){return he-c(me.length)}),d.selectAll(".parentGroup").raise()},ie=Me=>{se=Q-Me.left-Me.right,he=J-Me.bottom-Me.top},ye=(Me,Ce,ve,ue,me)=>{if(!e.plotArea.fitChart){const ce=Me[0].data.length-be,le=Ce-20;I=Le.dimensionList.slice(K,K+be),ae=JSON.parse(JSON.stringify(Me)),ae.forEach((E,k)=>ae[k].data=E.data.filter(w=>I.includes(w.dimension))),ve.append("rect").attr("x",ue.left).attr("y",le).attr("width",me).attr("height",8).attr("fill","#ddd").attr("rx",4);const B=me*be/Le.dimensionList.length,$=ve.append("rect").attr("x",ue.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",E=>{let k=Math.min(Math.max(E.x,ue.left),ue.left+me-B);$.attr("x",k),K=Math.round((k-ue.left)/(me-B)*ce),I=Le.dimensionList.slice(K,K+be),ae=JSON.parse(JSON.stringify(Me)),ae.forEach((w,D)=>ae[D].data=w.data.filter(R=>I.includes(R.dimension))),Ve(),Ne()}));ve.on("wheel",E=>{E.preventDefault();const k=Math.abs(E.deltaX)>Math.abs(E.deltaY)?E.deltaX:E.deltaY;K+=k>0?1:-1,K=Math.max(0,Math.min(K,ce));const w=ue.left+(me-B)*K/ce;$.attr("x",w),ae=JSON.parse(JSON.stringify(Me)),ae.forEach((D,R)=>ae[R].data=D.data.filter(W=>I.includes(W.dimension))),Ve(),Ne()})}Ne()},Ne=()=>{qt(d,Le,j,e,b,c,L,Y,J,h,t,se,he,I,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=fe.useRef(),p=fe.useRef(s);p.current=s;const H=fe.useRef(x);H.current=x;const g=pt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1;let j=!1;const q=!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,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b=!1,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te,ee,ke,O=[],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};fe.useEffect(()=>{try{ye()}catch($){ge("Linechart","createLineChart",$)}},[e]);const ye=()=>{({formatOptions:e,svg:a,width:c,height:i}=Ct(S,e)),Ne(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:F}=Nt(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:z,yLabel:te,xLabel:oe,yTitle:de,xTitle:se,dimensionHeightWidthArray:he,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:xe,secondaryYLabel:Q,visibleBars:Ve,columnWidth:Ye,scrollbarVisible:b}=vt(c,i,J,F,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,q,t,!1,ie),le(z),{dataTable:y,dataTableHeight:f}=ea(e,te,de,g,ie.dimensionList,r),kt(a,c,i,e),L=Mt(a,z),mt(L,e,f,v,d,u,m),Me(),ue(),Gt(L,e,f,te,we,d),j&&ci(L,e,f,Q,ee,d,v),St(e,V,a,z,oe,i,se,ie.chartType,te,v,d),Ft(d,e,f,V,a,z,de,te),j&&Ut(a,j,z,e,f,d,v,Q,pe),wt(a,e,c,Ae),Dt(i,a,he,Ae,c,xe,e,g,m,f,z,nt.line,u,n),Bt(g,i,c,a,z,v,b,Ve,ie,De,!1,Ce)},Ne=()=>{const $=[],E=[];let k=[],w=-1/0,D=1/0,R=-1/0,W=1/0;e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0),g.forEach(C=>{E.push(C.properties.alias?C.properties.alias:C.legend),C.data.forEach(M=>{$.push(M),C.properties.axis==="Secondary"?(j=!0,R=Math.max(R,M.value),W=Math.min(W,M.value)):(w=Math.max(w,M.value),D=Math.min(D,M.value))})}),ie.chartData=$,ie.legendList=E,ie.yMaxLeft=w,ie.yMinLeft=D,ie.yMaxRight=R,ie.yMinRight=W,k=t?bt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(C=>C):ie.dimensionList,ie.dimensionList.forEach((C,M)=>{ie.formattedDimensionListMap.set(C,k[M])}),O=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ke=ie.dimensionList:ke=ie.dimensionList.slice(De,De+Ve)},Me=()=>{let $=ot(Y||ie.yMaxLeft,ie.yMinLeft,d,e,ie,Z,Y).yAxisLabelArray;if(ie.yMaxLeft=$[$.length-1],ie.yMinLeft=$[0],I=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?P||0:P||ie.yMaxRight*1.1]).range([f>0?d-f:d,0])),be=[0,v],e.seriesLabel.seriesLabelVisibility){let E=aa(v,I,e,O,ae,j,d,!1);E.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Le=E.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?be=[0,v-E.heightWidth[0]]:be=[E.heightWidth[0],v]}},Ce=($,E,k)=>{O=E,ke=$,Ve=k,B()},ve=()=>{K=T.scalePoint().domain(ke).range(be).padding(.5)},ue=()=>{{let $=ot(Y||ie.yMaxLeft,ie.yMinLeft,d,e,ie,Z,Y);we=T.axisLeft(I).tickFormat(E=>_e(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,v,Le)).tickValues($.autoLabelFlag?void 0:$.yAxisLabelArray).ticks($.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let $=oi(P||ae.domain()[1],ae.domain()[0],e,d);ee=T.axisRight(ae).tickFormat(E=>_e(E,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues($.autoLabelFlag?void 0:$.secondaryYAxisLabelArray).ticks($.secondaryCustomTickValue).tickSize(Pt(e,v,Le)).tickPadding(8).tickSizeOuter(0)}},me=()=>{Te=T.axisBottom(K).tickSize(ia(e,d,f,!0)).tickSizeOuter(0).tickValues(Lt(ke,v))},ce=$=>{const E=[...$].reverse();E.forEach(M=>{M.data.forEach(_=>{_.hideZero=M.properties.hideZeroValues,_.axis=M.properties.axis})});const k=T.line().x(M=>{const _=K(M.dimension);return _??0}).y(M=>M.axis===at.primary?I(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 R=L.selectAll(".parentGroup").data([E]);R=R.enter().append("g").attr("class","lines parentGroup").merge(R);let W=R.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",U=>k(U.data)).attr("stroke",U=>U.properties.color!==Fe.white?U.properties.color:"none").attr("stroke-dasharray",U=>{const Se=parseInt(U.properties.lineWidth);switch(U.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",U=>U.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",U=>U.properties.lineStyle!=="None"?U.properties.lineWidth:0).attr("hoverId",(M.properties.alias||M.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${m}-clip)`).attr("d",U=>k(U.data)).attr(Ke.SeriesId,U=>U.properties.legendUniqueId).attr(Ke.DimValue,U=>U.properties.alias||U.properties.name||"").on("click",gt(H,p,(U,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 U=T.select(this),Se=this.getTotalLength();U.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se),D(U).attr("stroke-dashoffset",0)})}),W.exit().remove(),Ca(R,E,"None",K,I,ae,null,e,ie,P,N,Z,Y,!1,l),L.selectAll(".parentGroup").raise()},le=$=>{v=c-$.left-$.right,d=i-$.bottom-$.top},B=()=>{ve(),me(),qt(L,ie,oe,e,f,I,Te,he,i,v/ke.length,t,v,d,ke,K),ce(O),Da(g,K,I,ae,z,dt,[],[],e,u,i,c,v,ke,d,m,a,h,void 0,void 0,o);let $=aa(v,I,e,O,ae,j,d,!1).labelArray;za(e,L,$),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,a,L,y,A,I,K,void 0,void 0,void 0,f,u,e,te,de,ie.dimensionList,v,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=r.DimensionList,G=(pt(r.ChartData,r.DimensionList)||[]).reverse(),V=!1,j=new Map,q=!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,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te,ee=[],ke=0,O=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};fe.useEffect(()=>{try{Ne()}catch(k){ge("StackLinechart","createStackLineChart",k)}},[e]);const Ne=()=>{({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:te,xLabel:oe,yTitle:de,xTitle:se,dimensionHeightWidthArray:he,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:xe,secondaryYLabel:Q,visibleBars:O,columnWidth:Ve,scrollbarVisible:De}=vt(d,c,J,F,ye.yMaxLeft,e,ye.legendList,ye.dimensionList,ye.yMaxRight,q,ie,t,!1,ye),le(z),{dataTable:i,dataTableHeight:y}=ea(e,te,de,G,ye.dimensionList,r),kt(f,d,c,e),a=Mt(f,z),mt(a,e,y,b,v,u,m),Ce(),ue(),Gt(a,e,y,te,Le,v),St(e,V,f,z,oe,c,se,ye.chartType,te,b,v),Ft(v,e,y,V,f,z,de,te),Ut(f,q,z,e,y,v,b,Q,pe),wt(f,e,d,Ae),Dt(c,f,he,Ae,d,xe,e,[...G].reverse(),m,y,z,nt.line,u,n),Bt(G,c,d,f,z,b,De,O,ye,ke,!1,E),qa(j,ae,L,z,dt,[],e,u,c,d,f,o)},Me=()=>{const k=[],w=[];e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0),G.forEach((_,X)=>{const U=`${X}~$~${_.properties.alias?_.properties.alias:_.legend}`;_.properties.legend=U,w.push(U);for(const Se of _.data)k.push(Se)}),ye.chartData=k,ye.legendList=w,ee=JSON.parse(JSON.stringify(G));let D=xt(ye.dimensionList,G,ie);e.plotArea.fitChart?Te=ye.dimensionList:(Te=ye.dimensionList.slice(ke,ke+O),ee.forEach((_,X)=>ee[X].data=_.data.filter(U=>Te.includes(U.dimension))));const R=T.stack().keys(ye.legendList).offset(T.stackOffsetDiverging)(D);$();let W=1/0,C=-1/0;for(const _ of R)for(const[X,U]of _)W=Math.min(W,X),C=Math.max(C,U);ye.yMinLeft=W>0?0:W,ye.yMaxLeft=C;let M=t?bt(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList).map(_=>_):ye.dimensionList;ye.dimensionList.forEach((_,X)=>{ye.formattedDimensionListMap.set(_,M[X])})},Ce=()=>{let k=ot(Y||ye.yMaxLeft,ye.yMinLeft,v,e,ye,Z,Y).yAxisLabelArray;if(ye.yMaxLeft=k[k.length-1],ye.yMinLeft=k[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?v-y:v,0]),K=[0,b],e.seriesLabel.seriesLabelVisibility){let w=aa(b,L,e,ee,void 0,q,v,!0);w.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(be=w.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,b-w.heightWidth[0]]:K=[w.heightWidth[0],b]}ve()},ve=()=>{ae=T.scalePoint().domain(Te).range(K).padding(.5)},ue=()=>{me();{let k=ot(Y||ye.yMaxLeft,ye.yMinLeft,v,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(k.autoLabelFlag?void 0:k.yAxisLabelArray).ticks(k.customTickValue).tickPadding(8).tickSizeOuter(0)}},me=()=>{we=T.axisBottom(ae).tickSize(ia(e,v,y,!0)).tickSizeOuter(0).tickValues(Lt(Te,b))},ce=k=>{k.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 R=D.selectAll(".line-group").data(C=>C);const W=R.enter().append("g").attr("class",C=>"line-group "+C.key.replace(/ /g,"-"));W.append("path").attr("class","line").attr("fill","none"),W.merge(R).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!==Fe.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(Ke.SeriesId,G[M].properties.legendUniqueId).attr(Ke.DimValue,G[M].properties.alias||G[M].properties.name||"").on("click",gt(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||""}))),U=e.animation.animationEnabled,Se=X.node().getTotalLength();U?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",Fe.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)})}),R.exit().remove(),Ca(D,k,u,ae,L,I,null,e,ye,P,N,Z,Y,!1,x)},le=k=>{b=d-k.left-k.right,v=c-k.bottom-k.top},B=()=>{ve(),me(),qt(a,ye,oe,e,y,L,we,he,c,A,t,b,v,Te,ae),$(),ce(ee),Va(Ye,ae,L,I,z,dt,[],[],e,u,c,d,b,Te,v,m,f,h,y,o);let k=aa(b,L,e,ee,void 0,q,v,!0).labelArray;za(e,a,k),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,te,de,ye.dimensionList,b,K,ye.formattedDimensionListMap,m,z,v))},$=()=>{let k=xt(Te,ee,ie);Ye=T.stack().keys(ye.legendList).offset(T.stackOffsetDiverging)(k),ee.forEach((D,R)=>D.data.forEach((W,C)=>{W[0]=Ye[R][C][0],W[1]=Ye[R][C][1]}));let w=e.annotation.annotationSetLabelColor;Ye.forEach((D,R)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(G[R].properties.color)),D.individualAnnotationVisibility=JSON.parse(JSON.stringify(G[R].properties.individualAnnotationVisibility)),W.data.labelPosition=G[R].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(G[R].properties.color)):G[R].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(G[R].properties.hideZeroValues)),W.properties=G[R].properties}))},E=(k,w,D)=>{ee=w,Te=k,O=D,Ka(r,j,Te),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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList)?.reverse()||[],G=r.DimensionList,V=!1,j=!1;let q=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,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te=[],ee=0,ke,O=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};fe.useEffect(()=>{try{ye()}catch(k){ge("NormalizedLinechart","createNormalizedLinechart",k)}},[e]);const ye=()=>{({formatOptions:e,svg:y,width:v,height:d}=Ct(S,e)),Ne(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:P,yLabel:z,xLabel:te,yTitle:oe,xTitle:de,dimensionHeightWidthArray:se,chartTitleHeight:he,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:xe,visibleBars:ke,columnWidth:O,scrollbarVisible:De}=vt(v,d,Q,J,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,Ye,t,!1,ie),le(P),{dataTable:c,dataTableHeight:i}=ea(e,z,oe,g,ie.dimensionList,r),kt(y,v,d,e),f=Mt(y,P),mt(f,e,i,F,b,u,m),Me(),ue(),Gt(f,e,i,z,be,b),St(e,V,y,P,te,d,de,ie.chartType,z,F,b),Ft(b,e,i,V,y,P,oe,z),Ut(y,j,P,e,i,b,F,xe,Ae),wt(y,e,v,he),Dt(d,y,se,he,v,pe,e,[...g].reverse(),m,i,P,nt.line,u,n),Bt(g,d,v,y,P,F,De,ke,ie,ee,!1,B)},Ne=()=>{const k=[],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 U of M.data)k.push(U)}),ie.chartData=k,ie.legendList=w,Te=JSON.parse(JSON.stringify(g)),we=ie.dimensionList;const D=xt(ie.dimensionList,g,Ye),R=T.stack().keys(ie.legendList).offset(T.stackOffsetDiverging)(D);E();let W=1/0;for(const M of R)for(const[_]of M)W=Math.min(W,_);ie.yMinLeft=W>0?0:W,ie.yMaxLeft=1;const C=t?bt(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,Te);let k=aa(F,a,e,Te,void 0,j,b,!0);k.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(K=k.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ae=[0,F-k.heightWidth[0]]:ae=[k.heightWidth[0],F]}},Ce=()=>{I=T.scalePoint().domain(we).range(ae).padding(.5)};function ve(k,w){k.forEach((D,R)=>D.forEach((W,C)=>{w[R]&&w[R].data[C]&&(w[R].data[C][0]=W[0]=W.data.total===0?0:W[0]/W.data.total,w[R].data[C][1]=W[1]=W.data.total===0?0:W[1]/W.data.total)}))}const ue=()=>{be=T.axisLeft(a).tickSize(Pt(e,F,K)).ticks(i>0?(b-i)/80:b/80,"%").tickPadding(8).tickSizeOuter(0)},me=()=>{Le=T.axisBottom(I).tickSize(ia(e,b,i,!0)).tickSizeOuter(0).tickValues(Lt(we,F))},ce=k=>{ve(Ve,Te),k.forEach(C=>{C.data.forEach(M=>{M.hideZero=C.properties.hideZeroValues,M.axis=C.properties.axis})});const w=T.line().x(C=>I(C.data.dimension)?I(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 R=D.selectAll(".line-group").data(C=>C),W=R.enter().append("g").attr("class",C=>"line-group "+C.key.replace(/ /g,"-"));W.attr("hoverId",C=>(k[C.index]?.properties?.alias||k[C.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),W.merge(R).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!==Fe.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(Ke.SeriesId,g[M].properties.legendUniqueId).attr(Ke.DimValue,g[M].properties.alias||g[M].properties.name||"").on("click",gt(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||""}))),U=e.animation.animationEnabled,Se=X.node().getTotalLength();U?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",Fe.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(k[Ie.index]?.properties?.alias||k[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(k[Ie.index]?.properties?.alias||Ie[Ie.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),R.exit().remove(),Ca(D,k,u,I,a,L,null,e,ie,N,Y,q,Z,!0,x)},le=k=>{F=v-k.left-k.right,b=d-k.bottom-k.top},B=(k,w,D)=>{Te=w,we=k,ke=D,$()},$=()=>{Ce(),E(),me(),qt(f,ie,te,e,i,a,Le,se,d,A,t,F,b,we,I),ce(Te),Va(Ve,I,a,L,P,dt,[],[],e,u,d,v,F,we,b,m,y,h,i,o);let k=aa(F,a,e,Te,void 0,j,b,!0).labelArray;za(e,f,k),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,c,A,a,I,void 0,void 0,void 0,i,re.LineChart,e,z,oe,ie.dimensionList,F,ae,ie.formattedDimensionListMap,m,P,b))},E=()=>{let k=xt(we,Te,Ye);Ve=T.stack().keys(ie.legendList).offset(T.stackOffsetDiverging)(k),Te.forEach((D,R)=>D.data.forEach((W,C)=>{W[0]=Ve[R][C][0],W[1]=Ve[R][C][1]}));let w=e.annotation.annotationSetLabelColor;Ve.forEach((D,R)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(g[R].properties.color)),W.data.labelPosition=g[R].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues)),W.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%"}})})},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=fe.useRef(),p=fe.useRef(s);p.current=s;const H=fe.useRef(x);H.current=x;const g=pt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!0;let j=!1;const q=!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,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v=new Map,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te,ee,ke,O=[],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};fe.useEffect(()=>{try{ye()}catch($){ge("HorizontalBarchart","createHorizontalBarChart",$)}},[e]);const ye=()=>{({formatOptions:e,svg:a,width:i,height:y}=Ct(S,e)),Ne(),{maxNumberForPrimaryAxis:F,maxNumberForSecondaryAxis:b}=Nt(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:te,yLabel:oe,xLabel:de,yTitle:se,xTitle:he,dimensionHeightWidthArray:Ae,chartTitleHeight:pe,secondaryAxisTitleWidth:xe,legendMargin:Q,secondaryYLabel:J,visibleBars:Ve,columnWidth:A,scrollbarVisible:Ye}=vt(i,y,F,b,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,q,t,V,ie),ce(te),kt(a,i,y,e),L=Mt(a,te),mt(L,e,f,d,c,u,m),Me(),ve(),Ya(e,L,oe,c,d,we),j&&zl(e,L,J,Te,d),St(e,V,a,te,de,y,he,ie.chartType,oe,d,c),Ft(c,e,f,V,a,te,se,oe,d),Ut(a,j,te,e,f,c,d,J,xe,V),wt(a,e,i,pe),Dt(y,a,Ae,pe,i,Q,e,g,m,f,te,nt.rectangle,u,n),Bt(g,y,i,a,te,d,Ye,Ve,ie,De,!1,le,V)},Ne=()=>{const $=[],E=[];let k=[],w=-1/0,D=1/0,R=-1/0,W=1/0,C=1/0,M=-1/0;g.forEach(_=>{E.push(_.properties.legendUniqueId),M=-1/0,C=1/0,_.data.forEach(X=>{$.push(X),_.properties.axis==="Secondary"?(j=!0,R=Math.max(R,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=$,ie.legendList=E,ie.yMaxLeft=w,ie.yMinLeft=D>0?0:D,ie.yMaxRight=R,ie.yMinRight=W,k=t?bt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(_=>_):ie.dimensionList,ie.dimensionList.forEach((_,X)=>{ie.formattedDimensionListMap.set(_,k[X])}),O=JSON.parse(JSON.stringify(g)),ke=ie.dimensionList,e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0)},Me=()=>{let $=ot(ie.yMaxLeft,ie.yMinLeft,c,e,ie,Y,N,V,d).yAxisLabelArray;ie.yMaxLeft=$[$.length-1],ie.yMinLeft=$[0],K=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?(P||P==0)&&!Number.isNaN(P)?P:0:(P||P==0)&&!Number.isNaN(P)?P: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),I=T.scalePoint().domain(ke).range(Le).padding(.5)},ve=()=>{{let $=ot(N||ie.yMaxLeft,ie.yMinLeft,c,e,ie,Y,N,V,d);we=T.axisBottom(K).tickFormat(E=>_e(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-c:0).tickValues($.autoLabelFlag?void 0:$.yAxisLabelArray).ticks($.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let $=oi(z||be.domain()[1],be.domain()[0],e,d);Te=T.axisTop(be).tickFormat(E=>_e(E,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues($.autoLabelFlag?void 0:$.secondaryYAxisLabelArray).ticks($.secondaryCustomTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-c:0).tickPadding(8).tickSizeOuter(0)}},ue=()=>{ee=T.axisLeft(I).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))},me=$=>{$.forEach(E=>{E.data.forEach(k=>{k.hideZero=E.properties.hideZeroValues,k.axis=E.properties.axis,k.legendUniqueId=E.properties.legendUniqueId})}),ke.forEach(E=>{L.append("rect").attr("id",`dim-background-${E}`).attr("class","dimension-background").attr("y",I(E)-A/2).attr("height",A).attr("x",0).attr("width",d).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),$.forEach(E=>{let k=L.selectAll(".parentGroup").data([E],C=>C.properties.legendUniqueId);k=k.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(k);let w=k.selectAll(".column-group").data(E.data.map(C=>({...C,properties:E.properties})),C=>C.legend+C.dimension),D=w.enter().append("g").attr("class","column-group").attr("hoverId",(E.properties.alias||E.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",C=>`translate(0, ${I(C.dimension)-A/2})`);w.attr("transform",C=>`translate(0, ${I(C.dimension)-A/2})`),D.merge(w).attr("transform",C=>`translate(0, ${I(C.dimension)-A/2})`);const R=D.append("rect").attr("y",C=>ae(C.legendUniqueId)).attr("height",ae.bandwidth()).attr("x",C=>{const M=E.properties.axis===at.primary?K:be;return C.value>=0,M(0)}).attr("width",0).attr("fill",C=>Z.get(E.properties.legendUniqueId)?.(C.value)??E.properties.color).attr("stroke-dasharray",C=>C.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",C=>`${C.properties.stackBorderWidth}px`).attr("stroke",C=>E.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?E.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",C=>C.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Ke.SeriesId,()=>E.properties.legendUniqueId).attr(Ke.DimValue,C=>Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension));(e.animation.animationEnabled?R.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):R).attr("x",C=>{const M=E.properties.axis===at.primary?K:be;return C.value>=0?M(0):M(C.value)}).attr("width",C=>{const M=E.properties.axis===at.primary?K:be,_=E.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)=>{(E.properties.alias||E.properties.name||"Legend").replace(/ /g,"-");const _=String(ie.formattedDimensionListMap.get(Array.isArray(M.dimension)?M.dimension[0]:M.dimension)??""),X=ht(l,_,E.properties);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,E.properties,X)}).on("mouseout",(C,M)=>{(E.properties.alias||E.properties.name||"Legend").replace(/ /g,"-"),rt()}).on("click",gt(H,p,(C,M)=>({seriesId:E.properties.legendUniqueId,dimValue:Array.isArray(M.dimension)?String(M.dimension[0]):String(M.dimension),legendUniqueId:E.properties.legendUniqueId,seriesDisplayName:E.properties.alias||E.properties.name||""}))),w.exit().remove()}),L.selectAll(".parentGroup").raise()},ce=$=>{d=i-$.left-$.right,c=y-$.bottom-$.top},le=($,E,k)=>{O=E,ke=$,Ve=k,Ka(r,v,ke),e.xAxisLabel.hideZeroValues&&(ke=ke.filter(w=>v.get(w)!==0)),B()},B=()=>{Ce(),ue(),Ua(e,L,de,c,d,ee,Te,K,ie.yMaxLeft,ke,u,t,i,Ae,A,I),me(O),Da(O,I,K,be,te,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList)?.reverse(),G=r.DimensionList,V=!0,j=!1;let q=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y,N,P,z,te,oe,de,se,he,Ae,pe,xe;const Q=new Map;let J,F,b,v,d,c,i,y,f,a,L,I,ae=[],K=0,be=2,Le=!1,we=[];const Te=!1;let ee=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};fe.useEffect(()=>{try{O()}catch(B){ge("StackStackHorizontalBarchart","createStackHorizontalBarChart",B)}},[e]);const O=()=>{({formatOptions:e,svg:d,width:b,height:v}=Ct(S,e)),De(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:xe}=Nt(e,ke.yMinLeft,ke.yMaxLeft,ke.yMinRight,ke.yMaxRight),{margin:Y,yLabel:N,xLabel:P,yTitle:z,xTitle:te,dimensionHeightWidthArray:oe,chartTitleHeight:de,secondaryAxisTitleWidth:se,legendMargin:he,secondaryYLabel:Ae,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(b,v,pe,xe,ke.yMaxLeft,e,ke.legendList,ke.dimensionList,ke.yMaxRight,j,Te,t,V,ke),Me(Y),kt(d,b,v,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,P,v,te,ke.chartType,N,J,F),Ft(F,e,0,V,d,Y,z,N,b),wt(d,e,b,de),Dt(v,d,oe,de,b,he,e,[...g].reverse(),m,0,Y,nt.rectangle,u,n),Bt(g,v,b,d,Y,J,Le,be,ke,K,!1,Ce,V)},De=()=>{const B=[],$=[];let E=-1/0,k=1/0;g.forEach((M,_)=>{const X=`${_}~$~${M.properties.legend}`;M.properties.legend=X,$.push(X),E=-1/0,k=1/0;for(const U of M.data)E=Math.max(E,U.value),k=Math.min(k,U.value),B.push(U);M.properties.setColorScale&&Q.set(M.properties.legendUniqueId,T.scaleSequential().domain([k,E]).interpolator(T.interpolateRgb(M.properties.startColor,M.properties.endColor)))}),ke.chartData=B,ke.legendList=$,ae=JSON.parse(JSON.stringify(g));let w=xt(ke.dimensionList,g,Te);e.plotArea.fitChart?I=ke.dimensionList:(I=ke.dimensionList.slice(K,K+be),ae.forEach((M,_)=>ae[_].data=M.data.filter(X=>I.includes(X.dimension))));const D=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(w);ue();let R=1/0,W=-1/0;for(const M of D)for(const[_,X]of M)R=Math.min(R,_),W=Math.max(W,X);ke.yMinLeft=R>0?0:R,ke.yMaxLeft=W;let C=t?bt(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,q,Z,V,J).yAxisLabelArray;ke.yMaxLeft=B[B.length-1],ke.yMinLeft=B[0],i=T.scaleLinear().domain([ke.yMinLeft>=0?q!==void 0&&!Number.isNaN(q)?q: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(I).range(f).padding(.5)},ie=()=>{{let B=ot(Z||ke.yMaxLeft,ke.yMinLeft,F,e,ke,q,Z,V,J);a=T.axisBottom(i).tickFormat($=>_e($,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(I,F))},Ne=B=>{B.forEach(C=>{C.data.forEach(M=>{M.hideZero=C.properties.hideZeroValues,M.axis=C.properties.axis})}),I.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 $=c.selectAll(".parentGroup").data([we]);$=$.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge($);let E=$.selectAll(".column-group").data(C=>C);E=E.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(E);let w=E.selectAll("rect").data(C=>C);const D=(C,M)=>{const _=Array.from(E.nodes()).indexOf(C[M].parentNode);return{props:g[_]?.properties,groupIndex:_}},R=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 Q.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(Ke.SeriesId,C=>C.key??"").attr(Ke.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(ke.formattedDimensionListMap.get(_)??""),M.properties))}).on("mouseout",(C,M)=>{M.data.dimension,rt()}).on("click",gt(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||""})));R.attr("x",C=>i(0)),(e.animation.animationEnabled?R.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):R).attr("x",C=>Math.min(i(C[0]),i(C[1]))).attr("width",C=>Math.abs(i(C[1])-i(C[0]))),E.exit().remove(),c.selectAll(".parentGroup").raise()},Me=B=>{J=b-B.left-B.right,F=v-B.bottom-B.top},Ce=(B,$,E)=>{ae=$,I=B,be=E,Ka($,ee,I),ue(),ve()},ve=()=>{Ye(),ye(),Ua(e,c,P,F,J,L,void 0,i,ke.yMaxLeft,I,u,t,b,oe,A,y),Ne(ae),Va(we,y,i,void 0,Y,dt,[],[],e,u,v,b,J,I,F,m,d,h,0,o,V),qa(ee,y,i,Y,dt,[],e,u,v,b,d,o,V),me(),c.selectAll(".connectors").raise()},ue=()=>{let B=xt(I,ae,Te);we=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(B),ae.forEach((E,k)=>E.data.forEach((w,D)=>{w[0]=we[k][D][0],w[1]=we[k][D][1]}));let $=e.annotation.annotationSetLabelColor;we.forEach((E,k)=>E.forEach(w=>{w.key=E.key,E.color=JSON.parse(JSON.stringify(g[k].properties.color)),w.data.labelPosition=g[k].properties.dataLabelPosition,w.data.labelColor=$=="2"?JSON.parse(JSON.stringify(g[k].properties.color)):g[k].properties.labelColor,w.hideZero=JSON.parse(JSON.stringify(g[k].properties.hideZeroValues)),w.properties=g[k].properties}))},me=()=>{try{const B=Number(e.connector?.connectorVisibility);if(!e.connector||B===2)return;const $=[],E=[],k=[];let w;const D=[];if(B===1)w=1;else if(B===3){const U=Number(e.connector.connectorFollow);U===1?w=Number(e.connector.connectorStepSize):U===2&&((e.connector.connectorExclude||[]).forEach(Se=>k.push(Se)),w=1)}const R=[],W=[],C=[],M=e.connector?.connectorCustomRange||[];k.forEach(U=>{const Se=U.split("-");Se.length&&R.push(Se[0])});const X=(we?.[0]||[]).map((U,Se)=>({Dimension:U.data.dimension,Total:U.data.total,CustomTotal:U.data.total-(C[Se]??0),Index:Se}));if(w!=null){for(let U=0;U<X.length;U++)(w===1||U%w===0&&w!==1)&&$.push(X[U]);for(let U=w;U<X.length;U+=w){const Se=Math.min(U+w,X.length);let ze=-1/0;for(let Ie=U;Ie<Se;Ie++)X[Ie].Total>ze&&(ze=X[Ie].Total);ze!==-1/0&&D.push(ze)}for(let U=1;U<$.length;U++)E.push($[U])}else{const U=[];(M||[]).forEach(Se=>{if(Se?.from&&Se?.to){const ze=X.some(Qe=>Qe.Dimension===Se.from),Ie=X.some(Qe=>Qe.Dimension===Se.to);ze&&Ie&&U.push({from:Se.from,to:Se.to})}}),U.forEach(Se=>{const ze=X.findIndex(Qe=>Qe.Dimension===Se.from),Ie=X.findIndex(Qe=>Qe.Dimension===Se.to);if(ze>=0&&Ie>=0){const Qe=Math.min(ze,Ie),lt=Math.max(ze,Ie);$.push(X[Qe]);let ut=X[Qe]?.Total??-1/0;for(let tt=Qe;tt<=lt;tt++)X[tt].Total>ut&&(ut=X[tt].Total);ut!==-1/0&&D.push(ut),E.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!==Fe.white?e.connector.connectorMarkerColor:"none"),ce($,D,E,w,R),le($,D,E,w,R)}catch(B){console.error(B)}},ce=(B,$,E,k,w)=>{try{const D=y.bandwidth()??0,R=c.selectAll(".connector-paths").data([0]),W=R.enter().append("g").attr("class","connector-paths connectors").merge(R),C=B.filter((X,U)=>k!=null?U<B.length-1:U<B.length),M=W.selectAll("path.connector-path").data(C,(X,U)=>X?.Dimension??U);M.exit().remove(),M.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",(X,U)=>{const Se=E?.[U]??{Total:0,Dimension:X.Dimension},ze=X?.Total??0,Ie=typeof Se.Total=="number"?i(Se.Total):0,Qe=typeof ze=="number"?i(ze):0,lt=Math.max(Ie,Qe);return e.total.totalVisibility?`M ${Qe+50},
73
+ `,N},"");S.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;">${G}</div>`);const V=S.node(),j=V.offsetWidth,K=V.offsetHeight;let Z=H+15,B=g+15;Z+j>window.innerWidth&&(Z=H-j-10),B+K>window.innerHeight&&(B=g-K-10),S.style("left",`${Z}px`).style("top",`${B}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 B=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(ne.italic)?ne.italic:"").style("text-decoration",()=>(u?m.legends.legendFontStyle:V.properties.fontStyle).includes(ne.underline)?ne.underline:"").style("font-weight",()=>(u?m.legends.legendFontStyle:V.properties.fontStyle).includes(ne.bold)?ne.bold:"").style("white-space","nowrap").attr("title",u?V.legendDisplay+" : "+V.actualValue:V.properties.alias).html(u?V.legendDisplay+" : "+V.actualValue+B: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=fe.useRef(),H=fe.useRef(l);H.current=l;const g=fe.useRef(s);g.current=s;const G=fe.useRef(x);G.current=x;const V=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let Z=!1;const B=!1;let N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,E=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,q=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te,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};fe.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:se,yLabel:ce,xLabel:oe,yTitle:he,xTitle:Ae,dimensionHeightWidthArray:pe,chartTitleHeight:xe,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,B,t,!1,ye),le(se),{dataTable:f,dataTableHeight:a}=ea(e,ce,he,V,ye.dimensionList,r),kt(L,i,y,e),P=Mt(L,se),mt(P,e,a,d,c,S,m),Ce(),ue(),Gt(P,e,a,ce,Te,c),Z&&ci(P,e,a,F,ke,c,d),St(e,K,L,se,oe,y,Ae,ye.chartType,ce,d,c),Ft(c,e,a,K,L,se,he,ce),Ut(L,Z,se,e,a,c,d,F,O),wt(L,e,i,xe),Dt(y,L,pe,xe,i,J,e,V,m,a,se,nt.rectangle,S,n),Bt(V,y,i,L,se,d,u,Ye,ye,Ve,!1,U)},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(z=>{R.push(z),X.properties.axis==="Secondary"?(Z=!0,W=Math.max(W,z.value),C=Math.min(C,z.value)):(D=Math.max(D,z.value),I=Math.min(I,z.value)),_=Math.max(_,z.value),M=Math.min(M,z.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,z)=>{ye.formattedDimensionListMap.set(X,w[z])}),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?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$: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)},ue=()=>{{let R=ot(E||ye.yMaxLeft,ye.yMinLeft,c,e,ye,N,E);Te=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)}},me=()=>{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,z=String(ye.formattedDimensionListMap.get(X)??X??""),Se=ht(H.current,String(X??""),{...v.properties,formattedDimensionValue:z});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:z},{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},U=(R,v,w)=>{De=v,ee=R,Ye=w,Y()},Y=()=>{ve(),me(),qt(P,ye,oe,e,a,ae,te,pe,y,A,t,d,c,ee,be),de(De),Da(V,be,ae,Q,se,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,ce,he,ye.dimensionList,d,Fe,ye.formattedDimensionListMap,m,se,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=fe.useRef(),g=fe.useRef(l);g.current=l;const G=fe.useRef(s);G.current=s;const V=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let Z=!1;const B=!1;let N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,E=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,q=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te=[],te=[],ke=[],ee=[],De=[],Ve=[],Ye=[],ie=[],ye,Pe,Me,Ce=new Map,ve,ue=[],me=[],de=0,le,U={dimensionList:j,chartType:p,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};fe.useEffect(()=>{try{Y()}catch(Re){ge("CustomColumnchart","createCustomColumnChart",Re)}},[e]);const Y=()=>{({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,U.yMinLeft,U.yMaxLeft,U.yMinRight,U.yMaxRight),{margin:se,yLabel:ce,xLabel:oe,yTitle:he,xTitle:Ae,dimensionHeightWidthArray:pe,chartTitleHeight:xe,secondaryAxisTitleWidth:O,legendMargin:J,secondaryYLabel:F,visibleBars:le,columnWidth:A,scrollbarVisible:u}=vt(i,y,b,k,U.yMaxLeft,e,U.legendList,U.dimensionList,U.yMaxRight,Z,B,t,!1,U),ze(se),{dataTable:f,dataTableHeight:a}=ea(e,ce,he,V,U.dimensionList,r),kt(L,i,y,e),P=Mt(L,se),mt(P,e,a,d,c,p,m),w(),I(),Gt(P,e,a,ce,ye,c),Z&&ci(P,e,a,F,Me,c,d),St(e,K,L,se,oe,y,Ae,U.chartType,ce,d,c),Ft(c,e,a,K,L,se,he,ce),Ut(L,Z,se,e,a,c,d,F,O),wt(L,e,i,xe),Dt(y,L,pe,xe,i,J,e,V,m,a,se,null,p,n),Bt(V,y,i,L,se,d,u,le,U,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&&(Te.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})}),ue=JSON.parse(JSON.stringify(V)),U.chartData=Ee,U.legendList=Re,U.yMaxLeft=it,U.yMinLeft=Je>0?0:Je,U.yMaxRight=Ze,U.yMinRight=Ge,He=t?gt(e.xAxisLabel.xAxisNumberFormat,U.dimensionList).map(Ne=>Ne):U.dimensionList,U.dimensionList.forEach((Ne,Ue)=>{U.formattedDimensionListMap.set(Ne,He[Ue])}),e.plotArea.fitChart?ve=U.dimensionList:ve=U.dimensionList.slice(de,de+le),e.plotArea.hideZeroValues&&(U.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);me=[];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(...U.chartData),Ze.length){const Ke=[];Ze.forEach(pi=>{Ke.push(...xt.filter(cl=>cl.properties?.type===pi.properties.type&&cl.properties.legend===pi.legend))}),me.push(...Ke)}else me.push(...xt)},w=()=>{ae=T.scaleLinear().domain([U.yMinLeft>=0?N!==void 0&&!Number.isNaN(N)?N:0:U.yMinLeft<0?U.yMinLeft*1.1:U.yMinLeft*.9,U.yMaxLeft<=0?0:E!==void 0&&!Number.isNaN(E)?E:U.yMaxLeft*1.1]).range([a>0?c-a:c,0]),Z&&(Q=T.scaleLinear().domain([U.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:U.yMinRight*1.1,U.yMaxRight<=0?(q||q==0)&&!Number.isNaN(q)?q:0:(q||q==0)&&!Number.isNaN(q)?q:U.yMaxRight*1.1]).range([a>0?c-a:c,0])),Fe=[0,d]},D=()=>{Le=T.scaleBand().domain(U.legendList).range([0,A]).paddingInner(U.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),be=T.scalePoint().domain(ve).range(Fe).padding(.5)},I=()=>{{let Re=ot(E||U.yMaxLeft,U.yMinLeft,c,e,U,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||U.yMaxRight,U.yMinRight,c,e,U,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),z(Je);break}});const He=ue.filter(Je=>Je.properties.type===re.LineChart);He.length&&_(He);const it=ue.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:U.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(U.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,U,q,$,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,U,q,$,N,E)},z=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,U,q,$,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:U.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(U.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)=>{ue=He,ve=Re,le=it,Oe(r,Ce,ve),v(ke,ee,De,Ve,He),ue=JSON.parse(JSON.stringify(me)),ue.forEach((Je,Ze)=>{Je.properties.type===re.StackColumnChart||Je.properties.type===re.StackAreaChart?Je.data.forEach((Ge,Ee)=>ue[Ze].data[Ee].data=Ge.data.filter(Ne=>ve.includes(Ne.dimension))):ue[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(ue),qt(P,U,oe,e,a,ae,Pe,pe,y,A,t,d,c,ve,be);const Re=()=>{Il(ue,be,ae,Q,se,dt,Ye,ie,[],[],A,e,y,i,d,ve,c,m,L,h,Le,o),qa(Ce,be,ae,se,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,ce,he,U.dimensionList,d,Fe,U.formattedDimensionListMap,m,se,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(Te.length>0){const He=(ee.length>0?pt(ve,ee,!1):pt(ve,ke,!1)).map(it=>it.total);U.yMaxLeft=Math.max(U.yMaxLeft,...He),U.yMinLeft=Math.min(U.yMinLeft,...He)}if(te.length>0){const He=(Ve.length>0?pt(ve,Ve,!1):pt(ve,De,!1)).map(it=>it.total);U.yMaxRight=Math.max(U.yMaxRight,...He),U.yMinRight=Math.min(U.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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B=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,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le=[];const Fe=new Map;let Te=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};fe.useEffect(()=>{try{De()}catch(me){ge("LayeredColumnchart","createLayeredColumnChart",me)}},[e]);const De=()=>{({formatOptions:e,svg:i,width:b,height:k}=Ct(S,e)),Ve(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:xe,maxNumberForSecondaryAxis:O}=Nt(e,ee.yMinLeft,ee.yMaxLeft,ee.yMinRight,ee.yMaxRight),{margin:N,yLabel:E,xLabel:$,yTitle:q,xTitle:se,dimensionHeightWidthArray:ce,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:te,columnWidth:A,scrollbarVisible:ke}=vt(b,k,xe,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,$,k,se,ee.chartType,E,J,F),Ft(F,e,c,V,i,N,q,E),Ut(i,j,N,e,c,F,J,pe,he),wt(i,e,b,oe),Dt(k,i,ce,oe,b,Ae,e,g,m,c,N,nt.rectangle,u,n),Bt(g,k,b,i,N,J,ke,te,ee,Te,!1,ue)},Ve=()=>{const me=[],de=[];let le=[],U=-1/0,Y=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=>{me.push(W),w=Math.max(w,W.value),D=Math.min(D,W.value),U=Math.max(U,W.value),Y=Math.min(Y,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=me,ee.legendList=de,ee.yMaxLeft=U,ee.yMinLeft=Y>0?0:Y,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(Te,Te+te),e.plotArea.hideZeroValues&&(ee.hideZeroValues=!0)},Ye=()=>{let me=ot(B||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,B).yAxisLabelArray;ee.yMaxLeft=me[me.length-1],ee.yMinLeft=me[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:B!==void 0&&!Number.isNaN(B)?B: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 me=ot(B||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,B);ae=T.axisLeft(f).tickFormat(de=>_e(de,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,J)).tickValues(me.autoLabelFlag?void 0:me.yAxisLabelArray).ticks(me.customTickValue).tickPadding(8).tickSizeOuter(0)}},Pe=()=>{Q=T.axisBottom(L).tickSize(ia(e,F,c)).tickSizeOuter(0).tickValues(Lt(be,J))},Me=me=>{me.forEach(de=>{de.data.forEach(le=>{le.hideZero=de.properties.hideZeroValues,le.properties=de.properties,le.axis=de.properties.axis})}),me.forEach((de,le)=>{let U=y.selectAll(`.parentGroup-${de.properties.legendUniqueId}`).data([de],D=>D.properties.legendUniqueId);U=U.enter().append("g").attr("class",`column parentGroup parentGroup-${de.properties.legendUniqueId}`).attr("clip-path",`url(#${m}-clip)`).merge(U);let Y=U.selectAll(".column-group").data(de.data,D=>D.dimension+"_"+de.properties.legendUniqueId),R=Y.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)`);Y.attr("transform",D=>le===0?`translate(${L(D.dimension)-A/2}, 0)`:`translate(${L(D.dimension)-A/(2+le*2)}, 0)`),R.merge(Y).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))}),Y.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(Y).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(Y).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||""}))),Y.exit().remove()}),y.selectAll(".parentGroup").raise()},Ce=me=>{J=b-me.left-me.right,F=k-me.bottom-me.top},ve=()=>{ie(),Pe(),qt(y,ee,$,e,c,f,Q,ce,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))},ue=(me,de,le)=>{Le=de,be=me,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=fe.useRef(),H=fe.useRef(s);H.current=s;const g=fe.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,B=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,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P;const ae=new Map;let Q,be,Le,Fe=[],Te=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};fe.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:xe,maxNumberForSecondaryAxis:O}=Nt(e,Ve.yMinLeft,Ve.yMaxLeft,Ve.yMinRight,Ve.yMaxRight),{margin:N,yLabel:E,xLabel:$,yTitle:q,xTitle:se,dimensionHeightWidthArray:ce,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:te,columnWidth:A,scrollbarVisible:u}=vt(b,k,xe,O,Ve.yMaxLeft,e,Ve.legendList,Ve.dimensionList,Ve.yMaxRight,K,De,t,!1,Ve),ue(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,$,k,se,Ve.chartType,E,J,F),Ft(F,e,c,j,i,N,q,E),Ut(i,K,N,e,c,F,J,pe,he),wt(i,e,b,oe),Dt(k,i,ce,oe,b,Ae,e,[...V].reverse(),m,c,N,nt.rectangle,S,n),Bt(V,k,b,i,N,J,u,te,Ve,Te,!1,me)},ie=()=>{const v=[],w=[];let D=-1/0,I=1/0;V.forEach((z,Se)=>{const ze=`${Se}~$~${z.properties.legend}`;z.properties.legend=ze,w.push(ze),D=-1/0,I=1/0;for(const Ie of z.data)D=Math.max(D,Ie.value),I=Math.min(I,Ie.value),v.push(Ie);z.properties.setColorScale&&ae.set(z.properties.legendUniqueId,T.scaleSequential().domain([I,D]).interpolator(ii.interpolateRgb(z.properties.startColor,z.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 z of C)for(const[Se,ze]of z)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(z=>z):Ve.dimensionList;Ve.dimensionList.forEach((z,Se)=>{Ve.formattedDimensionListMap.set(z,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:B!==void 0&&!Number.isNaN(B)?B: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(B||Ve.yMaxLeft,Ve.yMinLeft,F,e,Ve,Z,B);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(z=>{z.hideZero=X.properties.hideZeroValues,z.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,z)=>{const Se=Array.from(D.nodes()).indexOf(X[z].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,z,Se)=>{const{props:ze}=C(Se,z);return ae.get(ze.legendUniqueId)?.(X.data[X.key])??ze?.color??"gray"}).attr("stroke",(X,z,Se)=>{const{props:ze}=C(Se,z);return ze?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ze.stackBorderColor:"none"}).attr("stroke-dasharray",(X,z,Se)=>{const{props:ze}=C(Se,z);return ze?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(X,z,Se)=>{const{props:ze}=C(Se,z);return(ze?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(X,z,Se)=>{const{props:ze}=C(Se,z);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,z)=>{const Se=String(Ve.formattedDimensionListMap.get(z.data.dimension)??z.data.dimension??""),ze=ht(l,String(z.data.dimension??""),{...z.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(z.data.dimension)},{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.data[z.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:z.properties.alias}],e,X,z.properties,ze)}).on("mouseout",(X,z)=>{rt()}).on("click",At(g,H,(X,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.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()},ue=v=>{J=b-v.left-v.right,F=k-v.bottom-v.top},me=(v,w,D)=>{Fe=w,Le=v,te=D,Ka(r,ee,Le),de()},de=()=>{Pe(),Ce(),qt(y,Ve,$,e,c,f,be,ce,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)),U()},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}))},U=()=>{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(z=>String(z).split("-")[0]),C=(ke[0]??[]).map((z,Se)=>({Dimension:z.data.dimension,Total:z.data.total,CustomTotal:z.data.total,Index:Se})),M=[],_=[];let X=[];if(D){if(D===1)M.push(...C);else for(const z of C)z.Index%D===0&&M.push(z);for(let z=D;z<C.length;z+=D){const Se=Math.min(z+D,C.length);let ze=C[z]?.Total??Number.NEGATIVE_INFINITY;for(let Ie=z;Ie<Se;Ie++)C[Ie].Total>ze&&(ze=C[Ie].Total);Number.isFinite(ze)&&_.push(ze)}X=M.slice(1)}else{const z=v.connectorCustomRange??[],Se=new Map;C.forEach(ze=>Se.set(String(ze.Dimension),ze.Index));for(const ze of z){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 z){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"),Y(M,_,X,D,W),R(M,_,X,D,W)}catch{}},Y=(v,w,D,I,W)=>{try{const C=v.filter((z,Se)=>I!=null?Se<v.length-1:Se<v.length);let M=y.selectAll("path.connector-path").data(C,z=>String(z.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",(z,Se)=>e.total.totalVisibility?`M ${L(z.Dimension)+L.bandwidth()/2+5}, ${f(z.Total)-25} V ${-35+Math.min(f(w[Se]),f(D[Se].Total),f(z.Total))} H ${L(D[Se].Dimension)+L.bandwidth()/2-10} V ${-27+f(D[Se].Total)}`:`M ${L(z.Dimension)+L.bandwidth()/2+5}, ${f(z.Total)-5} V ${-30+Math.min(f(D[Se].Total),f(z.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",z=>W.includes(z.Dimension)||z.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 z=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Se=Ti(z,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B,N,E,$,q,se,ce,oe,he,Ae,pe,xe,O=!1,J,F,b,k,d,c,i,y,f,a,L,P;const ae=new Map;let Q,be,Le,Fe=[],Te=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};fe.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:xe}=Nt(e,De.yMinLeft,De.yMaxLeft,De.yMinRight,De.yMaxRight),{margin:B,yLabel:N,xLabel:E,yTitle:$,xTitle:q,dimensionHeightWidthArray:se,chartTitleHeight:ce,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Ae,visibleBars:te,columnWidth:A,scrollbarVisible:O}=vt(b,k,pe,xe,De.yMaxLeft,e,De.legendList,De.dimensionList,De.yMaxRight,j,ee,t,!1,De),ve(B),{dataTable:d,dataTableHeight:c}=ea(e,N,$,g,De.dimensionList,r),kt(i,b,k,e),y=Mt(i,B),mt(y,e,c,J,F,u),ie(),Pe(),Gt(y,e,c,N,Q,F),St(e,V,i,B,E,k,q,De.chartType,N,J,F),Ft(F,e,c,V,i,B,$,N),Ut(i,j,B,e,c,F,J,Ae,oe),wt(i,e,b,ce),Dt(k,i,se,ce,b,he,e,[...g].reverse(),m,c,B,nt.rectangle,u,n),Bt(g,k,b,i,B,J,O,te,De,Te,!1,ue)},Ye=()=>{const le=[],U=[];let Y=-1/0,R=1/0;g.forEach((W,C)=>{const M=`${C}~$~${W.properties.legend}`;W.properties.legend=M,U.push(M),Y=-1/0,R=1/0;for(const _ of W.data)Y=Math.max(Y,_.value),R=Math.min(R,_.value),le.push(_);W.properties.setColorScale&&ae.set(W.properties.legendUniqueId,T.scaleSequential().domain([R,Y]).interpolator(T.interpolateRgb(W.properties.startColor,W.properties.endColor)))}),De.chartData=le,De.legendList=U,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 U=aa(J,f,e,Fe,void 0,j,F,!0);U.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&U.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?P=[0,J-U.heightWidth[0]]:P=[U.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 U=y.selectAll(".parentGroup").data([ke]);U=U.enter().append("g").attr("class","columns parentGroup").merge(U);let Y=U.selectAll(".column-group").data(C=>C);Y=Y.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(Y);let v=Y.selectAll("rect").data(C=>C);const w=(C,M)=>{const _=Array.from(Y.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||""}))),Y.exit().remove(),y.selectAll(".parentGroup").raise()},ve=le=>{J=b-le.left-le.right,F=k-le.bottom-le.top},ue=(le,U,Y)=>{Fe=U,Le=le,te=Y,me()},me=()=>{ye(),Me(),de(),qt(y,De,E,e,c,f,be,se,k,A,t,J,F,Le,L),Ce(Fe),Va(ke,L,f,a,B,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,$,De.dimensionList,J,P,De.formattedDimensionListMap,m,B,F))},de=()=>{let le=pt(Le,Fe,ee);ke=T.stack().keys(De.legendList).offset(T.stackOffsetDiverging)(le),Fe.forEach((Y,R)=>Y.data.forEach((v,w)=>{v[0]=ke[R][w][0],v[1]=ke[R][w][1]}));let U=e.annotation.annotationSetLabelColor;ke.forEach((Y,R)=>Y.forEach(v=>{v.key=Y.key,Y.color=JSON.parse(JSON.stringify(g[R].properties.color)),Y.individualAnnotationVisibility=JSON.parse(JSON.stringify(g[R].properties.individualAnnotationVisibility)),v.data.labelPosition=g[R].properties.dataLabelPosition,v.data.labelColor=U=="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,B=!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,$=t-l.left-l.right;return{margins:l,yLabel:V,xLabel:g,yTitle:G,xTitle:H,chartTitleHeight:j,legendMargin:m,innerHeight:E,innerWidth:$}}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(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 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(ne.italic)?ne.italic:"").style("text-decoration",m.includes(ne.underline)?ne.underline:"").style("font-weight",m.includes(ne.bold)?ne.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(),B=JSON.parse(JSON.stringify(r.plotArea.dataLabelsCoordinates||[]));B=B.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,$=(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($);const se=O=>(O.data.y?.value??0)!==0;q=q.filter(se),q=Rt(q,r,O=>O.data.y.value);let ce=new Map(B.map(O=>[O.data?.x?.legend,O])),oe=[];q.forEach(O=>{const J=O.data.x.legend,F=ce.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 he=s.append("g").attr("class","annotation-group parentGroup").attr("transform",o).call(Z),Ae=r.plotArea.dataLabelNameFontStyle??[];he.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(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 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;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,${-J} ${J},0 0,${J} ${-J},0`).style("fill",O).style("stroke",O)})}if(he.selectAll("rect,.annotation-subject").remove(),r.animation?.animationEnabled){const O=r.animation.animationDuration,J=Xe[r.animation.animationEffect],F=he.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 xe=r.plotArea.connectorColor??"#ccc";he.selectAll(".connector").style("stroke",xe).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",xe).style("stroke",xe),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 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=fe.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,B,N,E,$,q,se,ce,oe,he,Ae,pe=[],xe=[],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};fe.useEffect(()=>{try{Fe()}catch(Me){ge("Columnchart","createColumnChart",Me)}},[e]);const Fe=()=>{({formatOptions:e,svg:k,width:O,height:J}=Ct(l,e)),Te(),{maxNumberForPrimaryAxis:se,maxNumberForSecondaryAxis:ce}=Nt(e,Le.yMinLeft,Le.yMaxLeft,Le.yMinRight,Le.yMaxRight),{margin:G,yLabel:V,xLabel:j,yTitle:K,xTitle:Z,dimensionHeightWidthArray:B,chartTitleHeight:N,secondaryAxisTitleWidth:E,legendMargin:$,secondaryYLabel:q}=vt(O,J,se,ce,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,he,n),te(),ee(),De(),Gt(d,e,b,V,a,he),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,he)),St(e,m,k,G,j,J,Z,Le.chartType,V,oe,he),Ft(he,e,b,m,k,G,K,V),Ut(k,A,G,e,b,he,oe,q,E),wt(k,e,O,N),Dt(J,k,B,N,O,$,e,s,o,b,G,nt.rectangle)},Te=()=>{const Me=[],Ce=[];let ve=[],ue=-1/0,me=1/0;s.forEach(U=>{Ce.push(U.legend),U.data.forEach(Y=>{Me.push(Y),ue=Math.max(ue,Y.value),me=Math.min(me,Y.value)})}),Le.chartData=Me,Le.legendList=Ce,Le.yMaxLeft=ue,Le.yMinLeft=me>0?0:me,ae=JSON.parse(JSON.stringify(s)),ae.forEach(U=>U.data.forEach(Y=>ve.push(Y.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(me=>me.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 ue=Le.xMin;if(Me)for(pe=[ue];ue<Le.xMax;)ue+=ve,pe.push(ue);else for(pe=[ue];Math.round(ue)<Math.round(Le.xMax);)ue+=ve,pe.push(Math.round(ue))},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(ue=>ue).domain(i.domain()).thresholds(Me);ae.forEach(ue=>{let me=Ce(ue.data.map(de=>de.value));xe.push(me)}),ae.forEach((ue,me)=>xe[me].forEach(de=>{de.name=ue.properties.legend,de.color=ue.properties.color,de.opacity=ue.properties.opacity}));let ve=[];xe.forEach(ue=>ue.forEach(me=>ve.push(me.length))),Le.yMaxLeft=T.max(ve),Le.yMinLeft=T.min(ve),c=T.scaleLinear().range([he,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,he,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,he,!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,he,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(xe).enter().append("g").selectAll("rect").data(me=>me).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(me){return"translate("+i(me.x0)+","+he+")"}).attr("width",function(me){return i(me.x1)-i(me.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(me.x1)-i(me.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",me=>me.color!==we.white?me.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(me,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,me)}).on("mouseout",rt);(Ce?ve.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):ve).attr("transform",function(me){return"translate("+i(me.x0)+","+(c(me.length)>0?c(me.length):0)+")"}).attr("height",function(me){return he-c(me.length)}),d.selectAll(".parentGroup").raise()},ie=Me=>{oe=O-Me.left-Me.right,he=J-Me.bottom-Me.top},ye=(Me,Ce,ve,ue,me)=>{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",ue.left).attr("y",le).attr("width",me).attr("height",8).attr("fill","#ddd").attr("rx",4);const U=me*be/Le.dimensionList.length,Y=ve.append("rect").attr("x",ue.left).attr("y",le).attr("width",U).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,ue.left),ue.left+me-U);Y.attr("x",v),Q=Math.round((v-ue.left)/(me-U)*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=ue.left+(me-U)*Q/de;Y.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,B,J,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%"}})})},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=fe.useRef(),p=fe.useRef(s);p.current=s;const H=fe.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,B=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,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b=!1,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te,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};fe.useEffect(()=>{try{ye()}catch(Y){ge("Linechart","createLineChart",Y)}},[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:$,yLabel:q,xLabel:se,yTitle:ce,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:xe,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($),{dataTable:y,dataTableHeight:f}=ea(e,q,ce,g,ie.dimensionList,r),kt(a,c,i,e),L=Mt(a,$),mt(L,e,f,k,d,u,m),Me(),ue(),Gt(L,e,f,q,Fe,d),j&&ci(L,e,f,O,te,d,k),St(e,V,a,$,se,i,oe,ie.chartType,q,k,d),Ft(d,e,f,V,a,$,ce,q),j&&Ut(a,j,$,e,f,d,k,O,pe),wt(a,e,c,Ae),Dt(i,a,he,Ae,c,xe,e,g,m,f,$,nt.line,u,n),Bt(g,i,c,a,$,k,b,Ve,ie,De,!1,Ce)},Pe=()=>{const Y=[],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=>{Y.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=Y,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 Y=ot(B||ie.yMaxLeft,ie.yMinLeft,d,e,ie,Z,B).yAxisLabelArray;if(ie.yMaxLeft=Y[Y.length-1],ie.yMinLeft=Y[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:B!==void 0&&!Number.isNaN(B)?B: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=(Y,R,v)=>{ee=R,ke=Y,Ve=v,U()},ve=()=>{Q=T.scalePoint().domain(ke).range(be).padding(.5)},ue=()=>{{let Y=ot(B||ie.yMaxLeft,ie.yMinLeft,d,e,ie,Z,B);Fe=T.axisLeft(P).tickFormat(R=>_e(R,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,k,Le)).tickValues(Y.autoLabelFlag?void 0:Y.yAxisLabelArray).ticks(Y.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let Y=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(Y.autoLabelFlag?void 0:Y.secondaryYAxisLabelArray).ticks(Y.secondaryCustomTickValue).tickSize(Pt(e,k,Le)).tickPadding(8).tickSizeOuter(0)}},me=()=>{Te=T.axisBottom(Q).tickSize(ia(e,d,f,!0)).tickSizeOuter(0).tickValues(Lt(ke,k))},de=Y=>{const R=[...Y].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",z=>v(z.data)).attr("stroke",z=>z.properties.color!==we.white?z.properties.color:"none").attr("stroke-dasharray",z=>{const Se=parseInt(z.properties.lineWidth);switch(z.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",z=>z.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",z=>z.properties.lineStyle!=="None"?z.properties.lineWidth:0).attr("hoverId",(M.properties.alias||M.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${m}-clip)`).attr("d",z=>v(z.data)).attr(Qe.SeriesId,z=>z.properties.legendUniqueId).attr(Qe.DimValue,z=>z.properties.alias||z.properties.name||"").on("click",At(H,p,(z,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 z=T.select(this),Se=this.getTotalLength();z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se),D(z).attr("stroke-dashoffset",0)})}),W.exit().remove(),Ca(I,R,"None",Q,P,ae,null,e,ie,E,N,Z,B,!1,l),L.selectAll(".parentGroup").raise()},le=Y=>{k=c-Y.left-Y.right,d=i-Y.bottom-Y.top},U=()=>{ve(),me(),qt(L,ie,se,e,f,P,Te,he,i,k/ke.length,t,k,d,ke,Q),de(ee),Da(g,Q,P,ae,$,dt,[],[],e,u,i,c,k,ke,d,m,a,h,void 0,void 0,o);let Y=aa(k,P,e,ee,ae,j,d,!1).labelArray;za(e,L,Y),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,ce,ie.dimensionList,k,be,ie.formattedDimensionListMap,m,$,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B=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,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te,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};fe.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:$,yLabel:q,xLabel:se,yTitle:ce,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:xe,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($),{dataTable:i,dataTableHeight:y}=ea(e,q,ce,G,ye.dimensionList,r),kt(f,d,c,e),a=Mt(f,$),mt(a,e,y,b,k,u,m),Ce(),ue(),Gt(a,e,y,q,Le,k),St(e,V,f,$,se,c,oe,ye.chartType,q,b,k),Ft(k,e,y,V,f,$,ce,q),Ut(f,K,$,e,y,k,b,O,pe),wt(f,e,d,Ae),Dt(c,f,he,Ae,d,xe,e,[...G].reverse(),m,y,$,nt.line,u,n),Bt(G,c,d,f,$,b,De,ee,ye,ke,!1,R),qa(j,ae,L,$,dt,[],e,u,c,d,f,o)},Me=()=>{const v=[],w=[];e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0),G.forEach((_,X)=>{const z=`${X}~$~${_.properties.alias?_.properties.alias:_.legend}`;_.properties.legend=z,w.push(z);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?Te=ye.dimensionList:(Te=ye.dimensionList.slice(ke,ke+ee),te.forEach((_,X)=>te[X].data=_.data.filter(z=>Te.includes(z.dimension))));const I=T.stack().keys(ye.legendList).offset(T.stackOffsetDiverging)(D);Y();let W=1/0,C=-1/0;for(const _ of I)for(const[X,z]of _)W=Math.min(W,X),C=Math.max(C,z);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(B||ye.yMaxLeft,ye.yMinLeft,k,e,ye,Z,B).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:B!==void 0&&!Number.isNaN(B)?B: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(Te).range(Q).padding(.5)},ue=()=>{me();{let v=ot(B||ye.yMaxLeft,ye.yMinLeft,k,e,ye,Z,B);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)}},me=()=>{Fe=T.axisBottom(ae).tickSize(ia(e,k,y,!0)).tickSizeOuter(0).tickValues(Lt(Te,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||""}))),z=e.animation.animationEnabled,Se=X.node().getTotalLength();z?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,B,!1,x)},le=v=>{b=d-v.left-v.right,k=c-v.bottom-v.top},U=()=>{ve(),me(),qt(a,ye,se,e,y,L,Fe,he,c,A,t,b,k,Te,ae),Y(),de(te),Va(Ye,ae,L,P,$,dt,[],[],e,u,c,d,b,Te,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,ce,ye.dimensionList,b,Q,ye.formattedDimensionListMap,m,$,k))},Y=()=>{let v=pt(Te,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,Te=v,ee=D,Ka(r,j,Te),U()};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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,E,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te=[],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};fe.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:$,xLabel:q,yTitle:se,xTitle:ce,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:xe,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,$,se,g,ie.dimensionList,r),kt(y,k,d,e),f=Mt(y,E),mt(f,e,i,F,b,u,m),Me(),ue(),Gt(f,e,i,$,be,b),St(e,V,y,E,q,d,ce,ie.chartType,$,F,b),Ft(b,e,i,V,y,E,se,$),Ut(y,j,E,e,i,b,F,xe,Ae),wt(y,e,k,he),Dt(d,y,oe,he,k,pe,e,[...g].reverse(),m,i,E,nt.line,u,n),Bt(g,d,k,y,E,F,De,ke,ie,te,!1,U)},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 z of M.data)v.push(z)}),ie.chartData=v,ie.legendList=w,Te=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,Te);let v=aa(F,a,e,Te,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 ue=()=>{be=T.axisLeft(a).tickSize(Pt(e,F,Q)).ticks(i>0?(b-i)/80:b/80,"%").tickPadding(8).tickSizeOuter(0)},me=()=>{Le=T.axisBottom(P).tickSize(ia(e,b,i,!0)).tickSizeOuter(0).tickValues(Lt(Fe,F))},de=v=>{ve(Ve,Te),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||""}))),z=e.animation.animationEnabled,Se=X.node().getTotalLength();z?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,B,K,Z,!0,x)},le=v=>{F=k-v.left-v.right,b=d-v.bottom-v.top},U=(v,w,D)=>{Te=w,Fe=v,ke=D,Y()},Y=()=>{Ce(),R(),me(),qt(f,ie,q,e,i,a,Le,oe,d,A,t,F,b,Fe,P),de(Te),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,Te,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,$,se,ie.dimensionList,F,ae,ie.formattedDimensionListMap,m,E,b))},R=()=>{let v=pt(Fe,Te,Ye);Ve=T.stack().keys(ie.legendList).offset(T.stackOffsetDiverging)(v),Te.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=fe.useRef(),p=fe.useRef(s);p.current=s;const H=fe.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 B=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,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k=new Map,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te,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};fe.useEffect(()=>{try{ye()}catch(Y){ge("HorizontalBarchart","createHorizontalBarChart",Y)}},[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:se,xLabel:ce,yTitle:oe,xTitle:he,dimensionHeightWidthArray:Ae,chartTitleHeight:pe,secondaryAxisTitleWidth:xe,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,se,c,d,Fe),j&&zl(e,L,J,Te,d),St(e,V,a,q,ce,y,he,ie.chartType,se,d,c),Ft(c,e,f,V,a,q,oe,se,d),Ut(a,j,q,e,f,c,d,J,xe,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 Y=[],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=>{Y.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=Y,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 Y=ot(ie.yMaxLeft,ie.yMinLeft,c,e,ie,B,N,V,d).yAxisLabelArray;ie.yMaxLeft=Y[Y.length-1],ie.yMinLeft=Y[0],Q=T.scaleLinear().domain([ie.yMinLeft>=0?B!==void 0&&!Number.isNaN(B)?B: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?$||0:$||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 Y=ot(N||ie.yMaxLeft,ie.yMinLeft,c,e,ie,B,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(Y.autoLabelFlag?void 0:Y.yAxisLabelArray).ticks(Y.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let Y=oi($||be.domain()[1],be.domain()[0],e,d);Te=T.axisTop(be).tickFormat(R=>_e(R,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Y.autoLabelFlag?void 0:Y.secondaryYAxisLabelArray).ticks(Y.secondaryCustomTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-c:0).tickPadding(8).tickSizeOuter(0)}},ue=()=>{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))},me=Y=>{Y.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()}),Y.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:$;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(_)??_??""),z=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,z)}).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=Y=>{d=i-Y.left-Y.right,c=y-Y.bottom-Y.top},le=(Y,R,v)=>{ee=R,ke=Y,Ve=v,Ka(r,k,ke),e.xAxisLabel.hideZeroValues&&(ke=ke.filter(w=>k.get(w)!==0)),U()},U=()=>{Ce(),ue(),Ua(e,L,ce,c,d,te,Te,Q,ie.yMaxLeft,ke,u,t,i,Ae,A,P),me(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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B,N,E,$,q,se,ce,oe,he,Ae,pe,xe;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 Te=!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};fe.useEffect(()=>{try{ee()}catch(U){ge("StackStackHorizontalBarchart","createStackHorizontalBarChart",U)}},[e]);const ee=()=>{({formatOptions:e,svg:d,width:b,height:k}=Ct(S,e)),De(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:xe}=Nt(e,ke.yMinLeft,ke.yMaxLeft,ke.yMinRight,ke.yMaxRight),{margin:B,yLabel:N,xLabel:E,yTitle:$,xTitle:q,dimensionHeightWidthArray:se,chartTitleHeight:ce,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Ae,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(b,k,pe,xe,ke.yMaxLeft,e,ke.legendList,ke.dimensionList,ke.yMaxRight,j,Te,t,V,ke),Me(B),kt(d,b,k,e),c=Mt(d,B),mt(c,e,0,J,F,u,m),Ve(),ie(),Ya(e,c,N,F,J,a),St(e,V,d,B,E,k,q,ke.chartType,N,J,F),Ft(F,e,0,V,d,B,$,N,b),wt(d,e,b,ce),Dt(k,d,se,ce,b,he,e,[...g].reverse(),m,0,B,nt.rectangle,u,n),Bt(g,k,b,d,B,J,Le,be,ke,Q,!1,Ce,V)},De=()=>{const U=[],Y=[];let R=-1/0,v=1/0;g.forEach((M,_)=>{const X=`${_}~$~${M.properties.legend}`;M.properties.legend=X,Y.push(X),R=-1/0,v=1/0;for(const z of M.data)R=Math.max(R,z.value),v=Math.min(v,z.value),U.push(z);M.properties.setColorScale&&O.set(M.properties.legendUniqueId,T.scaleSequential().domain([v,R]).interpolator(T.interpolateRgb(M.properties.startColor,M.properties.endColor)))}),ke.chartData=U,ke.legendList=Y,ae=JSON.parse(JSON.stringify(g));let w=pt(ke.dimensionList,g,Te);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);ue();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 U=ot(ke.yMaxLeft,ke.yMinLeft,F,e,ke,K,Z,V,J).yAxisLabelArray;ke.yMaxLeft=U[U.length-1],ke.yMinLeft=U[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 U=ot(Z||ke.yMaxLeft,ke.yMinLeft,F,e,ke,K,Z,V,J);a=T.axisBottom(i).tickFormat(Y=>_e(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-F:0).tickValues(U.autoLabelFlag?void 0:U.yAxisLabelArray).ticks(U.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=U=>{U.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 Y=c.selectAll(".parentGroup").data([Fe]);Y=Y.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(Y);let R=Y.selectAll(".column-group").data(C=>C);R=R.enter().append("g").attr("class",C=>"column-group "+C.key.replace(/ /g,"-")).attr("hoverId",C=>(U[C.index].properties.alias||U[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=U=>{J=b-U.left-U.right,F=k-U.bottom-U.top},Ce=(U,Y,R)=>{ae=Y,P=U,be=R,Ka(r,te,P),ue(),ve()},ve=()=>{Ye(),ye(),Ua(e,c,E,F,J,L,void 0,i,ke.yMaxLeft,P,u,t,b,se,A,y);const U=new Map;P.forEach((Y,R)=>{let v=0;Fe.forEach(w=>{const D=w[R]?.[0]??0;D<v&&(v=D)}),U.set(Y,v)}),Pe(ae),Va(Fe,y,i,void 0,B,dt,[],[],e,u,k,b,J,P,F,m,d,h,0,o,V),qa(te,y,i,B,dt,[],e,u,k,b,d,o,V,U),me(),c.selectAll(".connectors").raise()},ue=()=>{let U=pt(P,ae,Te);Fe=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(U),ae.forEach((R,v)=>R.data.forEach((w,D)=>{w[0]=Fe[v][D][0],w[1]=Fe[v][D][1]}));let Y=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=Y=="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}))},me=()=>{try{const U=Number(e.connector?.connectorVisibility);if(!e.connector||U===2)return;const Y=[],R=[],v=[];let w;const D=[];if(U===1)w=1;else if(U===3){const z=Number(e.connector.connectorFollow);z===1?w=Number(e.connector.connectorStepSize):z===2&&((e.connector.connectorExclude||[]).forEach(Se=>v.push(Se)),w=1)}const I=[],W=[],C=[],M=e.connector?.connectorCustomRange||[];v.forEach(z=>{const Se=z.split("-");Se.length&&I.push(Se[0])});const X=(Fe?.[0]||[]).map((z,Se)=>({Dimension:z.data.dimension,Total:z.data.total,CustomTotal:z.data.total-(C[Se]??0),Index:Se}));if(w!=null){for(let z=0;z<X.length;z++)(w===1||z%w===0&&w!==1)&&Y.push(X[z]);for(let z=w;z<X.length;z+=w){const Se=Math.min(z+w,X.length);let ze=-1/0;for(let Ie=z;Ie<Se;Ie++)X[Ie].Total>ze&&(ze=X[Ie].Total);ze!==-1/0&&D.push(ze)}for(let z=1;z<Y.length;z++)R.push(Y[z])}else{const z=[];(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&&z.push({from:Se.from,to:Se.to})}}),z.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);Y.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(Y,D,R,w,I),le(Y,D,R,w,I)}catch(U){console.error(U)}},de=(U,Y,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=U.filter((X,z)=>v!=null?z<U.length-1:z<U.length),M=W.selectAll("path.connector-path").data(C,(X,z)=>X?.Dimension??z);M.exit().remove(),M.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",(X,z)=>{const Se=R?.[z]??{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
74
  ${y(X.Dimension)+D/2-5}
75
75
  H ${60+lt}
76
76
  V ${y(Se.Dimension)+D/2+5}
77
- H ${30+Ie}`:`M ${Qe+30},
77
+ H ${30+Ie}`:`M ${Oe+30},
78
78
  ${y(X.Dimension)+D/2-5}
79
79
  H ${45+lt}
80
80
  V ${y(Se.Dimension)+D/2+5}
81
- H ${10+Ie}`}).style("stroke",e.connector.connectorLineColor!==Fe.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(X,U)=>w.includes(X.Dimension)||X.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(D){console.error(D)}},le=(B,$,E,k,w)=>{try{const D=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,R=Ti(D,A);let W=e.connector.connectorFontStyle,C=e.connector.connectorNumberFormat,M=F/30<I.length?Math.round(F/30):I.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(C=".2s");const _=B.filter((Ie,Qe)=>k!=null?Qe<B.length-1:Qe<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,Qe)=>{const lt=E?.[Qe]??{Dimension:Ie.Dimension,Total:0},ut=y(Ie.Dimension)??0;return(y(lt.Dimension)??ut)+k*R/2}).attr("x",(Ie,Qe)=>{const lt=E?.[Qe]??{Total:0},ut=Ie?.Total??0,tt=Math.max(i(lt.Total),i(ut));return e.total.totalVisibility?70+tt:50+tt}).text((Ie,Qe)=>{const lt=E?.[Qe]??{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!==Fe.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,Qe)=>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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList)?.reverse(),G=r.DimensionList,V=!0,j=!1;let q=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Y,N,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b;const v=new Map;let d,c,i,y,f,a,L,I,ae=[],K=0,be,Le=!1,we=[];const Te=!0;let ee={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};fe.useEffect(()=>{try{ke()}catch(ue){ge("StackNormalizedStackBarchart","createNormalizedStackBarChart",ue)}},[e]);const ke=()=>{({formatOptions:e,svg:d,width:F,height:b}=Ct(S,e)),O(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:xe}=Nt(e,ee.yMinLeft,ee.yMaxLeft,ee.yMinRight,ee.yMaxRight),{margin:Y,yLabel:N,xLabel:P,yTitle:z,xTitle:te,dimensionHeightWidthArray:oe,chartTitleHeight:de,secondaryAxisTitleWidth:se,legendMargin:he,secondaryYLabel:Ae,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(F,b,pe,xe,ee.yMaxLeft,e,ee.legendList,ee.dimensionList,ee.yMaxRight,j,Te,t,V,ee),Ne(Y),kt(d,F,b,e),c=Mt(d,Y),mt(c,e,0,Q,J,u),De(),Ye(),Ya(e,c,N,J,Q,a),St(e,V,d,Y,P,b,te,ee.chartType,N,Q,J),Ft(J,e,0,V,d,Y,z,N,Q),wt(d,e,F,de),Dt(b,d,oe,de,F,he,e,[...g].reverse(),m,0,Y,nt.rectangle,u,n),Bt(g,b,F,d,Y,Q,Le,be,ee,K,!1,ve,V)},O=()=>{const ue=[],me=[];let ce=-1/0,le=1/0;g.forEach((w,D)=>{const R=`${D}~$~${w.properties.legend}`;w.properties.legend=R,me.push(R),ce=-1/0,le=1/0;for(const W of w.data)ce=Math.max(ce,W.value),le=Math.min(le,W.value),ue.push(W);w.properties.setColorScale&&v.set(w.properties.legendUniqueId,T.scaleSequential().domain([le,ce]).interpolator(T.interpolateRgb(w.properties.startColor,w.properties.endColor)))}),ee.chartData=ue,ee.legendList=me,ae=JSON.parse(JSON.stringify(g));let B=xt(ee.dimensionList,g,Te);e.plotArea.fitChart?I=ee.dimensionList:(I=ee.dimensionList.slice(K,K+be),ae.forEach((w,D)=>ae[D].data=w.data.filter(R=>I.includes(R.dimension))));const $=T.stack().keys(ee.legendList).offset(T.stackOffsetDiverging)(B);Ce();let E=1/0;for(const w of $)for(const[D,R]of w)E=Math.min(E,D);ee.yMinLeft=E>0?0:E,ee.yMaxLeft=1;let k=t?bt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList).map(w=>w):ee.dimensionList;ee.dimensionList.forEach((w,D)=>{ee.formattedDimensionListMap.set(w,k[D])}),e.plotArea.hideZeroValues&&(ee.hideZeroValues=!0)},De=()=>{let ue=ot(Z||ee.yMaxLeft,ee.yMinLeft,J,e,ee,q,Z,V,Q).yAxisLabelArray;ee.yMaxLeft=ue[ue.length-1],ee.yMinLeft=ue[0],i=T.scaleLinear().domain([ee.yMinLeft<0?-1:0,1]).range([0,Q]),f=[J,0]},Ve=()=>{y=T.scalePoint().domain(I).range(f).padding(.5)},Ye=()=>{a=T.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-J:0).ticks(Q/80,"%").tickPadding(8).tickSizeOuter(0)},ie=()=>{L=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(I,J))},ye=ue=>{we.forEach((w,D)=>w.forEach((R,W)=>{ue[D].data[W][0]=R[0]=R.data.total===0?0:R[0]/R.data.total,ue[D].data[W][1]=R[1]=R.data.total===0?0:R[1]/R.data.total})),ue.forEach(w=>{w.data.forEach(D=>{D.hideZero=w.properties.hideZeroValues,D.axis=w.properties.axis})}),I.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",Q).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let me=c.selectAll(".parentGroup").data([we]);me=me.enter().append("g").attr("class","columns parentGroup").merge(me);let ce=me.selectAll(".column-group").data(w=>w);ce=ce.enter().append("g").attr("class",w=>"column-group "+w.key.replace(/ /g,"-")).attr("hoverId",w=>(ue[w.index].properties.alias||ue[w.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(ce);let B=ce.selectAll("rect").data(w=>w);const $=(w,D)=>{const R=Array.from(ce.nodes()).indexOf(w[D].parentNode);return{props:g[R]?.properties,groupIndex:R}},E=B.enter().append("rect").merge(B).attr("y",w=>y(w.data.dimension)-A/2).attr("height",A).attr("fill",(w,D,R)=>{const{props:W}=$(R,D);return v.get(W.legendUniqueId)?.(w.data[w.key])??W?.color??"gray"}).attr("stroke",(w,D,R)=>{const W=$(R,D).props;return W?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?W.stackBorderColor:"none"}).attr("stroke-dasharray",(w,D,R)=>$(R,D).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(w,D,R)=>($(R,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,R)=>{const W=$(R,D).props;return w.data[w.key]===0&&W?.hideZeroValues?"hidden":"visible"}).attr(Ke.SeriesId,w=>w.key??"").attr(Ke.DimValue,w=>Array.isArray(w.data.dimension)?String(w.data.dimension[0]):String(w.data.dimension)).on("mousemove",(w,D)=>{const R=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:ee.formattedDimensionListMap.get(R)},{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(ee.formattedDimensionListMap.get(R)??""),D.properties))}).on("mouseout",(w,D)=>{let R=(D.properties.alias||D.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",gt(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?E.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):E).attr("x",w=>Math.min(i(w[0]),i(w[1]))).attr("width",w=>Math.abs(i(w[1])-i(w[0]))),ce.exit().remove(),c.selectAll(".parentGroup").raise()},Ne=ue=>{Q=F-ue.left-ue.right,J=b-ue.bottom-ue.top},Me=()=>{Ve(),ie(),Ua(e,c,P,J,Q,L,void 0,i,ee.yMaxLeft,I,u,t,F,oe,A,y),ye(ae),Va(we,y,i,void 0,Y,dt,[],[],e,u,b,F,Q,I,J,m,d,h,0,o,V)},Ce=()=>{let ue=xt(I,ae,Te);we=T.stack().keys(ee.legendList).offset(T.stackOffsetDiverging)(ue),ae.forEach((ce,le)=>ce.data.forEach((B,$)=>{B[0]=we[le][$][0],B[1]=we[le][$][1]}));let me=e.annotation.annotationSetLabelColor;we.forEach((ce,le)=>ce.forEach(B=>{B.key=ce.key,ce.color=JSON.parse(JSON.stringify(g[le].properties.color)),B.data.labelPosition=g[le].properties.dataLabelPosition,B.data.labelColor=me=="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=(ue,me,ce)=>{ae=me,I=ue,be=ce,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!0,j=!1,q=new Map;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae=[],K=0,be=2,Le=!1,we=[];const Te=!1;let ee={dimensionList:G,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};fe.useEffect(()=>{try{ke()}catch(le){ge("StackStackHorizontalBarchart","createStackHorizontalBarChart",le)}},[e]);const ke=()=>{({formatOptions:e,svg:d,width:b,height:v}=Ct(S,e)),O(),{maxNumberForPrimaryAxis:xe,maxNumberForSecondaryAxis:Q}=Nt(e,ee.yMinLeft,ee.yMaxLeft,ee.yMinRight,ee.yMaxRight),{margin:N,yLabel:P,xLabel:z,yTitle:te,xTitle:oe,dimensionHeightWidthArray:de,chartTitleHeight:se,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(b,v,xe,Q,ee.yMaxLeft,e,ee.legendList,ee.dimensionList,ee.yMaxRight,j,Te,t,V,ee),Ne(N),kt(d,b,v,e),c=Mt(d,N),mt(c,e,0,J,F,u,m),De(),Ye(),Ya(e,c,P,F,J,a),St(e,V,d,N,z,v,oe,ee.chartType,P,J,F),Ft(F,e,0,V,d,N,te,P),wt(d,e,b,se),Dt(v,d,de,se,b,Ae,e,g,m,0,N,nt.rectangle,u,n),Bt(g,v,b,d,N,J,Le,be,ee,K,!1,Me,V)},O=()=>{const le=[],B=[];let $=[],E=-1/0,k=1/0,w=-1/0,D=1/0,R=-1/0,W=1/0;g.forEach(C=>{B.push(C.properties.legendUniqueId),R=-1/0,W=1/0,C.data.forEach(M=>{le.push(M),R=Math.max(R,M.value),W=Math.min(W,M.value),E=Math.max(E,M.value),k=Math.min(k,M.value)}),C.properties.setColorScale&&q.set(C.properties.legendUniqueId,T.scaleSequential().domain([W,R]).interpolator(T.interpolateRgb(C.properties.startColor,C.properties.endColor)))}),ee.chartData=le,ee.legendList=B,ee.yMaxLeft=E,ee.yMinLeft=k>0?0:k,ee.yMaxRight=w,ee.yMinRight=D,$=t?bt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList).map(C=>C):ee.dimensionList,$=t?bt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList).map(C=>C):ee.dimensionList,ee.dimensionList.forEach((C,M)=>{ee.formattedDimensionListMap.set(C,$[M]),ee.formattedDimensionListMap.set(C,$[M])}),ae=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?I=ee.dimensionList:I=ee.dimensionList.slice(K,K+be),e.plotArea.hideZeroValues&&(ee.hideZeroValues=!0)},De=()=>{let le=ot(Y||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,Y,V,J).yAxisLabelArray;ee.yMaxLeft=le[le.length-1],ee.yMinLeft=le[0],i=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([0,J]),f=[F,0],Ve()},Ve=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(ee.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=T.scalePoint().domain(I).range(f).padding(.5)},Ye=()=>{ie();{let le=ot(Y||ee.yMaxLeft,ee.yMinLeft,F,e,ee,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(I,F))},ye=le=>{le.forEach(B=>{B.data.forEach($=>{$.hideZero=B.properties.hideZeroValues,$.axis=B.properties.axis,$.properties=B.properties})}),le.forEach((B,$)=>{let E=c.selectAll(`.parentGroup-${B.properties.legendUniqueId}`).data([B],W=>W.properties.legendUniqueId);E=E.enter().append("g").attr("class",`column parentGroup parentGroup-${B.properties.legendUniqueId}`).attr("clip-path",`url(#${m}-clip)`).merge(E);let k=E.selectAll(".column-group").data(B.data,W=>W.dimension+"_"+B.properties.legendUniqueId),w=k.enter().append("g").attr("class","column-group").attr("hoverId",(B.properties.alias||B.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",W=>$===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+$*2)})`);k.attr("transform",W=>$===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+$*2)})`),w.merge(k).attr("transform",W=>$===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+$*2)})`);const D=w.append("rect").attr("y",0).attr("height",$===0?A:A/2).attr("x",()=>i(0)).attr("width",0).attr("fill",W=>q.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(Ke.SeriesId,()=>B.properties.legendUniqueId).attr(Ke.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))),k.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(k).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:ee.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(ee.formattedDimensionListMap.get(C.dimension)??""),B.properties))}).on("mouseout",()=>{rt()}).on("click",gt(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||""}))),k.exit().remove()}),c.selectAll(".parentGroup").raise()},Ne=le=>{J=b-le.left-le.right,F=v-le.bottom-le.top},Me=(le,B,$)=>{ae=B,I=le,be=$,Ce()},Ce=()=>{Ve(),ie(),Ua(e,c,z,F,J,L,void 0,i,ee.yMaxLeft,I,u,t,b,de,A,y),ve(),ye(ae),Da(ae,y,i,void 0,N,dt,[],[],e,u,v,b,J,I,F,m,d,h,void 0,A,o,!1,V),ue()},ve=()=>{let le=xt(I,ae,Te);we=T.stack().keys(ee.legendList).offset(T.stackOffsetDiverging)(le),ae.forEach(($,E)=>$.data.forEach((k,w)=>{k[0]=we[E][w][0],k[1]=we[E][w][1]}));let B=e.annotation.annotationSetLabelColor;we.forEach(($,E)=>$.forEach(k=>{k.key=$.key,$.color=JSON.parse(JSON.stringify(g[E].properties.color)),k.data.labelPosition=g[E].properties.dataLabelPosition,k.data.labelColor=B=="2"?JSON.parse(JSON.stringify(g[E].properties.color)):g[E].properties.labelColor,k.hideZero=JSON.parse(JSON.stringify(g[E].properties.hideZeroValues))}))},ue=()=>{try{const le=Number(e.connector?.connectorVisibility);if(!e.connector||le===2)return;const B=[],$=[],E=[];let k;const w=[];if(le===1)k=1;else if(le===3){const X=Number(e.connector.connectorFollow);X===1?k=Number(e.connector.connectorStepSize):X===2&&((e.connector.connectorExclude||[]).forEach(U=>E.push(U)),k=1)}const D=[],R=[],W=[],C=e.connector?.connectorCustomRange||[];E.forEach(X=>{const U=X.split("-");U.length&&D.push(U[0])});const _=(we?.[0]||[]).map((X,U)=>({Dimension:X.data.Dimension,Total:X.data.Total,CustomTotal:X.data.Total-(W[U]??0),Index:U}));if(k!=null){for(let X=0;X<_.length;X++)(k===1||X%k===0&&k!==1)&&B.push(_[X]);for(let X=k;X<_.length;X+=k){const U=Math.min(X+k,_.length);let Se=-1/0;for(let ze=X;ze<U;ze++)_[ze].Total>Se&&(Se=_[ze].Total);Se!==-1/0&&w.push(Se)}for(let X=1;X<B.length;X++)$.push(B[X])}else{const X=[];(C||[]).forEach(U=>{if(U?.from&&U?.to){const Se=_.some(Ie=>Ie.Dimension===U.from),ze=_.some(Ie=>Ie.Dimension===U.to);Se&&ze&&X.push({from:U.from,to:U.to})}}),X.forEach(U=>{const Se=_.findIndex(Ie=>Ie.Dimension===U.from),ze=_.findIndex(Ie=>Ie.Dimension===U.to);if(Se>=0&&ze>=0){const Ie=Math.min(Se,ze),Qe=Math.max(Se,ze);B.push(_[Ie]);let lt=_[Ie]?.Total??-1/0;for(let ut=Ie;ut<=Qe;ut++)_[ut].Total>lt&&(lt=_[ut].Total);lt!==-1/0&&w.push(lt),$.push(_[Qe])}})}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!==Fe.white?e.connector.connectorMarkerColor:"none"),me(B,w,$,k,D),ce(B,w,$,k,D)}catch(le){console.error(le)}},me=(le,B,$,E,k)=>{try{c.append("g").selectAll("path").data(le).enter().filter((w,D)=>E!=null?D<le.length-1:D<le.length).append("path").attr("d",(w,D)=>e.total.totalVisibility?`M ${i(w.Total)+50},
81
+ H ${10+Ie}`}).style("stroke",e.connector.connectorLineColor!==we.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(X,z)=>w.includes(X.Dimension)||X.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(D){console.error(D)}},le=(U,Y,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 _=U.filter((Ie,Oe)=>v!=null?Oe<U.length-1:Oe<U.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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B,N,E,$,q,se,ce,oe,he,Ae,pe,xe,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 Te=!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};fe.useEffect(()=>{try{ke()}catch(ue){ge("StackNormalizedStackBarchart","createNormalizedStackBarChart",ue)}},[e]);const ke=()=>{({formatOptions:e,svg:d,width:F,height:b}=Ct(S,e)),ee(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:xe}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:B,yLabel:N,xLabel:E,yTitle:$,xTitle:q,dimensionHeightWidthArray:se,chartTitleHeight:ce,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Ae,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(F,b,pe,xe,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,Te,t,V,te),Pe(B),kt(d,F,b,e),c=Mt(d,B),mt(c,e,0,O,J,u),De(),Ye(),Ya(e,c,N,J,O,a),St(e,V,d,B,E,b,q,te.chartType,N,O,J),Ft(J,e,0,V,d,B,$,N,O),wt(d,e,F,ce),Dt(b,d,se,ce,F,he,e,[...g].reverse(),m,0,B,nt.rectangle,u,n),Bt(g,b,F,d,B,O,Le,be,te,Q,!1,ve,V)},ee=()=>{const ue=[],me=[];let de=-1/0,le=1/0;g.forEach((w,D)=>{const I=`${D}~$~${w.properties.legend}`;w.properties.legend=I,me.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),ue.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=ue,te.legendList=me,ae=JSON.parse(JSON.stringify(g));let U=pt(te.dimensionList,g,Te);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 Y=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(U);Ce();let R=1/0;for(const w of Y)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 ue=ot(Z||te.yMaxLeft,te.yMinLeft,J,e,te,K,Z,V,O).yAxisLabelArray;te.yMaxLeft=ue[ue.length-1],te.yMinLeft=ue[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=ue=>{Fe.forEach((w,D)=>w.forEach((I,W)=>{ue[D].data[W][0]=I[0]=I.data.total===0?0:I[0]/I.data.total,ue[D].data[W][1]=I[1]=I.data.total===0?0:I[1]/I.data.total})),ue.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 me=c.selectAll(".parentGroup").data([Fe]);me=me.enter().append("g").attr("class","columns parentGroup").merge(me);let de=me.selectAll(".column-group").data(w=>w);de=de.enter().append("g").attr("class",w=>"column-group "+w.key.replace(/ /g,"-")).attr("hoverId",w=>(ue[w.index].properties.alias||ue[w.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(de);let U=de.selectAll("rect").data(w=>w);const Y=(w,D)=>{const I=Array.from(de.nodes()).indexOf(w[D].parentNode);return{props:g[I]?.properties,groupIndex:I}},R=U.enter().append("rect").merge(U).attr("y",w=>y(w.data.dimension)-A/2).attr("height",A).attr("fill",(w,D,I)=>{const{props:W}=Y(I,D);return k.get(W.legendUniqueId)?.(w.data[w.key])??W?.color??"gray"}).attr("stroke",(w,D,I)=>{const W=Y(I,D).props;return W?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?W.stackBorderColor:"none"}).attr("stroke-dasharray",(w,D,I)=>Y(I,D).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(w,D,I)=>(Y(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=Y(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=ue=>{O=F-ue.left-ue.right,J=b-ue.bottom-ue.top},Me=()=>{Ve(),ie(),Ua(e,c,E,J,O,L,void 0,i,te.yMaxLeft,P,u,t,F,se,A,y),ye(ae),Va(Fe,y,i,void 0,B,dt,[],[],e,u,b,F,O,P,J,m,d,h,0,o,V)},Ce=()=>{let ue=pt(P,ae,Te);Fe=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(ue),ae.forEach((de,le)=>de.data.forEach((U,Y)=>{U[0]=Fe[le][Y][0],U[1]=Fe[le][Y][1]}));let me=e.annotation.annotationSetLabelColor;Fe.forEach((de,le)=>de.forEach(U=>{U.key=de.key,de.color=JSON.parse(JSON.stringify(g[le].properties.color)),U.data.labelPosition=g[le].properties.dataLabelPosition,U.data.labelColor=me=="2"?JSON.parse(JSON.stringify(g[le].properties.color)):g[le].properties.labelColor,U.hideZero=JSON.parse(JSON.stringify(g[le].properties.hideZeroValues)),U.properties=g[le].properties}))},ve=(ue,me,de)=>{ae=me,P=ue,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,E,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae=[],Q=0,be=2,Le=!1,Fe=[];const Te=!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};fe.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:xe,maxNumberForSecondaryAxis:O}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:N,yLabel:E,xLabel:$,yTitle:q,xTitle:se,dimensionHeightWidthArray:ce,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:be,columnWidth:A,scrollbarVisible:Le}=vt(b,k,xe,O,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,Te,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,$,k,se,te.chartType,E,J,F),Ft(F,e,0,V,d,N,q,E),wt(d,e,b,oe),Dt(k,d,ce,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=[],U=[];let Y=[],R=-1/0,v=1/0,w=-1/0,D=1/0,I=-1/0,W=1/0;g.forEach(C=>{U.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=U,te.yMaxLeft=R,te.yMinLeft=v>0?0:v,te.yMaxRight=w,te.yMinRight=D,Y=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(C=>C):te.dimensionList,Y=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(C=>C):te.dimensionList,te.dimensionList.forEach((C,M)=>{te.formattedDimensionListMap.set(C,Y[M]),te.formattedDimensionListMap.set(C,Y[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(B||te.yMaxLeft,te.yMinLeft,F,e,te,Z,B,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:B!==void 0&&!Number.isNaN(B)?B: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(B||te.yMaxLeft,te.yMinLeft,F,e,te,Z,B,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.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(U=>{U.data.forEach(Y=>{Y.hideZero=U.properties.hideZeroValues,Y.axis=U.properties.axis,Y.properties=U.properties})}),le.forEach((U,Y)=>{let R=c.selectAll(`.parentGroup-${U.properties.legendUniqueId}`).data([U],W=>W.properties.legendUniqueId);R=R.enter().append("g").attr("class",`column parentGroup parentGroup-${U.properties.legendUniqueId}`).attr("clip-path",`url(#${m}-clip)`).merge(R);let v=R.selectAll(".column-group").data(U.data,W=>W.dimension+"_"+U.properties.legendUniqueId),w=v.enter().append("g").attr("class","column-group").attr("hoverId",(U.properties.alias||U.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",W=>Y===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+Y*2)})`);v.attr("transform",W=>Y===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+Y*2)})`),w.merge(v).attr("transform",W=>Y===0?`translate(0, ${y(W.dimension)-A/2})`:`translate(0, ${y(W.dimension)-A/(2+Y*2)})`);const D=w.append("rect").attr("y",0).attr("height",Y===0?A:A/2).attr("x",()=>i(0)).attr("width",0).attr("fill",W=>K.get(U.properties.legendUniqueId)?.(W.value)??U.properties.color).attr("stroke-dasharray",()=>U.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${U.properties.stackBorderWidth}px`).attr("stroke",()=>U.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?U.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,()=>U.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:U.properties.alias}],e,W,U.properties,ht(x,String(C.dimension??""),{...U.properties,formattedDimensionValue:String(te.formattedDimensionListMap.get(C.dimension)??C.dimension??"")}))}).on("mouseout",()=>{rt()}).on("click",At(H,p,(W,C)=>({seriesId:U.properties.legendUniqueId,dimValue:Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension),legendUniqueId:U.properties.legendUniqueId,seriesDisplayName:U.properties.alias||U.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,U,Y)=>{ae=U,P=le,be=Y,Ce()},Ce=()=>{Ve(),ie(),Ua(e,c,$,F,J,L,void 0,i,te.yMaxLeft,P,u,t,b,ce,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),ue()},ve=()=>{let le=pt(P,ae,Te);Fe=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(le),ae.forEach((Y,R)=>Y.data.forEach((v,w)=>{v[0]=Fe[R][w][0],v[1]=Fe[R][w][1]}));let U=e.annotation.annotationSetLabelColor;Fe.forEach((Y,R)=>Y.forEach(v=>{v.key=Y.key,Y.color=JSON.parse(JSON.stringify(g[R].properties.color)),v.data.labelPosition=g[R].properties.dataLabelPosition,v.data.labelColor=U=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,v.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues))}))},ue=()=>{try{const le=Number(e.connector?.connectorVisibility);if(!e.connector||le===2)return;const U=[],Y=[],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(z=>R.push(z)),v=1)}const D=[],I=[],W=[],C=e.connector?.connectorCustomRange||[];R.forEach(X=>{const z=X.split("-");z.length&&D.push(z[0])});const _=(Fe?.[0]||[]).map((X,z)=>({Dimension:X.data.Dimension,Total:X.data.Total,CustomTotal:X.data.Total-(W[z]??0),Index:z}));if(v!=null){for(let X=0;X<_.length;X++)(v===1||X%v===0&&v!==1)&&U.push(_[X]);for(let X=v;X<_.length;X+=v){const z=Math.min(X+v,_.length);let Se=-1/0;for(let ze=X;ze<z;ze++)_[ze].Total>Se&&(Se=_[ze].Total);Se!==-1/0&&w.push(Se)}for(let X=1;X<U.length;X++)Y.push(U[X])}else{const X=[];(C||[]).forEach(z=>{if(z?.from&&z?.to){const Se=_.some(Ie=>Ie.Dimension===z.from),ze=_.some(Ie=>Ie.Dimension===z.to);Se&&ze&&X.push({from:z.from,to:z.to})}}),X.forEach(z=>{const Se=_.findIndex(Ie=>Ie.Dimension===z.from),ze=_.findIndex(Ie=>Ie.Dimension===z.to);if(Se>=0&&ze>=0){const Ie=Math.min(Se,ze),Oe=Math.max(Se,ze);U.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),Y.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"),me(U,w,Y,v,D),de(U,w,Y,v,D)}catch(le){console.error(le)}},me=(le,U,Y,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
82
  ${y(w.Dimension)+y.bandwidth()/2-5}
83
- H ${60+Math.max(i(B[D]),i($[D].Total),i(w.Total))}
84
- V ${y($[D].Dimension)+y.bandwidth()/2+5}
85
- H ${30+i($[D].Total)}`:`M ${i(w.Total)+30},
83
+ H ${60+Math.max(i(U[D]),i(Y[D].Total),i(w.Total))}
84
+ V ${y(Y[D].Dimension)+y.bandwidth()/2+5}
85
+ H ${30+i(Y[D].Total)}`:`M ${i(w.Total)+30},
86
86
  ${y(w.Dimension)+y.bandwidth()/2-5}
87
- H ${45+Math.max(i(B[D]),i($[D].Total),i(w.Total))}
88
- V ${y($[D].Dimension)+y.bandwidth()/2+5}
89
- H ${10+i($[D].Total)}
90
- `).style("stroke",e.connector.connectorLineColor!==Fe.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",w=>k.includes(w.Dimension)||w.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(w){console.error(w)}},ce=(le,B,$,E,k)=>{try{let w=e.connector.connectorFontStyle,D=e.connector.connectorNumberFormat,R=F/30<I.length?Math.round(F/30):I.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(D=".2s"),c.append("g").selectAll("text1").data(le).enter().filter((W,C)=>E!=null?C<le.length-1:C<le.length).append("text").attr("y",(W,C)=>E==null?y($[C].Dimension)/2+y(W.Dimension)/2+15:E==1?R<6&&y.bandwidth()>40?y($[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y($[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y($[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2*E+12).attr("x",(W,C)=>e.total.totalVisibility?70+Math.max(i(B[C]),i($[C].Total),i(W.Total)):50+Math.max(i(B[C]),i($[C].Total),i(W.Total))).text((W,C)=>(W.CustomTotal==0&&$[C].CustomTotal!=0&&(W.CustomTotal=1),hi($[C].Total,W.Total,parseInt(e.connector.connectorDecimalPrecision),D,parseInt(W.Dimension),parseInt($[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!==Fe.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=>k.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=fe.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,q,Z,Y,N,P,z,te,oe,de,se,he,Ae,pe=[],xe=[],Q,J,F,b,v,d,c,i,y,f,a,L=[],I=0;const ae=2;let K={dimensionList:x,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};fe.useEffect(()=>{try{be()}catch(ye){ge("HorizontalHistogramChart","createHorizontalChart",ye)}},[e]);const be=()=>{({formatOptions:e,svg:v,width:Q,height:J}=Ct(l,e)),Le(),{formatOptions:e}=Qt(e,s,r.DataTableData??[]),{maxNumberForPrimaryAxis:oe,maxNumberForSecondaryAxis:de}=Nt(e,K.yMinLeft,K.yMaxLeft,K.yMinRight,K.yMaxRight),{margin:G,yLabel:V,xLabel:j,yTitle:q,xTitle:Z,dimensionHeightWidthArray:Y,chartTitleHeight:N,secondaryAxisTitleWidth:P,legendMargin:z,secondaryYLabel:te}=vt(Q,J,oe,de,K.yMaxLeft,e,K.legendList,K.dimensionList,K.yMaxRight,A,u,t),Ve(G),{dataTable:F,dataTableHeight:b}=ea(e,V,q,s,K.dimensionList),kt(v,Q,J,e),d=Mt(v,G),mt(d,e,b,se,he,n),we(),ee(),ke(),qt(d,K,j,e,b,c,f,Y,J,h,t,se,he,a,c),Gt(d,e,b,V,y,he),Ye(s,J,v,G,se),St(e,m,v,G,j,J,Z,K.chartType,V,se,he),Ft(he,e,b,m,v,G,q,V),Ut(v,A,G,e,b,he,se,te,P),wt(v,e,Q,N),Dt(J,v,Y,N,Q,z,e,s,o,b,G,nt.rectangle)},Le=()=>{const ye=[],Ne=[];let Me=[],Ce=-1/0,ve=1/0;s.forEach(ce=>{Ne.push(ce.legend),ce.data.forEach(le=>{ye.push(le),Ce=Math.max(Ce,le.value),ve=Math.min(ve,le.value)})}),K.chartData=ye,K.legendList=Ne,K.yMaxLeft=Ce,K.yMinLeft=ve>0?0:ve,L=JSON.parse(JSON.stringify(s)),L.forEach(ce=>ce.data.forEach(le=>Me.push(le.value)));let ue=S||S==0?S:0,me=p||p==0?p:L[0]?.data?.length;K.yMaxLeft=parseFloat((ue+"").length>(me+"").length?ue+"":me+""),K.xMax=T.max(Me),K.xMin=T.min(Me)},we=()=>{switch(e.bins.binsCalculation){case"Automatic":Ae=he/50;break;case"Number of Bins":Te(!1);break;case"Bin Width":Te(!0)}},Te=ye=>{L.forEach(ve=>ve.data.sort((ue,me)=>ue.value-me.value));let Ne=K.xMax-K.xMin,Me;ye?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),Me=Ne/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),Me=Ne/parseFloat(e.bins.binsCalculationValue));let Ce=K.xMin;if(ye)for(pe=[Ce];Ce<K.xMax;)Ce+=Me,pe.push(Ce);else for(pe=[Ce];Math.round(Ce)<Math.round(K.xMax);)Ce+=Me,pe.push(Math.round(Ce))},ee=()=>{c=T.scaleLinear().domain([K.xMin,K.xMax]).range([he,0]);const ye=pe.length>0?pe:c.ticks(Ae);let Ne=T.bin().value(Ce=>Ce).domain(c.domain()).thresholds(ye);L.forEach(Ce=>{let ve=Ne(Ce.data.map(ue=>ue.value));xe.push(ve)}),L.forEach((Ce,ve)=>xe[ve].forEach(ue=>{ue.name=Ce.properties.legend,ue.color=Ce.properties.color,ue.opacity=Ce.properties.opacity}));let Me=[];xe.forEach(Ce=>Ce.forEach(ve=>Me.push(ve.length))),K.yMaxLeft=T.max(Me),K.yMinLeft=T.min(Me),i=T.scaleLinear().domain([H||H==0?H:0,g||g==0?g:K.yMaxLeft+.2*K.yMaxLeft]).range([0,se])},ke=()=>{O();{let ye=ot(K.yMaxLeft,K.yMinLeft,se,e,K,S,p,!1,he);f=T.axisBottom(i).tickFormat(Ne=>_e(Ne,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-he+0:0).tickValues(ye.autoLabelFlag?void 0:ye.yAxisLabelArray).ticks(ye.customTickValue).tickPadding(8).tickSizeOuter(0)}},O=()=>{xi(K.xMax,K.xMin,he,e,H,g,se,!1).xAxisLabelArray.shift(),y=T.axisLeft(c).tickFormat(Ne=>_e(Ne,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-se:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(Ae):y.tickValues(pe).ticks(he/50)},De=ye=>{const Ne=e.animation.animationEnabled,Me=d.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(xe).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 ue=c(ve.x0),me=c(ve.x1);return Math.min(ue,me)}).attr("height",ve=>{const ue=c(ve.x0),me=c(ve.x1),ce=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(me-ue)-ce)}).attr("width",0).style("fill",ve=>ve.color!==Fe.white?ve.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(ve,ue)=>{st([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ue.properties?.currentMeasure?ue.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${ue.x0}-${ue.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(ue.length/L[0].data.length):ue.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,ve)}).on("mouseout",rt);(Ne?Me.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Me).attr("width",ve=>i(ve.length)),d.selectAll(".parentGroup").raise()},Ve=ye=>{se=Q-ye.left-ye.right,he=J-ye.bottom-ye.top},Ye=(ye,Ne,Me,Ce,ve)=>{if(!e.plotArea.fitChart){const ue=ye[0].data.length-ae,me=Ne-20;a=K.dimensionList.slice(I,I+ae),L=JSON.parse(JSON.stringify(ye)),L.forEach((B,$)=>L[$].data=B.data.filter(E=>a.includes(E.dimension))),Me.append("rect").attr("x",Ce.left).attr("y",me).attr("width",ve).attr("height",8).attr("fill","#ddd").attr("rx",4);const ce=ve*ae/K.dimensionList.length,le=Me.append("rect").attr("x",Ce.left).attr("y",me).attr("width",ce).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",B=>{let $=Math.min(Math.max(B.x,Ce.left),Ce.left+ve-ce);le.attr("x",$),I=Math.round(($-Ce.left)/(ve-ce)*ue),a=K.dimensionList.slice(I,I+ae),L=JSON.parse(JSON.stringify(ye)),L.forEach((E,k)=>L[k].data=E.data.filter(w=>a.includes(w.dimension))),O(),ie()}));Me.on("wheel",B=>{B.preventDefault();const $=Math.abs(B.deltaX)>Math.abs(B.deltaY)?B.deltaX:B.deltaY;I+=$>0?1:-1,I=Math.max(0,Math.min(I,ue));const E=Ce.left+(ve-ce)*I/ue;le.attr("x",E),L=JSON.parse(JSON.stringify(ye)),L.forEach((k,w)=>L[w].data=k.data.filter(D=>a.includes(D.dimension))),O(),ie()})}ie()},ie=()=>{Gt(d,e,b,V,y,he),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=fe.useRef(),p=fe.useRef(s);p.current=s;const H=fe.useRef(x);H.current=x;const g=pt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1;let j=!1;const q=!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,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te,ee,ke=[],O=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};fe.useEffect(()=>{try{ye()}catch($){ge("Linechart","createLineChart",$)}},[e]);const ye=()=>{({formatOptions:e,svg:f,width:d,height:c}=Ct(S,e)),Ne(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:F}=Nt(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:z,yLabel:te,xLabel:oe,yTitle:de,xTitle:se,dimensionHeightWidthArray:he,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:xe,secondaryYLabel:Q,visibleBars:De,columnWidth:Ve,scrollbarVisible:Ye}=vt(d,c,J,F,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,q,t,!1,ie),ce(z),{dataTable:i,dataTableHeight:y}=ea(e,te,de,g,ie.dimensionList,r),kt(f,d,c,e),a=Mt(f,z),mt(a,e,y,b,v,u,m),Me(),ve(),Gt(a,e,y,te,Le,v),j&&ci(a,e,y,Q,Te,v,b),St(e,V,f,z,oe,c,se,ie.chartType,te,b,v),Ft(v,e,y,V,f,z,de,te),Ut(f,j,z,e,y,v,b,Q,pe),wt(f,e,d,Ae),Dt(c,f,he,Ae,d,xe,e,g,m,y,z,nt.areaWithLine,u,n),Bt(g,c,d,f,z,b,Ye,De,ie,O,!1,le)},Ne=()=>{const $=[],E=[];let k=[],w=-1/0,D=1/0,R=-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=>{E.push(C.properties.alias?C.properties.alias:C.legend),C.data.forEach(M=>{$.push(M),C.properties.axis==="Secondary"?(j=!0,R=Math.max(R,M.value),W=Math.min(W,M.value)):(w=Math.max(w,M.value),D=Math.min(D,M.value))})}),ie.chartData=$,ie.legendList=E,ie.yMaxLeft=w,ie.yMinLeft=D>0?0:D,ie.yMaxRight=R,ie.yMinRight=W,k=t?bt(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(C=>C):ie.dimensionList,ie.dimensionList.forEach((C,M)=>{ie.formattedDimensionListMap.set(C,k[M])}),ke=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ee=ie.dimensionList:ee=ie.dimensionList.slice(O,O+De)},Me=()=>{let $=ot(Y||ie.yMaxLeft,ie.yMinLeft,v,e,ie,Z,Y).yAxisLabelArray;if(ie.yMaxLeft=$[$.length-1],ie.yMinLeft=$[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?v-y:v,0]),j&&(I=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?P||0:P||ie.yMaxRight*1.1]).range([y>0?v-y:v,0])),K=[0,b],e.seriesLabel.seriesLabelVisibility){let E=aa(b,L,e,ke,void 0,j,v);E.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(be=E.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,b-E.heightWidth[0]]:K=[E.heightWidth[0],b]}},Ce=()=>{ae=T.scalePoint().domain(ee).range(K).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{ue();{let $=ot(Y||ie.yMaxLeft,ie.yMinLeft,v,e,ie,Z,Y);Le=T.axisLeft(L).tickFormat(E=>_e(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,b,be)).tickValues($.autoLabelFlag?void 0:$.yAxisLabelArray).ticks($.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let $=oi(P||I.domain()[1],I.domain()[0],e,v);Te=T.axisRight(I).tickFormat(E=>_e(E,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues($.autoLabelFlag?void 0:$.secondaryYAxisLabelArray).ticks($.secondaryCustomTickValue??v/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-b:0).tickSizeOuter(0)}},ue=()=>{we=T.axisBottom(ae).tickSize(ia(e,v,y,!0)).tickSizeOuter(0).tickValues(Lt(ee,b))},me=$=>{const E=e.plotArea.plotAreaHideLineAndMarkers;$.forEach(_=>{_.data.forEach(X=>{X.hideZero=_.properties.hideZeroValues,X.axis=_.properties.axis})});const k=T.area().x(_=>ae(_.dimension)?ae(_.dimension):null).y0(_=>_.axis===at.primary?L(0):I(0)).y1(_=>_.axis===at.primary?L(_.value):I(_.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 R=a.selectAll(".parentGroup").data([$]),W=a.append("g").attr("class","focusClass");R=R.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(R);let C=R.selectAll(".area-group").data(_=>_),M=C.enter().append("g").attr("class","area-group");M.append("path").attr("class","area parentGroup").attr("fill",_=>_.properties.color!==Fe.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(Ke.SeriesId,_=>_.properties.legendUniqueId).attr(Ke.DimValue,_=>_.properties.alias||_.properties.name||"").on("click",gt(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",k(_.data)):T.select(this).attr("d",k(_.data))}),M.merge(C).each(function(_){const X=T.select(this);X.selectAll("path.visibleLine").data([_]).join("path").attr("class","visibleLine parentGroup").attr("d",U=>D?w(U.data):k(U.data)).attr("stroke",U=>U.properties.areaBorderColor!==Fe.white?U.properties.areaBorderColor:"none").attr("stroke-dasharray",U=>{const Se=parseInt(U.properties.lineWidth);switch(U.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",U=>U.properties.lineStyle===yt.dotted?sa.round:sa.butt).attr("stroke-width",U=>E?U.properties.lineStyle!==yt.none&&e.plotArea.plotAreaHideLineAndMarkers?U.properties.lineWidth:"0":0).attr("fill","none").each(function(U){D&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",k(U.data))}),X.selectAll("path.hoverLine").data([_]).join("path").attr("class","hoverLine").attr("d",U=>k(U.data)).attr("fill",Fe.transparent).attr("stroke","none").style("pointer-events","all").raise(),yi(e,R,W,ee,$,ae,L,u)}),C.exit().remove(),Ca(R,$,u,ae,L,I,null,e,ie,P,N,Z,Y,!1,l),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ce=$=>{b=d-$.left-$.right,v=c-$.bottom-$.top},le=($,E,k)=>{ke=E,ee=$,De=k,B()},B=()=>{Ce(),ue(),Da(g,ae,L,I,z,dt,[],[],e,u,c,d,b,ee,v,m,f,h,void 0,void 0,o);let $=aa(b,L,e,ke,void 0,j,v).labelArray;qt(a,ie,oe,e,y,L,we,he,c,A,t,b,v,ee,ae),me(ke),za(e,a,$),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,te,de,ee,b,K,ie.formattedDimensionListMap,m,z,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%"}})})},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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList)?.reverse()||[],G=r.DimensionList,V=!1,j=!1;let q=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,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F=new Map,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te,ee=[],ke=0,O,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};fe.useEffect(()=>{try{Ne()}catch(k){ge("StackAreaChart","createAreaChart",k)}},[e]);const Ne=()=>{({formatOptions:e,svg:f,width:d,height:c}=Ct(S,e)),Me(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:Q,maxNumberForSecondaryAxis:J}=Nt(e,ye.yMinLeft,ye.yMaxLeft,ye.yMinRight,ye.yMaxRight),{margin:P,yLabel:z,xLabel:te,yTitle:oe,xTitle:de,dimensionHeightWidthArray:se,chartTitleHeight:he,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:xe,visibleBars:O,columnWidth:De,scrollbarVisible:Ve}=vt(d,c,Q,J,ye.yMaxLeft,e,ye.legendList,ye.dimensionList,ye.yMaxRight,j,ie,t,!1,ye),le(P),{dataTable:i,dataTableHeight:y}=ea(e,z,oe,g,ye.dimensionList,r),kt(f,d,c,e),a=Mt(f,P),mt(a,e,y,b,v,u,m),Ce(),ue(),Gt(a,e,y,z,Le,v),St(e,V,f,P,te,c,de,ye.chartType,z,b,v),Ft(v,e,y,V,f,P,oe,z),Ut(f,j,P,e,y,v,b,xe,Ae),wt(f,e,d,he),Dt(c,f,se,he,d,pe,e,[...g].reverse(),m,y,P,nt.areaWithLine,u,n),Bt(g,c,d,f,P,b,Ve,O,ye,ke,!1,B,V)},Me=()=>{const k=[],w=[];e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0,g.forEach(_=>{_.data=_.data.filter(X=>X.value!==0)})),g.forEach((_,X)=>{const U=`${X}~$~${_.properties.alias}`;_.properties.legend=U,w.push(U);for(const Se of _.data)k.push(Se)}),ye.chartData=k,ye.legendList=w,ee=JSON.parse(JSON.stringify(g));let D=xt(ye.dimensionList,g,ie);e.plotArea.fitChart?Te=ye.dimensionList:(Te=ye.dimensionList.slice(ke,ke+O),ee.forEach((_,X)=>ee[X].data=_.data.filter(U=>Te.includes(U.dimension))));const R=T.stack().keys(ye.legendList).offset(T.stackOffsetNone)(D);E();let W=1/0,C=-1/0;for(const _ of R)for(const[X,U]of _)W=Math.min(W,X),C=Math.max(C,U);ye.yMinLeft=W>0?0:W,ye.yMaxLeft=C;let M=t?bt(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList).map(_=>_):ye.dimensionList;ye.dimensionList.forEach((_,X)=>{ye.formattedDimensionListMap.set(_,M[X])})},Ce=()=>{let k=ot(Z||ye.yMaxLeft,ye.yMinLeft,v,e,ye,q,Z).yAxisLabelArray;if(ye.yMaxLeft=k[k.length-1],ye.yMinLeft=k[0],L=T.scaleLinear().domain([ye.yMinLeft>=0?q!==void 0&&!Number.isNaN(q)?q: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?v-y:v,0]),K=[0,b],e.seriesLabel.seriesLabelVisibility){let w=aa(b,L,e,g,void 0,j,v,!0);w.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(be=w.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,b-w.heightWidth[0]]:K=[w.heightWidth[0],b]}},ve=()=>{ae=T.scalePoint().domain(Te).range(K).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ue=()=>{{let k=ot(Z||ye.yMaxLeft,ye.yMinLeft,v,e,ye,q,Z);Le=T.axisLeft(L).tickFormat(w=>_e(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,b,be)).tickValues(k.autoLabelFlag?void 0:k.yAxisLabelArray).ticks(k.customTickValue).tickPadding(8).tickSizeOuter(0)}},me=()=>{we=T.axisBottom(ae).tickSize(ia(e,v,y,!0)).tickSizeOuter(0).tickValues(Lt(Te,b))},ce=k=>{const w=e.animation.animationEnabled,D=e.plotArea.plotAreaHideLineAndMarkers;k.forEach(U=>{U.data.forEach(Se=>{Se.hideZero=U.properties.hideZeroValues,Se.axis=U.properties.axis})});const R=T.area().x(U=>ae(U.data.dimension)?ae(U.data.dimension):null).y0(U=>L(U[0])).y1(U=>L(U[1])).defined(U=>U.data.hideZero?!!U.data.key:!0).curve(Ot(e)),W=T.area().x(U=>ae(U.data.dimension)?ae(U.data.dimension):null).y0(()=>L(0)).y1(()=>L(0)).defined(U=>U.data.hideZero?!!U.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(U=>U),X=_.enter().append("g").attr("class",U=>"area-group "+U.key.replace(/ /g,"-"));X.append("path").attr("hoverId",U=>(k[U.index].properties.alias||k[U.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",U=>U.color!==Fe.white?U.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",U=>W(U)).attr(Ke.SeriesId,U=>g[U.index]?.properties?.legendUniqueId??U.key).attr(Ke.DimValue,U=>g[U.index]?.properties?.alias||g[U.index]?.properties?.name||"").on("click",gt(H,p,(U,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(U){w?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",R(U)):T.select(this).attr("d",R(U))}),X.merge(_).each(function(U,Se){const ze=T.select(this);ze.selectAll("path.visibleLine").data([U]).join("path").attr("class","visibleLine parentGroup").attr("d",Ie=>w?W(Ie):R(Ie)).attr("stroke",Ie=>Ie.color!==Fe.white?g[Se].properties.areaBorderColor:"none").attr("stroke-dasharray",Ie=>{const Qe=parseInt(g[Se].properties.lineWidth.toString());switch(g[Se].properties.lineStyle){case yt.dotted:return`0,${Qe+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",R(Ie))}),ze.selectAll("path.hoverLine").data([U]).join("path").attr("class","hoverLine").attr("d",Ie=>R(Ie)).attr("fill",Fe.transparent).attr("stroke","none").style("pointer-events","all").raise(),f.selectAll('[hoverId="'+(g[U.index].properties.alias||g[U.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),_.exit().remove(),yi(e,C,M,Te,k,ae,L,u,!0),Ca(C,k,u,ae,L,I,null,e,ye,N,Y,q,Z,!1,x),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},le=k=>{b=d-k.left-k.right,v=c-k.bottom-k.top},B=(k,w,D)=>{ee=w,Te=k,O=D,Ka(r,F,Te),E(),$()},$=()=>{ve(),me(),qt(a,ye,te,e,y,L,we,se,c,A,t,b,v,Te,ae),ce(ee),Va(Ye,ae,L,I,P,dt,[],[],e,u,c,d,b,Te,v,m,f,h,y,o);let k=aa(b,L,e,ee,void 0,j,v,!0).labelArray;za(e,a,k),qa(F,ae,L,P,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,oe,ye.dimensionList,b,K,ye.formattedDimensionListMap,m,P,v))},E=()=>{let k=xt(Te,ee,ie);Ye=T.stack().keys(ye.legendList).offset(T.stackOffsetNone)(k),ee.forEach((D,R)=>D.data.forEach((W,C)=>{W[0]=Ye[R][C][0],W[1]=Ye[R][C][1]}));let w=e.annotation.annotationSetLabelColor;Ye.forEach((D,R)=>D.forEach(W=>{W.key=D.key,D.color=JSON.parse(JSON.stringify(g[R].properties.color)),W.data.labelPosition=g[R].properties.dataLabelPosition,W.data.labelColor=w=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,W.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues)),W.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%"}})})},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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.useRef(s);H.current=s;const g=pt(r.ChartData,r.DimensionList)?.reverse()||[],G=r.DimensionList,V=!1,j=!1;let q=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,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we,Te=[],ee=0,ke,O,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};fe.useEffect(()=>{try{ye()}catch(E){ge("NormalizedLinechart","createLineChart",E)}},[e]);const ye=()=>{({formatOptions:e,svg:y,width:v,height:d}=Ct(S,e)),Ne(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:P,yLabel:z,xLabel:te,yTitle:oe,xTitle:de,dimensionHeightWidthArray:se,chartTitleHeight:he,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:xe,visibleBars:ke,columnWidth:De,scrollbarVisible:O}=vt(v,d,Q,J,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,j,Ye,t,!1,ie),ce(P),{dataTable:c,dataTableHeight:i}=ea(e,z,oe,g,ie.dimensionList,r),kt(y,v,d,e),f=Mt(y,P),mt(f,e,i,F,b,u),Me(),ve(),Gt(f,e,i,z,be,b),St(e,V,y,P,te,d,de,ie.chartType,z,F,b),Ft(b,e,i,V,y,P,oe,z),Ut(y,j,P,e,i,b,F,xe,Ae),wt(y,e,v,he),Dt(d,y,se,he,v,pe,e,[...g].reverse(),m,i,P,nt.areaWithLine,u,n),Bt(g,d,v,y,P,F,O,ke,ie,ee,!1,le)},Ne=()=>{const E=[],k=[];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=_,k.push(_);for(const X of C.data)E.push(X)}),ie.chartData=E,ie.legendList=k,Te=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?we=ie.dimensionList:(we=ie.dimensionList.slice(ee,ee+ke),Te.forEach(C=>{C.data=C.data.filter(M=>we.includes(M.dimension))}));const w=xt(ie.dimensionList,g,Ye),D=T.stack().keys(ie.legendList).offset(T.stackOffsetNone)(w);$();let R=1/0;for(const C of D)for(const[M]of C)R=Math.min(R,M);ie.yMinLeft=R>0?0:R,ie.yMaxLeft=1;const W=t?bt(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 E=aa(F,a,e,g,void 0,j,b,!0);E.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(K=E.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ae=[0,F-E.heightWidth[0]]:ae=[E.heightWidth[0],F]}},Ce=()=>{I=T.scalePoint().domain(we).range(ae).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{be=T.axisLeft(a).tickSize(Pt(e,F,K)).ticks(i>0?(b-i)/80:b/80,"%").tickPadding(8).tickSizeOuter(0)},ue=()=>{Le=T.axisBottom(I).tickSize(ia(e,b,i,!0)).tickSizeOuter(0).tickValues(Lt(we,F))},me=E=>{const k=e.animation.animationEnabled,w=e.plotArea.plotAreaHideLineAndMarkers;Ve.forEach((X,U)=>X.forEach((Se,ze)=>{const Ie=Se.data.total;E[U].data[ze]&&(E[U].data[ze][0]=Se[0]=Ie===0?0:Se[0]/Ie,E[U].data[ze][1]=Se[1]=Ie===0?0:Se[1]/Ie)})),E.forEach(X=>{X.data.forEach(U=>{U.hideZero=X.properties.hideZeroValues,U.axis=X.properties.axis})});const D=T.area().x(X=>I(X.data.dimension)?I(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),R=T.area().x(X=>I(X.data.dimension)?I(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=>(E[X.index]?.properties?.alias||E[X.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",X=>X.color!==Fe.white?X.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",X=>R(X)).attr(Ke.SeriesId,X=>g[X.index]?.properties?.legendUniqueId??X.key).attr(Ke.DimValue,X=>g[X.index]?.properties?.alias||g[X.index]?.properties?.name||"").on("click",gt(H,p,(X,U)=>{const Se=g[U.index]?.properties?.legendUniqueId??U.key,ze=g[U.index]?.properties?.alias||g[U.index]?.properties?.name||"";return{seriesId:Se,dimValue:ze,legendUniqueId:Se,seriesDisplayName:ze}})).each(function(X){const U=T.select(this);k?U.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",D(X)):U.attr("d",D(X))}),_.merge(M).each(function(X,U){const Se=T.select(this);Se.selectAll("path.visibleLine").data([X]).join("path").attr("class","visibleLine parentGroup").attr("d",ze=>k?R(ze):D(ze)).attr("stroke",ze=>ze.color!==Fe.white?g[U].properties.areaBorderColor:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[U].properties.lineWidth.toString());switch(g[U].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[U]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>w?g[U].properties.lineStyle!==yt.none?g[U].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(ze){k&&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",Fe.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+ui((E[X.index]?.properties?.alias||E[X.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),M.exit().remove(),yi(e,W,C,we,E,I,a,u,!0),f.selectAll(".parentGroup").raise(),f.selectAll(".hoverLine").raise(),Ca(W,E,u,I,a,L,null,e,ie,N,Y,q,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,I,void 0,void 0,void 0,i,u,e,z,oe,ie.dimensionList,F,ae,ie.formattedDimensionListMap,m,P,b))},ce=E=>{F=v-E.left-E.right,b=d-E.bottom-E.top},le=(E,k,w)=>{Te=k,we=E,ke=w,$(),B()},B=()=>{Ce(),ue(),qt(f,ie,te,e,i,a,Le,se,d,A,t,F,b,we,I),me(Te),Va(Ve,I,a,L,P,dt,[],[],e,u,d,v,F,we,b,m,y,h,i,o,!1);let E=aa(F,a,e,Te,void 0,j,b,!0).labelArray;za(e,f,E)},$=()=>{let E=xt(we,Te,Ye);Ve=T.stack().keys(ie.legendList).offset(T.stackOffsetNone)(E),Te.forEach((w,D)=>w.data.forEach((R,W)=>{Ve[D][W]&&(R[0]=Ve[D][W][0],R[1]=Ve[D][W][1])}));let k=e.annotation.annotationSetLabelColor;Ve.forEach((w,D)=>w.forEach(R=>{R.key=w.key,w.color=JSON.parse(JSON.stringify(g[D].properties.color)),R.data.labelPosition=g[D].properties.dataLabelPosition,R.data.labelColor=k=="2"?JSON.parse(JSON.stringify(g[D].properties.color)):g[D].properties.labelColor,R.hideZero=JSON.parse(JSON.stringify(g[D].properties.hideZeroValues)),R.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!==Fe.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){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=fe.useRef(),A=fe.useRef(l);A.current=l;const u=fe.useRef(s);u.current=s;const S=pt(t.ChartData);let p,H,g,G=40,V=Ht,j=[0,0],q,Z,Y,N,P,z,te,oe,de=!1;fe.useEffect(()=>{se()},[e]);const se=()=>{({chartFormatOptions:p,svg:P,width:g,height:H}=Jt(m,e)),he(),j=Ia(p,S),{margins:V,innerHeight:q,innerWidth:Z,legendListWidth:oe,chartTitleHeight:G}=Na(p,g,H,j,V),Ae(),jt(m,g,H,p),N=la(P,V),_t(m,G,g,p),Pa(p,P,S,g,H,oe,G,r,V,nt.circle,void 0,n),pe(),xe(),p.plotArea.annotationDraggable&&p.plotArea.dataLabels?Oi(dt,z,p,Q(),re.PieChart,g,H,N,Math.min(q*.5,Z*.5),o,h):F(),vi(p,te,G,P,g,H)},he=()=>{try{te=0,t.ChartData.forEach(b=>{b.properties.dataLabelPosition=="2"&&(de=!0),te+=b.data[0].value})}catch(b){ge(Ea,"loopOverSeriesData",b)}},Ae=()=>{try{Y=Math.min(q*.5,Z*.5),de&&(Y=Y*.9)}catch(b){ge(Ea,"defineChartRadius",b)}},pe=()=>{try{let b=et(p.plotArea.rotation);const v=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;z=T.pie().value(i=>Math.abs(v?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)}},xe=()=>{try{const b=T.arc().innerRadius(0).outerRadius(Y),v=T.arc().innerRadius(0).outerRadius(Y+10),d=N.append("g").attr("class","parentGroup").attr("fill-opacity",p.plotArea.opacity).attr("transform",`${Q()}`).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!==Fe.white?c.data.properties.color:"none").attr(Ke.SeriesId,c=>c.data.properties.legendUniqueId??c.data.properties.name??"").attr(Ke.DimValue,c=>c.data.properties.alias||c.data.legend||"").on("click",gt(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",v)}).on("mousemove. ",c=>{st([{key:p.yAxisTitle.yAxisTitleText,value:p.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(c.currentTarget.__data__.data.data[0].value/te)*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)}},Q=()=>{try{return`translate(${Z/2},${q/2})`}catch(b){return ge(Ea,"getPiePosition",b),""}},J=(b,v)=>{try{if(v)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",`${Q()}`).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??Fe.black).attr("font-style",c=>c.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",c=>c.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",c=>c.data.properties?.labelFontStyle?.includes(ne.bold)?ne.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",`${Q()}`).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??Fe.black).attr("font-style",c=>c.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",c=>c.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",c=>c.data.properties?.valueFontStyle?.includes(ne.bold)?ne.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/te)*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(ne.bold)?ne.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 v=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",Q()).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=v.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(I=>I.join(",")).join(" ")}),N.append("g").attr("class","pie-label-group").attr("transform",Q()).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=>v.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/te)*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="
87
+ H ${45+Math.max(i(U[D]),i(Y[D].Total),i(w.Total))}
88
+ V ${y(Y[D].Dimension)+y.bandwidth()/2+5}
89
+ H ${10+i(Y[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,U,Y,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(Y[C].Dimension)/2+y(W.Dimension)/2+15:R==1?I<6&&y.bandwidth()>40?y(Y[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(Y[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(Y[C].Dimension)+y.bandwidth()/2+y.bandwidth()/2*R+12).attr("x",(W,C)=>e.total.totalVisibility?70+Math.max(i(U[C]),i(Y[C].Total),i(W.Total)):50+Math.max(i(U[C]),i(Y[C].Total),i(W.Total))).text((W,C)=>(W.CustomTotal==0&&Y[C].CustomTotal!=0&&(W.CustomTotal=1),hi(Y[C].Total,W.Total,parseInt(e.connector.connectorDecimalPrecision),D,parseInt(W.Dimension),parseInt(Y[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=fe.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,B,N,E,$,q,se,ce,oe,he,Ae,pe=[],xe=[],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};fe.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:se,maxNumberForSecondaryAxis:ce}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:G,yLabel:V,xLabel:j,yTitle:K,xTitle:Z,dimensionHeightWidthArray:B,chartTitleHeight:N,secondaryAxisTitleWidth:E,legendMargin:$,secondaryYLabel:q}=vt(O,J,se,ce,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,he,n),Fe(),te(),ke(),qt(d,Q,j,e,b,c,f,B,J,h,t,oe,he,a,c),Gt(d,e,b,V,y,he),Ye(s,J,k,G,oe),St(e,m,k,G,j,J,Z,Q.chartType,V,oe,he),Ft(he,e,b,m,k,G,K,V),Ut(k,A,G,e,b,he,oe,q,E),wt(k,e,O,N),Dt(J,k,B,N,O,$,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 ue=S||S==0?S:0,me=p||p==0?p:L[0]?.data?.length;Q.yMaxLeft=parseFloat((ue+"").length>(me+"").length?ue+"":me+""),Q.xMax=T.max(Me),Q.xMin=T.min(Me)},Fe=()=>{switch(e.bins.binsCalculation){case"Automatic":Ae=he/50;break;case"Number of Bins":Te(!1);break;case"Bin Width":Te(!0)}},Te=ye=>{L.forEach(ve=>ve.data.sort((ue,me)=>ue.value-me.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([he,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(ue=>ue.value));xe.push(ve)}),L.forEach((Ce,ve)=>xe[ve].forEach(ue=>{ue.name=Ce.properties.legend,ue.color=Ce.properties.color,ue.opacity=Ce.properties.opacity}));let Me=[];xe.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,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(ye.autoLabelFlag?void 0:ye.yAxisLabelArray).ticks(ye.customTickValue).tickPadding(8).tickSizeOuter(0)}},ee=()=>{xi(Q.xMax,Q.xMin,he,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(he/50)},De=ye=>{const Pe=e.animation.animationEnabled,Me=d.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(xe).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 ue=c(ve.x0),me=c(ve.x1);return Math.min(ue,me)}).attr("height",ve=>{const ue=c(ve.x0),me=c(ve.x1),de=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(me-ue)-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,ue)=>{st([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ue.properties?.currentMeasure?ue.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${ue.x0}-${ue.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(ue.length/L[0].data.length):ue.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,he=J-ye.bottom-ye.top},Ye=(ye,Pe,Me,Ce,ve)=>{if(!e.plotArea.fitChart){const ue=ye[0].data.length-ae,me=Pe-20;a=Q.dimensionList.slice(P,P+ae),L=JSON.parse(JSON.stringify(ye)),L.forEach((U,Y)=>L[Y].data=U.data.filter(R=>a.includes(R.dimension))),Me.append("rect").attr("x",Ce.left).attr("y",me).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",me).attr("width",de).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",U=>{let Y=Math.min(Math.max(U.x,Ce.left),Ce.left+ve-de);le.attr("x",Y),P=Math.round((Y-Ce.left)/(ve-de)*ue),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",U=>{U.preventDefault();const Y=Math.abs(U.deltaX)>Math.abs(U.deltaY)?U.deltaX:U.deltaY;P+=Y>0?1:-1,P=Math.max(0,Math.min(P,ue));const R=Ce.left+(ve-de)*P/ue;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,he),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=fe.useRef(),p=fe.useRef(s);p.current=s;const H=fe.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,B=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,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te,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};fe.useEffect(()=>{try{ye()}catch(Y){ge("Linechart","createLineChart",Y)}},[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:$,yLabel:q,xLabel:se,yTitle:ce,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Ae,secondaryAxisTitleWidth:pe,legendMargin:xe,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($),{dataTable:i,dataTableHeight:y}=ea(e,q,ce,g,ie.dimensionList,r),kt(f,d,c,e),a=Mt(f,$),mt(a,e,y,b,k,u,m),Me(),ve(),Gt(a,e,y,q,Le,k),j&&ci(a,e,y,O,Te,k,b),St(e,V,f,$,se,c,oe,ie.chartType,q,b,k),Ft(k,e,y,V,f,$,ce,q),Ut(f,j,$,e,y,k,b,O,pe),wt(f,e,d,Ae),Dt(c,f,he,Ae,d,xe,e,g,m,y,$,nt.areaWithLine,u,n),Bt(g,c,d,f,$,b,Ye,De,ie,ee,!1,le)},Pe=()=>{const Y=[],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=>{Y.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=Y,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 Y=ot(B||ie.yMaxLeft,ie.yMinLeft,k,e,ie,Z,B).yAxisLabelArray;if(ie.yMaxLeft=Y[Y.length-1],ie.yMinLeft=Y[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:B!==void 0&&!Number.isNaN(B)?B: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=()=>{ue();{let Y=ot(B||ie.yMaxLeft,ie.yMinLeft,k,e,ie,Z,B);Le=T.axisLeft(L).tickFormat(R=>_e(R,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,b,be)).tickValues(Y.autoLabelFlag?void 0:Y.yAxisLabelArray).ticks(Y.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let Y=oi(E||P.domain()[1],P.domain()[0],e,k);Te=T.axisRight(P).tickFormat(R=>_e(R,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Y.autoLabelFlag?void 0:Y.secondaryYAxisLabelArray).ticks(Y.secondaryCustomTickValue??k/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-b:0).tickSizeOuter(0)}},ue=()=>{Fe=T.axisBottom(ae).tickSize(ia(e,k,y,!0)).tickSizeOuter(0).tickValues(Lt(te,b))},me=Y=>{const R=e.plotArea.plotAreaHideLineAndMarkers;Y.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([Y]),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",z=>D?w(z.data):v(z.data)).attr("stroke",z=>z.properties.areaBorderColor!==we.white?z.properties.areaBorderColor:"none").attr("stroke-dasharray",z=>{const Se=parseInt(z.properties.lineWidth);switch(z.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",z=>z.properties.lineStyle===yt.dotted?sa.round:sa.butt).attr("stroke-width",z=>R?z.properties.lineStyle!==yt.none&&e.plotArea.plotAreaHideLineAndMarkers?z.properties.lineWidth:"0":0).attr("fill","none").each(function(z){D&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",v(z.data))}),X.selectAll("path.hoverLine").data([_]).join("path").attr("class","hoverLine").attr("d",z=>v(z.data)).attr("fill",we.transparent).attr("stroke","none").style("pointer-events","all").raise(),yi(e,I,W,te,Y,ae,L,u)}),C.exit().remove(),Ca(I,Y,u,ae,L,P,null,e,ie,E,N,Z,B,!1,l),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},de=Y=>{b=d-Y.left-Y.right,k=c-Y.bottom-Y.top},le=(Y,R,v)=>{ke=R,te=Y,De=v,U()},U=()=>{Ce(),ue(),Da(g,ae,L,P,$,dt,[],[],e,u,c,d,b,te,k,m,f,h,void 0,void 0,o);let Y=aa(b,L,e,ke,void 0,j,k).labelArray;qt(a,ie,se,e,y,L,Fe,he,c,A,t,b,k,te,ae),me(ke),za(e,a,Y),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,ce,te,b,Q,ie.formattedDimensionListMap,m,$,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,E,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F=new Map,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te,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};fe.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:$,xLabel:q,yTitle:se,xTitle:ce,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:xe,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,$,se,g,ye.dimensionList,r),kt(f,d,c,e),a=Mt(f,E),mt(a,e,y,b,k,u,m),Ce(),ue(),Gt(a,e,y,$,Le,k),St(e,V,f,E,q,c,ce,ye.chartType,$,b,k),Ft(k,e,y,V,f,E,se,$),Ut(f,j,E,e,y,k,b,xe,Ae),wt(f,e,d,he),Dt(c,f,oe,he,d,pe,e,[...g].reverse(),m,y,E,nt.areaWithLine,u,n),Bt(g,c,d,f,E,b,Ve,ee,ye,ke,!1,U,V)},Me=()=>{const v=[],w=[];e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0,g.forEach(_=>{_.data=_.data.filter(X=>X.value!==0)})),g.forEach((_,X)=>{const z=`${X}~$~${_.properties.alias}`;_.properties.legend=z,w.push(z);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?Te=ye.dimensionList:(Te=ye.dimensionList.slice(ke,ke+ee),te.forEach((_,X)=>te[X].data=_.data.filter(z=>Te.includes(z.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,z]of _)W=Math.min(W,X),C=Math.max(C,z);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(Te).range(Q).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ue=()=>{{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)}},me=()=>{Fe=T.axisBottom(ae).tickSize(ia(e,k,y,!0)).tickSizeOuter(0).tickValues(Lt(Te,b))},de=v=>{const w=e.animation.animationEnabled,D=e.plotArea.plotAreaHideLineAndMarkers;v.forEach(z=>{z.data.forEach(Se=>{Se.hideZero=z.properties.hideZeroValues,Se.axis=z.properties.axis})});const I=T.area().x(z=>ae(z.data.dimension)?ae(z.data.dimension):null).y0(z=>L(z[0])).y1(z=>L(z[1])).defined(z=>z.data.hideZero?!!z.data.key:!0).curve(Ot(e)),W=T.area().x(z=>ae(z.data.dimension)?ae(z.data.dimension):null).y0(()=>L(0)).y1(()=>L(0)).defined(z=>z.data.hideZero?!!z.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(z=>z),X=_.enter().append("g").attr("class",z=>"area-group "+z.key.replace(/ /g,"-"));X.append("path").attr("hoverId",z=>(v[z.index].properties.alias||v[z.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",z=>z.color!==we.white?z.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",z=>W(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(H,p,(z,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(z){w?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",I(z)):T.select(this).attr("d",I(z))}),X.merge(_).each(function(z,Se){const ze=T.select(this);ze.selectAll("path.visibleLine").data([z]).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([z]).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[z.index].properties.alias||g[z.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),_.exit().remove(),yi(e,C,M,Te,v,ae,L,u,!0),Ca(C,v,u,ae,L,P,null,e,ye,N,B,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},U=(v,w,D)=>{te=w,Te=v,ee=D,Ka(r,F,Te),R(),Y()},Y=()=>{ve(),me(),qt(a,ye,q,e,y,L,Fe,oe,c,A,t,b,k,Te,ae),de(te),Va(Ye,ae,L,P,E,dt,[],[],e,u,c,d,b,Te,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,$,se,ye.dimensionList,b,Q,ye.formattedDimensionListMap,m,E,k))},R=()=>{let v=pt(Te,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=fe.useRef(),p=fe.useRef(l);p.current=l;const H=fe.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,B=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,E,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe,Te=[],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};fe.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:$,xLabel:q,yTitle:se,xTitle:ce,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Ae,legendMargin:pe,secondaryYLabel:xe,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,$,se,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,$,be,b),St(e,V,y,E,q,d,ce,ie.chartType,$,F,b),Ft(b,e,i,V,y,E,se,$),Ut(y,j,E,e,i,b,F,xe,Ae),wt(y,e,k,he),Dt(d,y,oe,he,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,Te=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?Fe=ie.dimensionList:(Fe=ie.dimensionList.slice(te,te+ke),Te.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);Y();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)},ue=()=>{Le=T.axisBottom(P).tickSize(ia(e,b,i,!0)).tickSizeOuter(0).tickValues(Lt(Fe,F))},me=R=>{const v=e.animation.animationEnabled,w=e.plotArea.plotAreaHideLineAndMarkers;Ve.forEach((X,z)=>X.forEach((Se,ze)=>{const Ie=Se.data.total;R[z].data[ze]&&(R[z].data[ze][0]=Se[0]=Ie===0?0:Se[0]/Ie,R[z].data[ze][1]=Se[1]=Ie===0?0:Se[1]/Ie)})),R.forEach(X=>{X.data.forEach(z=>{z.hideZero=X.properties.hideZeroValues,z.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,z)=>{const Se=g[z.index]?.properties?.legendUniqueId??z.key,ze=g[z.index]?.properties?.alias||g[z.index]?.properties?.name||"";return{seriesId:Se,dimValue:ze,legendUniqueId:Se,seriesDisplayName:ze}})).each(function(X){const z=T.select(this);v?z.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",D(X)):z.attr("d",D(X))}),_.merge(M).each(function(X,z){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[z].properties.areaBorderColor:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[z].properties.lineWidth.toString());switch(g[z].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[z]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>w?g[z].properties.lineStyle!==yt.none?g[z].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,B,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,$,se,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)=>{Te=v,Fe=R,ke=w,Y(),U()},U=()=>{Ce(),ue(),qt(f,ie,q,e,i,a,Le,oe,d,A,t,F,b,Fe,P),me(Te),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,Te,void 0,j,b,!0).labelArray;za(e,f,R)},Y=()=>{let R=pt(Fe,Te,Ye);Ve=T.stack().keys(ie.legendList).offset(T.stackOffsetNone)(R),Te.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(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){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=fe.useRef(),A=fe.useRef(l);A.current=l;const u=fe.useRef(s);u.current=s;const S=bt(t.ChartData);let p,H,g,G=40,V=Ht,j=[0,0],K,Z,B,N,E,$,q,se,ce=!1;fe.useEffect(()=>{oe()},[e]);const oe=()=>{({chartFormatOptions:p,svg:E,width:g,height:H}=Jt(m,e)),he(),j=Ia(p,S),{margins:V,innerHeight:K,innerWidth:Z,legendListWidth:se,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,se,G,r,V,nt.circle,void 0,n),pe(),xe(),p.plotArea.annotationDraggable&&p.plotArea.dataLabels?Oi(dt,$,p,O(),re.PieChart,g,H,N,Math.min(K*.5,Z*.5),o,h):F(),vi(p,q,G,E,g,H)},he=()=>{try{q=0,t.ChartData.forEach(b=>{b.properties.dataLabelPosition=="2"&&(ce=!0),q+=b.data[0].value})}catch(b){ge(Ea,"loopOverSeriesData",b)}},Ae=()=>{try{B=Math.min(K*.5,Z*.5),ce&&(B=B*.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;$=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:B,depth:2}))}catch(b){ge(Ea,"initPieChartData",b)}},xe=()=>{try{const b=T.arc().innerRadius(0).outerRadius(B),k=T.arc().innerRadius(0).outerRadius(B+10),d=N.append("g").attr("class","parentGroup").attr("fill-opacity",p.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data($).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)*(B*.65),i=Math.sin(d-Math.PI/2)*(B*.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=$&&$.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($.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(ne.italic)?ne.italic:"").attr("text-decoration",c=>c.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",c=>c.data.properties?.labelFontStyle?.includes(ne.bold)?ne.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($.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(ne.italic)?ne.italic:"").attr("text-decoration",c=>c.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",c=>c.data.properties?.valueFontStyle?.includes(ne.bold)?ne.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(ne.bold)?ne.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+B/7:0).outerRadius(c=>c.depth>1?c.y1-1+B/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+B/1.5);N.selectAll("polyline.pie-label-connector").data(Rt($.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=B*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($.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 B*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
91
  font-size: ${c.data.properties.labelFontSize}px;
92
92
  color: ${c.data.properties.labelFontColor};
93
93
  font-style: ${c.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:""};
@@ -114,7 +114,7 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
114
114
  font-family: ${c.data.properties.valueFont};
115
115
  display: block;">
116
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=fe.useRef(),A=fe.useRef(l);A.current=l;const u=fe.useRef(s);u.current=s;const S=pt(t.ChartData);let p,H,g,G=40,V=Ht,j=[0,0],q,Z,Y,N,P,z,te,oe,de=!1,se;fe.useEffect(()=>{he()},[e]);const he=()=>{({chartFormatOptions:p,svg:se,width:H,height:g}=Jt(m,e)),Ae(),j=Ia(p,S),{margins:V,innerHeight:q,innerWidth:Z,legendListWidth:P,chartTitleHeight:G}=Na(p,H,g,j,V),pe(),jt(m,H,g,p),z=la(se,V),_t(m,G,H,p),Pa(p,se,S,H,g,P,G,r,V,nt.hollowCircle,!1,n),xe(),Q(),p.plotArea.annotationDraggable&&p.plotArea.dataLabels?Oi(dt,te,p,J(),re.DonutChart,H,g,z,Math.min(q*.5,Z*.5),o,h):b(),v()},Ae=()=>{try{oe=0,S.forEach(d=>{d.properties.dataLabelPosition=="2"&&(de=!0),oe+=d.data[0].value})}catch(d){ge(Ma,"loopOverSeriesData",d)}},pe=()=>{try{Y=Math.min(q*.4,Z*.4),de&&(Y=Y*.9),N=Math.min(et(p.plotArea.innerRadius)/100*Y,Y)}catch(d){ge(Ma,"defineChartRadius",d)}},xe=()=>{try{let d=et(p.plotArea.rotation);const c=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;te=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)}},Q=()=>{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(te).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!==Fe.white?a.data.properties.color:"none").attr(Ke.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(Ke.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",gt(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/oe)*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(I){return c(L(I))}}):f.attr("d",a=>c(a))}catch(d){ge(Ma,"drawDonutChart",d)}},J=()=>{try{return`translate(${Z/2},${q/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,I=0;return L>180&&L<360?I=90:I=-90,L+=I,`translate(${f},${a}) rotate(${L})`}}catch(i){return ge(Ma,"getDataLabelTransformString",i),""}},b=()=>{try{if(p.plotArea.dataLabels){const d=te&&te.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(te.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??Fe.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=>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(te.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??Fe.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??Fe.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/oe)*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(ne.bold)?ne.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??Fe.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(te.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 I=Y*1.1*(L<Math.PI?1:-1),ae=a[1];return[f,a,[I,ae]].map(K=>K.join(",")).join(" ")}),z.append("g").attr("class","pie-label-group").attr("transform",J()).selectAll("foreignObject").data(Rt(te.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/oe)*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="
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=fe.useRef(),A=fe.useRef(l);A.current=l;const u=fe.useRef(s);u.current=s;const S=bt(t.ChartData);let p,H,g,G=40,V=Ht,j=[0,0],K,Z,B,N,E,$,q,se,ce=!1,oe;fe.useEffect(()=>{he()},[e]);const he=()=>{({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),$=la(oe,V),_t(m,G,H,p),Pa(p,oe,S,H,g,E,G,r,V,nt.hollowCircle,!1,n),xe(),O(),p.plotArea.annotationDraggable&&p.plotArea.dataLabels?Oi(dt,q,p,J(),re.DonutChart,H,g,$,Math.min(K*.5,Z*.5),o,h):b(),k()},Ae=()=>{try{se=0,S.forEach(d=>{d.properties.dataLabelPosition=="2"&&(ce=!0),se+=d.data[0].value})}catch(d){ge(Ma,"loopOverSeriesData",d)}},pe=()=>{try{B=Math.min(K*.4,Z*.4),ce&&(B=B*.9),N=Math.min(et(p.plotArea.innerRadius)/100*B,B)}catch(d){ge(Ma,"defineChartRadius",d)}},xe=()=>{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:B,depth:2}))}catch(d){ge(Ma,"initPieChartData",d)}},O=()=>{try{const d=p.animation.animationEnabled,c=T.arc().innerRadius(N).outerRadius(B),i=T.arc().innerRadius(N).outerRadius(B+10),f=$.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/se)*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+B)/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;$.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(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=>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:""}),$.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(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??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/se)*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(ne.bold)?ne.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+B/7:0).outerRadius(y=>y.depth>1?y.y1-1+B/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+B/1.5);$.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=B*1.1*(L<Math.PI?1:-1),ae=a[1];return[f,a,[P,ae]].map(Q=>Q.join(",")).join(" ")}),$.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 B*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/se)*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="
118
118
  font-size: ${y.data.properties.labelFontSize}px;
119
119
  color: ${y.data.properties.labelFontColor};
120
120
  font-style: ${y.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:""};
@@ -141,13 +141,13 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
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)}},v=()=>{try{if(p.total&&p.total.totalVisibility){let d=oe,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!==Fe.white?p.total.totalColor:"none").style("font-family",p.total.totalFontFamily).style("font-size",p.total.totalFontSize).style("font-style",c.includes(ne.italic)?ne.italic:"").style("text-decoration",c.includes(ne.underline)?ne.underline:"").style("font-weight",c.includes(ne.bold)?ne.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(ne.bold)?ne.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=fe.useRef(),s=fe.useRef(o);s.current=o;const x=fe.useRef(h);x.current=h;let m,A,u,S=40,p=Ht,H,g,G,V,j,q;fe.useEffect(()=>{Z()},[e]);const Z=()=>{({chartFormatOptions:m,svg:q,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(q,p),_t(l,S,A,m),Y(),N(),oe()},Y=()=>{try{const de={name:"root",children:t.ChartData},se=T.hierarchy(de).sum(he=>he.data&&he.data[0].value).sort((he,Ae)=>(Ae.data.data[0].value??0)-(he.data.data[0].value??0));V=T.treemap().tile(T.treemapSquarify).size([g,H]).padding(1).round(!0)(se).leaves(),j=V[0].data.properties.color}catch(de){ge(Ga,"initChartData",de)}},N=()=>{try{if(m.colorScale.showColor===ga.colorTheme){let se=V[0].data.data.length>1?1:0,he=m.colorScale.startColor,Ae=m.colorScale.endColor,pe=new Set(V.map(F=>F.data.data[se].value)),xe=Array.from(pe).sort((F,b)=>F-b),Q=xe.length,J;if(Q===1)J=()=>he;else{const F=T.interpolateLab(he,Ae);J=T.scaleOrdinal().domain(xe.map(String)).range(xe.map((b,v)=>F(v/(Q-1))))}V=V.map(F=>{let b=F.data.data[se].value;return{...F,data:{...F.data,properties:{...F.data.properties,themeColor:J(b.toString())}}}}),P(he,Ae,Q,xe)}}catch(de){ge(Ga,"prepareTreeColors",de)}},P=(de,se,he,Ae)=>{try{let pe=T.scalePow().exponent(1).domain([0,he-1]).range([de,se]),Q=q.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/he}%`).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=q.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");q.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=de=>{try{switch(m.colorScale.showColor){case ga.none:return j;case ga.discrete:return de.properties.color;case ga.colorTheme:return de.properties.themeColor;default:return}}catch(se){ge(Ga,"getColor",se)}},te=de=>{try{const se=de?.currentTarget?.__data__?.data?.properties;if(!se)return;switch(m.colorScale.showColor){case ga.none:return{...se,markerColor:j};case ga.colorTheme:return{...se,markerColor:se.themeColor};case ga.discrete:default:return se}}catch(se){ge(Ga,"getMarkerColorForTooltip",se)}},oe=()=>{try{const de=m.animation.animationEnabled,se=G.selectAll("g").data(V).enter().append("g").attr("transform",Ae=>`translate(${Ae.x0},${Ae.y0})`),he=se.append("rect").attr("fill",Ae=>z(Ae.data)).attr("fill-opacity",de?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,te(Ae),ht(n,String(pe.data.data[0]?.legend??""),te(Ae)))}).on("mouseout",()=>rt()).attr(Ke.SeriesId,Ae=>String(Ae.data.properties?.legendUniqueId??Ae.data.legend??"")).attr(Ke.DimValue,Ae=>String(Ae.data.data[0].legend??"")).on("click",gt(x,s,(Ae,pe)=>{const xe=String(pe.data.properties?.legendUniqueId??pe.data.legend??""),Q=String(pe.data.data[0].legend??"");return{seriesId:xe,dimValue:Q,legendUniqueId:xe,seriesDisplayName:String(pe.data.properties?.alias||pe.data.properties?.name||Q)}}));if(de&&he.transition().duration(m.animation.animationDuration).ease(Xe[m.animation.animationEffect]).attr("fill-opacity",.7),se.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;se.filter(pe=>{if(!Ae?.enabled)return!0;const xe=pe.data.data[0].value;switch(Ae.condition){case"lt":return xe<Ae.maxVal;case"gt":return xe>Ae.minVal;case"in":return xe>=Ae.minVal&&xe<=Ae.maxVal;case"not-in":return xe<Ae.minVal||xe>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(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,xe)=>`url(#clip-${xe}-${r})`),m.plotArea.dataLabelName&&se.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(pe=>pe.data.legend),m.plotArea.dataLabelValue&&se.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)),de&&se.selectAll("text").attr("opacity",0).transition().duration(m.animation.animationDuration).ease(Xe[m.animation.animationEffect]).attr("opacity",1)}}catch(de){ge(Ga,"initChartRect",de)}};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=fe.useRef();let l,s,x,m=40,A=Ht,u,S,p,H,g,G,V,j,q,Z,Y,N,P,z=[0,0],te,oe;fe.useEffect(()=>{de()},[e]);const de=()=>{({chartFormatOptions:l,svg:H,width:s,height:x}=Jt(n,e)),{plotArea:oe}=l,se(),{margins:A,innerHeight:u,innerWidth:S,legendListWidth:te,chartTitleHeight:m}=Na(l,s,x,z,A),he(),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()},se=()=>{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)}},he=()=>{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",`${Q()}`).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!==Fe.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 I=L;if(I.data.children&&I.data.children.length>1){p.selectAll(".childGroup").remove(),p.selectAll(".childLabels").remove(),p.selectAll("line").remove(),q=I.data.legend;let ae=90-(L.x0+L.x1)/2/Math.PI*180;xe(I.data.children,ae,L)}}catch(I){ge(ra,"drawPieChart_onClick",I)}});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 I=>i(L(I))}):f.attr("d",a=>i(a))}catch(i){ge(ra,"drawPieChart",i)}},xe=(i,y,f)=>{try{p.select(".parentGroup").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${Q()} rotate(${y})`),p.selectAll(".parentLabels").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${Q()} rotate(${y})`);let L=T.pie().value(K=>K.data[0].value)(i).map((K,be)=>({...K,x0:K.startAngle,x1:K.endAngle,y0:0,y1:V,depth:2}));const I=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",K=>"path "+K.data.legend).attr("hoverId",K=>K.data.legend.replace(/ /g,"-")).attr("fill",K=>K.data.properties.color!==Fe.white?K.data.properties.color:"none").attr("d",K=>I(K)).on("mouseover.arc",function(K){T.select(this).transition().duration(100).attr("d",ae)}).on("mousemove.text",K=>{st([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(K.currentTarget.__data__.data.data[0].value/j)*100).toFixed(et(l.toolTip.toolTipDecimalPrecision))+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(K.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:K.currentTarget.__data__.data.legend}],l,void 0,K.currentTarget.__data__.data.properties,ht(h,String(K.currentTarget.__data__.data.legend??""),K.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(K){T.select(this).transition().duration(100).attr("d",I),rt()}),v(L),d(f,i)}catch(a){ge(ra,"drawChildPie",a)}},Q=()=>{try{return Z=q?3*S/8:S/2,Y=u/2,`translate(${Z},${Y})`}catch(i){ge(ra,"getParentPiePosition",i)}},J=()=>{try{return N=3*S/4,P=u/2,`translate(${N},${P})`}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 I=f*180/Math.PI-90;return`translate(${a},${L}) rotate(${I})`}catch(f){ge(ra,"getDataLabelTransformString",f)}},b=()=>{try{l.plotArea.dataLabels&&(p.append("g").attr("class","parentLabels parentGroup").attr("transform",`${Q()}`).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??Fe.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=>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",`${Q()}`).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??Fe.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=>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)}},v=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??Fe.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=>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??Fe.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=>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),I=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+I).attr("y1",Y-L).attr("x2",N).attr("y2",P-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+I).attr("y1",Y+L).attr("x2",N).attr("y2",P+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=fe.useRef();let s=pt(t.ChartData),x,m,A,u,S=40,p=Ht,H=[0,0],g,G,V,j,q=[0],Z,Y,N,P;fe.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),te(),jt(l,A,u,x),Z=oe(),_t(l,S,A,x),Pa(x,m,s,A,u,N,S,r,p,nt.rectangle,!1,h),de(),se(),Ae(),he()},te=()=>{try{V=Math.min(g,G),j=.866*V}catch(xe){ge(da,"initPyramidSideCalculations",xe)}},oe=()=>{try{return m.append("g").attr("transform",`translate(${p.left},${p.top+(g-j)/2})`)}catch(xe){return ge(da,"initChartArea",xe),null}},de=()=>{try{s=s.sort((xe,Q)=>{const J=xe.data[0].value,F=Q.data[0].value;return x.plotArea.flipPyramid?F-J:J-F}),Y=T.sum(s,xe=>Math.abs(xe.data[0].value)),q=[0],s.forEach((xe,Q)=>{const J=Math.abs(xe.data[0].value)/Y*j;q.push(q[Q]+J)})}catch(xe){ge(da,"initPyramidData",xe)}},se=()=>{try{s.forEach((xe,Q)=>{try{const J=q[Q],F=q[Q+1];let b=x.plotArea.flipPyramid?1:0;const v=V*(b-q[Q]/j),d=V*(b-q[Q+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",xe.legend.replace(/\s+/g,"-")).attr("points",`
145
- ${c-v/2},${J}
146
- ${c+v/2},${J}
144
+ </span>`),a}catch(f){return ge(Ma,"drawDonutDataLabels",f),""}}),p.animation.animationEnabled&&$.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=se,c=p.total.totalFontStyle;const i=$.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(ne.italic)?ne.italic:"").style("text-decoration",c.includes(ne.underline)?ne.underline:"").style("font-weight",c.includes(ne.bold)?ne.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(ne.bold)?ne.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=fe.useRef(),s=fe.useRef(o);s.current=o;const x=fe.useRef(h);x.current=h;let m,A,u,S=40,p=Ht,H,g,G,V,j,K;fe.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),B(),N(),se()},B=()=>{try{const ce={name:"root",children:t.ChartData},oe=T.hierarchy(ce).sum(he=>he.data&&he.data[0].value).sort((he,Ae)=>(Ae.data.data[0].value??0)-(he.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(ce){ge(Ga,"initChartData",ce)}},N=()=>{try{if(m.colorScale.showColor===ga.colorTheme){let oe=V[0].data.data.length>1?1:0,he=m.colorScale.startColor,Ae=m.colorScale.endColor,pe=new Set(V.map(F=>F.data.data[oe].value)),xe=Array.from(pe).sort((F,b)=>F-b),O=xe.length,J;if(O===1)J=()=>he;else{const F=T.interpolateLab(he,Ae);J=T.scaleOrdinal().domain(xe.map(String)).range(xe.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(he,Ae,O,xe)}}catch(ce){ge(Ga,"prepareTreeColors",ce)}},E=(ce,oe,he,Ae)=>{try{let pe=T.scalePow().exponent(1).domain([0,he-1]).range([ce,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/he}%`).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)}},$=ce=>{try{switch(m.colorScale.showColor){case ga.none:return j;case ga.discrete:return ce.properties.color;case ga.colorTheme:return ce.properties.themeColor;default:return}}catch(oe){ge(Ga,"getColor",oe)}},q=ce=>{try{const oe=ce?.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)}},se=()=>{try{const ce=m.animation.animationEnabled,oe=G.selectAll("g").data(V).enter().append("g").attr("transform",Ae=>`translate(${Ae.x0},${Ae.y0})`),he=oe.append("rect").attr("fill",Ae=>$(Ae.data)).attr("fill-opacity",ce?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 xe=String(pe.data.properties?.legendUniqueId??pe.data.legend??""),O=String(pe.data.data[0].legend??"");return{seriesId:xe,dimValue:O,legendUniqueId:xe,seriesDisplayName:String(pe.data.properties?.alias||pe.data.properties?.name||O)}}));if(ce&&he.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 xe=pe.data.data[0].value;switch(Ae.condition){case"lt":return xe<Ae.maxVal;case"gt":return xe>Ae.minVal;case"in":return xe>=Ae.minVal&&xe<=Ae.maxVal;case"not-in":return xe<Ae.minVal||xe>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(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,xe)=>`url(#clip-${xe}-${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)),ce&&oe.selectAll("text").attr("opacity",0).transition().duration(m.animation.animationDuration).ease(Xe[m.animation.animationEffect]).attr("opacity",1)}}catch(ce){ge(Ga,"initChartRect",ce)}};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=fe.useRef();let l,s,x,m=40,A=Ht,u,S,p,H,g,G,V,j,K,Z,B,N,E,$=[0,0],q,se;fe.useEffect(()=>{ce()},[e]);const ce=()=>{({chartFormatOptions:l,svg:H,width:s,height:x}=Jt(n,e)),{plotArea:se}=l,oe(),{margins:A,innerHeight:u,innerWidth:S,legendListWidth:q,chartTitleHeight:m}=Na(l,s,x,$,A),he(),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);$=[i.width,i.height]}catch(i){ge(ra,"calculateMaxPossibleWidth",i)}},he=()=>{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;xe(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)}},xe=(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,B=u/2,`translate(${Z},${B})`}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(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=>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(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=>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(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=>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(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=>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",B-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",B+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=fe.useRef();let s=bt(t.ChartData),x,m,A,u,S=40,p=Ht,H=[0,0],g,G,V,j,K=[0],Z,B,N,E;fe.useEffect(()=>{$()},[e]);const $=()=>{({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=se(),_t(l,S,A,x),Pa(x,m,s,A,u,N,S,r,p,nt.rectangle,!1,h),ce(),oe(),Ae(),he()},q=()=>{try{V=Math.min(g,G),j=.866*V}catch(xe){ge(da,"initPyramidSideCalculations",xe)}},se=()=>{try{return m.append("g").attr("transform",`translate(${p.left},${p.top+(g-j)/2})`)}catch(xe){return ge(da,"initChartArea",xe),null}},ce=()=>{try{s=s.sort((xe,O)=>{const J=xe.data[0].value,F=O.data[0].value;return x.plotArea.flipPyramid?F-J:J-F}),B=T.sum(s,xe=>Math.abs(xe.data[0].value)),K=[0],s.forEach((xe,O)=>{const J=Math.abs(xe.data[0].value)/B*j;K.push(K[O]+J)})}catch(xe){ge(da,"initPyramidData",xe)}},oe=()=>{try{s.forEach((xe,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",xe.legend.replace(/\s+/g,"-")).attr("points",`
145
+ ${c-k/2},${J}
146
+ ${c+k/2},${J}
147
147
  ${c+d/2},${F}
148
148
  ${c-d/2},${F}
149
- `).attr("fill",xe.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{st([{key:xe.legend,value:x.toolTip.toolTipNumberFormat==",.0%"?xe.data[0].value?(Math.abs(xe.data[0].value/Y)*100).toFixed(et(x.toolTip.toolTipDecimalPrecision))+"%":"":je(x.toolTip.toolTipDisplayUnits,x.toolTip.toolTipNumberFormat,x.toolTip.toolTipDecimalPrecision)(xe.data[0].value)}],x,void 0,xe.properties,ht(n,String(xe.legend??""),xe.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(xe){ge(da,"drawPyramidChart",xe)}},he=xe=>{try{if(x.annotation.annotationVisibility){let Q=dt.annotation(),J=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None",F=Rt(P,x,d=>d.data.measure);const b=x.annotation.connectorStyle?.toLowerCase();Q.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}))),v.selectAll(".connector").attr("hoverId",c=>c.data.legend.replace(/\s+/g,"-")).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[b]),v.selectAll(`.connector-${J}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),v.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(),v.selectAll(".annotation-note-label").filter(c=>c.data&&c.data.isVisible).style("display","block"),v.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 v=Z.append("g").attr("class","annotation-group parentGroup").call(Q);x.animation.animationEnabled&&v.attr("opacity",0).transition().duration(x.animation.animationDuration).ease(Xe[x.animation.animationEffect]).attr("opacity",1),v.selectAll("rect").style("visibility","hidden"),v.selectAll(".annotation-subject").remove(),v.selectAll(".connector").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[b]),v.selectAll(`.connector-${J}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),v.selectAll(".note-line").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[b]).filter(d=>d._dx==0&&d._dy==0).remove(),v.selectAll(".connector-end").filter(d=>d.connector.end=="dot"&&d._dx==0&&d._dy==0).remove(),v.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"),v.selectAll(".annotation-note-title").filter(d=>d.data&&!d.data.isVisible).style("display","none"),x.annotation.annotationType==Wt.automatic&&v.selectAll(".annotation-note-content").attr("transform",function(){const c=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(c)return`translate(${parseFloat(c[1])}, 0)`}),v.selectAll(".annotation-note-label").attr("y","15").attr("text-anchor","middle"),v.selectAll(".annotation-note-title").attr("text-anchor","middle"),v.selectAll(".annotation-note-content").attr("transform","translate(0,-28)"),!x.plotArea.dataLabelName&&v.selectAll("tspan").attr("dy","0"),x.plotArea.dataLabelName&&v.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(ne.italic)?ne.italic:"").style("text-decoration",d=>d.data.labelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",d=>d.data.labelFontStyle.includes(ne.bold)?ne.bold:"300").style("fill",d=>d.data.labelFontColor),x.plotArea.dataLabelValue&&v.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(ne.italic)?ne.italic:"").style("text-decoration",d=>d.data.valueFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",d=>d.data.valueFontStyle.includes(ne.bold)?ne.bold:"300").style("fill",d=>d.data.valueFontColor)}}catch(Q){ge(da,"pyramidAnnotations",Q)}},Ae=()=>{try{let xe=x.annotation.annotationType??"1",Q=[xe=="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(v=>[v.data?.legend,v]));P=[],s.forEach((v,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?v.properties.alias:"",label:x.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(v.data[0].value/Y)*100).toFixed(et(x.plotArea.dataLabelDecimalPrecision))+"%":x.plotArea.dataLabelValue?v.data[0].value>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(v.data[0].value/1e9)+"B":je(x.annotation.annotationDisplayUnits,x.plotArea.dataLabelNumberFormat,x.plotArea.dataLabelDecimalPrecision)(v.data[0].value):"",align:"middle"},data:{x:G/2,y:pe(v,d,v.properties.dataLabelPosition),isVisible:!0,dimension:v.legend,legend:v.legend,measure:v.data[0].value,labelFontFamily:v.properties.labelFont,labelFontSize:v.properties.labelFontSize,labelFontColor:v.properties.labelFontColor,labelFontStyle:v.properties.labelFontStyle,valueFontFamily:v.properties.valueFont,valueFontSize:v.properties.valueFontSize,valueFontColor:v.properties.valueFontColor,valueFontStyle:v.properties.valueFontStyle},dx:0,dy:0,connector:{end:J,curve:ml[x.annotation.connectorCurve]},disable:Q,subject:{height:15,width:15},type:fl[xe],color:x.plotArea.dataLabelNameColor!=Fe.black?x.plotArea.dataLabelNameColor:Fe.black,height:A,width:A,index:d};const f=b.get(v.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),P.push(y)}catch(c){ge(da,"prepareNewAnnotationsList.forEach",c)}})}catch(xe){ge(da,"prepareNewAnnotationsList",xe)}},pe=(xe,Q,J)=>{try{switch(J){case ni.top:return q[Q]+30;case ni.middle:return(q[Q]+q[Q+1])/2+15;case ni.bottom:return q[Q+1];default:return q[Q]+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=fe.useRef();let l=pt(t),s,x,m,A=40,u=Ht,S=[0,0],p,H,g,G,V,j,q,Z;const Y=1,N=0;fe.useEffect(()=>{P()},[e]);const P=()=>{({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),te(),oe(),vi(s,g,A,V,x,m)},z=()=>{try{q=Math.min(p*.45,H*.45),Z=Math.min(et(s.plotArea.innerRadius)/100*q,q)}catch(se){ge(Ta,"setRadiusAndInnerRadius",se)}},te=()=>{try{g=t[Y].data[0].value+t[N].data[0].value}catch(se){ge(Ta,"initProgressChartData",se)}},oe=()=>{try{let se=t[Y].data[0].value,he=t[N].data[0].value,Ae=Math.PI*2,pe=he/se*Math.PI*2,xe=s.plotArea.dataLabelValueFontStyle;const Q=T.arc().innerRadius(Z).outerRadius(q).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("d",Q({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)(se)}],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",de()),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("d",Q({endAngle:pe})).on("mousemove",F=>{try{st([{key:t[N].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(he/se*100)+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(se)},{key:t[Y].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(he)}],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(v){try{return Q({endAngle:b(v)})}catch(d){return ge(Ta,"drawProgressChart.attrTween.inner",d),""}}}catch(b){return ge(Ta,"drawProgressChart.attrTween",b),()=>""}});const J=G.append("text").attr("transform",de()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>s.plotArea.dataLabels&&Gi([{value:he}],s,b=>b?.value??0).length>0?"visible":"hidden").attr("fill",s.plotArea.dataLabelValueColor!==Fe.white?s.plotArea.dataLabelValueColor:s.toolTip.toolTipDisplayUnits).attr("font-style",xe.includes(ne.italic)?ne.italic:"").attr("text-decoration",xe.includes(ne.underline)?ne.underline:"").attr("font-weight",xe.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/se*100)+"%":je(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormatProgress,s.plotArea.dataLabelDecimalPrecision)(he));s.animation.animationEnabled&&J.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1)}catch(se){ge(Ta,"drawProgressChart",se)}},de=()=>{try{return"translate("+H/2+","+p/2+")"}catch(se){return ge(Ta,"getTransformString",se),""}};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=fe.useRef(),h=pt(t);let n,l,s,x=40,m=Ht,A,u,S,p,H,g,G,V,j,q,Z,Y={},N;const P="Speedometer.tsx";fe.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),te(),jt(o,l,s,n),S=la(p,m),_t(o,x,l,n),de(),se(),Ae(),xe()},te=()=>{try{let b;A*.8<u*.45?(H=A*.8,b="width"):(H=u*.45,b="height"),N=oe(b),g=et(n.plotArea.innerRadiusForSpeedometer)/100*H}catch(b){ge(P,"initChartRadius",b)}};function oe(b){try{return b=="height"?`translate(${u/2},${A/2+H/2})`:`translate(${u/2},${s-60})`}catch(v){return ge(P,"centerTranslation",v),""}}const de=()=>{try{let b=t[0].data[0].value;b<0?(G=0,V=b):(G=b,V=0),n.customScaling.customScalingtoggle?q=100:q=et(n.plotArea.ticks)}catch(b){ge(P,"initSpeedometerData",b)}},se=()=>{try{j=[];let b=et(n.plotArea.ticks);if(n.customScaling.customScalingtoggle){for(let v=1;v<=b;v++){let d=n.customScaling[`share${v}`];if(j.length<100)for(let c=0;c<d;c++)j.push(n.customScaling[`division${v}`])}if(j.length<101)for(let v=j.length;v<100;v++)j.push(Fe.black)}else if(n.colorScale.showColor==ga.none){const v=t[0].properties?.color??"#bac8de";for(let d=1;d<=b;d++)j.push(v)}else if(n.colorScale.showColor==ga.discrete)for(let v=1;v<=b;v++)j.push(n.colorScale["division"+v]);else{let v=n.colorScale.startColor,d=n.colorScale.endColor;const c=T.scaleLinear().domain([0,b]).range([v,d]);for(let i=0;i<b;i++)j.push(c(i))}}catch(b){ge(P,"initColorTheme",b)}},he=(b,v,d)=>{try{let c=[],i=Math.abs(b)-Math.abs(v),y=Math.abs(i)/d,f=v>0?0:v;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(P,"setTickValues",c),[]}},Ae=()=>{try{switch(n.plotArea.dataLabelsOptions){case Wt.automatic:Z=pe();break;case Wt.startOnly:Z=[V];break;case Wt.endOnly:let v=Array(q).fill("");v[q]=G,Z=v;break;case Wt.startAndEndBoth:let d=Array(q).fill("");d[q]=G,d[0]=V,Z=d;break;case Wt.none:Z=[];break}}catch(b){ge(P,"setDataLabelsOptions",b)}},pe=()=>{try{let b,v=et(n.plotArea.ticks),d=he(G,V,q);if(n.customScaling.customScalingtoggle){let c=Array(100).fill("");c[0]=V;let i=0;for(let y=1;y<=v;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(P,"initTicksValues",b),[]}},xe=()=>{try{let v=function(d,c){try{let i=function(De){try{return De*Math.PI/180}catch(Ve){return ge(P,"deg2rad",Ve),0}},y=function(De){try{let Ve;for(Ve in De)O[Ve]=De[Ve];L=O.maxAngle-O.minAngle,ae=Math.round(H*O.pointerHeadLengthPercent),Le=T.scaleLinear().range([0,1]).domain([O.minValue,O.maxValue]),be=T.arc().innerRadius(g).outerRadius(H).startAngle((Ye,ie)=>{let ye=1/O.majorTicks*ie;return i(O.minAngle+ye*L)}).endAngle((Ye,ie)=>{let ye=1/O.majorTicks*(ie+1);return i(O.minAngle+ye*L)})}catch(Ve){ge(P,"configure",Ve)}},f=function(De,Ve){try{if(Ve===0){S.append("g").attr("class","arc").attr("transform",N).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,ue){let me=L/O.majorTicks*ue;return"rotate("+(O.minAngle+me)+") translate(0,"+(O.labelInset-H)+")"}).attr("text-anchor","middle").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==Fe.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%"?K=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,ue=Xe[n.animation.animationEffect];Ce.selectAll("text").attr("opacity",0).attr("transform",function(me,ce){const le=L/O.majorTicks*ce;return`rotate(${O.minAngle+le}) translate(0, ${O.labelInset-H+20})`}).transition().duration(ve).ease(ue).attr("opacity",1).attr("transform",function(me,ce){const le=L/O.majorTicks*ce;return`rotate(${O.minAngle+le}) translate(0, ${O.labelInset-H})`})}}n.pointerValue.showPointerValue&&h.length===2&&J(N);let Ye=[[O.pointerWidth/2,0],[0,-ae],[-(O.pointerWidth/2),0],[0,O.pointerTailLength],[O.pointerWidth/2,0]],ie=T.line().curve(T.curveLinear);ee=S.append("g").data([Ye]).attr("class","pointer").attr("transform",N).append("path").attr("d",Ve>0?ie:null).attr("transform","rotate("+O.minAngle+")").attr("fill",n.plotArea.pointerColor).on("mousemove",(Ne,Me)=>{st([{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()}),ee.selectAll("text").append("text").text(O.maxValue),a(De===void 0?0:De)}catch(Ye){ge(P,"gauge.render",Ye)}},a=function(De,Ve){try{Ve!==void 0&&y(Ve);let Ye=Le(De),ie=O.minAngle+Ye*L;ee.transition().duration(n.animation.animationEnabled?n.animation.animationDuration:0).ease(Xe[n.animation.animationEffect]).attr("transform","rotate("+ie+")")}catch(Ye){ge(P,"gauge.update",Ye)}},L,I,ae,K,be,Le,we,Te,ee,ke,O={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:q,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(P,"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++)v.render(Q(h[d],d),d)}catch(b){ge(P,"initSpeedometer",b)}};function Q(b,v){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(P,"setPointerofSpeedometer",d),0}}function J(b){try{let v="";if(n.pointerValue.kpiAlias)v=n.pointerValue.kpiAliasText;else switch(n.pointerValue.connectorKPIforSpeedometer){case Za.PointerValue:v="Pointer Value";break;case Za.Absolute:v="Absolute Value";break;case Za.CAGR:v="CAGR";break;case Za.PercentageGrowth:v="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!==Fe.white?n.pointerValue.pointerValueColor:"none").attr("font-style",d.includes(ne.italic)?ne.italic:"").attr("text-decoration",d.includes(ne.underline)?ne.underline:"").attr("font-weight",d.includes(ne.bold)?ne.bold:"").attr("font-family",n.pointerValue.pointerValueFontFamily).text(i=>`${v}: ${!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(v){ge(P,"setPointerValueText",v)}}function F(b,v){try{let d=b-v,c=1,i=parseInt(n.pointerValue.connectorKPIforSpeedometer),y,f;const a=n.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:d=v;break;case 2:d=Math.abs(d);break;case 3:return y=`.${a}%`,d=Math.pow(v/b,1/c)-1,f=T.format(y)(d),f;case 4:return y=`.${a}%`,d=Math.round(v/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(P,"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=fe.useRef(),l=pt(t);let s,x,m,A=40,u=Ht,S=[0,0],p,H,g,G,V,j;fe.useEffect(()=>{q()},[e]);const q=()=>{({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((oe,de)=>({...oe,index:de}));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(te){return Sa("RadialBarChart.tsx","getModifiedDataForLabels",te),z}},N=()=>{try{let z=function(Te,ee){try{const ke=T.interpolate(0,c(Math.abs(Te.data[0].value)));return O=>ae({...Te,endAngle:ke(O)},ee)}catch(ke){Sa("RadialBarChart.tsx","arcTween",ke)}},te=function(Te){try{return Te*180/F}catch(ee){Sa("RadialBarChart.tsx","radTodeg",ee)}},oe=function(Te){try{return Te*Math.PI/180}catch(ee){Sa("RadialBarChart.tsx","degToRad",ee)}},de=function(Te){try{return b+(L-(Te+1))*(I+v)}catch(ee){Sa("RadialBarChart.tsx","getInnerRadius",ee)}},se=function(Te){try{return de(Te)+I}catch(ee){Sa("RadialBarChart.tsx","getOuterRadius",ee)}},he=l.length>1?T.max(l,Te=>Te.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)(he),xe=s.plotArea.axialAxis?It(pe,et(s.plotArea.axialAxisDataLabelFontSize),s.plotArea.axialAxisDataLabelFontFamily).width+10:20;const Q=Math.min(p*.5,H*.5)-xe;let J=g.append("g").attr("transform",P()).attr("width",H).attr("height",p);const F=Math.PI,b=l.length>1?10:70,v=et(s.plotArea.arcPadding),d=et(s.plotArea.axialTicks);let c=T.scaleLinear().domain([0,he]).range([0,oe(360)]),i=c.ticks(d);i[i.length-1]==he&&i.pop();let y=i,f=l.map((Te,ee)=>Te.data[0].legend),a=l.reduce((Te,ee)=>Te+ee.data[0].value,0);const L=f.length,I=(Q-b-L*v)/L;let ae=T.arc().innerRadius((Te,ee)=>de(ee)).outerRadius((Te,ee)=>se(ee)).startAngle(0).endAngle(Te=>Te.endAngle),K=T.arc().innerRadius((Te,ee)=>de(ee)).outerRadius((Te,ee)=>se(ee)).startAngle(0).endAngle(oe(360)),be=J.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");s.plotArea.axialGrid&&be.append("circle").attr("r",(Te,ee)=>se(ee)+v).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",Te=>"rotate("+(te(c(Te))-90)+")");s.plotArea.axialGrid&&Le.append("line").attr("x2",Q).attr("stroke","#a9a9a9").attr("stroke-width",1),Le.append("text").attr("x",Q+10).attr("class","text-xs text-gray-600").style("text-anchor",Te=>c(Te)>=F&&c(Te)<2*F?"end":null).attr("transform",Te=>"rotate("+(90-te(c(Te)))+","+(Q+10)+",0)").text(Te=>je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(Te)).attr("fill",s.plotArea.axialAxisDataLabelColor!==Fe.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=J.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",Te=>Te.data[0].legend.replaceAll(" ","-")).attr("fill",Te=>Te.properties.color).attr("d",(Te,ee)=>ae({...Te,endAngle:0},ee)).on("mousemove",(Te,ee)=>{st([{key:s.yAxisTitle.yAxisTitleText,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(ee.data[0].value/a)*100).toFixed(et(s.toolTip.toolTipDecimalPrecision))+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ee.data[0].value)},{key:"Legend",value:ee.properties.alias}],s,void 0,ee.properties,ht(h,String(ee.data[0]?.legend??""),ee.properties))}).on("mouseout",()=>{rt()});if(s.animation.animationEnabled?we.transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attrTween("d",z):we.attr("d",(Te,ee)=>ae({...Te,endAngle:c(Math.abs(Te.data[0].value))},ee)),s.plotArea.dataLabels){const Te=Gi(Y(t),s,ke=>ke?.data?.[0]?.value??0),ee=J.selectAll(".arc-label-"+r).data(Te).enter().append("text").attr("class","arc-label-"+r).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(ke,O)=>(se(ke.index??O)-de(ke.index??O))/1.75);ee.append("textPath").attr("xlink:href",(ke,O)=>`#arc-path-${ke.index??O}-`+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!==Fe.white?s.plotArea.dataLabelValueColor:"none").style("font-size",s.plotArea.dataLabelValueFontSize).style("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-style",Ae.includes(ne.italic)?ne.italic:"").attr("text-decoration",Ae.includes(ne.underline)?ne.underline:"").attr("font-weight",Ae.includes(ne.bold)?ne.bold:"").on("mousemove",(ke,O)=>{st([{key:s.yAxisTitle.yAxisTitleText,value:je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)(O.data[0].value)},{key:"Legend",value:O.properties.alias}],s,ke,O.properties,ht(h,String(O.data[0]?.legend??""),O.properties))}).on("mouseout",()=>{rt()}),s.animation.animationEnabled&&ee.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1),we.each((ke,O)=>{J.append("path").attr("id",`arc-path-${O}-`+r).attr("d",K(ke,O)).attr("fill","none").attr("stroke","none")})}}catch(z){Sa("RadialBarChart.tsx","initRadialBarChart",z)}},P=()=>{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=fe.useRef();let n=pt(t),l,s,x,m=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,p,H,g,G,V,j=0;fe.useEffect(()=>{q()},[e]);const q=()=>{({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 P=N.data[0].value;return j+=P,l.plotArea.hideZeroValues&&P==0?null:(P<m&&(m=P),P>A&&(A=P),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(oe){try{g.append("g").attr("transform","translate("+te.size()[0]/2+","+te.size()[1]/2+")").selectAll("text").data(oe).enter().append("text").attr("font-size",function(de){try{return V(de.data[0].value)+"px"}catch(se){return ge(ya,"draw-font-size",se),"12px"}}).attr("text-anchor","middle").style("font-family",l.text.textFontFamily).attr("fill",function(de){try{return de.properties.color!==Fe.white?de.properties.color:"none"}catch(se){return ge(ya,"draw-fill",se),"none"}}).attr("transform",function(de){try{return"translate("+[de.x,de.y]+")rotate("+de.rotate+")"}catch(se){return ge(ya,"draw-transform",se),""}}).text(function(de){try{return de.properties.alias}catch(se){return ge(ya,"draw-text",se),""}}).on("mousemove.text",(de,se)=>{try{st([{key:se.properties.alias,value:je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(se.data[0].value)},{key:se.properties.measureUniqueId,value:j}],l,void 0,se.properties,ht(o,String(se.properties.alias??""),se.properties))}catch(he){ge(ya,"draw-mousemove",he)}}).on("mouseout.text",()=>{try{rt()}catch(de){ge(ya,"draw-mouseout",de)}})}catch(de){ge(ya,"draw",de)}},P=l.text.textSpacing,z=l.text.textRotation,te=yl().size([H,p]).words(n).padding(P).rotate(function(){try{return Math.round(Math.random())*z}catch(oe){return ge(ya,"rotate",oe),0}}).random(()=>.5).font(l.text.textFontFamily).fontWeight("bolder").fontSize(function(oe){try{return V(oe.data[0].value)}catch(de){return ge(ya,"fontSize",de),12}}).text(function(oe){try{return oe.properties.alias}catch(de){return ge(ya,"text",de),""}}).on("end",N);te.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=fe.useRef();let h=pt(t),n,l,s,x=40,m=Ht,A,u,S,p=[0,0],H,g;fe.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(),q()},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(ne.italic)?ne.italic:"").attr("text-decoration",Z.includes(ne.underline)?ne.underline:"").style("font-weight",Z.includes(ne.bold)?ne.bold:"").html(P=>P.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!==Fe.white?n.plotArea.dataLabelValueColor:"none").style("font-style",Y.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",Y.includes(ne.underline)?ne.underline:"none").style("font-weight",Y.includes(ne.bold)?ne.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(P=>P.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(P.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(ne.italic)?ne.italic:"").attr("text-decoration",Z.includes(ne.underline)?ne.underline:"").style("font-weight",Z.includes(ne.bold)?ne.bold:"").html(P=>P.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!==Fe.white?n.plotArea.dataLabelValueColor:"none").style("font-style",Y.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",Y.includes(ne.underline)?ne.underline:"none").style("font-weight",Y.includes(ne.bold)?ne.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(P=>P.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(P.actualValue):"").attr("visibility",n.plotArea.intersectionValueVisibility?"visible":"hidden"),N&&N.selectAll(".venn-circle path").style("fill",P=>P.properties?P.properties.color:null),N&&N.selectAll("g").on("mousemove",function(P,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(P,z){rt();var te=T.select(this).transition("tooltip").duration(400);te.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 P=It(N.legendDisplay+" : "+N.actualValue,et(n.legends.legendFontSize),n.legends.legendFontFamily);Z=Math.max(Z,P.width),Y=Math.max(Y,P.height)}}),[Z,Y]}catch(Z){return ge("VennChart.tsx","calculateLegendsMaxPossibleWidth",Z),[0,0]}},q=()=>{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=fe.useRef(),m=fe.useRef(o);m.current=o;const A=fe.useRef(h);A.current=h;let u,S,p,H=40,g=Ht,G,V,j,q,Z=Oa.left,Y=0,N=!1,P=new Map,z=new Map,te=.8,oe=.8;fe.useEffect(()=>{de()},[t]);const de=()=>{({chartFormatOptions:u,svg:q,width:S,height:p}=Jt(x,t)),{margins:g,chartTitleHeight:H,innerHeight:G,innerWidth:V}=Qa(u,p,S),se(),jt(x,S,p,u),j=la(q,g),_t(x,H,S,u),pe()},se=()=>{try{te=et(u.nodes.nodesFillOpacity),oe=et(u.links.linksFillOpacity),s.forEach(b=>{b.totalValue=0}),s.forEach(b=>l.forEach(v=>(b.name==v.source||b.name==v.target)&&(b.totalValue=(b.totalValue||0)+v.value))),s=s.filter(b=>b.totalValue!=0),l=l.filter(b=>b.value!=0);let J=xe(l),F=new Map;J.forEach(b=>{b.nodes.forEach(v=>{F.set(v,b.layer)})}),s.forEach(b=>{let v=F.get(b.name);P.set(v,(P.get(v)||0)+b.totalValue)}),s.forEach(b=>{z.set(b.name,b.totalValue/P.get(F.get(b.name))*100)}),he(J)}catch(J){ge("SankeyChart.tsx","prepareDataForSankey",J)}},he=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 v=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(v.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,v=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(v).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,we)=>Le.y0-we.y0);const I=L[0],ae=L[L.length-1],K=I.y1-I.y0,be=ae.y1-ae.y0;if(I.y0=0,I.y1=K,ae.y1=G,ae.y0=G-be,L.length>2){const Le=L.slice(1,L.length-1),we=ae.y0-I.y1,Te=T.sum(Le,O=>O.y1-O.y0),ee=(we-Te)/(Le.length+1);let ke=I.y1+ee;Le.forEach(O=>{const De=O.y1-O.y0;O.y0=ke,O.y1=ke+De,ke+=De+ee})}})}catch(f){ge("SankeyChart.tsx","centerAlignNodesByLayer",f)}},F=function(){try{d.forEach(f=>{let a=0,L=0;f.sourceLinks.forEach(I=>{I.sy=a,a+=I.width}),f.targetLinks.forEach(I=>{I.ty=L,L+=I.width})})}catch(f){ge("SankeyChart.tsx","arrangeFlows",f)}},b=function(f){return function(a){try{const L=a.source.x1,I=a.source.y0+a.sy+a.width/2,ae=a.target.x0,K=a.target.y0+a.ty+a.width/2,be=ae-L,Le=L+be*f,we=ae-be*f;return`M${L},${I} C${Le},${I} ${we},${K} ${ae},${K}`}catch(L){return ge("SankeyChart.tsx","sankeyLinkCustom",L),""}}},v=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",te).attr("id",f=>"Node"+f.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==Fe.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:Fe.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!==Fe.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",te).style("cursor","pointer"),j.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(L=>{j.select(`#Node${L.target.index}`).style("fill-opacity",te).style("stroke",u.nodes.nodesBorderColor!==Fe.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${L.index}`).style("stroke-opacity",oe),j.select(`#Label${L.target.index}`).style("opacity",1)}),a.targetLinks.forEach(L=>{j.select(`#Node${L.source.index}`).style("fill-opacity",te).style("stroke",u.nodes.nodesBorderColor!==Fe.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${L.index}`).style("stroke-opacity",oe),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",te).style("stroke",u.nodes.nodesBorderColor!==Fe.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",oe),j.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&rt()}catch(a){ge("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(Ke.SeriesId,f=>String(f.name??"")).attr(Ke.DimValue,f=>String(f.name??"")).on("click",gt(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",oe).attr("id",f=>"Link"+f.index).attr("d",b(v)).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",oe).style("cursor","pointer"),j.select(`#Node${a.target.index}`).style("fill-opacity",te).style("Stroke",u.nodes.nodesBorderColor!==Fe.white?u.nodes.nodesBorderColor:"none"),j.select(`#Node${a.source.index}`).style("fill-opacity",te).style("Stroke",u.nodes.nodesBorderColor!==Fe.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",te),j.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==Fe.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",oe),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(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(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,I=Z===Oa.center;T.select(this).append("foreignObject").attr("x",Q(a).x).attr("y",Q(a).y-16).attr("width",be=>I?L:Y).attr("height",20).append("xhtml:div").style("white-space",I||N?"nowrap":"normal").style("overflow",I||N?"hidden":"visible").style("text-overflow",I||N?"ellipsis":"clip").style("display","block").style("max-width",be=>I?"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(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",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",Q(a).x).attr("y",Q(a).y).attr("width",be=>I?L:Y).attr("height",20).append("xhtml:div").style("white-space",I||N?"nowrap":"normal").style("overflow",I||N?"hidden":"visible").style("text-overflow",I||N?"ellipsis":"clip").style("display","block").style("max-width",be=>I?"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(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",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 xe(J){try{const F=new Map,b=new Map,v=new Set;for(const{source:f,target:a}of J)v.add(f),v.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 v)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 I of L){const ae=a+1;(!d.has(I)||d.get(I)<ae)&&(d.set(I,ae),c.push(I))}}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 Q=J=>{try{let F={};const b=Number(u.nodes.sankeyNodeWidth),v=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+v-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=fe.useRef();let n=pt(t),l,s,x,m=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,p,H,g,G,V=0,j=1,q,Z=new Map,Y=new Map,N=new Map,P=Number.MAX_VALUE,z=Number.MIN_VALUE,te=0,oe=0,de,se;fe.useEffect(()=>{he()},[r,o]);const he=()=>{({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(),xe(),Q()},Ae=F=>{try{let b=new Set,v=new Set;F.forEach(i=>{i.data.forEach((y,f)=>{f===V&&(b.add(y.value.toString()),te+=y.value),f===j&&(v.add(y.value.toString()),oe+=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)de=()=>d;else{const i=T.interpolateLab(d,c);de=T.scaleOrdinal().domain(Array.from(b)).range(Array.from(b).map((y,f)=>i(f/(b.size-1))))}if(v.size===1)se=()=>d;else{const i=T.interpolateLab(l.colorScaleForMapsBubble.startColorForMapsBubble,l.colorScaleForMapsBubble.endColorForMapsBubble);se=T.scaleOrdinal().domain(Array.from(v)).range(Array.from(v).map((y,f)=>i(f/(v.size-1))))}}catch(b){ge("Maps.tsx","dataPreparation",b)}},pe=F=>{q=Mr},xe=()=>{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)})}),q.features.forEach(F=>{const b=F.properties.name;let v;if(Y.has(b)){const d=Y.get(b);F.properties.displayName=d,v=d}if(Z.has(b)){const d=Z.get(b);F.properties.displayName=d,v=d}else v=b;if(N.has(v)){const d=N.get(v);F.properties.data=d;let c;d.data&&d.data[1]&&(c=d.data[1]?d.data[1].value:0,P=Math.min(P,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)}},Q=()=>{try{let F=0;const b=T.geoAlbersUsa().fitSize([H,p],q),v=T.geoPath().projection(b),d=g.append("g").attr("class","paths");if(d.selectAll(o+" .path-group").data(q.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+=v.area(c),v(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/q.features.length,i=l.plotArea.dataLabelName,y=l.plotArea.dataLabelValue,f=a=>l.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?v.area(a)<c*.25:!1;d.selectAll(".text-container").data(q.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>v.centroid(a)[0]-50).attr("y",a=>{const L=v.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 I=L?.properties.alias||a.properties.displayName,ae=l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/te*100)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let K="";return l.plotArea.dataLabelName&&(K+=`<div style=
149
+ `).attr("fill",xe.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{st([{key:xe.legend,value:x.toolTip.toolTipNumberFormat==",.0%"?xe.data[0].value?(Math.abs(xe.data[0].value/B)*100).toFixed(et(x.toolTip.toolTipDecimalPrecision))+"%":"":je(x.toolTip.toolTipDisplayUnits,x.toolTip.toolTipNumberFormat,x.toolTip.toolTipDecimalPrecision)(xe.data[0].value)}],x,void 0,xe.properties,ht(n,String(xe.legend??""),xe.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(xe){ge(da,"drawPyramidChart",xe)}},he=xe=>{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(ne.italic)?ne.italic:"").style("text-decoration",d=>d.data.labelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",d=>d.data.labelFontStyle.includes(ne.bold)?ne.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(ne.italic)?ne.italic:"").style("text-decoration",d=>d.data.valueFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",d=>d.data.valueFontStyle.includes(ne.bold)?ne.bold:"300").style("fill",d=>d.data.valueFontColor)}}catch(O){ge(da,"pyramidAnnotations",O)}},Ae=()=>{try{let xe=x.annotation.annotationType??"1",O=[xe=="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/B)*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[xe],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(xe){ge(da,"prepareNewAnnotationsList",xe)}},pe=(xe,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=fe.useRef();let l=bt(t),s,x,m,A=40,u=Ht,S=[0,0],p,H,g,G,V,j,K,Z;const B=1,N=0;fe.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),$(),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(),se(),vi(s,g,A,V,x,m)},$=()=>{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[B].data[0].value+t[N].data[0].value}catch(oe){ge(Ta,"initProgressChartData",oe)}},se=()=>{try{let oe=t[B].data[0].value,he=t[N].data[0].value,Ae=Math.PI*2,pe=he/oe*Math.PI*2,xe=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[B].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressScale).attr("hoverId",F=>(t[B]?.properties?.alias||t[B]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",O({endAngle:Ae})).on("mousemove",F=>{try{st([{key:t[B].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(oe)}],s,void 0,t[B].properties,ht(h,String(t[B].properties?.alias??""),t[B].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",ce()),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("d",O({endAngle:pe})).on("mousemove",F=>{try{st([{key:t[N].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[B].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(he)}],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",ce()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>s.plotArea.dataLabels&&Gi([{value:he}],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",xe.includes(ne.italic)?ne.italic:"").attr("text-decoration",xe.includes(ne.underline)?ne.underline:"").attr("font-weight",xe.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&&J.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1)}catch(oe){ge(Ta,"drawProgressChart",oe)}},ce=()=>{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=fe.useRef(),h=bt(t);let n,l,s,x=40,m=Ht,A,u,S,p,H,g,G,V,j,K,Z,B={},N;const E="Speedometer.tsx";fe.useEffect(()=>{$()},[e]);const $=()=>{({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),ce(),oe(),Ae(),xe()},q=()=>{try{let b;A*.8<u*.45?(H=A*.8,b="width"):(H=u*.45,b="height"),N=se(b),g=et(n.plotArea.innerRadiusForSpeedometer)/100*H}catch(b){ge(E,"initChartRadius",b)}};function se(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 ce=()=>{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)}},he=(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=he(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),[]}},xe=()=>{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).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,ue){let me=L/ee.majorTicks*ue;return"rotate("+(ee.minAngle+me)+") 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(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/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,ue=Xe[n.animation.animationEffect];Ce.selectAll("text").attr("opacity",0).attr("transform",function(me,de){const le=L/ee.majorTicks*de;return`rotate(${ee.minAngle+le}) translate(0, ${ee.labelInset-H+20})`}).transition().duration(ve).ease(ue).attr("opacity",1).attr("transform",function(me,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,Te,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 B.configure=y,B.render=f,B.update=a,y(c),B}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(ne.italic)?ne.italic:"").attr("text-decoration",d.includes(ne.underline)?ne.underline:"").attr("font-weight",d.includes(ne.bold)?ne.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=fe.useRef(),l=bt(t);let s,x,m,A=40,u=Ht,S=[0,0],p,H,g,G,V,j;fe.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($=>{V+=$.data[0].value})}catch($){Sa("RadialBarChart.tsx","loopOverChartData",$)}},B=$=>{try{switch(s.plotArea.dataLabelsOptions){case Wt.automatic:return $.map((se,ce)=>({...se,index:ce}));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(q){return Sa("RadialBarChart.tsx","getModifiedDataForLabels",q),$}},N=()=>{try{let $=function(Te,te){try{const ke=T.interpolate(0,c(Math.abs(Te.data[0].value)));return ee=>ae({...Te,endAngle:ke(ee)},te)}catch(ke){Sa("RadialBarChart.tsx","arcTween",ke)}},q=function(Te){try{return Te*180/F}catch(te){Sa("RadialBarChart.tsx","radTodeg",te)}},se=function(Te){try{return Te*Math.PI/180}catch(te){Sa("RadialBarChart.tsx","degToRad",te)}},ce=function(Te){try{return b+(L-(Te+1))*(P+k)}catch(te){Sa("RadialBarChart.tsx","getInnerRadius",te)}},oe=function(Te){try{return ce(Te)+P}catch(te){Sa("RadialBarChart.tsx","getOuterRadius",te)}},he=l.length>1?T.max(l,Te=>Te.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)(he),xe=s.plotArea.axialAxis?It(pe,et(s.plotArea.axialAxisDataLabelFontSize),s.plotArea.axialAxisDataLabelFontFamily).width+10:20;const O=Math.min(p*.5,H*.5)-xe;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,he]).range([0,se(360)]),i=c.ticks(d);i[i.length-1]==he&&i.pop();let y=i,f=l.map((Te,te)=>Te.data[0].legend),a=l.reduce((Te,te)=>Te+te.data[0].value,0);const L=f.length,P=(O-b-L*k)/L;let ae=T.arc().innerRadius((Te,te)=>ce(te)).outerRadius((Te,te)=>oe(te)).startAngle(0).endAngle(Te=>Te.endAngle),Q=T.arc().innerRadius((Te,te)=>ce(te)).outerRadius((Te,te)=>oe(te)).startAngle(0).endAngle(se(360)),be=J.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");s.plotArea.axialGrid&&be.append("circle").attr("r",(Te,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",Te=>"rotate("+(q(c(Te))-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",Te=>c(Te)>=F&&c(Te)<2*F?"end":null).attr("transform",Te=>"rotate("+(90-q(c(Te)))+","+(O+10)+",0)").text(Te=>je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(Te)).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(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 Fe=J.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",Te=>Te.data[0].legend.replaceAll(" ","-")).attr("fill",Te=>Te.properties.color).attr("d",(Te,te)=>ae({...Te,endAngle:0},te)).on("mousemove",(Te,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",$):Fe.attr("d",(Te,te)=>ae({...Te,endAngle:c(Math.abs(Te.data[0].value))},te)),s.plotArea.dataLabels){const Te=Gi(B(t),s,ke=>ke?.data?.[0]?.value??0),te=J.selectAll(".arc-label-"+r).data(Te).enter().append("text").attr("class","arc-label-"+r).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(ke,ee)=>(oe(ke.index??ee)-ce(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(ne.italic)?ne.italic:"").attr("text-decoration",Ae.includes(ne.underline)?ne.underline:"").attr("font-weight",Ae.includes(ne.bold)?ne.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($){Sa("RadialBarChart.tsx","initRadialBarChart",$)}},E=()=>{try{return`translate(${H/2},${p/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",vr=({data:{ChartData:t},formatOptions:e,chartId:r,tooltipFormatter:o})=>{const h=fe.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;fe.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(),B()},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)}},B=()=>{try{let N=function(se){try{g.append("g").attr("transform","translate("+q.size()[0]/2+","+q.size()[1]/2+")").selectAll("text").data(se).enter().append("text").attr("font-size",function(ce){try{return V(ce.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(ce){try{return ce.properties.color!==we.white?ce.properties.color:"none"}catch(oe){return ge(ya,"draw-fill",oe),"none"}}).attr("transform",function(ce){try{return"translate("+[ce.x,ce.y]+")rotate("+ce.rotate+")"}catch(oe){return ge(ya,"draw-transform",oe),""}}).text(function(ce){try{return ce.properties.alias}catch(oe){return ge(ya,"draw-text",oe),""}}).on("mousemove.text",(ce,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(he){ge(ya,"draw-mousemove",he)}}).on("mouseout.text",()=>{try{rt()}catch(ce){ge(ya,"draw-mouseout",ce)}})}catch(ce){ge(ya,"draw",ce)}},E=l.text.textSpacing,$=l.text.textRotation,q=yl().size([H,p]).words(n).padding(E).rotate(function(){try{return Math.round(Math.random())*$}catch(se){return ge(ya,"rotate",se),0}}).random(()=>.5).font(l.text.textFontFamily).fontWeight("bolder").fontSize(function(se){try{return V(se.data[0].value)}catch(ce){return ge(ya,"fontSize",ce),12}}).text(function(se){try{return se.properties.alias}catch(ce){return ge(ya,"text",ce),""}}).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=fe.useRef();let h=bt(t),n,l,s,x=40,m=Ht,A,u,S,p=[0,0],H,g;fe.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,B=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(ne.italic)?ne.italic:"").attr("text-decoration",Z.includes(ne.underline)?ne.underline:"").style("font-weight",Z.includes(ne.bold)?ne.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",B.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",B.includes(ne.underline)?ne.underline:"none").style("font-weight",B.includes(ne.bold)?ne.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(ne.italic)?ne.italic:"").attr("text-decoration",Z.includes(ne.underline)?ne.underline:"").style("font-weight",Z.includes(ne.bold)?ne.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",B.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",B.includes(ne.underline)?ne.underline:"none").style("font-weight",B.includes(ne.bold)?ne.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,$){st([{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(E,$){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,B=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),B=Math.max(B,E.height)}}),[Z,B]}catch(Z){return ge("VennChart.tsx","calculateLegendsMaxPossibleWidth",Z),[0,0]}},K=()=>{try{let Z=n.legends.legendPosition,B=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,B,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,B,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=fe.useRef(),m=fe.useRef(o);m.current=o;const A=fe.useRef(h);A.current=h;let u,S,p,H=40,g=Ht,G,V,j,K,Z=Oa.left,B=0,N=!1,E=new Map,$=new Map,q=.8,se=.8;fe.useEffect(()=>{ce()},[t]);const ce=()=>{({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),se=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=xe(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=>{$.set(b.name,b.totalValue/E.get(F.get(b.name))*100)}),he(J)}catch(J){ge("SankeyChart.tsx","prepareDataForSankey",J)}},he=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);B=Math.max(k.width,d.width)+6,N&&(B=Math.min(V*.1,B))}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-B,G];break;case Oa.left:d=[B,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,Te=T.sum(Le,ee=>ee.y1-ee.y0),te=(Fe-Te)/(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%"?$.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",se),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",se),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",se),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",se).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",se).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",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){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(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(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:B).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":B+"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",be=>$.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=>$.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:B).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":B+"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",be=>$.get(be.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(be.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(be.totalValue):"").text(be=>$.get(be.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.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 xe(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-B;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=fe.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,B=new Map,N=new Map,E=Number.MAX_VALUE,$=Number.MIN_VALUE,q=0,se=0,ce,oe;fe.useEffect(()=>{he()},[r,o]);const he=()=>{({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(),xe(),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()),se+=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)ce=()=>d;else{const i=T.interpolateLab(d,c);ce=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},xe=()=>{try{n?.forEach(F=>{N.set(F.legend,F)}),e.mappings.forEach(F=>{B.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(B.has(b)){const d=B.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),$=Math.max($,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=
151
151
  "text-align:center;
152
152
  font-family:${a.properties.data.properties.labelFont};
153
153
  font-size:${a.properties.data.properties.labelFontSize}px;
@@ -155,8 +155,8 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
155
155
  font-style:${a.properties.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:"normal"};
156
156
  text-decoration:${a.properties.data.properties.labelFontStyle.includes(ne.underline)?ne.underline:"none"};
157
157
  color:${a.properties.data.properties.labelFontColor};">
158
- ${I??""}
159
- </div>`),l.plotArea.dataLabelValue&&(K+=`<div style=
158
+ ${P??""}
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
162
  font-weight:${a.properties.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"normal"};
@@ -164,12 +164,12 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
164
164
  text-decoration:${a.properties.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:"none"};
165
165
  color:${a.properties.data.properties.valueFontColor};">
166
166
  ${ae??""}
167
- </div>`),K}return null})}if(l.bubbleformatting.showBubble){let c=Math.min(H,p);const i=T.scaleLinear().domain([P,z]).range([c*.01,c*.07]);g.selectAll("myCircles").data(q.features).join("circle").attr("cx",y=>v.centroid(y)[0]).attr("cy",y=>v.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"?se(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/oe*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?de(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=fe.useRef(),l=fe.useRef();let s,x,m,A=40,u=Ht,S,p=new Map,H=new Map,g=zt.left,G=[],V=0,j=0,q,Z=new Map,Y,N=Number.NEGATIVE_INFINITY,P=Number.POSITIVE_INFINITY,z;fe.useEffect(()=>{te()},[h,t,e]);const te=()=>{({chartFormatOptions:s,svg:S,width:x,height:m}=Jt(n,e)),se(),Y=oe(Z),{margins:u,innerHeight,innerWidth,legendListWidth:q,chartTitleHeight:A}=Na(s,x,m,Y,u),jt(n,x,m,s),_t(n,A,x,s),he(),J(G),de()},oe=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]},de=()=>{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,q,A,h,u,nt.rectangle,void 0)},se=()=>{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=Q(y).filter(a=>a.value!==null);i!=="default"&&(f=f.sort((a,L)=>i==="asc"?a.value-L.value:L.value-a.value)),xe(f),Ae(f),G=pe(f),s.heatMap.showHeatMap&&(z=T.scaleSequential().domain([P,N]).interpolator(T.interpolateRgb(s.heatMap.heatMapMinColor,s.heatMap.heatMapMaxColor)))}catch(i){ge(na,"dataPreparation",i)}},he=()=>{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),P=Math.min(P,i.value)}),d}catch(c){ge(na,"addStyleObjectToChartData",c)}},xe=d=>{try{d.forEach((c,i)=>{p.set(c.id,i)})}catch(c){ge(na,"createIdIndexMap",c)}},Q=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,I,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 K=(a.y+L.y)/2;return`M ${a.x},${a.y} C ${a.x},${K} ${L.x},${K} ${L.x},${L.y}`;case ca.arc:const be=L.x-a.x,Le=L.y-a.y,we=Math.sqrt(be*be+Le*Le);return`M ${a.x},${a.y} A ${we},${we} 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 Te=(a.y+L.y)/2;return`M ${a.x},${a.y} L ${a.x},${Te-10} L ${L.x},${Te+10} L ${L.x},${L.y}`}else if(g==zt.bottom){const Te=(a.y+L.y)/2;return`
167
+ </div>`),Q}return null})}if(l.bubbleformatting.showBubble){let c=Math.min(H,p);const i=T.scaleLinear().domain([E,$]).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/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(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?ce(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=fe.useRef(),l=fe.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,B,N=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,$;fe.useEffect(()=>{q()},[h,t,e]);const q=()=>{({chartFormatOptions:s,svg:S,width:x,height:m}=Jt(n,e)),oe(),B=se(Z),{margins:u,innerHeight,innerWidth,legendListWidth:K,chartTitleHeight:A}=Na(s,x,m,B,u),jt(n,x,m,s),_t(n,A,x,s),he(),J(G),ce()},se=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]},ce=()=>{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)),xe(f),Ae(f),G=pe(f),s.heatMap.showHeatMap&&($=T.scaleSequential().domain([E,N]).interpolator(T.interpolateRgb(s.heatMap.heatMapMinColor,s.heatMap.heatMapMaxColor)))}catch(i){ge(na,"dataPreparation",i)}},he=()=>{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)}},xe=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 Te=(a.y+L.y)/2;return`M ${a.x},${a.y} L ${a.x},${Te-10} L ${L.x},${Te+10} L ${L.x},${L.y}`}else if(g==zt.bottom){const Te=(a.y+L.y)/2;return`
168
168
  M ${a.x},${a.y}
169
169
  L ${a.x},${Te+10}
170
170
  L ${L.x},${Te-10}
171
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,I,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 K=(a.x+L.x)/2;return`M ${a.x},${a.y} C ${K},${a.y} ${K},${L.y} ${L.x},${L.y}`;case ca.arc:if(g==zt.left){const be=L.x-a.x,Le=L.y-a.y,we=Math.sqrt(be*be+Le*Le);return`M ${a.x},${a.y} A ${we},${we} 0 0,1 ${L.x},${L.y}`}else if(g==zt.right){const be=a.x-L.x,Le=L.y-a.y,we=Math.sqrt(be*be+Le*Le);return`M ${a.x},${a.y} A ${we},${we} 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`
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`
173
173
  M ${a.x},${a.y}
174
174
  L ${be-10},${a.y}
175
175
  L ${be+10},${L.y}
@@ -179,16 +179,16 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
179
179
  L ${be+10},${a.y}
180
180
  L ${be-10},${L.y}
181
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",I=["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",I?`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 I=`${a.data.styleObject.borderRadius}px`,ae="",K="",be="",Le="",we="";switch(i){case ei.rounded:I="10px";break;case ei.pill:I="999px";break;case ei.extra_rounded:I="20px";break;case ei.squircle:I="25%";break;default:I="1px";break}return we=`
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=`
183
183
  border-width: ${a.data.styleObject.borderWidth}px
184
184
  border-style:${s.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"}
185
185
  border-color:${a.data.styleObject.borderColor};
186
- border-radius: ${I};
186
+ border-radius: ${P};
187
187
  `,`<div hoverId="${a.data.label}" style="
188
188
  border-width: ${a.data.styleObject.borderWidth}px;
189
189
  border-style:${s.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"} ;
190
190
  border-color:${a.data.styleObject.borderColor};
191
- border-radius: ${I};
191
+ border-radius: ${P};
192
192
  width: ${a.width}px;
193
193
  height: ${a.height}px;
194
194
  padding: 5px;
@@ -197,12 +197,12 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=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
202
  transform: ${ae};
203
203
  transition: unset;">
204
204
 
205
- ${K}
205
+ ${Q}
206
206
 
207
207
  <div style="font-family:${a.data.styleObject.labelFont};
208
208
  color:${a.data.styleObject.labelFontColor};
@@ -215,7 +215,7 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
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} : ${v(a.data.styleObject.alias)}`:`${v(a.data.styleObject.alias)}`}
218
+ ${L===0?a.data.styleObject.alias:s.nodes.nodesLabelVisibility?`${a.data.label} : ${k(a.data.styleObject.alias)}`:`${k(a.data.styleObject.alias)}`}
219
219
  </div>
220
220
 
221
221
  <div style="font-family:${a.data.styleObject.valueFont};
@@ -230,7 +230,7 @@ let g=t<200?200:S?e:t,G=e<200?200:S?t:e,V=g*.15*.8,j=Wl(l,n),q=V<j[0]+10?V:j[0]+
230
230
  </div>
231
231
 
232
232
  ${be}
233
- </div>`}catch(I){return ge(na,"drawOrganizationChart.nodeContent",I),""}}).buttonContent(({node:a,state:L})=>{try{if(y)return`
233
+ </div>`}catch(P){return ge(na,"drawOrganizationChart.nodeContent",P),""}}).buttonContent(({node:a,state:L})=>{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),q=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(I){return ge(na,"drawOrganizationChart.buttonContent",I),""}}).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+v(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,y}catch(i){ge(na,"calculateNodeWidth",i)}},v=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=fe.useRef(h);s.current=h;const x=fe.useRef(n);x.current=n;const m=new Map((t.ChartData??[]).map((O,De)=>[O.legend,De]));let A=t.LegendList;const u=fe.useRef();let S,p=[0,0];const H=re.BubbleChart;let g,G,V=40,j=Ht,q,Z,Y,N,P=[],z=[],te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a;fe.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),K(),{longestMeasure:d,customYaxisIntervalValue:c,customYaxisMaxValue:i,customYaxisMinValue:y}=ji(S,de,se),{longestDimension:J,customXaxisIntervalValue:F,customXaxisMaxValue:b,customXaxisMinValue:v}=Ji(S,te,oe),{margins:j,yLabel:he,xLabel:Ae,yTitle:pe,xTitle:xe,chartTitleHeight:V,legendMargin:Q,innerHeight:q,innerWidth:Z}=_i(g,G,d,S,J,p),jt(u,g,G,S),Y=la(N,j),mt(Y,e,0,Z,q,H),_t(u,V,g,S),be(),Le(),we(),Zi(e,!1,N,j,Ae,G,xe,"Bubble",he,Z,q),Xi(q,e,0,!1,N,j,pe,he),Te(),ee(),I(),el(N,S.legends.legendPosition,S,G,g,j,q,xe,Ae,t.length)},I=()=>{try{let O=5,De=30,Ve={minimumValue:de,maximumValue:se};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",Ne=>Ne.legendName.replace(/ /g,"-")).attr("fill",Ne=>Ne.legendColor!==Fe.white?Ne.legendColor:"none").append("path").attr("class","path").attr("id",function(Ne,Me){T.select(this).attr("d",T.symbol().type(T.symbolCircle).size(ae(O,De,Ve,Ne.measure,10)*et(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(Ne){return`translate(${f(Ne.dimension)}, ${a(Ne.measure)})`}).attr(Ke.SeriesId,Ne=>`${m.get(Ne.legendName)}_${Ne.legendName}`).attr(Ke.DimValue,Ne=>String(Ne.dimension)).attr("opacity",ie?0:S.plotArea.fillOpacity).style("visibility",(Ne,Me)=>Ne.dimension[0]===0||Ne.measure===0&&S.plotArea.hideZeroValues||Ne.dimension<v||Ne.dimension>b||Ne.measure<y||Ne.measure>i?"hidden":"visible").on("click",gt(x,s,(Ne,Me)=>({seriesId:`${m.get(Me.legendName)}_${Me.legendName}`,dimValue:String(Me.dimension),legendUniqueId:`${m.get(Me.legendName)}_${Me.legendName}`,seriesDisplayName:Me.legendName}))).on("mousemove",(Ne,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,Ne,{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(O){ge("BubbleChart","initCircles",O)}};function ae(O,De,Ve,Ye,ie){try{if(Ye==null)return ie;var ye=Ve.minimumValue,Ne=Ve.maximumValue,Me=De*De*2*Math.PI,Ce=O*O*2*Math.PI,ve=ie;if(ye==Ne)ve=De;else{var ue=Ye,me=(ue-ye)/(Ne-ye)*(Me-Ce)+Ce;me<Ce&&(me=Ce),ve=Math.sqrt(me/(Math.PI*2))}return ve}catch(ce){return ge("BubbleChart","getBubbleSize",ce),ie}}const K=()=>{try{P=[],z=[],de=void 0,se=void 0,te=void 0,oe=void 0,t.forEach(O=>{O.measureName&&(P.push(O.measure),(O.measure<de||de===void 0)&&(de=O.measure),(O.measure>se||se===void 0)&&(se=O.measure)),O.dimensionName&&(z.push(O.dimension),(O.dimension<te||te===void 0)&&(te=O.dimension),(O.dimension>oe||oe===void 0)&&(oe=O.dimension))})}catch(O){ge("BubbleChart","iterateOverChartData",O)}},be=()=>{try{let O=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):te>0?0:te*1.1,De=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):oe*1.1,Ve=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):de>0?0:de*1.1,Ye=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):se*1.1;f=T.scaleLinear().domain([O,De]).range([0,Z]),a=T.scaleLinear().domain([Ve,Ye]).range([q,0])}catch(O){ge("BubbleChart","initScale",O)}},Le=()=>{try{let{xAxisLabelArray:O,customTickValue:De,autoLabelFlag:Ve}=xi(oe,te,Z,e,v,b,Z,!1);const Ye=T.axisBottom(f).tickFormat(je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(ia(e,q,0,!0)).tickValues(O.length>0?O:null).ticks(De).tickPadding(8).tickSizeOuter(0);Qi(Y,S,0,Ae,Ye,q,Z,j,a)}catch(O){ge("BubbleChart","drawXAxis",O)}},we=()=>{try{let{yAxisLabelArray:O,customTickValue:De}=qi(se,de,q,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(O.length>0?O:null).ticks(De).tickPadding(8).tickSizeOuter(0);Ki(Y,S,0,he,Ve,q)}catch(O){ge("BubbleChart","drawYAxis",O)}},Te=()=>{try{if(S.plotArea.xCoordinate!=Yt.None){let O;switch(S.plotArea.xCoordinate){case Yt.Mean:O=T.mean(t,De=>De.dimension);break;case Yt.Median:O=T.median(t,De=>De.dimension);break;case Yt.Custom:O=et(S.plotArea.xscaleposition);break}Y.append("line").attr("x1",f(O)).attr("y1",0).attr("x2",f(O)).attr("y2",q).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Yt.None){let O;switch(S.plotArea.yCoordinate){case Yt.Mean:O=T.mean(t,De=>De.measure);break;case Yt.Median:O=T.median(t,De=>De.measure);break;case Yt.Custom:O=et(S.plotArea.yscaleposition);break}Y.append("line").attr("x1",0).attr("y1",a(O)).attr("x2",Z).attr("y2",a(O)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(O){ge("BubbleChart","drawReferenceLines",O)}},ee=()=>{try{let O=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,O||[],g,G,p[0],V,r,j,nt.circle,!1,o)}catch(O){ge("BubbleChart","initLegendList",O)}},ke=O=>{try{if(!O||!O.ChartData||!O.ChartData[0])return[];const De=[];return O.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??Fe.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=fe.useRef(o);l.current=o;const s=fe.useRef(h);s.current=h;const x=t.ColorElements??[],m=t.ShapeElements??[],A=new Map(x.map((Ne,Me)=>[Ne.name,Me]));let u=[];const S=fe.useRef();let p,H=[0,0],g,G,V=40,j=Ht,q,Z,Y,N,P=Number.POSITIVE_INFINITY,z=Number.NEGATIVE_INFINITY,te=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,de=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I=new Map,ae=new Map;fe.useEffect(()=>{K()},[e,t,r]);const K=()=>{({chartFormatOptions:p,svg:N,width:g,height:G}=Jt(S,e));let Ne=[...m,...x];H=Ia(p,Ne,"alias"),Le(),{longestMeasure:d,customYaxisIntervalValue:c,customYaxisMaxValue:i,customYaxisMinValue:y}=ji(p,te,oe),{longestDimension:J,customXaxisIntervalValue:F,customXaxisMaxValue:b,customXaxisMinValue:v}=Ji(p,P,z),{margins:j,yLabel:he,xLabel:Ae,yTitle:pe,xTitle:xe,chartTitleHeight:V,legendMargin:Q,innerHeight:q,innerWidth:Z}=_i(g,G,d,p,J,H),jt(S,g,G,p),Y=la(N,j),mt(Y,e,0,Z,q,"Scatter",r),_t(S,V,g,p),we(),Te(),ee(),Zi(e,!1,N,j,Ae,G,xe,"Scatter",he,Z,q),Xi(q,e,0,!1,N,j,pe,he),ke(),be(),O(),De(),el(N,p.legends.legendPosition,p,G,g,j,q,xe,Ae,u.length)},be=()=>{try{let Ne=function(ue){return ue=="Square"?T.symbolSquare:ue=="Circle"?T.symbolCircle:ue=="Cross"?T.symbolCross:ue=="Triangle"?T.symbolTriangle:ue=="Star"?T.symbolStar:ue=="Diamond"?T.symbolDiamond:ue=="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",ue=>ue.color).attr("colorId",ue=>ue.colorName.replace(/ /g,"-")).attr("shapeId",ue=>ue.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(ue,me){T.select(this).attr("d",T.symbol().type(Ne(ue.shape)).size((ue.sizeValue?L(ue.sizeValue):10)*2*et(p.plotArea.scatterSizeIndex)))}).attr("transform",function(ue){return`translate(${f(ue.dimension)}, ${a(ue.measure)})`}).attr(Ke.SeriesId,ue=>`${A.get(ue.colorName)}_${ue.colorName}`).attr(Ke.DimValue,ue=>String(ue.dimension)).attr("opacity",Ce?0:p.plotArea.fillOpacity).style("visibility",(ue,me)=>ue.dimension[0]===0||ue.measure===0&&p.plotArea.hideZeroValues||ue.dimension<v||ue.dimension>b||ue.measure<y||ue.measure>i?"hidden":"visible").on("click",gt(s,l,(ue,me)=>({seriesId:`${A.get(me.colorName)}_${me.colorName}`,dimValue:String(me.dimension),legendUniqueId:`${A.get(me.colorName)}_${me.colorName}`,seriesDisplayName:me.colorName}))).on("mousemove",(ue,me)=>{st([{key:p.xAxisTitle.xAxisTitleText,value:je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(me.dimension)},{key:p.yAxisTitle.yAxisTitleText,value:je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(me.measure)},{key:"Color",value:me.colorName},...me.shapeName?[{key:"Shape",value:me.shapeName}]:[]],p,ue,{alias:me.colorName},ht(n,String(me.dimension),{alias:me.colorName}))}).on("mouseout",()=>{rt()});Ce&&ve.transition().duration(p.animation.animationDuration).ease(Xe[p.animation.animationEffect]).attr("opacity",p.plotArea.fillOpacity)}catch(Ne){ge(ua,"initCircles",Ne)}},Le=()=>{try{let Ne=function(Me,Ce,ve){te=Math.min(te,Me.value),oe=Math.max(oe,Me.value),P=Math.min(P,Me.dimension),z=Math.max(z,Me.dimension),de=Math.min(de,Me.value2??10),se=Math.max(se,Me.value2??10),u.push({dimension:Me.dimension,measure:Me.value,sizeValue:Me.value2,colorName:Ce,shapeName:ve,shape:ae.get(ve)||"Circle",color:I.get(Ce)||"#6ba2b8ff"})};x.forEach(Me=>{I.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=>{Ne(ve,Me.legend,Ce.legend)})}),Me.data&&Me.data.length>0&&Me.data.forEach(Ce=>{Ne(Ce,Me.legend)})})}catch(Ne){ge(ua,"iterateOverChartData",Ne)}},we=()=>{try{let Ne=p.yAxisLabel.yAxisIntervalsVisibility&&p.yAxisLabel.yAxisMinText!==""?parseFloat(p.yAxisLabel.yAxisMinText):te>0?0:te*1.1,Me=p.yAxisLabel.yAxisIntervalsVisibility&&p.yAxisLabel.yAxisMaxText!==""?parseFloat(p.yAxisLabel.yAxisMaxText):oe*1.1;a=T.scaleLinear().domain([Ne,Me]).range([q,0]),L=T.scaleLinear().domain([de,se]).range([1,10])}catch(Ne){ge(ua,"initScale",Ne)}},Te=()=>{try{const Me=(parseFloat(e.plotArea.ticksHeight)||100)/100*q;let{xAxisLabelArray:Ce,customTickValue:ve}=xi(z,P,Z,e,v,b,q,!1);Ce.length>0?f=T.scaleLinear().domain([Ce[0],Ce[Ce.length-1]]).range([0,Z]):f=T.scaleLinear().domain([v,b]).range([0,Z]);const ue=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,ue,q,Z,j,a)}catch(Ne){ge(ua,"drawXAxis",Ne)}},ee=()=>{try{const Me=(parseFloat(e.plotArea.ticksWidth)||100)/100*Z;let{yAxisLabelArray:Ce,customTickValue:ve}=qi(oe,te,q,e,y,i);const ue=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,he,ue,q)}catch(Ne){ge(ua,"drawYAxis",Ne)}},ke=()=>{try{if(p.plotArea.xCoordinate!=Yt.None){let Ne;switch(p.plotArea.xCoordinate){case Yt.Mean:Ne=T.mean(u,Me=>Me.dimension);break;case Yt.Median:Ne=T.median(u,Me=>Me.dimension);break;case Yt.Custom:Ne=et(p.plotArea.xscaleposition);break}Y.append("line").attr("x1",f(Ne)).attr("y1",0).attr("x2",f(Ne)).attr("y2",q).attr("stroke",p.plotArea.refLineBorderColor).attr("stroke-width",p.plotArea.refLineBorderThickness)}if(p.plotArea.yCoordinate!=Yt.None){let Ne;switch(p.plotArea.yCoordinate){case Yt.Mean:Ne=T.mean(u,Me=>Me.value);break;case Yt.Median:Ne=T.median(u,Me=>Me.value);break;case Yt.Custom:Ne=et(p.plotArea.yscaleposition);break}Y.append("line").attr("x1",0).attr("y1",a(Ne)).attr("x2",Z).attr("y2",a(Ne)).attr("stroke",p.plotArea.refLineBorderColor).attr("stroke-width",p.plotArea.refLineBorderThickness)}}catch(Ne){ge(ua,"drawReferenceLines",Ne)}},O=()=>{try{p.legends.legendAlignment===void 0&&(p.legends.legendAlignment="Top"),p.legends.legendAlignmentTopBottom===void 0&&(p.legends.legendAlignmentTopBottom="Start");let Ne=p.legends.legendPosition,Me=p.legends.legendAlignment,Ce=p.legends.legendAlignmentTopBottom;switch(Ne){case Be.none:break;case Be.right:Ve(x,g-Q-30,V+5,Q+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,Q+25,G-V-10);break;case Be.bottom:Ve(x,5,G-35,g-10,30);break}}catch(Ne){ge(ua,"drawColors",Ne)}},De=()=>{try{p.legends.legendAlignment===void 0&&(p.legends.legendAlignment=Fa.top),p.legends.legendAlignmentTopBottom===void 0&&(p.legends.legendAlignmentTopBottom=wa.start);let Ne=p.legends.legendPosition;if(m.length>0)switch(Ne){case Be.none:break;case Be.right:Ye(m,g-Q-30,G/2+10,Q+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,Q+25,G-V-10);break;case Be.bottom:Ye(m,g/2+5,G-35,g-10,30);break}}catch(Ne){ge(ua,"drawShapes",Ne)}},Ve=(Ne,Me,Ce,ve,ue)=>{try{let ce=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",ue).style("user-select","none"),$=(ce==Be.top||ce==Be.bottom)&&m.length>0?"50%":"100%";var me=B.append("xhtml:div").style("width",$).style("display","flex").style("height",ce==Be.top||ce==Be.bottom?ue-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",ce==Be.top||ce==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",ce==Be.top||ce==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Ne.forEach((E,k)=>{let w=me.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(R){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(R){N.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),N.selectAll('[colorId="'+ye(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(ce==Be.bottom||ce==Be.top)&&w.style("margin-right","16px").style("white-space","nowrap"),w.append("div").style("height","10px").style("width","10px").style("background",E.color).style("border-radius","1px");let D=p.legends.legendColorMode=="1"?E.color?E.color:Fe.black:p.legends.legendSelectedUnicolor;w.append("div").style("margin-left","5px").style("color",D).attr("title",E.name).style("font-size",p.legends.legendFontSize+"px").style("font-family",p.legends.legendFontFamily).style("font-style",le.includes(ne.italic)?ne.italic:"").style("text-decoration",le.includes(ne.underline)?ne.underline:"").style("font-weight",le.includes(ne.bold)?ne.bold:"").style("white-space","nowrap").html(E.name)})}catch(ce){ge(ua,"colorListWithScroll",ce)}},Ye=(Ne,Me,Ce,ve,ue)=>{try{let ce=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",ue).style("user-select","none"),$=p.legends.legendPosition==Be.top||p.legends.legendPosition==Be.bottom?"calc(50% - 5px)":"calc(100%)";var me=B.append("xhtml:div").style("width",$).style("display","flex").style("height",ce==Be.top||ce==Be.bottom?ue-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",ce==Be.top||ce==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",ce==Be.top||ce==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Ne.forEach((E,k)=>{let w=me.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){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(R){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))});(ce==Be.top||ce==Be.bottom)&&w.style("margin-right","16px").style("white-space","nowrap"),ie(w,E.markerShape);let D=p.legends.legendColorMode=="1"?Fe.black:p.legends.legendSelectedUnicolor;w.append("div").style("margin-left","5px").style("color",D).attr("title",E.name).style("font-size",p.legends.legendFontSize+"px").style("font-family",p.legends.legendFontFamily).style("font-style",le.includes(ne.italic)?ne.italic:"").style("text-decoration",le.includes(ne.underline)?ne.underline:"").style("font-weight",le.includes(ne.bold)?ne.bold:"").style("white-space","nowrap").html(E.name)})}catch(ce){ge(ua,"shapeListWithScroll",ce)}},ie=(Ne,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;Ne.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=(Ne="")=>{try{return Ne.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=fe.useRef(),S=fe.useRef(h);S.current=h;const p=fe.useRef(n);p.current=n;const H=o??!1,g=H?[]:pt(r.ChartData,r.DimensionList),G=r.DimensionList,V=!1,j=!1,q=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K=[],be=[],Le,we=0;const Te=2;let ee={dimensionList:G,chartType:A,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};fe.useEffect(()=>{try{ke()}catch(le){ge("WaterfallChart","createWaterfallChart",le)}},[e]);const ke=()=>{({formatOptions:e,svg:c,width:b,height:v}=Ct(u,e)),O(),{maxNumberForPrimaryAxis:xe,maxNumberForSecondaryAxis:Q}=Nt(e,ee.yMinLeft,ee.yMaxLeft,ee.yMinRight,ee.yMaxRight),{margin:N,yLabel:P,xLabel:z,yTitle:te,xTitle:oe,dimensionHeightWidthArray:de,chartTitleHeight:se,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe}=vt(b,v,xe,Q,ee.yMaxLeft,e,ee.legendList,ee.dimensionList,ee.yMaxRight,j,q,t),Me(N),kt(c,b,v,e),i=Mt(c,N),mt(i,e,d,J,F,A,s),Ve(),ie(),Gt(i,e,d,P,L,F),Ce(g,v,c,N,J),St(e,V,c,N,z,v,oe,ee.chartType,P,J,F),Ft(F,e,d,V,c,N,te,P),Ut(c,j,N,e,d,F,J,pe,he),wt(c,e,b,se)},O=()=>{if(H){let k=ce(r);k=k.filter(D=>D.up+D.down+D.base!=0),ee.dimensionList=k.map(D=>D.xKey),ee.legendList=ee.dimensionList,be=T.stack().keys(["base","dimensionTotal","up","down"])(k);const w=[];be.forEach(D=>D.forEach(R=>w.push(R[1]))),ee.yMaxLeft=T.max(w)??0,ee.yMinLeft=T.min(w)??0;return}g.forEach(k=>{k.data.forEach(w=>{})}),K=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ae=ee.dimensionList:ae=ee.dimensionList.slice(we,we+Te),e.plotArea.hideZeroValues&&(ee.hideZeroValues=!0);let le=H?ce(r):ue(),B=JSON.parse(JSON.stringify(le));le.forEach(k=>{if(!k.Dimension&&(k.Up<1e-9&&k.Up!==0||k.Down<1e-9&&k.Down!==0)){let w=B.findIndex(D=>D.Legend===k.Legend);w!==-1&&B.splice(w,1)}}),le=B,le.forEach(k=>k.dimension?ee.legendList.push(k.dimension):ee.legendList.push(k.legend)),be=T.stack().keys(["base","dimensionTotal","up","down"])(le);let $=[],E=[];be.forEach(k=>{k.key=="base"?k.opacity=0:k.opacity=1,k.forEach(w=>$.push(w)),!E.includes(k.dimension)&&k.dimensionTotal===0&&k.total===0&&E.push(k.dimension)}),ee.yMaxLeft=T.max($,k=>k[1]),ee.yMinLeft=T.min($,k=>k[1]),e.xAxisLabel.hideZeroValues&&(E.length>0&&E.forEach(k=>{ee.legendList=ee.legendList.filter(w=>w!==k)}),ee.dimensionList=ee.legendList),t?bt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList).map(k=>k):ee.dimensionList,De(le)},De=le=>{try{let B=[],$=[],E=[];le&&le.forEach((w,D)=>{w.dimension&&(B.push(w.dimension),$.push({dimension:w.dimension,chartDataIndex:D,selfIndex:$.length}))}),t?E=bt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList).map(w=>w):E=B;let k=JSON.parse(JSON.stringify(ee.legendList));$.forEach((w,D)=>{k[w.chartDataIndex]=E[w.selfIndex]}),ee.legendList.forEach((w,D)=>{ee.formattedDimensionListMap.set(w,k[D])})}catch(B){throw B}},Ve=()=>{let le=ot(Y||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,Y).yAxisLabelArray;ee.yMaxLeft=le[le.length-1],ee.yMinLeft=le[0],y=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([F,0]),a=[0,J],Ye()},Ye=()=>{x=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(J/ee.legendList.length),f=T.scaleBand().domain(ee.legendList).range(a).padding(.4)},ie=()=>{ye();{let le=ot(Y||ee.yMaxLeft,ee.yMinLeft,F,e,ee,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=()=>{I=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(ee.legendList,J))},Ne=le=>{let B;if(be.forEach(($,E)=>$.forEach(k=>k.key=$.key)),Le){let $=K.map(E=>E.legend);B=T.stack().keys($)(Le),B.forEach((E,k)=>{B[k].color=K[k].properties.color})}B&&B.forEach($=>{$.forEach(E=>{E.Key=$.key})}),[0,1].forEach($=>{if($===1&&(be=B),be){let E=i.selectAll(`.parentGroup-${$}`).data([null]);E=E.enter().append("g").attr("class",`parentGroup parentGroup-${$}`).merge(E);let k=E.selectAll(`.bar-group-${$}`).data(be);k=k.enter().append("g").attr("class",`bar-group-${$}`).attr("fill",M=>M.color?M.color:m(M.key)!==Fe.white?m(M.key):"none").attr("opacity",M=>M.opacity).merge(k);let D=k.selectAll("rect").data(M=>M,M=>M.key||M.Key);const R=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=>$===0&&M.data.dimension&&Le?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(M,_)=>{const X=H?Aa.base:Aa.dimensionTotal,U={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,U,ht(l,String(ee.formattedDimensionListMap.get(H?_.data.xKey:_.data.dimension||_.data.legend)??(H?_.data.xKey:_.data.dimension||_.data.legend)??""),{...U,alias:_.properties?.alias??_.properties?.currentMeasure??String(_.Key??_.key??"")}))}).on("mouseout",()=>{rt()}).attr(Ke.SeriesId,M=>String(M.key??M.Key??"")).attr(Ke.DimValue,M=>String(H?M.data.xKey||"":M.data.dimension||M.data.legend||"")).on("click",gt(p,S,(M,_)=>{const X=String(_.key??_.Key??""),U=String(H?_.data.xKey||"":_.data.dimension||_.data.legend||"");return{seriesId:X,dimValue:U,legendUniqueId:X,seriesDisplayName:X}}));if((R?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"&&$!=1){const M=k.selectAll("text").data(U=>U),_=M.enter().append("text").text(U=>_e(U[1]-U[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",U=>f(H?U.data.xKey:U.data.dimension||U.data.legend)+f.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",U=>U[1]-U[0]!==0&&y(U[1])?"visible":"hidden");(R?_.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):_).attr("y",U=>U[1]?y(U[1])-15:0),M.exit().remove()}}}),i.selectAll(".parentGroup").raise()},Me=le=>{J=b-le.left-le.right,F=v-le.bottom-le.top},Ce=(le,B,$,E,k)=>{if(!e.plotArea.fitChart){const w=le[0].data.length-Te,D=B-20;ae=ee.dimensionList.slice(we,we+Te),Ye(),K=JSON.parse(JSON.stringify(le)),K.forEach((C,M)=>K[M].data=C.data.filter(_=>ae.includes(_.dimension))),ye(),$.append("rect").attr("x",E.left).attr("y",D).attr("width",k).attr("height",8).attr("fill","#ddd").attr("rx",4);const R=k*Te/ee.dimensionList.length,W=$.append("rect").attr("x",E.left).attr("y",D).attr("width",R).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,E.left),E.left+k-R);W.attr("x",M),we=Math.round((M-E.left)/(k-R)*w),ae=ee.dimensionList.slice(we,we+Te),Ye(),K=JSON.parse(JSON.stringify(le)),K.forEach((_,X)=>K[X].data=_.data.filter(U=>ae.includes(U.dimension))),ye(),ve()}));$.on("wheel",C=>{C.preventDefault();const M=Math.abs(C.deltaX)>Math.abs(C.deltaY)?C.deltaX:C.deltaY;we+=M>0?1:-1,we=Math.max(0,Math.min(we,w));const _=E.left+(k-R)*we/w;W.attr("x",_),Ye(),K=JSON.parse(JSON.stringify(le)),K.forEach((X,U)=>K[U].data=X.data.filter(Se=>ae.includes(Se.dimension))),ye(),ve()})}ve()},ve=()=>{qt(i,ee,z,e,d,y,I,de,v,x,t,J,F,ee.legendList,f),Ne()},ue=()=>{try{if(g.length<1)return[];if(ee.dimensionList.length<2)return[];let le=[],B=[],$=[],E="";if(E.length>1){let W=E;g.forEach(C=>{W===C.properties.currentLegend?B.push(C):$.push(C)})}B.length>0&&(K=B);let k=0,w=0;for(let W=0;W<K.length;++W)k=k+K[W].data[0].value;let D="";for(let W=1;W<ae.length;++W){let C={};C.dimension=ae[W-1],C.total=k,C.base=0,C.dimensionTotal=k,C.up=0,C.down=0,le.push(C);for(let M=0;M<K.length;++M){let _={};for(let X=0;X<M;X++)D=D+" ";w=K[M].data[W].value-K[M].data[W-1].value,w!==0&&(_.legend=D+K[M].properties.legend,_.dimensionTotal=0,w<0?(_.base=k+w,_.down=-w,_.up=0,_.total=k-w):(_.base=k,_.down=0,_.up=w,_.total=k+w),k=k+w,le.push(_))}}let R={};return R.dimension=ae[ae.length-1],R.dimensionTotal=k,R.base=0,R.total=k,R.up=0,R.down=0,le.push(R),$.length>0&&(K=$,Le=xt(ae,$,!1)),le}catch(le){throw le}},me=le=>le==null||le===""?0:Number(le),ce=le=>(le[0]?.Column1==""?le.filter($=>$.Column1&&$.Column1!=="*"):o?le.Data:le).map($=>({xKey:$.Column1||$.Dimension||$.Legend,base:me($.Column3||$.Total),up:me($.Column4||$.Up),down:me($.Column5||$.Down),total:me($.Column6||$.total),dimensionTotal:me($.Column2||$.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=fe.useRef(),p=fe.useRef(n);p.current=n;const H=fe.useRef(l);H.current=l;let g=pt(r.ChartData,r.DimensionList,!0);g=Xl(g,r,u);const G=r.DimensionList,V=!0,j=!1,q=!1;let Z=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y,f,a,L,I,ae,K,be,Le,we=[],Te=0,ee=2,ke=!1,O={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};fe.useEffect(()=>{try{De()}catch(B){ge("Tornadochart","createTornadoChart",B)}},[e]);const De=()=>{({formatOptions:e,svg:i,width:b,height:v}=Ct(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:xe,maxNumberForSecondaryAxis:Q}=Nt(e,O.yMinLeft,O.yMaxLeft,O.yMinRight,O.yMaxRight),{margin:N,yLabel:P,xLabel:z,yTitle:te,xTitle:oe,dimensionHeightWidthArray:de,chartTitleHeight:se,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:ee,columnWidth:m,scrollbarVisible:ke}=vt(b,v,xe,Q,O.yMaxLeft,e,u?O.legendList.map(B=>B.alias.split(" - ")[0]):O.legendList.map(B=>B.alias),O.dimensionList,O.yMaxRight,j,q,t,!0,O),ve(N),kt(i,b,v,e),y=Mt(i,N),mt(y,e,c,J,F,A),ie(),Me(),Ya(e,y,z,F,J,K),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,P,te,O.dimensionList,J,I,O.formattedDimensionListMap,x,N,F)),St(e,V,i,N,z,v,oe,O.chartType,P,J,F),Ft(F,e,c,V,i,N,te,P,J),Ut(i,j,N,e,c,F,J,pe,he),wt(i,e,b,se),Dt(v,i,de,se,b,Ae,e,Ve(g,O.legendList,u,e),x,c,N,nt.rectangle),ce(g,v,b,i,N,J,ke,ee,O,Te,!1,ue,V)},Ve=(B,$,E,k)=>B.map((w,D)=>{const R=$[D];if(!R)return{...w,properties:{}};let W=R.alias;E&&R.alias&&(W=R.alias.split(" - ")[0].trim());let C=R.color;return E&&W&&(W.includes("+ve")?C=k.plotArea.plotAreaCalculatedHigh:W.includes("-ve")&&(C=k.plotArea.plotAreaCalculatedLow)),{...w,properties:{...R,alias:W,color:C}}}).filter(w=>w.properties&&Object.keys(w.properties).length>0),Ye=()=>{let B;if(u)O.chartData=g,O.yMaxLeft=Math.min(...g.map(E=>E.data[0].value)),O.yMaxRight=Math.max(...g.map(E=>E.data[0].value));else{const E=g[0]?.properties?.measureUniqueId;let k=0,w=-1/0;B=g.map((D,R)=>{const W=D.properties.measureUniqueId===E,C=D.data.map(_=>{const X=W?-Math.abs(_.value):Math.abs(_.value);return{..._,value:X}}),M=C.map(_=>_.value);return W?k=Math.min(k,Math.min(...M)):w=Math.max(w,Math.max(...M)),{...D,data:C}}),O.chartData=B,O.yMaxLeft=k,O.yMaxRight=w}const $=t?bt(e.xAxisLabel.xAxisNumberFormat,O.dimensionList):O.dimensionList;O.dimensionList.forEach((E,k)=>{O.formattedDimensionListMap.set(E,$[k])}),we=JSON.parse(JSON.stringify(u?g:B)),g=we,Le=O.dimensionList,e.plotArea.hideZeroValues&&(O.hideZeroValues=!0)},ie=()=>{let B=O.yMaxLeft,$=O.yMaxRight,E=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,k,w=!1,D=!1;B>$?(k=B,w=!0):(k=$,D=!0);let R=e.annotation.annotationVisibility!="5"?B/k!==1?Math.abs(B/k)*100<10?3:0:Math.abs($/k)*100<10?3:0:0,W=0,C=0;B<0&&$>0?(W=B*(1.2+(D?R:0)),C=$*(1.2+(w?R:0))):B>=0&&$>=0?(W=0,C=$*(1.2+(w?R:0))):B<=0&&$<=0?(W=B*(1.2+(D?R:0)),C=0):(W=B*1.2,C=$*1.2),W=Math.floor(W),C=Math.ceil(C),L=T.scaleLinear().domain([W,C]).range([E,J-E]),a=L,I=[0,J],ye()},ye=()=>{f=T.scalePoint().domain(Le).range([F,0]).padding(.5)},Ne=()=>{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=()=>{K=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(O.yMaxRight,O.yMaxLeft,F,e,O,Z,Y,V,J).yAxisLabelArray).ticks(ot(Y||O.yMaxLeft,O.yMinLeft,F,e,O,Z,Y,V,J).customTickValue??J/30).tickPadding(8).tickSizeOuter(0)},Ce=()=>{y.selectAll(".parentGroup").remove();const B=e.plotArea.plotAreaCalculatedHigh,$=e.plotArea.plotAreaCalculatedLow,E=y.append("g").attr("class","parentGroup"),k=e.animation.animationEnabled,w=E.selectAll("rect").data(we.flatMap(R=>R.data.map(W=>({...W,legendText:u?R.legend.split("ve) - ")[1]?.trim()??R.legend:O.dimensionList[0]==re.TornadoDefaultEntry?bi.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(re.TornadoDefaultEntry))-m/2).attr("height",m).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?B!==Fe.white?B:"none":$!==Fe.white?$:"none":R.properties.color).on("mousemove",(R,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,R,r.IsCalCSensitivity?W.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:W.properties,ht(s,String(O.formattedDimensionListMap.get(W.legend)??W.legend??""),W.properties))}).on("mouseout",rt).attr(Ke.SeriesId,R=>String(R.properties?.legendUniqueId??"")).attr(Ke.DimValue,R=>String(R.legend??R.legendText??"")).on("click",gt(H,p,(R,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||"")})));(k?w.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):w).attr("x",R=>R.value>=0?a(0):a(R.value)).attr("width",R=>Math.abs(a(R.value)-a(0)))},ve=B=>{J=b-B.left-B.right,F=v-B.bottom-B.top},ue=(B,$,E)=>{we=$,Le=B,ee=E,le()};function me(B){const $=new Map;return B.forEach(E=>{let k=$.get(E.properties.legendUniqueId);if(k){let w=k.data??[];w.push(E.data[0]),$.set(E.properties.legendUniqueId,{...k,data:w})}else k={...E,data:[E.data[0]]},$.set(E.properties.legendUniqueId,k)}),$.size>0?Array.from($.keys()).map(E=>$.get(E)):B}function ce(B,$,E,k,w,D,R,W,C,M,_,X,U=!1){const Se=(ze,Ie,Qe,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),Qe=Qe==null?0:Number(Qe),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(Oe=>it?!0:He.includes(Oe.legend.split(" - ")[1]));const Ze=w?.left??0,Ge=w?.top??0,Ee=Number(D)||0,Pe=Number(F)||0,Ue=Number(Qe)||0,At=Ie===0?1:Ie;if(U){const Oe=Ge+(Pe-Ue)*(Ie===0?0:M)/At;lt&&typeof lt.attr=="function"&&lt.attr("y",Oe)}else{const Oe=Ze+(Ee-Ue)*(Ie===0?0:M)/At;lt&&typeof lt.attr=="function"&&lt.attr("x",Oe)}X(He,Je,W)}catch(tt){typeof ge=="function"&&ge("ColumnChart","updateFromScrollPosition",tt)}};if(R){const ze=$-w.top-w.bottom,Ie=Math.max(0,G.length-W),Qe=$-8;k.append("rect").attr("id","scrollbarTrack").attr("x",U?E-8:w.left).attr("y",U?w.top:Qe).attr("width",U?8:D).attr("height",U?ze:8).attr("fill","#ccc");const lt=(U?ze:D)*W/C.dimensionList.length,ut=k.append("rect").attr("x",U?E-8:w.left).attr("y",U?w.top:Qe).attr("width",U?8:lt).attr("height",U?lt:8).attr("fill","#999").style("cursor",U?"ns-resize":"ew-resize");ut.call(T.drag().on("drag",tt=>{if(U){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))}})),k.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),U){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 k.on("wheel",null);Se(0,0,0,null,!0)}const le=()=>{ye(),Ne(),Ua(e,y,z,F,J,ae,be,a,O.yMaxLeft,Le,A,t,b,de,m,f),Ce();const B=me(we);Da(B??[],f,a,null,N,dt,[],[],e,A,v,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=fe.useRef(),u=pt(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,q,Z,Y,N,P,z,te,oe,de,se,he,Ae,pe,xe,Q,J,F,b,v,d,c,i,y=[],f=0,a=2,L=!1,I=[];const ae=!1;let K={dimensionList:S,chartType:m,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};fe.useEffect(()=>{try{be()}catch(Ce){ge("StackStackHorizontalBarchart","createDotPlot",Ce)}},[e]);const be=()=>{({formatOptions:e,svg:Q,width:pe,height:xe}=Ct(A,e)),Le(),{maxNumberForPrimaryAxis:de,maxNumberForSecondaryAxis:se}=Nt(e,K.yMinLeft,K.yMaxLeft,K.yMinRight,K.yMaxRight),{margin:V,yLabel:j,xLabel:q,yTitle:Z,xTitle:Y,dimensionHeightWidthArray:N,chartTitleHeight:P,secondaryAxisTitleWidth:z,legendMargin:te,secondaryYLabel:oe,visibleBars:a,columnWidth:x,scrollbarVisible:L}=vt(pe,xe,de,se,K.yMaxLeft,e,K.legendList,K.dimensionList,K.yMaxRight,H,ae,t,p,K),De(V),kt(Q,pe,xe,e),J=Mt(Q,V),mt(J,e,0,he,Ae,m),we(),ee(),Ya(e,J,j,Ae,he,d),St(e,p,Q,V,q,xe,Y,K.chartType,j,he,Ae),Ft(Ae,e,0,p,Q,V,Z,j),wt(Q,e,pe,P),Dt(xe,Q,N,P,pe,te,e,u,s,0,V,nt.rectangle,m,n),Bt(u,xe,pe,Q,V,he,L,a,K,f,!1,Ve,p)},Le=()=>{const Ce=[],ve=[];let ue=[],me=-1/0,ce=1/0,le=-1/0,B=1/0;u.forEach($=>{ve.push($.properties.legendUniqueId),$.data.forEach(E=>{Ce.push(E),me=Math.max(me,E.value),ce=Math.min(ce,E.value)})}),K.chartData=Ce,K.legendList=ve,K.yMaxLeft=me,K.yMinLeft=ce>0?0:ce,K.yMaxRight=le,K.yMinRight=B,ue=t?bt(e.xAxisLabel.xAxisNumberFormat,K.dimensionList).map($=>$):K.dimensionList,ue=t?bt(e.xAxisLabel.xAxisNumberFormat,K.dimensionList).map($=>$):K.dimensionList,K.dimensionList.forEach(($,E)=>{K.formattedDimensionListMap.set($,ue[E]),K.formattedDimensionListMap.set($,ue[E])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=K.dimensionList:i=K.dimensionList.slice(f,f+a),e.plotArea.hideZeroValues&&(K.hideZeroValues=!0)},we=()=>{let Ce=ot(G||K.yMaxLeft,K.yMinLeft,Ae,e,K,g,G,p,he).yAxisLabelArray;K.yMaxLeft=Ce[Ce.length-1],K.yMinLeft=Ce[0],F=T.scaleLinear().domain([K.yMinLeft>=0?g!==void 0&&!Number.isNaN(g)?g:0:K.yMinLeft<0?K.yMinLeft*1.1:K.yMinLeft*.9,K.yMaxLeft<=0?0:G!==void 0&&!Number.isNaN(G)?G:K.yMaxLeft*1.1]).range([0,he]),v=[Ae,0],Te()},Te=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,x]).paddingInner(K.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),b=T.scalePoint().domain(i).range(v).padding(.5)},ee=()=>{ke();{let Ce=ot(G||K.yMaxLeft,K.yMinLeft,Ae,e,K,g,G,p,he);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)*he*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(i,Ae))},O=Ce=>{Ce.forEach(ce=>{ce.data.forEach(le=>{le.markerShape=ce.properties.markerShape||"Circle",le.markerSize=ce.properties.markerSize||6,le.markerColor=ce.properties.markerColor||ce.properties.color,le.alias=ce.properties.alias,le.lineStyle=ce.properties.lineStyle,le.lineWidth=ce.properties.lineWidth,le.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const ve=T.group(Ce.flatMap(ce=>ce.data.map(le=>({...le,color:ce.properties.color}))),ce=>ce.dimension),ue=J.selectAll(".cleveland-line-group").data(Array.from(ve),([ce])=>ce);ue.enter().append("g").attr("class","cleveland-line-group").append("line").merge(ue.select("line")).attr("y1",([ce])=>b(ce)).attr("y2",([ce])=>b(ce)).attr("x1",([,ce])=>F(Math.min(ce[0]?.value??0,ce[1]?.value??0))).attr("x2",([,ce])=>F(Math.max(ce[0]?.value??0,ce[1]?.value??0))).attr("stroke",ce=>ce[1][0].lineColor).attr("stroke-width",ce=>ce[1][0].lineStyle!=="None"?ce[1][0].lineWidth:0).attr("stroke-dasharray",ce=>{switch(ce[1][0].lineStyle){case yt.dotted:return"1,4";case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",ce=>ce[1][0].lineStyle===yt.dotted?sa.round:""),ue.exit().remove(),Ce.forEach(ce=>{let le=J.selectAll(".parentGroup").data([ce],w=>w.properties.legendUniqueId);le=le.enter().append("g").attr("class","parentGroup").attr("hoverId",(ce.properties.alias||ce.properties.name||"Legend").replace(/\s+/g,"-")).merge(le);let B=le.selectAll(".column-group").data(ce.data,w=>w.dimension),$=B.enter().append("g").attr("class","column-group");const E=e.animation.animationEnabled,k=$.append("path").attr("class","cleveland-dot").attr("opacity",E?0:.9);k.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),R=b(w.dimension);return`translate(${D},${R})`}).attr("fill",w=>ce.properties.color).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(w,D)=>{st([{key:e.xAxisTitle.xAxisTitleText,value:K.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,ce.properties,ht(l,String(K.formattedDimensionListMap.get(D.dimension)??""),ce.properties))}).on("mouseout",()=>{T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll(".halo").remove(),rt()}),E&&k.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("opacity",.9),B.exit().remove()}),J.selectAll(".parentGroup").raise()},De=Ce=>{he=pe-Ce.left-Ce.right,Ae=xe-Ce.bottom-Ce.top},Ve=(Ce,ve,ue)=>{y=ve,i=Ce,a=ue,Ye()},Ye=()=>{Te(),ke(),Ua(e,J,q,Ae,he,c,void 0,F,K.yMaxLeft,i,m,t,pe,N,x,b),ie(),O(y),Da(y,b,F,void 0,V,dt,[],[],e,m,xe,pe,he,i,Ae,s,Q,h,b,x,o,!1,p),ye()},ie=()=>{let Ce=xt(i,y,ae);I=T.stack().keys(K.legendList).offset(T.stackOffsetDiverging)(Ce),y.forEach((ue,me)=>ue.data.forEach((ce,le)=>{ce[0]=I[me][le][0],ce[1]=I[me][le][1]}));let ve=e.annotation.annotationSetLabelColor;I.forEach((ue,me)=>ue.forEach(ce=>{ce.key=ue.key,ue.color=JSON.parse(JSON.stringify(u[me].properties.color)),ce.data.labelPosition=u[me].properties.dataLabelPosition,ce.data.labelColor=ve=="2"?JSON.parse(JSON.stringify(u[me].properties.color)):u[me].properties.labelColor,ce.hideZero=JSON.parse(JSON.stringify(u[me].properties.hideZeroValues))}))},ye=()=>{try{const Ce=Number(e.connector?.connectorVisibility);if(!e.connector||Ce===2)return;const ve=[],ue=[],me=[];let ce;const le=[];if(Ce===1)ce=1;else if(Ce===3){const R=Number(e.connector.connectorFollow);R===1?ce=Number(e.connector.connectorStepSize):R===2&&((e.connector.connectorExclude||[]).forEach(W=>me.push(W)),ce=1)}const B=[],$=[],E=[],k=e.connector?.connectorCustomRange||[];me.forEach(R=>{const W=R.split("-");W.length&&B.push(W[0])});const D=(I?.[0]||[]).map((R,W)=>({Dimension:R.data.Dimension,Total:R.data.Total,CustomTotal:R.data.Total-(E[W]??0),Index:W}));if(ce!=null){for(let R=0;R<D.length;R++)(ce===1||R%ce===0&&ce!==1)&&ve.push(D[R]);for(let R=ce;R<D.length;R+=ce){const W=Math.min(R+ce,D.length);let C=-1/0;for(let M=R;M<W;M++)D[M].Total>C&&(C=D[M].Total);C!==-1/0&&le.push(C)}for(let R=1;R<ve.length;R++)ue.push(ve[R])}else{const R=[];(k||[]).forEach(W=>{if(W?.from&&W?.to){const C=D.some(_=>_.Dimension===W.from),M=D.some(_=>_.Dimension===W.to);C&&M&&R.push({from:W.from,to:W.to})}}),R.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 U=D[_]?.Total??-1/0;for(let Se=_;Se<=X;Se++)D[Se].Total>U&&(U=D[Se].Total);U!==-1/0&&le.push(U),ue.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!==Fe.white?e.connector.connectorMarkerColor:"none"),Ne(ve,le,ue,ce,B),Me(ve,le,ue,ce,B)}catch(Ce){console.error(Ce)}},Ne=(Ce,ve,ue,me,ce)=>{try{J.append("g").selectAll("path").data(Ce).enter().filter((le,B)=>me!=null?B<Ce.length-1:B<Ce.length).append("path").attr("d",(le,B)=>e.total.totalVisibility?`M ${F(le.Total)+50},
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=fe.useRef(h);s.current=h;const x=fe.useRef(n);x.current=n;const m=new Map((t.ChartData??[]).map((ee,De)=>[ee.legend,De]));let A=t.LegendList;const u=fe.useRef();let S,p=[0,0];const H=re.BubbleChart;let g,G,V=40,j=Ht,K,Z,B,N,E=[],$=[],q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a;fe.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,ce,oe),{longestDimension:J,customXaxisIntervalValue:F,customXaxisMaxValue:b,customXaxisMinValue:k}=Ji(S,q,se),{margins:j,yLabel:he,xLabel:Ae,yTitle:pe,xTitle:xe,chartTitleHeight:V,legendMargin:O,innerHeight:K,innerWidth:Z}=_i(g,G,d,S,J,p),jt(u,g,G,S),B=la(N,j),mt(B,e,0,Z,K,H),_t(u,V,g,S),be(),Le(),Fe(),Zi(e,!1,N,j,Ae,G,xe,"Bubble",he,Z,K),Xi(K,e,0,!1,N,j,pe,he),Te(),te(),P(),el(N,S.legends.legendPosition,S,G,g,j,K,xe,Ae,t.length)},P=()=>{try{let ee=5,De=30,Ve={minimumValue:ce,maximumValue:oe};const Ye=B.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 ue=Ye,me=(ue-ye)/(Pe-ye)*(Me-Ce)+Ce;me<Ce&&(me=Ce),ve=Math.sqrt(me/(Math.PI*2))}return ve}catch(de){return ge("BubbleChart","getBubbleSize",de),ie}}const Q=()=>{try{E=[],$=[],ce=void 0,oe=void 0,q=void 0,se=void 0,t.forEach(ee=>{ee.measureName&&(E.push(ee.measure),(ee.measure<ce||ce===void 0)&&(ce=ee.measure),(ee.measure>oe||oe===void 0)&&(oe=ee.measure)),ee.dimensionName&&($.push(ee.dimension),(ee.dimension<q||q===void 0)&&(q=ee.dimension),(ee.dimension>se||se===void 0)&&(se=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):se*1.1,Ve=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):ce>0?0:ce*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(se,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(B,S,0,Ae,Ye,K,Z,j,a)}catch(ee){ge("BubbleChart","drawXAxis",ee)}},Fe=()=>{try{let{yAxisLabelArray:ee,customTickValue:De}=qi(oe,ce,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(B,S,0,he,Ve,K)}catch(ee){ge("BubbleChart","drawYAxis",ee)}},Te=()=>{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}B.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}B.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=fe.useRef(o);l.current=o;const s=fe.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=fe.useRef();let p,H=[0,0],g,G,V=40,j=Ht,K,Z,B,N,E=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,q=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,ce=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P=new Map,ae=new Map;fe.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,se),{longestDimension:J,customXaxisIntervalValue:F,customXaxisMaxValue:b,customXaxisMinValue:k}=Ji(p,E,$),{margins:j,yLabel:he,xLabel:Ae,yTitle:pe,xTitle:xe,chartTitleHeight:V,legendMargin:O,innerHeight:K,innerWidth:Z}=_i(g,G,d,p,J,H),jt(S,g,G,p),B=la(N,j),mt(B,e,0,Z,K,"Scatter",r),_t(S,V,g,p),Fe(),Te(),te(),Zi(e,!1,N,j,Ae,G,xe,"Scatter",he,Z,K),Xi(K,e,0,!1,N,j,pe,he),ke(),be(),ee(),De(),el(N,p.legends.legendPosition,p,G,g,j,K,xe,Ae,u.length)},be=()=>{try{let Pe=function(ue){return ue=="Square"?T.symbolSquare:ue=="Circle"?T.symbolCircle:ue=="Cross"?T.symbolCross:ue=="Triangle"?T.symbolTriangle:ue=="Star"?T.symbolStar:ue=="Diamond"?T.symbolDiamond:ue=="Wye"?T.symbolWye:T.symbolCircle};const Me=B.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",ue=>ue.color).attr("colorId",ue=>ue.colorName.replace(/ /g,"-")).attr("shapeId",ue=>ue.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(ue,me){T.select(this).attr("d",T.symbol().type(Pe(ue.shape)).size((ue.sizeValue?L(ue.sizeValue):10)*2*et(p.plotArea.scatterSizeIndex)))}).attr("transform",function(ue){return`translate(${f(ue.dimension)}, ${a(ue.measure)})`}).attr(Qe.SeriesId,ue=>`${A.get(ue.colorName)}_${ue.colorName}`).attr(Qe.DimValue,ue=>String(ue.dimension)).attr("opacity",Ce?0:p.plotArea.fillOpacity).style("visibility",(ue,me)=>ue.dimension[0]===0||ue.measure===0&&p.plotArea.hideZeroValues||ue.dimension<k||ue.dimension>b||ue.measure<y||ue.measure>i?"hidden":"visible").on("click",At(s,l,(ue,me)=>({seriesId:`${A.get(me.colorName)}_${me.colorName}`,dimValue:String(me.dimension),legendUniqueId:`${A.get(me.colorName)}_${me.colorName}`,seriesDisplayName:me.colorName}))).on("mousemove",(ue,me)=>{st([{key:p.xAxisTitle.xAxisTitleText,value:je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(me.dimension)},{key:p.yAxisTitle.yAxisTitleText,value:je(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(me.measure)},{key:"Color",value:me.colorName},...me.shapeName?[{key:"Shape",value:me.shapeName}]:[]],p,ue,{alias:me.colorName},ht(n,String(me.dimension),{alias:me.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),se=Math.max(se,Me.value),E=Math.min(E,Me.dimension),$=Math.max($,Me.dimension),ce=Math.min(ce,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):se*1.1;a=T.scaleLinear().domain([Pe,Me]).range([K,0]),L=T.scaleLinear().domain([ce,oe]).range([1,10])}catch(Pe){ge(ua,"initScale",Pe)}},Te=()=>{try{const Me=(parseFloat(e.plotArea.ticksHeight)||100)/100*K;let{xAxisLabelArray:Ce,customTickValue:ve}=xi($,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 ue=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(B,p,0,Ae,ue,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(se,q,K,e,y,i);const ue=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(B,p,0,he,ue,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}B.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}B.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,ue)=>{try{let de=p.legends.legendPosition,le=p.legends.legendFontStyle,U=N.append("foreignObject").attr("visibility",p.legends.legendVisibility?"visible":"hidden").attr("x",Me).attr("y",Ce).attr("width",ve).attr("height",ue).style("user-select","none"),Y=(de==Be.top||de==Be.bottom)&&m.length>0?"50%":"100%";var me=U.append("xhtml:div").style("width",Y).style("display","flex").style("height",de==Be.top||de==Be.bottom?ue-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=me.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(ne.italic)?ne.italic:"").style("text-decoration",le.includes(ne.underline)?ne.underline:"").style("font-weight",le.includes(ne.bold)?ne.bold:"").style("white-space","nowrap").html(R.name)})}catch(de){ge(ua,"colorListWithScroll",de)}},Ye=(Pe,Me,Ce,ve,ue)=>{try{let de=p.legends.legendPosition,le=p.legends.legendFontStyle,U=N.append("foreignObject").attr("visibility",p.legends.legendVisibility?"visible":"hidden").attr("x",Me).attr("y",Ce).attr("width",ve).attr("height",ue).style("user-select","none"),Y=p.legends.legendPosition==Be.top||p.legends.legendPosition==Be.bottom?"calc(50% - 5px)":"calc(100%)";var me=U.append("xhtml:div").style("width",Y).style("display","flex").style("height",de==Be.top||de==Be.bottom?ue-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=me.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(ne.italic)?ne.italic:"").style("text-decoration",le.includes(ne.underline)?ne.underline:"").style("font-weight",le.includes(ne.bold)?ne.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=fe.useRef(),S=fe.useRef(h);S.current=h;const p=fe.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,B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,E,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q=[],be=[],Le,Fe=0;const Te=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};fe.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:xe,maxNumberForSecondaryAxis:O}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:N,yLabel:E,xLabel:$,yTitle:q,xTitle:se,dimensionHeightWidthArray:ce,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe}=vt(b,k,xe,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,$,k,se,te.chartType,E,J,F),Ft(F,e,d,V,c,N,q,E),Ut(c,j,N,e,d,F,J,pe,he),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+Te),e.plotArea.hideZeroValues&&(te.hideZeroValues=!0);let le=H?de(r):ue(),U=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=U.findIndex(D=>D.Legend===v.Legend);w!==-1&&U.splice(w,1)}}),le=U,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 Y=[],R=[];be.forEach(v=>{v.key=="base"?v.opacity=0:v.opacity=1,v.forEach(w=>Y.push(w)),!R.includes(v.dimension)&&v.dimensionTotal===0&&v.total===0&&R.push(v.dimension)}),te.yMaxLeft=T.max(Y,v=>v[1]),te.yMinLeft=T.min(Y,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 U=[],Y=[],R=[];le&&le.forEach((w,D)=>{w.dimension&&(U.push(w.dimension),Y.push({dimension:w.dimension,chartDataIndex:D,selfIndex:Y.length}))}),t?R=gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(w=>w):R=U;let v=JSON.parse(JSON.stringify(te.legendList));Y.forEach((w,D)=>{v[w.chartDataIndex]=R[w.selfIndex]}),te.legendList.forEach((w,D)=>{te.formattedDimensionListMap.set(w,v[D])})}catch(U){throw U}},Ve=()=>{let le=ot(B||te.yMaxLeft,te.yMinLeft,F,e,te,Z,B).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:B!==void 0&&!Number.isNaN(B)?B: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(B||te.yMaxLeft,te.yMinLeft,F,e,te,Z,B);L=T.axisLeft(y).tickFormat(U=>_e(U,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 U;if(be.forEach((Y,R)=>Y.forEach(v=>v.key=Y.key)),Le){let Y=Q.map(R=>R.legend);U=T.stack().keys(Y)(Le),U.forEach((R,v)=>{U[v].color=Q[v].properties.color})}U&&U.forEach(Y=>{Y.forEach(R=>{R.Key=Y.key})}),[0,1].forEach(Y=>{if(Y===1&&(be=U),be){let R=i.selectAll(`.parentGroup-${Y}`).data([null]);R=R.enter().append("g").attr("class",`parentGroup parentGroup-${Y}`).merge(R);let v=R.selectAll(`.bar-group-${Y}`).data(be);v=v.enter().append("g").attr("class",`bar-group-${Y}`).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=>Y===0&&M.data.dimension&&Le?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(M,_)=>{const X=H?Aa.base:Aa.dimensionTotal,z={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,z,ht(l,String(te.formattedDimensionListMap.get(H?_.data.xKey:_.data.dimension||_.data.legend)??(H?_.data.xKey:_.data.dimension||_.data.legend)??""),{...z,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??""),z=String(H?_.data.xKey||"":_.data.dimension||_.data.legend||"");return{seriesId:X,dimValue:z,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"&&Y!=1){const M=v.selectAll("text").data(z=>z),_=M.enter().append("text").text(z=>_e(z[1]-z[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",z=>f(H?z.data.xKey:z.data.dimension||z.data.legend)+f.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",z=>z[1]-z[0]!==0&&y(z[1])?"visible":"hidden");(I?_.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):_).attr("y",z=>z[1]?y(z[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,U,Y,R,v)=>{if(!e.plotArea.fitChart){const w=le[0].data.length-Te,D=U-20;ae=te.dimensionList.slice(Fe,Fe+Te),Ye(),Q=JSON.parse(JSON.stringify(le)),Q.forEach((C,M)=>Q[M].data=C.data.filter(_=>ae.includes(_.dimension))),ye(),Y.append("rect").attr("x",R.left).attr("y",D).attr("width",v).attr("height",8).attr("fill","#ddd").attr("rx",4);const I=v*Te/te.dimensionList.length,W=Y.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+Te),Ye(),Q=JSON.parse(JSON.stringify(le)),Q.forEach((_,X)=>Q[X].data=_.data.filter(z=>ae.includes(z.dimension))),ye(),ve()}));Y.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,z)=>Q[z].data=X.data.filter(Se=>ae.includes(Se.dimension))),ye(),ve()})}ve()},ve=()=>{qt(i,te,$,e,d,y,P,ce,k,x,t,J,F,te.legendList,f),Pe()},ue=()=>{try{if(g.length<1)return[];if(te.dimensionList.length<2)return[];let le=[],U=[],Y=[],R="";if(R.length>1){let W=R;g.forEach(C=>{W===C.properties.currentLegend?U.push(C):Y.push(C)})}U.length>0&&(Q=U);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),Y.length>0&&(Q=Y,Le=pt(ae,Y,!1)),le}catch(le){throw le}},me=le=>le==null||le===""?0:Number(le),de=le=>(le[0]?.Column1==""?le.filter(Y=>Y.Column1&&Y.Column1!=="*"):o?le.Data:le).map(Y=>({xKey:Y.Column1||Y.Dimension||Y.Legend,base:me(Y.Column3||Y.Total),up:me(Y.Column4||Y.Up),down:me(Y.Column5||Y.Down),total:me(Y.Column6||Y.total),dimensionTotal:me(Y.Column2||Y.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=fe.useRef(),p=fe.useRef(n);p.current=n;const H=fe.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,B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N,E,$,q,se,ce,oe,he,Ae,pe,xe,O,J,F,b,k,d,c,i,y,f,a,L,P,ae,Q,be,Le,Fe=[],Te=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};fe.useEffect(()=>{try{De()}catch(U){ge("Tornadochart","createTornadoChart",U)}},[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:xe,maxNumberForSecondaryAxis:O}=Nt(e,ee.yMinLeft,ee.yMaxLeft,ee.yMinRight,ee.yMaxRight),{margin:N,yLabel:E,xLabel:$,yTitle:q,xTitle:se,dimensionHeightWidthArray:ce,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Ae,secondaryYLabel:pe,visibleBars:te,columnWidth:m,scrollbarVisible:ke}=vt(b,k,xe,O,ee.yMaxLeft,e,u?ee.legendList.map(U=>U.alias.split(" - ")[0]):ee.legendList.map(U=>U.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,$,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,$,k,se,ee.chartType,E,J,F),Ft(F,e,c,V,i,N,q,E,J),Ut(i,j,N,e,c,F,J,pe,he),wt(i,e,b,oe),Dt(k,i,ce,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,Te,!1,ue,V)},Ve=(U,Y,R,v)=>U.map((w,D)=>{const I=Y[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 U;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;U=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=U,ee.yMaxLeft=v,ee.yMaxRight=w}const Y=t?gt(e.xAxisLabel.xAxisNumberFormat,ee.dimensionList):ee.dimensionList;ee.dimensionList.forEach((R,v)=>{ee.formattedDimensionListMap.set(R,Y[v])}),Fe=JSON.parse(JSON.stringify(u?g:U)),g=Fe,Le=ee.dimensionList,e.plotArea.hideZeroValues&&(ee.hideZeroValues=!0)},ie=()=>{let U=ee.yMaxLeft,Y=ee.yMaxRight,R=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,v,w=!1,D=!1;U>Y?(v=U,w=!0):(v=Y,D=!0);let I=e.annotation.annotationVisibility!="5"?U/v!==1?Math.abs(U/v)*100<10?3:0:Math.abs(Y/v)*100<10?3:0:0,W=0,C=0;U<0&&Y>0?(W=U*(1.2+(D?I:0)),C=Y*(1.2+(w?I:0))):U>=0&&Y>=0?(W=0,C=Y*(1.2+(w?I:0))):U<=0&&Y<=0?(W=U*(1.2+(D?I:0)),C=0):(W=U*1.2,C=Y*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(U=>_e(U,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,B,V,J).yAxisLabelArray).ticks(ot(B||ee.yMaxLeft,ee.yMinLeft,F,e,ee,Z,B,V,J).customTickValue??J/30).tickPadding(8).tickSizeOuter(0)},Ce=()=>{y.selectAll(".parentGroup").remove();const U=e.plotArea.plotAreaCalculatedHigh,Y=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?U!==we.white?U:"none":Y!==we.white?Y:"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=U=>{J=b-U.left-U.right,F=k-U.bottom-U.top},ue=(U,Y,R)=>{Fe=Y,Le=U,te=R,le()};function me(U){const Y=new Map;return U.forEach(R=>{let v=Y.get(R.properties.legendUniqueId);if(v){let w=v.data??[];w.push(R.data[0]),Y.set(R.properties.legendUniqueId,{...v,data:w})}else v={...R,data:[R.data[0]]},Y.set(R.properties.legendUniqueId,v)}),Y.size>0?Array.from(Y.keys()).map(R=>Y.get(R)):U}function de(U,Y,R,v,w,D,I,W,C,M,_,X,z=!1){const Se=(ze,Ie,Oe,lt,ut)=>{try{if(ut&&(ze=M+ze),!C||!Array.isArray(C.dimensionList)||!Array.isArray(U))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(U||[]));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(z){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=Y-w.top-w.bottom,Ie=Math.max(0,G.length-W),Oe=Y-8;v.append("rect").attr("id","scrollbarTrack").attr("x",z?R-8:w.left).attr("y",z?w.top:Oe).attr("width",z?8:D).attr("height",z?ze:8).attr("fill","#ccc");const lt=(z?ze:D)*W/C.dimensionList.length,ut=v.append("rect").attr("x",z?R-8:w.left).attr("y",z?w.top:Oe).attr("width",z?8:lt).attr("height",z?lt:8).attr("fill","#999").style("cursor",z?"ns-resize":"ew-resize");ut.call(T.drag().on("drag",tt=>{if(z){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),z){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,$,F,J,ae,be,a,ee.yMaxLeft,Le,A,t,b,ce,m,f),Ce();const U=me(Fe);Da(U??[],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=fe.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,B,N,E,$,q,se,ce,oe,he,Ae,pe,xe,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};fe.useEffect(()=>{try{be()}catch(Ce){ge("StackStackHorizontalBarchart","createDotPlot",Ce)}},[e]);const be=()=>{({formatOptions:e,svg:O,width:pe,height:xe}=Ct(A,e)),Le(),{maxNumberForPrimaryAxis:ce,maxNumberForSecondaryAxis:oe}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:V,yLabel:j,xLabel:K,yTitle:Z,xTitle:B,dimensionHeightWidthArray:N,chartTitleHeight:E,secondaryAxisTitleWidth:$,legendMargin:q,secondaryYLabel:se,visibleBars:a,columnWidth:x,scrollbarVisible:L}=vt(pe,xe,ce,oe,Q.yMaxLeft,e,Q.legendList,Q.dimensionList,Q.yMaxRight,H,ae,t,p,Q),De(V),kt(O,pe,xe,e),J=Mt(O,V),mt(J,e,0,he,Ae,m),Fe(),te(),Ya(e,J,j,Ae,he,d),St(e,p,O,V,K,xe,B,Q.chartType,j,he,Ae),Ft(Ae,e,0,p,O,V,Z,j),wt(O,e,pe,E),Dt(xe,O,N,E,pe,q,e,u,s,0,V,nt.rectangle,m,n),Bt(u,xe,pe,O,V,he,L,a,Q,f,!1,Ve,p)},Le=()=>{const Ce=[],ve=[];let ue=[],me=-1/0,de=1/0,le=-1/0,U=1/0;u.forEach(Y=>{ve.push(Y.properties.legendUniqueId),Y.data.forEach(R=>{Ce.push(R),me=Math.max(me,R.value),de=Math.min(de,R.value)})}),Q.chartData=Ce,Q.legendList=ve,Q.yMaxLeft=me,Q.yMinLeft=de>0?0:de,Q.yMaxRight=le,Q.yMinRight=U,ue=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(Y=>Y):Q.dimensionList,ue=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(Y=>Y):Q.dimensionList,Q.dimensionList.forEach((Y,R)=>{Q.formattedDimensionListMap.set(Y,ue[R]),Q.formattedDimensionListMap.set(Y,ue[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,he).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,he]),k=[Ae,0],Te()},Te=()=>{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,he);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)*he*(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),ue=J.selectAll(".cleveland-line-group").data(Array.from(ve),([de])=>de);ue.enter().append("g").attr("class","cleveland-line-group").append("line").merge(ue.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:""),ue.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 U=le.selectAll(".column-group").data(de.data,w=>w.dimension),Y=U.enter().append("g").attr("class","column-group");const R=e.animation.animationEnabled,v=Y.append("path").attr("class","cleveland-dot").attr("opacity",R?0:.9);v.merge(U.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("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),U.exit().remove()}),J.selectAll(".parentGroup").raise()},De=Ce=>{he=pe-Ce.left-Ce.right,Ae=xe-Ce.bottom-Ce.top},Ve=(Ce,ve,ue)=>{y=ve,i=Ce,a=ue,Ye()},Ye=()=>{Te(),ke(),Ua(e,J,K,Ae,he,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,xe,pe,he,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((ue,me)=>ue.data.forEach((de,le)=>{de[0]=P[me][le][0],de[1]=P[me][le][1]}));let ve=e.annotation.annotationSetLabelColor;P.forEach((ue,me)=>ue.forEach(de=>{de.key=ue.key,ue.color=JSON.parse(JSON.stringify(u[me].properties.color)),de.data.labelPosition=u[me].properties.dataLabelPosition,de.data.labelColor=ve=="2"?JSON.parse(JSON.stringify(u[me].properties.color)):u[me].properties.labelColor,de.hideZero=JSON.parse(JSON.stringify(u[me].properties.hideZeroValues))}))},ye=()=>{try{const Ce=Number(e.connector?.connectorVisibility);if(!e.connector||Ce===2)return;const ve=[],ue=[],me=[];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=>me.push(W)),de=1)}const U=[],Y=[],R=[],v=e.connector?.connectorCustomRange||[];me.forEach(I=>{const W=I.split("-");W.length&&U.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++)ue.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 z=D[_]?.Total??-1/0;for(let Se=_;Se<=X;Se++)D[Se].Total>z&&(z=D[Se].Total);z!==-1/0&&le.push(z),ue.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,ue,de,U),Me(ve,le,ue,de,U)}catch(Ce){console.error(Ce)}},Pe=(Ce,ve,ue,me,de)=>{try{J.append("g").selectAll("path").data(Ce).enter().filter((le,U)=>me!=null?U<Ce.length-1:U<Ce.length).append("path").attr("d",(le,U)=>e.total.totalVisibility?`M ${F(le.Total)+50},
260
260
  ${b(le.Dimension)+b.bandwidth()/2-5}
261
- H ${60+Math.max(F(ve[B]),F(ue[B].Total),F(le.Total))}
262
- V ${b(ue[B].Dimension)+b.bandwidth()/2+5}
263
- H ${30+F(ue[B].Total)}`:`M ${F(le.Total)+30},
261
+ H ${60+Math.max(F(ve[U]),F(ue[U].Total),F(le.Total))}
262
+ V ${b(ue[U].Dimension)+b.bandwidth()/2+5}
263
+ H ${30+F(ue[U].Total)}`:`M ${F(le.Total)+30},
264
264
  ${b(le.Dimension)+b.bandwidth()/2-5}
265
- H ${45+Math.max(F(ve[B]),F(ue[B].Total),F(le.Total))}
266
- V ${b(ue[B].Dimension)+b.bandwidth()/2+5}
267
- H ${10+F(ue[B].Total)}
268
- `).style("stroke",e.connector.connectorLineColor!==Fe.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",le=>ce.includes(le.Dimension)||le.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(le){console.error(le)}},Me=(Ce,ve,ue,me,ce)=>{try{let le=e.connector.connectorFontStyle,B=e.connector.connectorNumberFormat,$=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((E,k)=>me!=null?k<Ce.length-1:k<Ce.length).append("text").attr("y",(E,k)=>me==null?b(ue[k].Dimension)/2+b(E.Dimension)/2+15:me==1?$<6&&b.bandwidth()>40?b(ue[k].Dimension)+b.bandwidth()/2+b.bandwidth()/2+13:b(ue[k].Dimension)+b.bandwidth()/2+b.bandwidth()/2+7:b(ue[k].Dimension)+b.bandwidth()/2+b.bandwidth()/2*me+12).attr("x",(E,k)=>e.total.totalVisibility?70+Math.max(F(ve[k]),F(ue[k].Total),F(E.Total)):50+Math.max(F(ve[k]),F(ue[k].Total),F(E.Total))).text((E,k)=>(E.CustomTotal==0&&ue[k].CustomTotal!=0&&(E.CustomTotal=1),hi(ue[k].Total,E.Total,parseInt(e.connector.connectorDecimalPrecision),B,parseInt(E.Dimension),parseInt(ue[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!==Fe.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",E=>ce.includes(E.Dimension)||E.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,q=s.get(V)??0;return q>0?parseFloat((j/q*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 P=N.dataset?.data?.length??0,z=N.dataIndex??0;switch(n){case"1":return!0;case"2":return z===0;case"3":return z===P-1;case"4":return z===0||z===P-1;default:return!1}}function j(N){const P=N.dataset?.data?.[N.dataIndex];return ll(P)}function q(N){if(o)return l==="2"?"center":"end";const P=j(N);switch(l){case"2":return"center";case"3":return P<0?"end":"start";case"1":return P>0?"end":"start";case"4":default:return P>0?"end":"start"}}function Z(N){if(o)return l==="2"?"center":"end";const P=j(N);if(h)switch(l){case"2":return"center";case"3":return"right";case"1":case"4":default:return P<0?"left":"right"}switch(l){case"2":return"center";case"3":return P>0?"top":"bottom";case"1":case"4":default:return P<0?"bottom":"top"}}function Y(N,P){const z=ll(N);if(s&&z===0)return null;const te=_e(z,G,g,H);if(o){const oe=P?.chart?.data?.labels?.[P.dataIndex]??"";return oe?`${oe}
269
- ${te}`:te}return te}return{display:V,anchor:q,align:Z,offset:o?l==="2"?0:8:l==="2"?0:4,color:p?N=>{const P=N.dataset?.backgroundColor,z=N.dataset?.borderColor,te=Array.isArray(P)?P[N.dataIndex]:P;return typeof te=="string"&&te?te: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=fe.useRef(null),m=fe.useRef(null),A=fe.useRef(!1);fe.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]),fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"line",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"area",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.LegendList??[],[t]),s=fe.useMemo(()=>pa(t,"pie",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>t.LegendList??[],[t]),s=fe.useMemo(()=>pa(t,"doughnut",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>pa(t,"scatter",e,h),[t,e,h]),l=fe.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=fe.useMemo(()=>t.ChartData?.map(m=>m.properties),[t]),s=fe.useMemo(()=>pa(t,"bubble",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>pa(t,"radar",e,h),[t,e,h]),l=fe.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=fe.useMemo(()=>t.LegendList??[],[t]),s=fe.useMemo(()=>pa(t,"polarArea",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"bar",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"horizontalBar",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"line",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"area",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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"})}));
265
+ H ${45+Math.max(F(ve[U]),F(ue[U].Total),F(le.Total))}
266
+ V ${b(ue[U].Dimension)+b.bandwidth()/2+5}
267
+ H ${10+F(ue[U].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,ue,me,de)=>{try{let le=e.connector.connectorFontStyle,U=e.connector.connectorNumberFormat,Y=Ae/30<i.length?Math.round(Ae/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(U=".2s"),J.append("g").selectAll("text1").data(Ce).enter().filter((R,v)=>me!=null?v<Ce.length-1:v<Ce.length).append("text").attr("y",(R,v)=>me==null?b(ue[v].Dimension)/2+b(R.Dimension)/2+15:me==1?Y<6&&b.bandwidth()>40?b(ue[v].Dimension)+b.bandwidth()/2+b.bandwidth()/2+13:b(ue[v].Dimension)+b.bandwidth()/2+b.bandwidth()/2+7:b(ue[v].Dimension)+b.bandwidth()/2+b.bandwidth()/2*me+12).attr("x",(R,v)=>e.total.totalVisibility?70+Math.max(F(ve[v]),F(ue[v].Total),F(R.Total)):50+Math.max(F(ve[v]),F(ue[v].Total),F(R.Total))).text((R,v)=>(R.CustomTotal==0&&ue[v].CustomTotal!=0&&(R.CustomTotal=1),hi(ue[v].Total,R.Total,parseInt(e.connector.connectorDecimalPrecision),U,parseInt(R.Dimension),parseInt(ue[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,$=N.dataIndex??0;switch(n){case"1":return!0;case"2":return $===0;case"3":return $===E-1;case"4":return $===0||$===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 B(N,E){const $=ll(N);if(s&&$===0)return null;const q=_e($,G,g,H);if(o){const se=E?.chart?.data?.labels?.[E.dataIndex]??"";return se?`${se}
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,$=N.dataset?.borderColor,q=Array.isArray(E)?E[N.dataIndex]:E;return typeof q=="string"&&q?q:typeof $=="string"&&$?$:S}:S,font:{size:x,family:m,style:A,weight:u},formatter:B,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=fe.useRef(null),m=fe.useRef(null),A=fe.useRef(!1);fe.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]),fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"line",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=fe.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=fe.useMemo(()=>pa(t,"area",e,n),[t,e,n]),A=fe.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=fe.useMemo(()=>t.LegendList??[],[t]),s=fe.useMemo(()=>pa(t,"pie",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>t.LegendList??[],[t]),s=fe.useMemo(()=>pa(t,"doughnut",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>pa(t,"scatter",e,h),[t,e,h]),l=fe.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=fe.useMemo(()=>t.ChartData?.map(m=>m.properties),[t]),s=fe.useMemo(()=>pa(t,"bubble",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>pa(t,"radar",e,h),[t,e,h]),l=fe.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=fe.useMemo(()=>t.LegendList??[],[t]),s=fe.useMemo(()=>pa(t,"polarArea",e,h),[t,e,h]),x=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"bar",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"horizontalBar",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"line",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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=fe.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=fe.useMemo(()=>ti(t,"area",e,h),[t,e,h]),x=fe.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),m=fe.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"})}));