(function(V,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ft):(V=typeof globalThis<"u"?globalThis:V||self,ft(V.ChartsReact={},V.React))})(this,function(V,ft){"use strict";var mU=Object.defineProperty;var gU=(V,ft,Dn)=>ft in V?mU(V,ft,{enumerable:!0,configurable:!0,writable:!0,value:Dn}):V[ft]=Dn;var Uu=(V,ft,Dn)=>gU(V,typeof ft!="symbol"?ft+"":ft,Dn);var Dn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Dn||{}),To=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(To||{}),Oo=(e=>(e.UPDATE="model-update",e))(Oo||{}),Hu=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Hu||{}),wo=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(wo||{}),$o=(e=>(e.CHANGE="zoom-domain-change",e))($o||{}),Mo=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Mo||{}),Co=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Co||{}),Ao=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Ao||{}),Lo=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(Lo||{}),ko=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(ko||{}),Do=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(Do||{}),Ro=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Ro||{}),Io=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Io||{}),No=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(No||{}),Po=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Po||{}),Uo=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Uo||{}),Bo=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Bo||{}),Ho=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Ho||{}),Sr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Sr||{}),Vo=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Vo||{}),Vu=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Vu||{}),Gu=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Gu||{}),zu=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(zu||{}),Fu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Fu||{}),ju=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(ju||{}),Tr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Tr||{});const o0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:zu,Area:Ao,Axis:Co,Bar:Ro,Boxplot:Io,CanvasZoom:Mo,Chart:Dn,Choropleth:Tr,CirclePack:Gu,Gauge:Do,Heatmap:ju,Legend:Vu,Line:Po,Meter:Fu,Modal:To,Model:Oo,Pie:ko,Radar:Uo,Scatter:No,Threshold:Vo,Toolbar:Hu,Tooltip:Sr,Tree:Bo,Treemap:Ho,WordCloud:Lo,ZoomBar:wo,ZoomDomain:$o},Symbol.toStringTag,{value:"Module"})),O=o0;var it=(e=>(e.HTML="html",e.SVG="svg",e))(it||{}),Go=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Go||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),Ue=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ue||{}),we=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(we||{}),Gt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Gt||{}),nt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(nt||{}),Or=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Or||{}),zt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(zt||{}),wr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(wr||{}),Cs=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Cs||{}),Mt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Mt||{}),lt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(lt||{}),jn=(e=>(e.CENTER="center",e))(jn||{}),pi=(e=>(e.LEFT="left",e.RIGHT="right",e))(pi||{}),Ft=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Ft||{}),Ke=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ke||{}),Qe=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Qe||{}),Wn=(e=>(e.SEMI="semi",e.FULL="full",e))(Wn||{}),As=(e=>(e.UP="up",e.DOWN="down",e))(As||{}),fi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(fi||{}),mi=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(mi||{}),ve=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(ve||{}),bt=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(bt||{}),Ls=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ls||{}),jt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(jt||{}),gi=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(gi||{}),$r=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))($r||{}),vi=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(vi||{}),Je=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Je||{}),Wu=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Wu||{});function zo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function yi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function xi(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?c0(o,d=>d.test(a)):l0(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function l0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function c0(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const qu=6048e5,h0=864e5,Yu=6e4,Xu=36e5,Zu=Symbol.for("constructDateFrom");function $e(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Zu in e?e[Zu](t):e instanceof Date?new e.constructor(t):new Date(t)}function qn(e,...t){const n=$e.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let d0={};function ks(){return d0}function Pt(e,t){return $e(t||e,e)}function bi(e,t){var n,r,i,s;const a=ks(),o=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??a.weekStartsOn??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.weekStartsOn)??0,l=Pt(e,t==null?void 0:t.in),c=l.getDay(),u=(c{let r;const i=p0[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},m0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},g0=(e,t,n,r)=>m0[e],v0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},y0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},x0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},b0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},E0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},S0=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},T0={ordinalNumber:S0,era:yi({values:v0,defaultWidth:"wide"}),quarter:yi({values:y0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:yi({values:x0,defaultWidth:"wide"}),day:yi({values:b0,defaultWidth:"wide"}),dayPeriod:yi({values:_0,defaultWidth:"wide",formattingValues:E0,defaultFormattingWidth:"wide"})},O0=/^(\d+)(th|st|nd|rd)?/i,w0=/\d+/i,$0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},M0={any:[/^b/i,/^(a|c)/i]},C0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},A0={any:[/1/i,/2/i,/3/i,/4/i]},L0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},k0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},D0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},R0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},I0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},N0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},P0={ordinalNumber:u0({matchPattern:O0,parsePattern:w0,valueCallback:e=>parseInt(e,10)}),era:xi({matchPatterns:$0,defaultMatchWidth:"wide",parsePatterns:M0,defaultParseWidth:"any"}),quarter:xi({matchPatterns:C0,defaultMatchWidth:"wide",parsePatterns:A0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xi({matchPatterns:L0,defaultMatchWidth:"wide",parsePatterns:k0,defaultParseWidth:"any"}),day:xi({matchPatterns:D0,defaultMatchWidth:"wide",parsePatterns:R0,defaultParseWidth:"any"}),dayPeriod:xi({matchPatterns:I0,defaultMatchWidth:"any",parsePatterns:N0,defaultParseWidth:"any"})},U0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},B0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},V0={date:zo({formats:U0,defaultWidth:"full"}),time:zo({formats:B0,defaultWidth:"full"}),dateTime:zo({formats:H0,defaultWidth:"full"})},Ku={code:"en-US",formatDistance:f0,formatLong:V0,formatRelative:g0,localize:T0,match:P0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Qu=typeof global=="object"&&global&&global.Object===Object&&global,G0=typeof self=="object"&&self&&self.Object===Object&&self,Be=Qu||G0||Function("return this")(),Me=Be.Symbol,Ju=Object.prototype,z0=Ju.hasOwnProperty,F0=Ju.toString,_i=Me?Me.toStringTag:void 0;function j0(e){var t=z0.call(e,_i),n=e[_i];try{e[_i]=void 0;var r=!0}catch{}var i=F0.call(e);return r&&(t?e[_i]=n:delete e[_i]),i}var W0=Object.prototype,q0=W0.toString;function Y0(e){return q0.call(e)}var X0="[object Null]",Z0="[object Undefined]",th=Me?Me.toStringTag:void 0;function Yn(e){return e==null?e===void 0?Z0:X0:th&&th in Object(e)?j0(e):Y0(e)}function tn(e){return e!=null&&typeof e=="object"}var K0="[object Symbol]";function Ds(e){return typeof e=="symbol"||tn(e)&&Yn(e)==K0}function Fo(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=v1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function _1(e){return function(){return e}}var Rs=function(){try{var e=Zn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),E1=Rs?function(e,t){return Rs(e,"toString",{configurable:!0,enumerable:!1,value:_1(t),writable:!0})}:jo,oh=b1(E1);function S1(e,t){for(var n=-1,r=e==null?0:e.length;++n-1}var C1=9007199254740991,A1=/^(?:0|[1-9]\d*)$/;function Xo(e,t){var n=typeof e;return t=t??C1,!!t&&(n=="number"||n!="symbol"&&A1.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=D1}function Kn(e){return e!=null&&Ko(e.length)&&!Wo(e)}function R1(e,t,n){if(!Ce(n))return!1;var r=typeof t;return(r=="number"?Kn(n)&&Xo(t,n.length):r=="string"&&t in n)?Ei(n[t],e):!1}function I1(e){return Zo(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&R1(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r-1}function Fy(e,t){var n=this.__data__,r=Us(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(o)?t>1?Vs(o,t-1,n,r,i):rl(i,o):r||(i[i.length]=o)}return i}var il=xh(Object.getPrototypeOf,Object),ix="[object Object]",sx=Function.prototype,ax=Object.prototype,Eh=sx.toString,ox=ax.hasOwnProperty,lx=Eh.call(Object);function Sh(e){if(!tn(e)||Yn(e)!=ix)return!1;var t=il(e);if(t===null)return!0;var n=ox.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Eh.call(n)==lx}function cx(){this.__data__=new hn,this.size=0}function ux(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hx(e){return this.__data__.get(e)}function dx(e){return this.__data__.has(e)}var px=200;function fx(e,t){var n=this.__data__;if(n instanceof hn){var r=n.__data__;if(!$i||r.lengtho))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&Vb?new Li:void 0;for(s.set(e,t),s.set(t,e);++d=D_){var c=t?null:k_(e);if(c)return ul(c);a=!1,i=Xh,l=new Li}else l=t?[]:o;t:for(;++rt?1:e>=t?0:NaN}function I_(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ml(e){let t,n,r;e.length!==2?(t=Jn,n=(o,l)=>Jn(e(o),l),r=(o,l)=>e(o)-l):(t=e===Jn||e===I_?e:N_,n=e,r=e);function i(o,l,c=0,u=o.length){if(c>>1;n(o[d],l)<0?c=d+1:u=d}while(c>>1;n(o[d],l)<=0?c=d+1:u=d}while(cc&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function N_(){return 0}function P_(e){return e===null?NaN:+e}function*U_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const B_=ml(Jn),gl=B_.right;ml(P_).center;function Ge(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r=s&&(n=r=s):(n>s&&(n=s),r=z_?10:s>=F_?5:s>=j_?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/ct&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*ct&&--l),l0))return[];if(e===t)return[e];const r=t=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function Rn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var W_={value:()=>{}};function yl(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ys.prototype=yl.prototype={constructor:Ys,on:function(e,t){var n=this._,r=q_(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s0)for(var n=new Array(i),r=0,i,s;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ud.hasOwnProperty(t)?{space:ud[t],local:e}:e}function X_(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xl&&t.documentElement.namespaceURI===xl?t.createElement(e):t.createElementNS(n,e)}}function Z_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hd(e){var t=Xs(e);return(t.local?Z_:X_)(t)}function K_(){}function bl(e){return e==null?K_:function(){return this.querySelector(e)}}function Q_(e){typeof e!="function"&&(e=bl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=_&&(_=x+1);!(b=m[_])&&++_=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function SE(e){e||(e=TE);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;st?1:e>=t?0:NaN}function OE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wE(){return Array.from(this)}function $E(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?UE:typeof t=="function"?HE:BE)(e,t,n??"")):Rr(this.node(),e)}function Rr(e,t){return e.style.getPropertyValue(t)||gd(e).getComputedStyle(e,null).getPropertyValue(t)}function GE(e){return function(){delete this[e]}}function zE(e,t){return function(){this[e]=t}}function FE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function jE(e,t){return arguments.length>1?this.each((t==null?GE:typeof t=="function"?FE:zE)(e,t)):this.node()[e]}function vd(e){return e.trim().split(/^|\s+/)}function _l(e){return e.classList||new yd(e)}function yd(e){this._node=e,this._names=vd(e.getAttribute("class")||"")}yd.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function xd(e,t){for(var n=_l(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function xS(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=CS.exec(e))?new he(t[1],t[2],t[3],1):(t=AS.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LS.exec(e))?Qs(t[1],t[2],t[3],t[4]):(t=kS.exec(e))?Qs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=DS.exec(e))?Ad(t[1],t[2]/100,t[3]/100,1):(t=RS.exec(e))?Ad(t[1],t[2]/100,t[3]/100,t[4]):Td.hasOwnProperty(e)?$d(Td[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function $d(e){return new he(e>>16&255,e>>8&255,e&255,1)}function Qs(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function PS(e){return e instanceof Ri||(e=fn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function Sl(e,t,n,r){return arguments.length===1?PS(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}El(he,Sl,Sd(Ri,{brighter(e){return e=e==null?Ks:Math.pow(Ks,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ii:Math.pow(Ii,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(nr(this.r),nr(this.g),nr(this.b),Js(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Md,formatHex:Md,formatHex8:US,formatRgb:Cd,toString:Cd}));function Md(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function US(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cd(){const e=Js(this.opacity);return`${e===1?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${e===1?")":`, ${e})`}`}function Js(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rr(e){return e=nr(e),(e<16?"0":"")+e.toString(16)}function Ad(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ze(e,t,n,r)}function Ld(e){if(e instanceof ze)return new ze(e.h,e.s,e.l,e.opacity);if(e instanceof Ri||(e=fn(e)),!e)return new ze;if(e instanceof ze)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n0&&l<1?0:a,new ze(a,o,l,e.opacity)}function kd(e,t,n,r){return arguments.length===1?Ld(e):new ze(e,t,n,r??1)}function ze(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}El(ze,kd,Sd(Ri,{brighter(e){return e=e==null?Ks:Math.pow(Ks,e),new ze(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ii:Math.pow(Ii,e),new ze(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new he(Tl(e>=240?e-240:e+120,i,r),Tl(e,i,r),Tl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ze(Dd(this.h),ta(this.s),ta(this.l),Js(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Js(this.opacity);return`${e===1?"hsl(":"hsla("}${Dd(this.h)}, ${ta(this.s)*100}%, ${ta(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Dd(e){return e=(e||0)%360,e<0?e+360:e}function ta(e){return Math.max(0,Math.min(1,e||0))}function Tl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ol=e=>()=>e;function BS(e,t){return function(n){return e+n*t}}function HS(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function VS(e){return(e=+e)==1?Rd:function(t,n){return n-t?HS(t,n,e):Ol(isNaN(t)?n:t)}}function Rd(e,t){var n=t-e;return n?BS(e,n):Ol(isNaN(e)?t:e)}const ea=function e(t){var n=VS(t);function r(i,s){var a=n((i=Sl(i)).r,(s=Sl(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Rd(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function GS(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:xe(r,i)})),n=$l.lastIndex;return n180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:xe(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:xe(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push(i(p)+"scale(",null,",",null,")");f.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(p){for(var f=-1,g=h.length,m;++f=0&&e._call.call(void 0,t),e=e._next;--Nr}function Fd(){ir=(ia=Vi.now())+sa,Nr=Ui=0;try{tT()}finally{Nr=0,nT(),ir=0}}function eT(){var e=Vi.now(),t=e-ia;t>Vd&&(sa-=t,ia=e)}function nT(){for(var e,t=ra,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ra=n);Hi=e,Cl(r)}function Cl(e){if(!Nr){Ui&&(Ui=clearTimeout(Ui));var t=e-ir;t>24?(e<1/0&&(Ui=setTimeout(Fd,e-Vi.now()-sa)),Bi&&(Bi=clearInterval(Bi))):(Bi||(ia=Vi.now(),Bi=setInterval(eT,Vd)),Nr=1,Gd(Fd))}}function jd(e,t,n){var r=new aa;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var rT=yl("start","end","cancel","interrupt"),iT=[],Wd=0,qd=1,Al=2,oa=3,Yd=4,Ll=5,la=6;function ca(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;sT(e,n,{name:t,index:r,group:i,on:rT,tween:iT,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Wd})}function kl(e,t){var n=Fe(e,t);if(n.state>Wd)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Fe(e,t);if(n.state>oa)throw new Error("too late; already running");return n}function Fe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function sT(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zd(s,0,n.time);function s(c){n.state=qd,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,p;if(n.state!==qd)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===oa)return jd(a);p.state===Yd?(p.state=la,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+uAl&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function IT(e,t,n){var r,i,s=RT(t)?kl:nn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function NT(e,t){var n=this._id;return arguments.length<2?Fe(this.node(),n).on.on(e):this.each(IT(n,e,t))}function PT(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function UT(){return this.on("end.remove",PT(this._id))}function BT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bl(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ua(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pr(e){return e=ua(Math.abs(e)),e?e[1]:NaN}function uO(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function hO(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var dO=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gi(e){if(!(t=dO.exec(e)))throw new Error("invalid format: "+e);var t;return new Il({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Gi.prototype=Il.prototype;function Il(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Il.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function pO(e){t:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Jd;function fO(e,t){var n=ua(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Jd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ua(e,Math.max(0,t+s-1))[0]}function tp(e,t){var n=ua(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const ep={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:cO,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>tp(e*100,t),r:tp,s:fO,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function np(e){return e}var rp=Array.prototype.map,ip=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mO(e){var t=e.grouping===void 0||e.thousands===void 0?np:uO(rp.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?np:hO(rp.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Gi(d);var h=d.fill,p=d.align,f=d.sign,g=d.symbol,m=d.zero,v=d.width,x=d.comma,_=d.precision,E=d.trim,b=d.type;b==="n"?(x=!0,b="g"):ep[b]||(_===void 0&&(_=12),E=!0,b="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var T=g==="$"?n:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",M=g==="$"?r:/[%p]/.test(b)?a:"",D=ep[b],A=/[defgprs%]/.test(b);_=_===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function R($){var H=T,P=M,B,S,w;if(b==="c")P=D($)+P,$="";else{$=+$;var L=$<0||1/$<0;if($=isNaN($)?l:D(Math.abs($),_),E&&($=pO($)),L&&+$==0&&f!=="+"&&(L=!1),H=(L?f==="("?f:o:f==="-"||f==="("?"":f)+H,P=(b==="s"?ip[8+Jd/3]:"")+P+(L&&f==="("?")":""),A){for(B=-1,S=$.length;++Bw||w>57){P=(w===46?i+$.slice(B+1):$.slice(B))+P,$=$.slice(0,B);break}}}x&&!m&&($=t($,1/0));var k=H.length+$.length+P.length,U=k>1)+H+$+P+U.slice(k);break;default:$=U+H+$+P;break}return s($)}return R.toString=function(){return d+""},R}function u(d,h){var p=c((d=Gi(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Pr(h)/3)))*3,g=Math.pow(10,-f),m=ip[8+f/3];return function(v){return p(g*v)+m}}return{format:c,formatPrefix:u}}var ha,Nl,sp;gO({thousands:",",grouping:[3],currency:["$",""]});function gO(e){return ha=mO(e),Nl=ha.format,sp=ha.formatPrefix,ha}function vO(e){return Math.max(0,-Pr(Math.abs(e)))}function yO(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pr(t)/3)))*3-Pr(Math.abs(e)))}function xO(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pr(t)-Pr(e))+1}function Ur(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const ap=Symbol("implicit");function da(){var e=new od,t=[],n=[],r=ap;function i(s){let a=e.get(s);if(a===void 0){if(r!==ap)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new od;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return da(t,n).unknown(r)},Ur.apply(i,arguments),i}function bO(e){return function(){return e}}function _O(e){return+e}var op=[0,1];function Br(e){return e}function Pl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:bO(isNaN(t)?NaN:.5)}function EO(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function SO(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i2?TO:SO,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),xe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,_O),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Nd,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Br,u()):a!==Br},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,p){return r=h,i=p,u()}}function cp(){return lp()(Br,Br)}function OO(e,t,n,r){var i=vl(e,t,n),s;switch(r=Gi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=yO(i,a))&&(r.precision=s),sp(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=xO(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=vO(i))&&(r.precision=s-(r.type==="%")*2);break}}return Nl(r)}function up(e){var t=e.domain;return e.ticks=function(n){var r=t();return qs(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return OO(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o0;){if(c=Dr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function je(){var e=cp();return e.copy=function(){return Ul(e,je())},Ur.apply(e,arguments),up(e)}function Bl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[gl(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Bl().domain([e,t]).range(i).unknown(s)},Ur.apply(up(a),arguments)}function zi(e,t,n){this.k=e,this.x=t,this.y=n}zi.prototype={constructor:zi,scale:function(e){return e===1?this:new zi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new zi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},zi.prototype;const de="cds",vn={opacity:{unselected:.05,selected:.4}},In={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Hr={duration:1e3,ease:Qd,zoomLevel:3},Vr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},hp={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Le={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},wO={defaultBins:10},Nt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},yn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Kt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},sr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},We={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},dp={minCellDividerDimension:16},pp={default:{size:24}},fp={defaultOffset:4,horizontalOffset:10},mp={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},be={height:{[Ue.GRAPH_VIEW]:32,[Ue.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},$O=[{type:jt.RADIUS,name:"Radius"},{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}],Gr={type:we.END_LINE,threshold:16,numCharacter:14},MO={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},CO={enabled:!0,position:Or.BOTTOM,clickable:!0,truncation:Gr,alignment:zt.LEFT,order:null,additionalItems:[]},AO={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},LO={enabled:!0},gp={enabled:!0,showTotal:!0,truncation:Gr,groupLabel:"Group"},vp={top:{visible:!0,includeZero:!0,truncation:Gr},bottom:{visible:!0,includeZero:!0,truncation:Gr},left:{visible:!0,includeZero:!0,truncation:Gr},right:{visible:!0,includeZero:!0,truncation:Gr}},pa={addSpaceOnEdges:1,showDayName:!1,localeObject:Ku,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let yp=!1;try{yp=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const Jt={width:null,height:null,resizable:!0,theme:Go.WHITE,tooltip:gp,legend:CO,locale:MO,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:bt.SHOW_AS_DATATABLE},...yp?[{type:bt.MAKE_FULLSCREEN}]:[],{type:bt.EXPORT_CSV},{type:bt.EXPORT_PNG},{type:bt.EXPORT_JPG}]}},xp=at({},Jt,{thematic:{projection:Je.geoNaturalEarth1}}),Fi=at({},Jt,{axes:vp,timeScale:pa,grid:AO,ruler:LO,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ue.GRAPH_VIEW}}}),ar=at({},Fi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:at(pa,{addSpaceOnEdges:1})}),kO=at({},ar,{}),DO=at({},ar,{}),RO=at({},ar,{bars:at({},ar.bars,{dividerSize:1.5})}),IO=at({},ar,{}),Hl=at({},Fi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),NO=Hl,bp=at({},Hl,{points:{radius:3,filled:!1,enabled:!0}}),_p=at({},bp,{timeScale:at(pa,{addSpaceOnEdges:0})}),PO=_p,UO=at({},Fi,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:jt.RADIUS,name:"Radius"}]}}),BO=at({},Fi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}]}}),HO=at({},ar,{bars:{dividerSize:1.5},timeScale:at(pa,{addSpaceOnEdges:0})}),VO=at({},Jt,{tooltip:at({},gp,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),Ep=at({},Jt,{pie:{labels:{formatter:null,enabled:!0},alignment:zt.LEFT,sortFunction:null,valueMapsTo:"value"}}),GO=at({},Jt,{legend:{enabled:!1},gauge:{type:Wn.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:zt.LEFT}}),zO=at({},Ep,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:zt.LEFT}}),Sp=at({},Jt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),FO=at({},Sp,{legend:{enabled:!0}}),jO=at({},Jt,{radar:{axes:{angle:"key",value:"value"},alignment:zt.LEFT},tooltip:{gridline:{enabled:!0}}}),WO=at({},ar,{comboChartTypes:[]}),qO=at({tree:{type:Cs.TREE}},Jt,{}),YO=at({},Jt,{data:at(Jt.data,{groupMapsTo:"name"})}),XO=at({},Jt,Vr,{data:at(Jt.data,{groupMapsTo:"name"})}),ZO=at({},Jt,{alluvial:{data:at(Jt.data,{groupMapsTo:"source"}),nodeAlignment:zt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),KO=at({},Jt,{axes:vp,heatmap:{divider:{state:$r.AUTO},colorLegend:{type:"linear"}}}),QO=at({},xp,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:ZO,areaChart:_p,axisChart:Fi,boxplotChart:IO,bubbleChart:UO,bulletChart:BO,chart:Jt,circlePackChart:XO,choroplethChart:QO,comboChart:WO,donutChart:zO,gaugeChart:GO,groupedBarChart:DO,heatmapChart:KO,histogramChart:HO,lineChart:bp,lollipopChart:NO,meterChart:Sp,pieChart:Ep,proportionalMeterChart:FO,radarChart:jO,scatterChart:Hl,simpleBarChart:kO,stackedAreaChart:PO,stackedBarChart:RO,thematicChart:xp,treeChart:qO,treemapChart:YO,wordCloudChart:VO};function JO(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=er(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Rt(e,t){var n;const r=pn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===nt.TIME?a.mapsTo="date":l===nt.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return Gl(r,t),at(r,t)}function xn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function ji(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Vl(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function Wi(e,t,n){if(n>e.length)return e;if(t===we.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===we.FRONT_LINE)return"..."+e.substr(-n);if(t===we.END_LINE)return e.substr(0,n)+"..."}function Gl(e,t){const n=y(e,"legend","additionalItems"),r=y(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=$O.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=R_(a,r,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Tp=(e,t)=>t===Gt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Tp(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function bn(e,t,n){return n===Gt.VERTICAL?[e,t]:[t,e]}function Op(e){const t=Pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function wp(e,t){const n=Pt(e,void 0);return n.setHours(0,0,0,0),n}function $p(e,t,n){const[r,i]=qn(void 0,e,t),s=wp(r),a=wp(i),o=+s-Op(s),l=+a-Op(a);return Math.round((o-l)/h0)}function tw(e,t){const n=Pt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ew(e,t){const n=Pt(e,void 0);return $p(n,tw(n))+1}function fa(e,t){return bi(e,{...t,weekStartsOn:1})}function Mp(e,t){const n=Pt(e,void 0),r=n.getFullYear(),i=$e(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=fa(i),a=$e(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=fa(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function nw(e,t){const n=Mp(e),r=$e(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),fa(r)}function rw(e,t){const n=Pt(e,void 0),r=+fa(n)-+nw(n);return Math.round(r/qu)+1}function Cp(e,t){var n,r,i,s;const a=Pt(e,t==null?void 0:t.in),o=a.getFullYear(),l=ks(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(i=l.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,u=$e((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=bi(u,t),h=$e((t==null?void 0:t.in)||e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=bi(h,t);return+a>=+d?o+1:+a>=+p?o:o-1}function iw(e,t){var n,r,i,s;const a=ks(),o=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,l=Cp(e,t),c=$e((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),bi(c,t)}function sw(e,t){const n=Pt(e,t==null?void 0:t.in),r=+bi(n,t)-+iw(n,t);return Math.round(r/qu)+1}function St(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Nn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return St(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):St(n+1,2)},d(e,t){return St(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return St(e.getHours()%12||12,t.length)},H(e,t){return St(e.getHours(),t.length)},m(e,t){return St(e.getMinutes(),t.length)},s(e,t){return St(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return St(i,t.length)}},zr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ap={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Nn.y(e,t)},Y:function(e,t,n,r){const i=Cp(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return St(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):St(s,t.length)},R:function(e,t){const n=Mp(e);return St(n,t.length)},u:function(e,t){const n=e.getFullYear();return St(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return St(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return St(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Nn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return St(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=sw(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):St(i,t.length)},I:function(e,t,n){const r=rw(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):St(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Nn.d(e,t)},D:function(e,t,n){const r=ew(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):St(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return St(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return St(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return St(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=zr.noon:r===0?i=zr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=zr.evening:r>=12?i=zr.afternoon:r>=4?i=zr.morning:i=zr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Nn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Nn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Nn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Nn.s(e,t)},S:function(e,t){return Nn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return kp(r);case"XXXX":case"XX":return or(r);case"XXXXX":case"XXX":default:return or(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return kp(r);case"xxxx":case"xx":return or(r);case"xxxxx":case"xxx":default:return or(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Lp(r,":");case"OOOO":default:return"GMT"+or(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Lp(r,":");case"zzzz":default:return"GMT"+or(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return St(r,t.length)},T:function(e,t,n){return St(+e,t.length)}};function Lp(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+St(s,2)}function kp(e,t){return e%60===0?(e>0?"-":"+")+St(Math.abs(e)/60,2):or(e,t)}function or(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=St(Math.trunc(r/60),2),s=St(r%60,2);return n+i+t+s}const Dp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Rp=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},aw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Dp(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Dp(r,t)).replace("{{time}}",Rp(i,t))},ow={p:Rp,P:aw},lw=/^D+$/,cw=/^Y+$/,uw=["D","DD","YY","YYYY"];function hw(e){return lw.test(e)}function dw(e){return cw.test(e)}function pw(e,t,n){const r=fw(e,t,n);if(console.warn(r),uw.includes(e))throw new RangeError(r)}function fw(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function mw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function gw(e){return!(!mw(e)&&typeof e!="number"||isNaN(+Pt(e)))}const vw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xw=/^'([^]*?)'?$/,bw=/''/g,_w=/[a-zA-Z]/;function zl(e,t,n){var r,i,s,a,o,l,c,u;const d=ks(),h=(n==null?void 0:n.locale)??d.locale??Ku,p=(n==null?void 0:n.firstWeekContainsDate)??((i=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(s=d.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,f=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,g=Pt(e,n==null?void 0:n.in);if(!gw(g))throw new RangeError("Invalid time value");let m=t.match(yw).map(x=>{const _=x[0];if(_==="p"||_==="P"){const E=ow[_];return E(x,h.formatLong)}return x}).join("").match(vw).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const _=x[0];if(_==="'")return{isToken:!1,value:Ew(x)};if(Ap[_])return{isToken:!0,value:x};if(_.match(_w))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:x}});h.localize.preprocessor&&(m=h.localize.preprocessor(g,m));const v={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(x=>{if(!x.isToken)return x.value;const _=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&dw(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&hw(_))&&pw(_,t,String(e));const E=Ap[_[0]];return E(g,_,h.localize,v)}).join("")}function Ew(e){const t=e.match(xw);return t?t[1].replace(bw,"'"):e}const Fl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Ip(e,t,n,r,i){const s=t===0,a=Number(zl(new Date(e),"c"))===2,o=Number(zl(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||ga(e)||qi(e,l)||Pn(e);case"minute":return s||ga(e)||qi(e,l)||Pn(e);case"30minutes":return s||ga(e)||qi(e,l)||Pn(e);case"hourly":return s||ga(e)||qi(e,l)||Pn(e);case"daily":return i?s||a||Pn(e):s||qi(e,l)||Pn(e);case"weekly":return s||a||Pn(e);case"monthly":return s||Pn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function jl(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=y(i,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=Ip(e,t,n,r,a);let p=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(p=p.replace("pp","h:mm:ss.SSS a"));const f=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,x=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!x){const _=zl(l,p,{locale:f}).split("").map(E=>{const b=Number(E);return E!==" "&&!Number.isNaN(b)?b.toLocaleString(g):E});return s[v](l,g,{},_.join(""))}else return s[v](l,g,x)}function ma(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function Sw(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function Tw(e){const t=Fl.reduce((n,[,r],i)=>{const s=Fl[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return ar.value),n=je().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Up(e,t){const n=y(t,"gradient","colors"),r=!Ve(n);let i=y(t,"pairing","option");const s=Pp(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(ht||{});function Ow(e,t){return e&&rd(e,t,Ti)}function ww(e,t){return function(n,r){if(n==null)return n;if(!Kn(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s=r&&++n;return n}function Nw(e){return e}function Pw(e=Jn){if(e===Jn)return Bp;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Bp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var Uw=Array.prototype,Bw=Uw.slice;function Yl(e){return()=>e}function Hw(e,t,n){let r;for(;;){const i=Dr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Vw(e){return Math.max(1,Math.ceil(Math.log(Iw(e))/Math.LN2)+1)}function Gw(){var e=Nw,t=Ge,n=Vw;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s=h)if(_>=h&&t===Ge){const b=Dr(d,h,E);isFinite(b)&&(b>0?h=(Math.floor(h/b)+1)*b:b<0&&(h=(Math.ceil(h*-b)+1)/-b))}else p.pop()}for(var f=p.length,g=0,m=f;p[g]<=d;)++g;for(;p[m-1]>h;)--m;(g||m0?p[s-1]:d,x.x1=s0)for(s=0;sn;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*d/l+h)),f=Math.min(r,Math.floor(t+(l-c)*d/l+h));Hp(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(Yi(e,n,t),i(e[r],s)>0&&Yi(e,n,r);a0;)--o}i(e[n],s)===0?Yi(e,n,o):(++o,Yi(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Yi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Xl(e,t,n){if(e=Float64Array.from(U_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Rn(e);if(t>=1)return tr(e);var r,i=(r-1)*t,s=Math.floor(i),a=tr(Hp(e,s).subarray(0,s+1)),o=Rn(e.subarray(s+1));return a+(o-a)*(i-s)}}function Vp(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n=0;)n[t]=t;return n}function zw(e,t){return e[t]}function Fw(e){const t=[];return t.key=e,t}function Zl(){var e=pt([]),t=Gp,n=Vp,r=zw;function i(s){var a=Array.from(e.apply(this,arguments),Fw),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Ww(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}let rn=class{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=y(r,"locale"),o=y(r,"tabularRepModal","tableHeadingFormatter"),l=y(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===nt.TIME&&(d=h=>s(h,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(h=>{d&&(h[1]=d(h[1]));for(const p in h){const f=h[p];typeof f=="number"&&(h[p]=a(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===nt.LINEAR||c===nt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===nt.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Nt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(pn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Nt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return Rw(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=wO.defaultBins}=s,l=Array.isArray(o),c=Gw().value(p=>p[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const p=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+p}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(p=>p[a]))),h=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,g=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:g[m]||0,bin:p.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Zl().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=ki(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Np(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===nt.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===nt.LOG||o===nt.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(p=>p.x0.toString()===c.toString());return a.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Np(p[f])===l:p[f].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=Lw(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Zl().offset(jw):Zl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[s]=a[c],d}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Gl(n,t),this.set({options:at(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(O.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Nt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(s=>s.map(a=>`"${(a==="–"?"–":a).split(/[,;'"`]/).map(o=>Ww(o)).join("")}"`)).map(s=>s.join(",")).join(` `),n=this.getOptions();let r="myChart";const i=y(n,"fileDownload","fileName");typeof i=="function"?r=i("csv"):typeof i=="string"&&(r=i),this.services.files.downloadCSV(t,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Nt.items.status,s=this.getOptions(),a=ki(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=y(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"numberOfVariants");(!n||n5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=da().range(o).domain(this.allDataGroups)}};class lr extends rn{constructor(t){super(t),this.axisFlavor=vi.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:y(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=y(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"–":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"–":l(h[s.identifier],c),...a?[h[a.identifier]===null?"–":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"–":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const r=y(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(pn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=ki(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(z).forEach(i=>{const s=z[i],a=n.axes[s];if(a&&a.scaleType===nt.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{y(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let qw=class extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"–":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}},Yw=class extends lr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Xl(t,.25),q_50:Xl(t,.5),q_75:Xl(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(_=>_[o]).sort(Jn),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,p=u-h,f=d+h,g=[],m=[];for(const _ of l)_f?g.push(_):m.push(_);c.outliers=g;const v=Rn(m),x=tr(m);c.whiskers={min:v||Rn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:x||tr([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData(),{number:i,code:s}=y(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=y(l,"outliers");return(c===null||c.length===0)&&(c=["–"]),[l[n],y(l,"whiskers","min")!==null?i(y(l,"whiskers","min"),s):"–",y(l,"quartiles","q_25")!==null?i(y(l,"quartiles","q_25"),s):"–",y(l,"quartiles","q_50")!==null?i(y(l,"quartiles","q_50"),s):"–",y(l,"quartiles","q_75")!==null?i(y(l,"quartiles","q_75"),s):"–",y(l,"whiskers","max")!==null?i(y(l,"whiskers","max"),s):"–",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(i(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"–",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"option");const r=hp.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=da().range(i).domain(this.allDataGroups)}},Xw=class extends lr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=y(n,"locale"),o=y(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"–":s(u.value,a),y(u,"marker")===null?"–":s(u.marker,a),y(u,"marker")===null?"–":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},Zw=class extends rn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ve(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ve(n)&&!Ve(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"–":a.id,a.name,a.value===null?"–":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=y(this.getOptions(),"color");this._colorScale=Up(this.getDisplayData(),t)}},Kw=class extends rn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=at({},t,this.getZoomOptions(t));Gl(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:at(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:jt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}},Qw=class extends rn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},Jw=class extends rn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}},t$=class extends lr{constructor(t){super(t),this.axisFlavor=vi.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==nt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==nt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==nt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==nt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ge(this.getDisplayData(),r=>r.value),n=je().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ve(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ve(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ve(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=pn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(pn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ve(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!Ve(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;uyt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}};class n$ extends rn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"–":a(d.value,o),...i?[i]:[]]]}else u=y(s,"total")||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let p;h.value!==null&&h.value!==void 0?p=Number(h.value):p=0;const f=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"–":a(p,o),a(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}let r$=class extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"–")])];return super.formatTable({headers:l,cells:c})}};class i$ extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"–"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class s$ extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}let a$=class extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}};var o$=/\s/;function l$(e){for(var t=e.length;t--&&o$.test(e.charAt(t)););return t}var c$=/^\s+/;function u$(e){return e&&e.slice(0,l$(e)+1).replace(c$,"")}var zp=NaN,h$=/^[-+]0x[0-9a-f]+$/i,d$=/^0b[01]+$/i,p$=/^0o[0-7]+$/i,f$=parseInt;function Fr(e){if(typeof e=="number")return e;if(Ds(e))return zp;if(Ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=u$(e);var n=d$.test(e);return n||p$.test(e)?f$(e.slice(2),n?2:8):h$.test(e)?zp:+e}var Kl=function(){return Be.Date.now()},m$="Expected a function",g$=Math.max,v$=Math.min;function ya(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(m$);t=Fr(t)||0,Ce(n)&&(u=!!n.leading,d="maxWait"in n,s=d?g$(Fr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(T){var M=r,D=i;return r=i=void 0,c=T,a=e.apply(D,M),a}function f(T){return c=T,o=setTimeout(v,t),u?p(T):a}function g(T){var M=T-l,D=T-c,A=t-M;return d?v$(A,s-D):A}function m(T){var M=T-l,D=T-c;return l===void 0||M>=t||M<0||d&&D>=s}function v(){var T=Kl();if(m(T))return x(T);o=setTimeout(v,g(T))}function x(T){return o=void 0,h&&r?p(T):(r=i=void 0,a)}function _(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function E(){return o===void 0?a:x(Kl())}function b(){var T=Kl(),M=m(T);if(r=arguments,i=this,l=T,M){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),a}return b.cancel=_,b.flush=E,b}function y$(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(cqt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Ql.setTime(+s),Jl.setTime(+a),e(Ql),e(Jl),Math.floor(n(Ql,Jl))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const xa=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):xa),xa.range;const _n=1e3,ke=_n*60,En=ke*60,Sn=En*24,tc=Sn*7,jp=Sn*30,ec=Sn*365,jr=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*_n)},(e,t)=>(t-e)/_n,e=>e.getUTCSeconds());jr.range;const nc=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_n)},(e,t)=>{e.setTime(+e+t*ke)},(e,t)=>(t-e)/ke,e=>e.getMinutes());nc.range,qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ke)},(e,t)=>(t-e)/ke,e=>e.getUTCMinutes()).range;const rc=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_n-e.getMinutes()*ke)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getHours());rc.range,qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getUTCHours()).range;const Zi=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ke)/Sn,e=>e.getDate()-1);Zi.range;const ic=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sn,e=>e.getUTCDate()-1);ic.range,qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sn,e=>Math.floor(e/Sn)).range;function cr(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ke)/tc)}const ba=cr(0),_a=cr(1),x$=cr(2),b$=cr(3),Wr=cr(4),_$=cr(5),E$=cr(6);ba.range,_a.range,x$.range,b$.range,Wr.range,_$.range,E$.range;function ur(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/tc)}const Wp=ur(0),Ea=ur(1),S$=ur(2),T$=ur(3),qr=ur(4),O$=ur(5),w$=ur(6);Wp.range,Ea.range,S$.range,T$.range,qr.range,O$.range,w$.range;const sc=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());sc.range,qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Tn=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Tn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Tn.range;const hr=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());hr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),hr.range;function $$(e,t,n,r,i,s){const a=[[jr,1,_n],[jr,5,5*_n],[jr,15,15*_n],[jr,30,30*_n],[s,1,ke],[s,5,5*ke],[s,15,15*ke],[s,30,30*ke],[i,1,En],[i,3,3*En],[i,6,6*En],[i,12,12*En],[r,1,Sn],[r,2,2*Sn],[n,1,tc],[t,1,jp],[t,3,3*jp],[e,1,ec]];function o(c,u,d){const h=um).right(a,h);if(p===a.length)return e.every(vl(c/ec,u/ec,d));if(p===0)return xa.every(Math.max(vl(c,u,d),1));const[f,g]=a[h/a[p-1][2]53)return null;"w"in G||(G.w=1),"Z"in G?(ot=oc(Ki(G.y,0,1)),It=ot.getUTCDay(),ot=It>4||It===0?Ea.ceil(ot):Ea(ot),ot=ic.offset(ot,(G.V-1)*7),G.y=ot.getUTCFullYear(),G.m=ot.getUTCMonth(),G.d=ot.getUTCDate()+(G.w+6)%7):(ot=ac(Ki(G.y,0,1)),It=ot.getDay(),ot=It>4||It===0?_a.ceil(ot):_a(ot),ot=Zi.offset(ot,(G.V-1)*7),G.y=ot.getFullYear(),G.m=ot.getMonth(),G.d=ot.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),It="Z"in G?oc(Ki(G.y,0,1)).getUTCDay():ac(Ki(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(It+5)%7:G.w+G.U*7-(It+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,oc(G)):ac(G)}}function D(F,q,Z,G){for(var dt=0,ot=q.length,It=Z.length,Ht,rt;dt=It)return-1;if(Ht=q.charCodeAt(dt++),Ht===37){if(Ht=q.charAt(dt++),rt=b[Ht in qp?q.charAt(dt++):Ht],!rt||(G=rt(F,Z,G))<0)return-1}else if(Ht!=Z.charCodeAt(G++))return-1}return G}function A(F,q,Z){var G=c.exec(q.slice(Z));return G?(F.p=u.get(G[0].toLowerCase()),Z+G[0].length):-1}function R(F,q,Z){var G=p.exec(q.slice(Z));return G?(F.w=f.get(G[0].toLowerCase()),Z+G[0].length):-1}function $(F,q,Z){var G=d.exec(q.slice(Z));return G?(F.w=h.get(G[0].toLowerCase()),Z+G[0].length):-1}function H(F,q,Z){var G=v.exec(q.slice(Z));return G?(F.m=x.get(G[0].toLowerCase()),Z+G[0].length):-1}function P(F,q,Z){var G=g.exec(q.slice(Z));return G?(F.m=m.get(G[0].toLowerCase()),Z+G[0].length):-1}function B(F,q,Z){return D(F,t,q,Z)}function S(F,q,Z){return D(F,n,q,Z)}function w(F,q,Z){return D(F,r,q,Z)}function L(F){return a[F.getDay()]}function k(F){return s[F.getDay()]}function U(F){return l[F.getMonth()]}function K(F){return o[F.getMonth()]}function W(F){return i[+(F.getHours()>=12)]}function j(F){return 1+~~(F.getMonth()/3)}function X(F){return a[F.getUTCDay()]}function ct(F){return s[F.getUTCDay()]}function J(F){return l[F.getUTCMonth()]}function Y(F){return o[F.getUTCMonth()]}function et(F){return i[+(F.getUTCHours()>=12)]}function ut(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var q=T(F+="",_);return q.toString=function(){return F},q},parse:function(F){var q=M(F+="",!1);return q.toString=function(){return F},q},utcFormat:function(F){var q=T(F+="",E);return q.toString=function(){return F},q},utcParse:function(F){var q=M(F+="",!0);return q.toString=function(){return F},q}}}var qp={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,L$=/^%/,k$=/[\\^$*+?|[\]().{}]/g;function xt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function R$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function I$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function N$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function P$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function U$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Yp(e,t,n){var r=Yt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Xp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function B$(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function H$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function V$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Zp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function G$(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Kp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function z$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function F$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function j$(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function W$(e,t,n){var r=Yt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function q$(e,t,n){var r=L$.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Y$(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function X$(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Qp(e,t){return xt(e.getDate(),t,2)}function Z$(e,t){return xt(e.getHours(),t,2)}function K$(e,t){return xt(e.getHours()%12||12,t,2)}function Q$(e,t){return xt(1+Zi.count(Tn(e),e),t,3)}function Jp(e,t){return xt(e.getMilliseconds(),t,3)}function J$(e,t){return Jp(e,t)+"000"}function tM(e,t){return xt(e.getMonth()+1,t,2)}function eM(e,t){return xt(e.getMinutes(),t,2)}function nM(e,t){return xt(e.getSeconds(),t,2)}function rM(e){var t=e.getDay();return t===0?7:t}function iM(e,t){return xt(ba.count(Tn(e)-1,e),t,2)}function tf(e){var t=e.getDay();return t>=4||t===0?Wr(e):Wr.ceil(e)}function sM(e,t){return e=tf(e),xt(Wr.count(Tn(e),e)+(Tn(e).getDay()===4),t,2)}function aM(e){return e.getDay()}function oM(e,t){return xt(_a.count(Tn(e)-1,e),t,2)}function lM(e,t){return xt(e.getFullYear()%100,t,2)}function cM(e,t){return e=tf(e),xt(e.getFullYear()%100,t,2)}function uM(e,t){return xt(e.getFullYear()%1e4,t,4)}function hM(e,t){var n=e.getDay();return e=n>=4||n===0?Wr(e):Wr.ceil(e),xt(e.getFullYear()%1e4,t,4)}function dM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xt(t/60|0,"0",2)+xt(t%60,"0",2)}function ef(e,t){return xt(e.getUTCDate(),t,2)}function pM(e,t){return xt(e.getUTCHours(),t,2)}function fM(e,t){return xt(e.getUTCHours()%12||12,t,2)}function mM(e,t){return xt(1+ic.count(hr(e),e),t,3)}function nf(e,t){return xt(e.getUTCMilliseconds(),t,3)}function gM(e,t){return nf(e,t)+"000"}function vM(e,t){return xt(e.getUTCMonth()+1,t,2)}function yM(e,t){return xt(e.getUTCMinutes(),t,2)}function xM(e,t){return xt(e.getUTCSeconds(),t,2)}function bM(e){var t=e.getUTCDay();return t===0?7:t}function _M(e,t){return xt(Wp.count(hr(e)-1,e),t,2)}function rf(e){var t=e.getUTCDay();return t>=4||t===0?qr(e):qr.ceil(e)}function EM(e,t){return e=rf(e),xt(qr.count(hr(e),e)+(hr(e).getUTCDay()===4),t,2)}function SM(e){return e.getUTCDay()}function TM(e,t){return xt(Ea.count(hr(e)-1,e),t,2)}function OM(e,t){return xt(e.getUTCFullYear()%100,t,2)}function wM(e,t){return e=rf(e),xt(e.getUTCFullYear()%100,t,2)}function $M(e,t){return xt(e.getUTCFullYear()%1e4,t,4)}function MM(e,t){var n=e.getUTCDay();return e=n>=4||n===0?qr(e):qr.ceil(e),xt(e.getUTCFullYear()%1e4,t,4)}function CM(){return"+0000"}function sf(){return"%"}function af(e){return+e}function of(e){return Math.floor(+e/1e3)}var Yr,lf;AM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function AM(e){return Yr=A$(e),lf=Yr.format,Yr.parse,Yr.utcFormat,Yr.utcParse,Yr}function LM(e){return new Date(e)}function kM(e){return e instanceof Date?+e:+new Date(+e)}function cf(e,t,n,r,i,s,a,o,l,c){var u=cp(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),x=c("%b %d"),_=c("%B"),E=c("%Y");function b(T){return(l(T)1?0:e<-1?ts:Math.acos(e)}function df(e){return e>=1?Sa:e<=-1?-Sa:Math.asin(e)}function pf(e){this._context=e}pf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Oa(e){return new pf(e)}function Un(){}function ff(e){this._context=e}ff.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function mf(e){return new ff(e)}function IM(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const NM=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Bn(e){const t=[];for(let n=0,r=e.length;n_e||e.height>_e)&&(e.width>_e&&e.height>_e?e.width>e.height?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e):e.width>_e?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e))}function $a(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function VM(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function GM(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),VM(i)}const pe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||pe(n,t)};function zM(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function FM(e,t){return gf(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function jM(e,t,n,r){const i=`.${e}:${t}`,s=n.cssText?zM(n):FM(n,r);return document.createTextNode(`${i}{${s}}`)}function yf(e,t,n,r){const i=window.getComputedStyle(e,n),s=i.getPropertyValue("content");if(s===""||s==="none")return;const a=NM();try{t.className=`${t.className} ${a}`}catch{return}const o=document.createElement("style");o.appendChild(jM(a,n,i,r)),t.appendChild(o)}function WM(e,t,n){yf(e,t,":before",n),yf(e,t,":after",n)}const xf="application/font-woff",bf="image/jpeg",qM={woff:xf,woff2:xf,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:bf,jpeg:bf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function YM(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cc(e){const t=YM(e).toLowerCase();return qM[t]||""}function XM(e){return e.split(/,/)[1]}function uc(e){return e.search(/^(data:)/)!==-1}function ZM(e,t){return`data:${t};base64,${e}`}async function _f(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const hc={};function KM(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function dc(e,t,n){const r=KM(e,t,n.includeQueryParams);if(hc[r]!=null)return hc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await _f(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),XM(o)));i=ZM(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return hc[r]=i,i}async function QM(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):$a(t)}async function JM(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return $a(o)}const n=e.poster,r=cc(n),i=await dc(n,r,t);return $a(i)}async function t2(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await Ma(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function e2(e,t){return pe(e,HTMLCanvasElement)?QM(e):pe(e,HTMLVideoElement)?JM(e,t):pe(e,HTMLIFrameElement)?t2(e,t):e.cloneNode(Ef(e))}const n2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ef=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function r2(e,t,n){var r,i;if(Ef(t))return t;let s=[];return n2(e)&&e.assignedNodes?s=Bn(e.assignedNodes()):pe(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Bn(e.contentDocument.body.childNodes):s=Bn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||pe(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>Ma(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function i2(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):gf(n).forEach(s=>{let a=i.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),pe(e,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),r.setProperty(s,a,i.getPropertyPriority(s))})}function s2(e,t){pe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),pe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function a2(e,t){if(pe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function o2(e,t,n){return pe(t,Element)&&(i2(e,t,n),WM(e,t,n),s2(e,t),a2(e,t)),t}async function l2(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;se2(r,t)).then(r=>r2(e,r,t)).then(r=>o2(e,r,t)).then(r=>l2(r,t))}const Sf=/url\((['"]?)([^'"]+?)\1\)/g,c2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,u2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function h2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function d2(e){const t=[];return e.replace(Sf,(n,r,i)=>(t.push(i),n)),t.filter(n=>!uc(n))}async function p2(e,t,n,r,i){try{const s=n?IM(t,n):t,a=cc(t);let o;return i||(o=await dc(s,a,r)),e.replace(h2(t),`$1${o}$3`)}catch{}return e}function f2(e,{preferredFontFormat:t}){return t?e.replace(u2,n=>{for(;;){const[r,,i]=c2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Tf(e){return e.search(Sf)!==-1}async function Of(e,t,n){if(!Tf(e))return e;const r=f2(e,n);return d2(r).reduce((i,s)=>i.then(a=>p2(a,s,t,n)),Promise.resolve(r))}async function Zr(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Of(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function m2(e,t){await Zr("background",e,t)||await Zr("background-image",e,t),await Zr("mask",e,t)||await Zr("-webkit-mask",e,t)||await Zr("mask-image",e,t)||await Zr("-webkit-mask-image",e,t)}async function g2(e,t){const n=pe(e,HTMLImageElement);if(!(n&&!uc(e.src))&&!(pe(e,SVGImageElement)&&!uc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await dc(r,cc(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...l)=>{try{s(t.onImageErrorHandler(...l))}catch(c){a(c)}}:a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function v2(e,t){const n=Bn(e.childNodes).map(r=>wf(r,t));await Promise.all(n).then(()=>e)}async function wf(e,t){pe(e,Element)&&(await m2(e,t),await g2(e,t),await v2(e,t))}function y2(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const $f={};async function Mf(e){let t=$f[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},$f[e]=t,t}async function Cf(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),_f(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Af(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function x2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Bn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Mf(l).then(u=>Cf(u,t)).then(u=>Af(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Mf(i.href).then(o=>Cf(o,t)).then(o=>Af(o).forEach(l=>{a.insertRule(l,a.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Bn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function b2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Tf(t.style.getPropertyValue("src")))}async function _2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Bn(e.ownerDocument.styleSheets),r=await x2(n,t);return b2(r)}function Lf(e){return e.trim().replace(/["']/g,"")}function E2(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(i=>{t.add(Lf(i))}),Array.from(r.children).forEach(i=>{i instanceof HTMLElement&&n(i)})}return n(e),t}async function S2(e,t){const n=await _2(e,t),r=E2(e);return(await Promise.all(n.filter(i=>r.has(Lf(i.style.fontFamily))).map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Of(i.cssText,s,t)}))).join(` `)}async function T2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await S2(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function O2(e,t={}){const{width:n,height:r}=vf(e,t),i=await Ma(e,t,!0);return await T2(i,t),await wf(i,t),y2(i,t),await GM(i,n,r)}async function kf(e,t={}){const{width:n,height:r}=vf(e,t),i=await O2(e,t),s=await $a(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||BM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||HM(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function w2(e,t={}){return(await kf(e,t)).toDataURL()}async function $2(e,t={}){return(await kf(e,t)).toDataURL("image/jpeg",t.quality||1)}class On{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const M2="DONT_STYLE_ME_css_styles_verifier";let N=class Bu extends On{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],g=parseFloat(f);f&&g>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=I(this.getHolder()).append("div").classed(`${de}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",M2),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),I(this.getHolder()).classed(`${de}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),$2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),w2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Bu.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(Bu.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=ya(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(O.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},pc=class i0 extends On{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:i0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Df(e){const t=C2(Rf(e),360);return Hn(t,[0,10])||Hn(t,[350,0])?{textAnchor:Ke.START,dominantBaseline:Qe.MIDDLE}:Hn(t,[10,80])?{textAnchor:Ke.START,dominantBaseline:Qe.HANGING}:Hn(t,[80,100])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.HANGING}:Hn(t,[100,170])?{textAnchor:Ke.END,dominantBaseline:Qe.HANGING}:Hn(t,[170,190])?{textAnchor:Ke.END,dominantBaseline:Qe.MIDDLE}:Hn(t,[190,260])?{textAnchor:Ke.END,dominantBaseline:Qe.BASELINE}:Hn(t,[260,280])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.BASELINE}:{textAnchor:Ke.START,dominantBaseline:Qe.BASELINE}}function C2(e,t){return(e%t+t)%t}function Hn(e,[t,n]){return e>=t&&e<=n}function Rf(e){return e*(180/Math.PI)}function Ut(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function A2(e,t){return t*Math.sin(e-Math.PI/2)}function L2(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i=t?e:t)),e}function Jf(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Fr(n),n=n===n?n:0),t!==void 0&&(t=Fr(t),t=t===t?t:0),xC(Fr(e),t,n)}var bC="Expected a function";function _C(e,t,n){if(typeof e!="function")throw new TypeError(bC);return setTimeout(function(){e.apply(void 0,n)},t)}var EC=Zo(function(e,t,n){return _C(e,Fr(t)||0,n)});function SC(e,t){var n=-1,r=Kn(e)?Array(e.length):[];return ql(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function TC(e,t){var n=Zt(e)?Fo:SC;return n(e,js(t))}var OC=1/0;function wC(e,t){return Vs(TC(e,t),OC)}function tm(e,t){return Fs(e,t)}var Qr=Qf(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function $C(e,t){var n;return ql(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function MC(e,t,n){var r=Zt(e)?Yh:$C;return r(e,js(t))}class pr{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}function*CC(e){for(const t of e)yield*t}function em(e){return Array.from(CC(e))}function AC(e){return e}var Ca=1,Aa=2,fc=3,ns=4,nm=1e-6;function LC(e){return"translate("+e+",0)"}function kC(e){return"translate(0,"+e+")"}function DC(e){return t=>+e(t)}function RC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function IC(){return!this.__axis}function La(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ca||e===ns?-1:1,u=e===ns||e===Aa?"x":"y",d=e===Ca||e===fc?LC:kC;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):AC),m=Math.max(s,0)+o,v=t.range(),x=+v[0]+l,_=+v[v.length-1]+l,E=(t.bandwidth?RC:DC)(t.copy(),l),b=p.selection?p.selection():p,T=b.selectAll(".domain").data([null]),M=b.selectAll(".tick").data(f,t).order(),D=M.exit(),A=M.enter().append("g").attr("class","tick"),R=M.select("line"),$=M.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(A),R=R.merge(A.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),$=$.merge(A.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ca?"0em":e===fc?"0.71em":"0.32em")),p!==b&&(T=T.transition(p),M=M.transition(p),R=R.transition(p),$=$.transition(p),D=D.transition(p).attr("opacity",nm).attr("transform",function(H){return isFinite(H=E(H))?d(H+l):this.getAttribute("transform")}),A.attr("opacity",nm).attr("transform",function(H){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(H))?P:E(H))+l)})),D.remove(),T.attr("d",e===ns||e===Aa?a?"M"+c*a+","+x+"H"+l+"V"+_+"H"+c*a:"M"+l+","+x+"V"+_:a?"M"+x+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+x+","+l+"H"+_),M.attr("opacity",1).attr("transform",function(H){return d(E(H)+l)}),R.attr(u+"2",c*s),$.attr(u,c*m).text(g),b.filter(IC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Aa?"start":e===ns?"end":"middle"),b.each(function(){this.__axis=E})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(s=a=+p,h):s},h.tickSizeInner=function(p){return arguments.length?(s=+p,h):s},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function NC(e){return La(Ca,e)}function PC(e){return La(Aa,e)}function mc(e){return La(fc,e)}function rm(e){return La(ns,e)}const gc={capture:!0,passive:!1};function vc(e){e.preventDefault(),e.stopImmediatePropagation()}function UC(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",vc,gc);"onselectstart"in t?n.on("selectstart.drag",vc,gc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function BC(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",vc,gc),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function HC(e,t){for(var n=new Array(t),r=0;r+e,yc=e=>()=>e;function GC(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function zC(e){e.stopImmediatePropagation()}function xc(e){e.preventDefault(),e.stopImmediatePropagation()}var im={name:"drag"},bc={name:"space"},Jr={name:"handle"},ti={name:"center"};const{abs:sm,max:ne,min:re}=Math;function am(e){return[+e[0],+e[1]]}function om(e){return[am(e[0]),am(e[1])]}var ka={name:"x",handles:["w","e"].map(Ec),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},_c={},wn={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},lm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},cm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},FC={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},jC={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ec(e){return{type:e}}function WC(e){return!e.ctrlKey&&!e.button}function qC(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function YC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sc(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function XC(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function um(){return ZC(ka)}function ZC(e){var t=qC,n=WC,r=YC,i=!0,s=yl("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Ec("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",wn.overlay).merge(v).each(function(){var _=Sc(this).extent;I(this).attr("x",_[0][0]).attr("y",_[0][1]).attr("width",_[1][0]-_[0][0]).attr("height",_[1][1]-_[0][1])}),m.selectAll(".selection").data([Ec("selection")]).enter().append("rect").attr("class","selection").attr("cursor",wn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=m.selectAll(".handle").data(e.handles,function(_){return _.type});x.exit().remove(),x.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return wn[_.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,x){m.tween?m.on("start.brush",function(_){u(this,arguments).beforestart().start(_)}).on("interrupt.brush end.brush",function(_){u(this,arguments).end(_)}).tween("brush",function(){var _=this,E=_.__brush,b=u(_,arguments),T=E.selection,M=e.input(typeof v=="function"?v.apply(this,arguments):v,E.extent),D=Pi(T,M);function A(R){E.selection=R===1&&M===null?null:D(R),c.call(_),b.brush()}return T!==null&&M!==null?A:A(1)}):m.each(function(){var _=this,E=arguments,b=_.__brush,T=e.input(typeof v=="function"?v.apply(_,E):v,b.extent),M=u(_,E).beforestart();Dl(_),b.selection=T===null?null:T,c.call(_),M.start(x).brush(x).end(x)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=Sc(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(x){return x.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(x){return x.type==="e"||x.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,x){var _=m.__brush.emitter;return _&&(!x||!_.clean)?_:new d(m,v,x)}function d(m,v,x){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=x}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,x){var _=I(this.that).datum();s.call(m,this.that,new GC(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:x,dispatch:s}),_)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,x=m.target.__data__.type,_=(i&&m.metaKey?x="overlay":x)==="selection"?im:i&&m.altKey?ti:Jr,E=e===_c?null:FC[x],b=e===ka?null:jC[x],T=Sc(v),M=T.extent,D=T.selection,A=M[0][0],R,$,H=M[0][1],P,B,S=M[1][0],w,L,k=M[1][1],U,K,W=0,j=0,X,ct=E&&b&&i&&m.shiftKey,J,Y,et=Array.from(m.touches||[m],rt=>{const Et=rt.identifier;return rt=er(rt,v),rt.point0=rt.slice(),rt.identifier=Et,rt});Dl(v);var ut=u(v,arguments,!0).beforestart();if(x==="overlay"){D&&(X=!0);const rt=[et[0],et[1]||et[0]];T.selection=D=[[R=e===_c?A:re(rt[0][0],rt[1][0]),P=e===ka?H:re(rt[0][1],rt[1][1])],[w=e===_c?S:ne(rt[0][0],rt[1][0]),U=e===ka?k:ne(rt[0][1],rt[1][1])]],et.length>1&&dt(m)}else R=D[0][0],P=D[0][1],w=D[1][0],U=D[1][1];$=R,B=P,L=w,K=U;var F=I(v).attr("pointer-events","none"),q=F.selectAll(".overlay").attr("cursor",wn[x]);if(m.touches)ut.moved=G,ut.ended=ot;else{var Z=I(m.view).on("mousemove.brush",G,!0).on("mouseup.brush",ot,!0);i&&Z.on("keydown.brush",It,!0).on("keyup.brush",Ht,!0),UC(m.view)}c.call(v),ut.start(m,_.name);function G(rt){for(const Et of rt.changedTouches||[rt])for(const Ne of et)Ne.identifier===Et.identifier&&(Ne.cur=er(Et,v));if(ct&&!J&&!Y&&et.length===1){const Et=et[0];sm(Et.cur[0]-Et[0])>sm(Et.cur[1]-Et[1])?Y=!0:J=!0}for(const Et of et)Et.cur&&(Et[0]=Et.cur[0],Et[1]=Et.cur[1]);X=!0,xc(rt),dt(rt)}function dt(rt){const Et=et[0],Ne=Et.point0;var Oe;switch(W=Et[0]-Ne[0],j=Et[1]-Ne[1],_){case bc:case im:{E&&(W=ne(A-R,re(S-w,W)),$=R+W,L=w+W),b&&(j=ne(H-P,re(k-U,j)),B=P+j,K=U+j);break}case Jr:{et[1]?(E&&($=ne(A,re(S,et[0][0])),L=ne(A,re(S,et[1][0])),E=1),b&&(B=ne(H,re(k,et[0][1])),K=ne(H,re(k,et[1][1])),b=1)):(E<0?(W=ne(A-R,re(S-R,W)),$=R+W,L=w):E>0&&(W=ne(A-w,re(S-w,W)),$=R,L=w+W),b<0?(j=ne(H-P,re(k-P,j)),B=P+j,K=U):b>0&&(j=ne(H-U,re(k-U,j)),B=P,K=U+j));break}case ti:{E&&($=ne(A,re(S,R-W*E)),L=ne(A,re(S,w+W*E))),b&&(B=ne(H,re(k,P-j*b)),K=ne(H,re(k,U+j*b)));break}}L<$&&(E*=-1,Oe=R,R=w,w=Oe,Oe=$,$=L,L=Oe,x in lm&&q.attr("cursor",wn[x=lm[x]])),K0&&(R=$-W),b<0?U=K-j:b>0&&(P=B-j),_=bc,q.attr("cursor",wn.selection),dt(rt));break}default:return}xc(rt)}function Ht(rt){switch(rt.keyCode){case 16:{ct&&(J=Y=ct=!1,dt(rt));break}case 18:{_===ti&&(E<0?w=L:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Jr,dt(rt));break}case 32:{_===bc&&(rt.altKey?(E&&(w=L-W*E,R=$+W*E),b&&(U=K-j*b,P=B+j*b),_=ti):(E<0?w=L:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Jr),q.attr("cursor",wn[x]),dt(rt));break}default:return}xc(rt)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=om(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:yc(om(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:yc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:yc(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const Tc=Math.PI,Oc=2*Tc,fr=1e-6,KC=Oc-fr;function hm(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hm;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;ifr)if(!(Math.abs(d*l-c*u)>fr)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,f=i-o,g=l*l+c*c,m=p*p+f*f,v=Math.sqrt(g),x=Math.sqrt(h),_=s*Math.tan((Tc-Math.acos((g+h-m)/(2*v*x)))/2),E=_/x,b=_/v;Math.abs(E-1)>fr&&this._append`L${t+E*u},${n+E*d}`,this._append`A${s},${s},0,0,${+(d*p>u*f)},${this._x1=t+b*l},${this._y1=n+b*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>fr||Math.abs(this._y1-u)>fr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Oc+Oc),h>KC?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>fr&&this._append`A${r},${r},0,${+(h>=Tc)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function dm(){return new wc}dm.prototype=wc.prototype;var wt=1e-6,JC=1e-12,mt=Math.PI,fe=mt/2,pm=mt/4,Ee=mt*2,se=180/mt,Bt=mt/180,Tt=Math.abs,fm=Math.atan,mr=Math.atan2,$t=Math.cos,tA=Math.exp,eA=Math.log,_t=Math.sin,Vn=Math.sign||function(e){return e>0?1:e<0?-1:0},qe=Math.sqrt,nA=Math.tan;function rA(e){return e>1?0:e<-1?mt:Math.acos(e)}function $n(e){return e>1?fe:e<-1?-fe:Math.asin(e)}function De(){}function Da(e,t){e&&gm.hasOwnProperty(e.type)&&gm[e.type](e,t)}var mm={Feature:function(e,t){Da(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++rmt&&(e-=Math.round(e/Ee)*Ee),[e,t]}kc.invert=kc;function ym(e,t,n){return(e%=Ee)?t||n?Lc(bm(e),_m(t,n)):bm(e):t||n?_m(t,n):kc}function xm(e){return function(t,n){return t+=e,Tt(t)>mt&&(t-=Math.round(t/Ee)*Ee),[t,n]}}function bm(e){var t=xm(e);return t.invert=xm(-e),t}function _m(e,t){var n=$t(e),r=_t(e),i=$t(t),s=_t(t);function a(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*n+u*r;return[mr(d*i-p*s,u*n-h*r),$n(p*i+d*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*i-d*s;return[mr(d*i+h*s,u*n+p*r),$n(p*n-u*r)]},a}function iA(e){e=ym(e[0]*Bt,e[1]*Bt,e.length>2?e[2]*Bt:0);function t(n){return n=e(n[0]*Bt,n[1]*Bt),n[0]*=se,n[1]*=se,n}return t.invert=function(n){return n=e.invert(n[0]*Bt,n[1]*Bt),n[0]*=se,n[1]*=se,n},t}function sA(e,t,n,r,i,s){if(n){var a=$t(t),o=_t(t),l=r*n;i==null?(i=t+r*Ee,s=t-l/2):(i=Em(a,i),s=Em(a,s),(r>0?is)&&(i+=r*Ee));for(var c,u=i;r>0?u>s:u1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Pa(e,t){return Tt(e[0]-t[0])=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);i.lineEnd()}}}function Om(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n=0?1:-1,R=A*D,$=R>mt,H=m*T;if(l.add(mr(H*A*_t(R),v*M+H*$t(R))),a+=$?D+A*Ee:D,$^f>=n^E>=n){var P=Ia(ni(p),ni(_));Ac(P);var B=Ia(s,P);Ac(B);var S=($^D>=0?-1:1)*$n(B[2]);(r>S||r===S&&(P[0]||P[1]))&&(o+=$^D>=0?1:-1)}}return(a<-1e-6||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),T=0;T1&&E&2&&b.push(b.pop().concat(b.shift())),u.push(b.filter(oA))}}return h}}function oA(e){return e.length>1}function lA(e,t){return((e=e.x)[0]<0?e[1]-fe-wt:fe-e[1])-((t=t.x)[0]<0?t[1]-fe-wt:fe-t[1])}const $m=wm(function(){return!0},cA,hA,[-mt,-fe]);function cA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?mt:-mt,l=Tt(s-t);Tt(l-mt)0?fe:-fe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=mt&&(Tt(t-r)wt?fm((_t(t)*(s=$t(r))*_t(n)-_t(r)*(i=$t(t))*_t(e))/(i*s*a)):(t+r)/2}function hA(e,t,n,r){var i;if(e==null)i=n*fe,r.point(-mt,i),r.point(0,i),r.point(mt,i),r.point(mt,0),r.point(mt,-i),r.point(0,-i),r.point(-mt,-i),r.point(-mt,0),r.point(-mt,i);else if(Tt(e[0]-t[0])>wt){var s=e[0]0,i=Tt(t)>wt;function s(u,d,h,p){sA(p,e,n,h,u,d)}function a(u,d){return $t(u)*$t(d)>t}function o(u){var d,h,p,f,g;return{lineStart:function(){f=p=!1,g=1},point:function(m,v){var x=[m,v],_,E=a(m,v),b=r?E?0:c(m,v):E?c(m+(m<0?mt:-mt),v):0;if(!d&&(f=p=E)&&u.lineStart(),E!==p&&(_=l(d,x),(!_||Pa(d,_)||Pa(x,_))&&(x[2]=1)),E!==p)g=0,E?(u.lineStart(),_=l(x,d),u.point(_[0],_[1])):(_=l(d,x),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^E){var T;!(b&h)&&(T=l(x,d,!0))&&(g=0,r?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}E&&(!d||!Pa(d,x))&&u.point(x[0],x[1]),d=x,p=E,h=b},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return g|(f&&p)<<1}}}function l(u,d,h){var p=ni(u),f=ni(d),g=[1,0,0],m=Ia(p,f),v=Ra(m,m),x=m[0],_=v-x*x;if(!_)return!h&&u;var E=t*v/_,b=-t*x/_,T=Ia(g,m),M=Na(g,E),D=Na(m,b);Cc(M,D);var A=T,R=Ra(M,A),$=Ra(A,A),H=R*R-$*(Ra(M,M)-1);if(!(H<0)){var P=qe(H),B=Na(A,(-R-P)/$);if(Cc(B,M),B=Mc(B),!h)return B;var S=u[0],w=d[0],L=u[1],k=d[1],U;w0^B[1]<(Tt(B[0]-S)mt^(S<=B[0]&&B[0]<=w)){var X=Na(A,(-R+P)/$);return Cc(X,M),[B,Mc(X)]}}}function c(u,d){var h=r?e:mt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return wm(a,o,s,r?[0,-e]:[-mt,e-mt])}function pA(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-o,f;if(f=n-a,!(!h&&f>0)){if(f/=h,h<0){if(f0){if(f>d)return;f>u&&(u=f)}if(f=i-a,!(!h&&f<0)){if(f/=h,h<0){if(f>d)return;f>u&&(u=f)}else if(h>0){if(f0)){if(f/=p,p<0){if(f0){if(f>d)return;f>u&&(u=f)}if(f=s-o,!(!p&&f<0)){if(f/=p,p<0){if(f>d)return;f>u&&(u=f)}else if(p>0){if(f0&&(e[0]=a+u*h,e[1]=o+u*p),d<1&&(t[0]=a+d*h,t[1]=o+d*p),!0}}}}}var Ba=1e9,Ha=-1e9;function fA(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var p=0,f=0;if(c==null||(p=a(c,d))!==(f=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==f);else h.point(u[0],u[1])}function a(c,u){return Tt(c[0]-e)0?0:3:Tt(c[0]-n)0?2:1:Tt(c[1]-t)0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=Sm(),h,p,f,g,m,v,x,_,E,b,T,M={point:D,lineStart:H,lineEnd:P,polygonStart:R,polygonEnd:$};function D(S,w){i(S,w)&&u.point(S,w)}function A(){for(var S=0,w=0,L=p.length;wr&&(ct-j)*(r-X)>(J-X)*(e-j)&&++S:J<=r&&(ct-j)*(r-X)<(J-X)*(e-j)&&--S;return S}function R(){u=d,h=[],p=[],T=!0}function $(){var S=A(),w=T&&S,L=(h=em(h)).length;(w||L)&&(c.polygonStart(),w&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),L&&Tm(h,o,S,s,c),c.polygonEnd()),u=c,h=p=f=null}function H(){M.point=B,p&&p.push(f=[]),b=!0,E=!1,x=_=NaN}function P(){h&&(B(g,m),v&&E&&d.rejoin(),h.push(d.result())),M.point=D,E&&u.lineEnd()}function B(S,w){var L=i(S,w);if(p&&f.push([S,w]),b)g=S,m=w,v=L,b=!1,L&&(u.lineStart(),u.point(S,w));else if(L&&E)u.point(S,w);else{var k=[x=Math.max(Ha,Math.min(Ba,x)),_=Math.max(Ha,Math.min(Ba,_))],U=[S=Math.max(Ha,Math.min(Ba,S)),w=Math.max(Ha,Math.min(Ba,w))];pA(k,U,e,t,n,r)?(E||(u.lineStart(),u.point(k[0],k[1])),u.point(U[0],U[1]),L||u.lineEnd(),T=!1):L&&(u.lineStart(),u.point(S,w),T=!1)}x=S,_=w,E=L}return M}}const Rc=e=>e;var Ic=new pr,Nc=new pr,Mm,Cm,Pc,Uc,Mn={point:De,lineStart:De,lineEnd:De,polygonStart:function(){Mn.lineStart=mA,Mn.lineEnd=vA},polygonEnd:function(){Mn.lineStart=Mn.lineEnd=Mn.point=De,Ic.add(Tt(Nc)),Nc=new pr},result:function(){var e=Ic/2;return Ic=new pr,e}};function mA(){Mn.point=gA}function gA(e,t){Mn.point=Am,Mm=Pc=e,Cm=Uc=t}function Am(e,t){Nc.add(Uc*e-Pc*t),Pc=e,Uc=t}function vA(){Am(Mm,Cm)}var ri=1/0,Va=ri,rs=-ri,Ga=rs,za={point:yA,lineStart:De,lineEnd:De,polygonStart:De,polygonEnd:De,result:function(){var e=[[ri,Va],[rs,Ga]];return rs=Ga=-(Va=ri=1/0),e}};function yA(e,t){ers&&(rs=e),tGa&&(Ga=t)}var Bc=0,Hc=0,is=0,Fa=0,ja=0,ii=0,Vc=0,Gc=0,ss=0,Lm,km,an,on,Re={point:gr,lineStart:Dm,lineEnd:Rm,polygonStart:function(){Re.lineStart=_A,Re.lineEnd=EA},polygonEnd:function(){Re.point=gr,Re.lineStart=Dm,Re.lineEnd=Rm},result:function(){var e=ss?[Vc/ss,Gc/ss]:ii?[Fa/ii,ja/ii]:is?[Bc/is,Hc/is]:[NaN,NaN];return Bc=Hc=is=Fa=ja=ii=Vc=Gc=ss=0,e}};function gr(e,t){Bc+=e,Hc+=t,++is}function Dm(){Re.point=xA}function xA(e,t){Re.point=bA,gr(an=e,on=t)}function bA(e,t){var n=e-an,r=t-on,i=qe(n*n+r*r);Fa+=i*(an+e)/2,ja+=i*(on+t)/2,ii+=i,gr(an=e,on=t)}function Rm(){Re.point=gr}function _A(){Re.point=SA}function EA(){Im(Lm,km)}function SA(e,t){Re.point=Im,gr(Lm=an=e,km=on=t)}function Im(e,t){var n=e-an,r=t-on,i=qe(n*n+r*r);Fa+=i*(an+e)/2,ja+=i*(on+t)/2,ii+=i,i=on*e-an*t,Vc+=i*(an+e),Gc+=i*(on+t),ss+=i*3,gr(an=e,on=t)}function Nm(e){this._context=e}Nm.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ee);break}}},result:De};var zc=new pr,Fc,Pm,Um,as,os,ls={point:De,lineStart:function(){ls.point=TA},lineEnd:function(){Fc&&Bm(Pm,Um),ls.point=De},polygonStart:function(){Fc=!0},polygonEnd:function(){Fc=null},result:function(){var e=+zc;return zc=new pr,e}};function TA(e,t){ls.point=Bm,Pm=as=e,Um=os=t}function Bm(e,t){as-=e,os-=t,zc.add(qe(as*as+os*os)),as=e,os=t}let Hm,Wa,Vm,Gm;class zm{constructor(t){this._append=t==null?Fm:OA(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==Vm||this._append!==Wa){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Vm=r,Wa=this._append,Gm=this._,this._=i}this._+=Gm;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Fm(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Fm;if(t!==Hm){const n=10**t;Hm=t,Wa=function(r){let i=1;this._+=r[0];for(const s=r.length;i=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new zm(n)),a},a.projection(e).digits(n).context(t)}function jc(e){return function(t){var n=new Wc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Wc(){}Wc.prototype={constructor:Wc,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function qc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ei(n,e.stream(za)),t(za.result()),r!=null&&e.clipExtent(r),e}function jm(e,t,n){return qc(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function $A(e,t,n){return jm(e,[[0,0],t],n)}function MA(e,t,n){return qc(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function CA(e,t,n){return qc(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Wm=16,AA=$t(30*Bt);function qm(e,t){return+t?kA(e,t):LA(e)}function LA(e){return jc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function kA(e,t){function n(r,i,s,a,o,l,c,u,d,h,p,f,g,m){var v=c-r,x=u-i,_=v*v+x*x;if(_>4*t&&g--){var E=a+h,b=o+p,T=l+f,M=qe(E*E+b*b+T*T),D=$n(T/=M),A=Tt(Tt(T)-1)t||Tt((v*P+x*B)/_-.5)>.3||a*h+o*p+l*f2?S[2]%360*Bt:0,P()):[o*se,l*se,c*se]},$.angle=function(S){return arguments.length?(d=S%360*Bt,P()):d*se},$.reflectX=function(S){return arguments.length?(h=S?-1:1,P()):h<0},$.reflectY=function(S){return arguments.length?(p=S?-1:1,P()):p<0},$.precision=function(S){return arguments.length?(T=qm(M,b=S*S),B()):qe(b)},$.fitExtent=function(S,w){return jm($,S,w)},$.fitSize=function(S,w){return $A($,S,w)},$.fitWidth=function(S,w){return MA($,S,w)},$.fitHeight=function(S,w){return CA($,S,w)};function P(){var S=Ym(n,0,0,h,p,d).apply(null,t(s,a)),w=Ym(n,r-S[0],i-S[1],h,p,d);return u=ym(o,l,c),M=Lc(t,w),D=Lc(u,M),T=qm(M,b),B()}function B(){return A=R=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&H,P()}}function Zm(e){var t=0,n=mt/3,r=Xm(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Bt,n=s[1]*Bt):[t*se,n*se]},i}function NA(e){var t=$t(e);function n(r,i){return[r*t,_t(i)/t]}return n.invert=function(r,i){return[r/t,$n(i*t)]},n}function PA(e,t){var n=_t(e),r=(n+_t(t))/2;if(Tt(r)wt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function WA(){return qa(Jm).scale(175.295)}function qA(e,t){return e.parent===t.parent?1:2}function YA(e){return e.reduce(XA,0)/e.length}function XA(e,t){return e+t.x}function ZA(e){return 1+e.reduce(KA,0)}function KA(e,t){return Math.max(e,t.y)}function QA(e){for(var t;t=e.children;)e=t[0];return e}function JA(e){for(var t;t=e.children;)e=t[t.length-1];return e}function tL(){var e=qA,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var p=h.children;p?(h.x=YA(p),h.y=ZA(p)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=QA(s),c=JA(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function eL(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function nL(){return this.eachAfter(eL)}function rL(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function iL(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function sL(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a=0;)n+=r[i].value;t.value=n})}function lL(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function cL(e){for(var t=this,n=uL(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function uL(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function hL(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function dL(){return Array.from(this)}function pL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function fL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*mL(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i=0;--o)i.push(s=a[o]=new fs(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(bL)}function gL(){return ps(this).eachBefore(xL)}function vL(e){return e.children}function yL(e){return Array.isArray(e)?e[1]:null}function xL(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function bL(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function fs(e){this.data=e,this.depth=this.height=0,this.parent=null}fs.prototype=ps.prototype={constructor:fs,count:nL,each:rL,eachAfter:sL,eachBefore:iL,find:aL,sum:oL,sort:lL,path:cL,ancestors:hL,descendants:dL,leaves:pL,links:fL,copy:gL,[Symbol.iterator]:mL};function _L(e){return e==null?null:tg(e)}function tg(e){if(typeof e!="function")throw new Error;return e}function vr(){return 0}function si(e){return function(){return e}}const EL=1664525,SL=1013904223,eg=4294967296;function TL(){let e=1;return()=>(e=(EL*e+SL)%eg)/eg}function OL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function wL(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function $L(e,t){for(var n=0,r=(e=wL(Array.from(e),t)).length,i=[],s,a;n0&&n*n>r*r+i*i}function Xc(e,t){for(var n=0;n1e-6?($+Math.sqrt($*$-4*R*H))/(2*R):H/$);return{x:r+T+M*P,y:i+D+A*P,r:P}}function ig(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function sg(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function ag(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Ka(e){this._=e,this.next=null,this.previous=null}function LL(e,t){if(!(s=(e=OL(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;ig(r,n,i=e[2]),n=new Ka(n),r=new Ka(r),i=new Ka(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function BL(e,t,n){return e.a.parent===t.parent?e.a:n}function Qa(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Qa.prototype=Object.create(fs.prototype);function HL(e){for(var t=new Qa(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Qa(s[a],a)),i.parent=n;return(t.parent=new Qa(null,0)).children=[t],t}function VL(){var e=NL,t=1,n=1,r=null;function i(c){var u=HL(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(x){x.xh.x&&(h=x),x.depth>p.depth&&(p=x)});var f=d===h?1:e(d,h)/2,g=f-d.x,m=t/(h.x+f+g),v=n/(p.depth||1);c.eachBefore(function(x){x.x=(x.x+g)*m,x.y=x.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){UL(c);var p=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-p):c.z=p}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,p=c,f=u,g=h.parent.children[0],m=h.m,v=p.m,x=f.m,_=g.m,E;f=Qc(f),h=Kc(h),f&&h;)g=Kc(g),p=Qc(p),p.a=c,E=f.z+x-h.z-m+e(f._,h._),E>0&&(PL(BL(f,c,d),c,E),m+=E,v+=E),x+=f.m,m+=h.m,_+=g.m,v+=p.m;f&&!Qc(p)&&(p.t=f,p.m+=x-v),h&&!Kc(g)&&(g.t=h,g.m+=m-_,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function GL(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++ox&&(x=c),T=m*m*b,_=Math.max(x/T,T/v),_>E){m-=c;break}E=_}a.push(l={value:m,dice:p1?r:1)},n}(zL);function WL(){var e=jL,t=!1,n=1,r=1,i=[0],s=vr,a=vr,o=vr,l=vr,c=vr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(RL),h}function d(h){var p=i[h.depth],f=h.x0+p,g=h.y0+p,m=h.x1-p,v=h.y1-p;m=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new wc(t)}function qL(e){return e.innerRadius}function YL(e){return e.outerRadius}function XL(e){return e.startAngle}function ZL(e){return e.endAngle}function KL(e){return e&&e.padAngle}function QL(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*hB*B+S*S&&(D=R,A=$),{cx:D,cy:A,x01:-u,y01:-d,x11:D*(i/b-1),y11:A*(i/b-1)}}function gs(){var e=qL,t=YL,n=pt(0),r=null,i=XL,s=ZL,a=KL,o=null,l=Ja(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-Sa,g=s.apply(this,arguments)-Sa,m=hf(g-f),v=g>f;if(o||(o=u=l()),pee))o.moveTo(0,0);else if(m>Ta-ee)o.moveTo(p*dr(f),p*sn(f)),o.arc(0,0,p,f,g,!v),h>ee&&(o.moveTo(h*dr(g),h*sn(g)),o.arc(0,0,h,g,f,v));else{var x=f,_=g,E=f,b=g,T=m,M=m,D=a.apply(this,arguments)/2,A=D>ee&&(r?+r.apply(this,arguments):Xr(h*h+p*p)),R=lc(hf(p-h)/2,+n.apply(this,arguments)),$=R,H=R,P,B;if(A>ee){var S=df(A/h*sn(D)),w=df(A/p*sn(D));(T-=S*2)>ee?(S*=v?1:-1,E+=S,b-=S):(T=0,E=b=(f+g)/2),(M-=w*2)>ee?(w*=v?1:-1,x+=w,_-=w):(M=0,x=_=(f+g)/2)}var L=p*dr(x),k=p*sn(x),U=h*dr(b),K=h*sn(b);if(R>ee){var W=p*dr(_),j=p*sn(_),X=h*dr(E),ct=h*sn(E),J;if(mee?H>ee?(P=to(X,ct,L,k,p,H,v),B=to(W,j,U,K,p,H,v),o.moveTo(P.cx+P.x01,P.cy+P.y01),Hee)||!(T>ee)?o.lineTo(U,K):$>ee?(P=to(U,K,W,j,h,-$,v),B=to(L,k,X,ct,h,-$,v),o.lineTo(P.cx+P.x01,P.cy+P.y01),$=p;--f)o.point(_[f],E[f]);o.lineEnd(),o.areaEnd()}v&&(_[h]=+e(m,h,d),E[h]=+t(m,h,d),o.point(r?+r(m,h,d):_[h],n?+n(m,h,d):E[h]))}if(x)return o=null,x+""||null}function u(){return vs().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:pt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function JL(e,t){return te?1:t>=e?0:NaN}function tk(e){return e}function ek(){var e=tk,t=JL,n=null,r=pt(0),i=pt(Ta),s=pt(0);function a(o){var l,c=(o=va(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(Ta,Math.max(-Ta,i.apply(this,arguments)-g)),v,x=Math.min(Math.abs(m)/c,s.apply(this,arguments)),_=x*(m<0?-1:1),E;for(l=0;l0&&(h+=E);for(t!=null?p.sort(function(b,T){return t(f[b],f[T])}):n!=null&&p.sort(function(b,T){return n(o[b],o[T])}),l=0,d=h?(m-c*_)/h:0;l0?E*d:0)+_,f[u]={data:o[u],index:l,value:E,startAngle:g,endAngle:v,padAngle:x};return f}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:pt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:pt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:pt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:pt(+o),a):s},a}var nk=ug(Oa);function cg(e){this._curve=e}cg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function ug(e){function t(n){return new cg(e(n))}return t._curve=e,t}function rk(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(ug(n)):t()._curve},e}function ik(){return rk(vs().curve(nk))}class sk{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function ak(e){return new sk(e,!0)}function ok(e){return e.source}function lk(e){return e.target}function ck(e){let t=ok,n=lk,r=Jc,i=tu,s=null,a=null,o=Ja(l);function l(){let c;const u=$w.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:pt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:pt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function uk(){return ck(ak)}let gt=class{constructor(t,n,r){if(this.type="",this.renderType=it.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${de}--${i}--${this.type}`,!0),r&&r.classed(`${de}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===it.SVG?"svg":"div"}${r}.${de}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=I(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?at({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:hg,setPrototypeOf:dg,isFrozen:hk,getPrototypeOf:dk,getOwnPropertyDescriptor:pk}=Object;let{freeze:ae,seal:Ie,create:pg}=Object,{apply:nu,construct:ru}=typeof Reflect<"u"&&Reflect;ae||(ae=function(e){return e}),Ie||(Ie=function(e){return e}),nu||(nu=function(e,t,n){return e.apply(t,n)}),ru||(ru=function(e,t){return new e(...t)});const eo=le(Array.prototype.forEach),fk=le(Array.prototype.lastIndexOf),fg=le(Array.prototype.pop),ys=le(Array.prototype.push),mk=le(Array.prototype.splice),no=le(String.prototype.toLowerCase),iu=le(String.prototype.toString),mg=le(String.prototype.match),xs=le(String.prototype.replace),gk=le(String.prototype.indexOf),vk=le(String.prototype.trim),Ye=le(Object.prototype.hasOwnProperty),oe=le(RegExp.prototype.test),bs=yk(TypeError);function le(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:no;dg&&dg(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(hk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function xk(e){for(let t=0;t/gm),Tk=Ie(/\$\{[\w\W]*/gm),Ok=Ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),wk=Ie(/^aria-[\-\w]+$/),bg=Ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$k=Ie(/^(?:\w+script|data):/i),Mk=Ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_g=Ie(/^html$/i),Ck=Ie(/^[a-z][.\w]*(-[.\w]+)+$/i);var Eg=Object.freeze({__proto__:null,ARIA_ATTR:wk,ATTR_WHITESPACE:Mk,CUSTOM_ELEMENT:Ck,DATA_ATTR:Ok,DOCTYPE_NAME:_g,ERB_EXPR:Sk,IS_ALLOWED_URI:bg,IS_SCRIPT_OR_DATA:$k,MUSTACHE_EXPR:Ek,TMPLIT_EXPR:Tk});const Es={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ak=function(){return typeof window>"u"?null:window},Lk=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Sg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Tg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ak();const t=C=>Tg(C);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==Es.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,g=_s(f,"cloneNode"),m=_s(f,"remove"),v=_s(f,"nextSibling"),x=_s(f,"childNodes"),_=_s(f,"parentNode");if(typeof a=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let E,b="";const{implementation:T,createNodeIterator:M,createDocumentFragment:D,getElementsByTagName:A}=n,{importNode:R}=r;let $=Sg();t.isSupported=typeof hg=="function"&&typeof _=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:P,TMPLIT_EXPR:B,DATA_ATTR:S,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:U}=Eg;let{IS_ALLOWED_URI:K}=Eg,W=null;const j=vt({},[...gg,...su,...au,...ou,...vg]);let X=null;const ct=vt({},[...yg,...lu,...xg,...ro]);let J=Object.seal(pg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,et=null,ut=!0,F=!0,q=!1,Z=!0,G=!1,dt=!0,ot=!1,It=!1,Ht=!1,rt=!1,Et=!1,Ne=!1,Oe=!0,ws=!1;const $s="user-content-";let _r=!0,Ze=!1,ci={},ui=null;const zv=vt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Fv=null;const jv=vt({},["audio","video","img","source","image","track"]);let Du=null;const Wv=vt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yo="http://www.w3.org/1998/Math/MathML",xo="http://www.w3.org/2000/svg",An="http://www.w3.org/1999/xhtml";let hi=An,Ru=!1,Iu=null;const oU=vt({},[yo,xo,An],iu);let bo=vt({},["mi","mo","mn","ms","mtext"]),_o=vt({},["annotation-xml"]);const lU=vt({},["title","style","font","a","script"]);let Ms=null;const cU=["application/xhtml+xml","text/html"],uU="text/html";let Xt=null,di=null;const hU=n.createElement("form"),qv=function(C){return C instanceof RegExp||C instanceof Function},Nu=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(di&&di===C)){if((!C||typeof C!="object")&&(C={}),C=yr(C),Ms=cU.indexOf(C.PARSER_MEDIA_TYPE)===-1?uU:C.PARSER_MEDIA_TYPE,Xt=Ms==="application/xhtml+xml"?iu:no,W=Ye(C,"ALLOWED_TAGS")?vt({},C.ALLOWED_TAGS,Xt):j,X=Ye(C,"ALLOWED_ATTR")?vt({},C.ALLOWED_ATTR,Xt):ct,Iu=Ye(C,"ALLOWED_NAMESPACES")?vt({},C.ALLOWED_NAMESPACES,iu):oU,Du=Ye(C,"ADD_URI_SAFE_ATTR")?vt(yr(Wv),C.ADD_URI_SAFE_ATTR,Xt):Wv,Fv=Ye(C,"ADD_DATA_URI_TAGS")?vt(yr(jv),C.ADD_DATA_URI_TAGS,Xt):jv,ui=Ye(C,"FORBID_CONTENTS")?vt({},C.FORBID_CONTENTS,Xt):zv,Y=Ye(C,"FORBID_TAGS")?vt({},C.FORBID_TAGS,Xt):{},et=Ye(C,"FORBID_ATTR")?vt({},C.FORBID_ATTR,Xt):{},ci=Ye(C,"USE_PROFILES")?C.USE_PROFILES:!1,ut=C.ALLOW_ARIA_ATTR!==!1,F=C.ALLOW_DATA_ATTR!==!1,q=C.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=C.SAFE_FOR_TEMPLATES||!1,dt=C.SAFE_FOR_XML!==!1,ot=C.WHOLE_DOCUMENT||!1,rt=C.RETURN_DOM||!1,Et=C.RETURN_DOM_FRAGMENT||!1,Ne=C.RETURN_TRUSTED_TYPE||!1,Ht=C.FORCE_BODY||!1,Oe=C.SANITIZE_DOM!==!1,ws=C.SANITIZE_NAMED_PROPS||!1,_r=C.KEEP_CONTENT!==!1,Ze=C.IN_PLACE||!1,K=C.ALLOWED_URI_REGEXP||bg,hi=C.NAMESPACE||An,bo=C.MATHML_TEXT_INTEGRATION_POINTS||bo,_o=C.HTML_INTEGRATION_POINTS||_o,J=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&qv(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&qv(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(F=!1),Et&&(rt=!0),ci&&(W=vt({},vg),X=[],ci.html===!0&&(vt(W,gg),vt(X,yg)),ci.svg===!0&&(vt(W,su),vt(X,lu),vt(X,ro)),ci.svgFilters===!0&&(vt(W,au),vt(X,lu),vt(X,ro)),ci.mathMl===!0&&(vt(W,ou),vt(X,xg),vt(X,ro))),C.ADD_TAGS&&(W===j&&(W=yr(W)),vt(W,C.ADD_TAGS,Xt)),C.ADD_ATTR&&(X===ct&&(X=yr(X)),vt(X,C.ADD_ATTR,Xt)),C.ADD_URI_SAFE_ATTR&&vt(Du,C.ADD_URI_SAFE_ATTR,Xt),C.FORBID_CONTENTS&&(ui===zv&&(ui=yr(ui)),vt(ui,C.FORBID_CONTENTS,Xt)),_r&&(W["#text"]=!0),ot&&vt(W,["html","head","body"]),W.table&&(vt(W,["tbody"]),delete Y.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw bs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw bs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=C.TRUSTED_TYPES_POLICY,b=E.createHTML("")}else E===void 0&&(E=Lk(p,i)),E!==null&&typeof b=="string"&&(b=E.createHTML(""));ae&&ae(C),di=C}},Yv=vt({},[...su,...au,...bk]),Xv=vt({},[...ou,..._k]),dU=function(C){let tt=_(C);(!tt||!tt.tagName)&&(tt={namespaceURI:hi,tagName:"template"});const Q=no(C.tagName),Ot=no(tt.tagName);return Iu[C.namespaceURI]?C.namespaceURI===xo?tt.namespaceURI===An?Q==="svg":tt.namespaceURI===yo?Q==="svg"&&(Ot==="annotation-xml"||bo[Ot]):!!Yv[Q]:C.namespaceURI===yo?tt.namespaceURI===An?Q==="math":tt.namespaceURI===xo?Q==="math"&&_o[Ot]:!!Xv[Q]:C.namespaceURI===An?tt.namespaceURI===xo&&!_o[Ot]||tt.namespaceURI===yo&&!bo[Ot]?!1:!Xv[Q]&&(lU[Q]||!Yv[Q]):!!(Ms==="application/xhtml+xml"&&Iu[C.namespaceURI]):!1},Er=function(C){ys(t.removed,{element:C});try{_(C).removeChild(C)}catch{m(C)}},Eo=function(C,tt){try{ys(t.removed,{attribute:tt.getAttributeNode(C),from:tt})}catch{ys(t.removed,{attribute:null,from:tt})}if(tt.removeAttribute(C),C==="is")if(rt||Et)try{Er(tt)}catch{}else try{tt.setAttribute(C,"")}catch{}},Zv=function(C){let tt=null,Q=null;if(Ht)C=""+C;else{const Wt=mg(C,/^[\r\n\t ]+/);Q=Wt&&Wt[0]}Ms==="application/xhtml+xml"&&hi===An&&(C=''+C+"");const Ot=E?E.createHTML(C):C;if(hi===An)try{tt=new h().parseFromString(Ot,Ms)}catch{}if(!tt||!tt.documentElement){tt=T.createDocument(hi,"template",null);try{tt.documentElement.innerHTML=Ru?b:Ot}catch{}}const Qt=tt.body||tt.documentElement;return C&&Q&&Qt.insertBefore(n.createTextNode(Q),Qt.childNodes[0]||null),hi===An?A.call(tt,ot?"html":"body")[0]:ot?tt.documentElement:Qt},Kv=function(C){return M.call(C.ownerDocument||C,C,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pu=function(C){return C instanceof d&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof u)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},Qv=function(C){return typeof o=="function"&&C instanceof o};function Ln(C,tt,Q){eo(C,Ot=>{Ot.call(t,tt,Q,di)})}const Jv=function(C){let tt=null;if(Ln($.beforeSanitizeElements,C,null),Pu(C))return Er(C),!0;const Q=Xt(C.nodeName);if(Ln($.uponSanitizeElement,C,{tagName:Q,allowedTags:W}),C.hasChildNodes()&&!Qv(C.firstElementChild)&&oe(/<[/\w]/g,C.innerHTML)&&oe(/<[/\w]/g,C.textContent)||C.nodeType===Es.progressingInstruction||dt&&C.nodeType===Es.comment&&oe(/<[/\w]/g,C.data))return Er(C),!0;if(!W[Q]||Y[Q]){if(!Y[Q]&&e0(Q)&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q)))return!1;if(_r&&!ui[Q]){const Ot=_(C)||C.parentNode,Qt=x(C)||C.childNodes;if(Qt&&Ot){const Wt=Qt.length;for(let kn=Wt-1;kn>=0;--kn){const Pe=g(Qt[kn],!0);Pe.__removalCount=(C.__removalCount||0)+1,Ot.insertBefore(Pe,v(C))}}}return Er(C),!0}return C instanceof l&&!dU(C)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&oe(/<\/no(script|embed|frames)/i,C.innerHTML)?(Er(C),!0):(G&&C.nodeType===Es.text&&(tt=C.textContent,eo([H,P,B],Ot=>{tt=xs(tt,Ot," ")}),C.textContent!==tt&&(ys(t.removed,{element:C.cloneNode()}),C.textContent=tt)),Ln($.afterSanitizeElements,C,null),!1)},t0=function(C,tt,Q){if(Oe&&(tt==="id"||tt==="name")&&(Q in n||Q in hU))return!1;if(!(F&&!et[tt]&&oe(S,tt))&&!(ut&&oe(w,tt))){if(!X[tt]||et[tt]){if(!(e0(C)&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,C)||J.tagNameCheck instanceof Function&&J.tagNameCheck(C))&&(J.attributeNameCheck instanceof RegExp&&oe(J.attributeNameCheck,tt)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(tt))||tt==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q))))return!1}else if(!Du[tt]&&!oe(K,xs(Q,k,""))&&!((tt==="src"||tt==="xlink:href"||tt==="href")&&C!=="script"&&gk(Q,"data:")===0&&Fv[C])&&!(q&&!oe(L,xs(Q,k,"")))&&Q)return!1}return!0},e0=function(C){return C!=="annotation-xml"&&mg(C,U)},n0=function(C){Ln($.beforeSanitizeAttributes,C,null);const{attributes:tt}=C;if(!tt||Pu(C))return;const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Ot=tt.length;for(;Ot--;){const Qt=tt[Ot],{name:Wt,namespaceURI:kn,value:Pe}=Qt,un=Xt(Wt);let ue=Wt==="value"?Pe:vk(Pe);if(Q.attrName=un,Q.attrValue=ue,Q.keepAttr=!0,Q.forceKeepAttr=void 0,Ln($.uponSanitizeAttribute,C,Q),ue=Q.attrValue,ws&&(un==="id"||un==="name")&&(Eo(Wt,C),ue=$s+ue),dt&&oe(/((--!?|])>)|<\/(style|title)/i,ue)){Eo(Wt,C);continue}if(Q.forceKeepAttr||(Eo(Wt,C),!Q.keepAttr))continue;if(!Z&&oe(/\/>/i,ue)){Eo(Wt,C);continue}G&&eo([H,P,B],fU=>{ue=xs(ue,fU," ")});const r0=Xt(C.nodeName);if(t0(r0,un,ue)){if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!kn)switch(p.getAttributeType(r0,un)){case"TrustedHTML":{ue=E.createHTML(ue);break}case"TrustedScriptURL":{ue=E.createScriptURL(ue);break}}try{kn?C.setAttributeNS(kn,Wt,ue):C.setAttribute(Wt,ue),Pu(C)?Er(C):fg(t.removed)}catch{}}}Ln($.afterSanitizeAttributes,C,null)},pU=function C(tt){let Q=null;const Ot=Kv(tt);for(Ln($.beforeSanitizeShadowDOM,tt,null);Q=Ot.nextNode();)Ln($.uponSanitizeShadowNode,Q,null),Jv(Q),n0(Q),Q.content instanceof s&&C(Q.content);Ln($.afterSanitizeShadowDOM,tt,null)};return t.sanitize=function(C){let tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,Ot=null,Qt=null,Wt=null;if(Ru=!C,Ru&&(C=""),typeof C!="string"&&!Qv(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw bs("dirty is not a string, aborting")}else throw bs("toString is not a function");if(!t.isSupported)return C;if(It||Nu(tt),t.removed=[],typeof C=="string"&&(Ze=!1),Ze){if(C.nodeName){const un=Xt(C.nodeName);if(!W[un]||Y[un])throw bs("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof o)Q=Zv(""),Ot=Q.ownerDocument.importNode(C,!0),Ot.nodeType===Es.element&&Ot.nodeName==="BODY"||Ot.nodeName==="HTML"?Q=Ot:Q.appendChild(Ot);else{if(!rt&&!G&&!ot&&C.indexOf("<")===-1)return E&&Ne?E.createHTML(C):C;if(Q=Zv(C),!Q)return rt?null:Ne?b:""}Q&&Ht&&Er(Q.firstChild);const kn=Kv(Ze?C:Q);for(;Qt=kn.nextNode();)Jv(Qt),n0(Qt),Qt.content instanceof s&&pU(Qt.content);if(Ze)return C;if(rt){if(Et)for(Wt=D.call(Q.ownerDocument);Q.firstChild;)Wt.appendChild(Q.firstChild);else Wt=Q;return(X.shadowroot||X.shadowrootmode)&&(Wt=R.call(r,Wt,!0)),Wt}let Pe=ot?Q.outerHTML:Q.innerHTML;return ot&&W["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&oe(_g,Q.ownerDocument.doctype.name)&&(Pe=" `+Pe),G&&eo([H,P,B],un=>{Pe=xs(Pe,un," ")}),E&&Ne?E.createHTML(Pe):Pe},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Nu(C),It=!0},t.clearConfig=function(){di=null,It=!1},t.isValidAttribute=function(C,tt,Q){di||Nu({});const Ot=Xt(C),Qt=Xt(tt);return t0(Ot,Qt,Q)},t.addHook=function(C,tt){typeof tt=="function"&&ys($[C],tt)},t.removeHook=function(C,tt){if(tt!==void 0){const Q=fk($[C],tt);return Q===-1?void 0:mk($[C],Q,1)[0]}return fg($[C])},t.removeHooks=function(C){$[C]=[]},t.removeAllHooks=function(){$=Sg()},t}var cu=Tg();const io=e=>cu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),kk=e=>cu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ln=e=>cu.sanitize(e,{ALLOWED_TAGS:[]}),Og=class s0 extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=it.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(O.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(O.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("
    "));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>` `).each(function(l,c){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(u){const d=I(this);d.classed("hovered",!0),o.services.events.dispatchEvent(O.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(O.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(O.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(O.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=I(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(O.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===bt.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${s0.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===bt.MAKE_FULLSCREEN&&l?a.type=bt.EXIT_FULLSCREEN:a.type===bt.EXIT_FULLSCREEN&&!l&&(a.type=bt.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length!1,iconSVG:{content:` `},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:p}=y(i,"locale","translations","toolbar");let f;switch(t){case bt.ZOOM_IN:n&&(f={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case bt.ZOOM_OUT:n&&(f={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case bt.RESET_ZOOM:n&&(f={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case bt.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case bt.EXIT_FULLSCREEN:f={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case bt.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(O.Modal.SHOW)};break;case bt.EXPORT_CSV:f={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case bt.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case bt.EXPORT_JPG:f={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return f}getControlIconByType(t){switch(t){case bt.ZOOM_IN:return` `;case bt.ZOOM_OUT:return` `;case bt.RESET_ZOOM:return'';case bt.MAKE_FULLSCREEN:return'';case bt.EXIT_FULLSCREEN:return'';case bt.SHOW_AS_DATATABLE:return'';case bt.EXPORT_CSV:return'';case bt.EXPORT_JPG:return'';case bt.EXPORT_PNG:return'';default:throw Error("Not supported toolbar control type: "+t)}}};Og.buttonID=0;let so=Og;const wg=class a0 extends gt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=a0.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=y(r,"growth");return i===lt.PREFERRED||i===lt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>y(t,"growth")===lt.STRETCH).size()}render(t=!0){const n=this.model.getOptions(),r=this.parent,{width:i,height:s}=N.getHTMLElementSize(r.node()),a=this.configs.direction===Mt.ROW||this.configs.direction===Mt.ROW_REVERSE,o=y(this.model.getOptions(),"style","prefix"),l=r.classed(`${de}--${o}--layout-row`,this.configs.direction===Mt.ROW).classed(`${de}--${o}--layout-row-reverse`,this.configs.direction===Mt.ROW_REVERSE).classed(`${de}--${o}--layout-column`,this.configs.direction===Mt.COLUMN).classed(`${de}--${o}--layout-column-reverse`,this.configs.direction===Mt.COLUMN_REVERSE).classed(`${de}--${o}--layout-alignitems-center`,this.configs.alignItems===jn.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);l.enter().append("div").merge(r.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(d=>{var h;const p=I(this),f=y(u,"renderType")===it.SVG;d.setParent(f?N.appendOrSelect(p,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):p),f&&!p.select("svg.layout-svg-wrapper").attr("aria-label")&&p.select("svg.layout-svg-wrapper").attr("aria-label",((h=n==null?void 0:n.accessibility)==null?void 0:h.svgAriaLabel)||(n==null?void 0:n.title));const g=y(u,"growth");(g===lt.PREFERRED||g===lt.FIXED)&&d.render(t)})}),r.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=y(u,"growth"),h=y(u,"renderType")===it.SVG?N.getSVGElementSize(I(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):N.getHTMLElementSize(this);if(d===lt.PREFERRED){const p=a?h.width:h.height,f=a?i:s;u.size=p/f*100}}),l.exit().remove(),this.children.filter(u=>y(u,"growth")===lt.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=r.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);a?c.style("width",u=>`${u.size/100*i}px`).style("height","100%"):c.style("height",u=>`${u.size/100*s}px`).style("width","100%"),c.each(function(u){u.components.forEach(d=>{y(u,"growth")===lt.STRETCH&&d.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};wg.instanceID=Math.floor(Math.random()*99999999999);let Se=wg;class Cn extends gt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||pp.default.size}px`).style("height",`${this.configs.size||pp.default.size}px`).attr("opacity",0)}}class ao extends gt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1).style("opacity",1).style("visibility","visible"),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),this.modal.on("click",this.handleHideModal),this.modal.select(".cds--modal-container").on("click",s=>{s.stopPropagation()}),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=i=>{i.key==="Escape"&&this.handleHideModal()},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null).style("opacity",0).style("visibility","hidden"),this.modal.on("click",null),this.modal.select(".cds--modal-container").on("click",null),this.modal.select(".cds--modal-close").on("click",null),typeof window<"u"&&window.removeEventListener("keydown",this.handleEscapeKey)},this.init()}addEventListeners(){this.services.events.addEventListener(O.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(O.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=y(n,"locale","translations","tabularRep"),s=y(n,"style","prefix"),a=this.model.getTabularDataArray();return`

    ${ln(n.title)}

    ${yt(a,0).map(o=>``).join("")} ${a.slice(1).map(o=>` ${o.map(l=>``).join("")} `).join("")}
    ${ln(o)}
    ${ln(l)}
    `}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${de}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ss extends gt{constructor(){super(...arguments),this.type="title",this.renderType=it.HTML}render(t=!1){const n=this.getComponentContainer(),r=y(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>ln(s)),i.node()&&i.node().offsetWidthn){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(O.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(O.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(O.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)i?s:this.getSubstringIndex(t,s,r,i):s}}class uu extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=it.HTML}render(t=!1){const n=this.getOptions(),r=y(n,"legend"),i=y(r,"alignment"),s=y(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Nt.items.status,l=a.some(x=>x.status===o),c=y(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===zt.CENTER).classed("right-aligned",i===zt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ht.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,x=>x.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});const p=y(this.getOptions(),"legend","clickable");u.classed("clickable",p&&a.length>1);const f=Nt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ht.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(x,_)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${_}-title`)).attr("aria-checked",({status:x})=>x===Nt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",x=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:x.name,originalClassName:"checkbox"})).style("background",x=>x.status===Nt.items.status.ACTIVE?this.model.getFillColor(x.name)||this.model.getStrokeColor(x.name):null).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});g.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const x=this,_=u.selectAll("div.additional-item").data(v);_.exit().remove();const E=_.enter().append("div").merge(_).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+D}-title`));E.selectAll("*").remove();let b,T=1;E.append("svg").classed("icon",!0).each(function(M){const D=I(this);!b||b!=M.type?(b=M.type,T=1):T++,x.addAdditionalItem(D,M,T)}),E.append("p").merge(E.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),p&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.lengthc.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===jt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ht.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===jt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ht.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Nt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===jt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",ht.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===jt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",ht.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===jt.ZOOM){const{iconData:a,color:o}=y(Nt,"zoom"),l=t.attr("role",ht.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=y(this.getOptions(),"legend","truncation"),r=y(n,"type"),i=y(n,"threshold"),s=y(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==we.NONE?a.html(function(o){const l=ln(o.name);return l.length>i&&l.length!==s?Wi(l,r,s):l}):a.html(o=>ln(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=y(r,"legend"),s=y(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacters.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(O.Legend.ITEM_CLICK,{clickedElement:I(this)});const a=I(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(O.Tooltip.HIDE),t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:I(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class $g extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=it.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class Dk extends $g{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=N.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var ai,Vt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Vt||(Vt={}));var Mg=(ai={},ai[Vt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},ai[Vt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},ai[Vt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},ai[Vt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},ai),Cg=typeof window<"u"?window:{innerHeight:0,innerWidth:0},oo=function(){function e(t){t===void 0&&(t={}),this.positions=Mg,this.positions=Object.assign({},Mg,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,p=i();u.topp.height&&(d=u.bottom-p.height),u.leftp.width&&(h=u.right-p.width),d&&!h?h=1:h&&!d&&(d=1);var f=n.offsetHeight*n.offsetWidth,g=d*h,m=f-g,v=m/f;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Cg.innerHeight,width:Cg.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new oo;class hu extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=it.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new oo,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=I(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`

    ${io(i.detail.content)}

    `:o=io(this.getTooltipHTML(l));const c=N.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`

    ${io(i.detail.content)}

    `;c.html(u)}else c.html(`

    ${io(this.model.getOptions().tooltip.customHTML(s,o,a))}

    `);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&I(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(O.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==O.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(O.Tooltip.MOVE,null),this.services.events.removeEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(O.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(O.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=y(n,"tooltip","truncation","type"),i=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return r!==we.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=Wi(a.label,r,s)),a.value&&a.value.length>i&&(a.value=Wi(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'
      '+t.map(n=>`
    • ${n.class||n.color?`
      `:""}

      ${n.label||""}

      ${n.labelIcon?`${n.labelIcon}`:""}
      ${n.value===void 0||n.value===null?"":`

      ${n.value}

      `}
    • `).join("")+"
    "}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=y(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=y(n,"tooltip","enabled");if(r){const i=I(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${de}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Vt.LEFT?i.left-=r:n==Vt.RIGHT?i.left+=r:n==Vt.TOP?i.top-=r:n==Vt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Vt.RIGHT,Vt.LEFT,Vt.TOP,Vt.BOTTOM];let d,{horizontalOffset:h}=fp;const{defaultOffset:p}=fp;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let x=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));x=this.addOffsetByPlacement(x,d,p),this.positionService.setElement(s,x);return}let f=y(t,"detail","mousePosition");if(!f)f=er(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=be.height[m];o&&(f[1]+=v+be.spacerHeight)}f[0]/r>.9?d=Vt.LEFT:f[0]/r<.1?d=Vt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Vt.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},s,d);this.positionService.setElement(s,g)}}const Ag=class So extends gt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=it.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),s=N.appendOrSelect(i,`g.${this.type}`),a=N.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=N.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const p=N.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===nt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const g=b=>{const T=b[1]-b[0];let M="0,"+T.toString();const D=Math.floor(l/So.DASH_LENGTH),A=D*So.DASH_LENGTH;for(let R=0;R{const T=b.selection;T===null||T[0]===T[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(T))},v=(b,T)=>{const M=uf().range([0,o]).domain(f);let D=[M.invert(b),M.invert(T)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==D[0].valueOf()||f[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let x;const _=b=>{const T=b.selection;T!==null&&(v(T[0],T[1]),s.call(x.move,null),p.style("display","none"))};l!=0&&o!=0&&(x=um().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",_),s.call(x));const E=this.services.zoom.getZoomRatio();i.on("click",function(b){if(b.shiftKey){const T=this.services.domUtils.getHolder(),M=er(s.node(),T)[0];let D=M-o*E/2;D<0&&(D=0);let A=M+o*E/2;A>o&&(A=o),v(D,A)}})}}};Ag.DASH_LENGTH=4;let Rk=Ag;class Ik extends gt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=it.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=um(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=be.height[s],{width:l}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=N.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(N.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",be.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ue.GRAPH_VIEW?N.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ue.SLIDER_VIEW&&N.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,p=h.getMainXScale(),f=h.getMainYScale(),g=h.getMainXScaleType();if(p&&g===nt.TIME){let m=this.services.zoom.getZoomBarData();if(Ve(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const x=this.model.get("initialZoomDomain"),_=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");_&&_[0]&&_[1]&&(_[0]=new Date(_[0]),_[1]=new Date(_[1])),_&&!(x&&x[0].valueOf()===_[0].valueOf()&&x[1].valueOf()===_[1].valueOf())?this.model.set({initialZoomDomain:at([],_),zoomDomain:_?at([],_):v},{skipUpdate:!0}):_===null&&x!==null&&this.model.set({initialZoomDomain:null,zoomDomain:at([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ge(m,T=>T.value));const E=this.model.get("zoomDomain");if(s===Ue.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const T=a.highlightStartMapsTo,M=a.highlightEndMapsTo,D=a.color,A=a.labelMapsTo;a.data.forEach((R,$)=>{N.appendOrSelect(d,`rect.highlight-${$}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(R[T])).attr("width",this.xScale(R[M])-this.xScale(R[T])).style("fill",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(E,c,l);const b=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(E!==void 0)if(E[0].valueOf()===E[1].valueOf())b.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const T=E.map(M=>this.xScale(M));T[1]-T[0]!1),b.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=be.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=O.ZoomBar.SELECTION_START:t.type==="brush"?a=O.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=O.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=be.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=be.height[s],o=-i/2,l=be.handleBarWidth,c=s===Ue.GRAPH_VIEW?be.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(p){if(p.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(p.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(p){return"handle-bar handle-bar--"+p.type}),h.attr("x",function(p){if(p.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(p.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ue.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=be.height[n],i=this.getComponentContainer().select("svg.zoom-container");N.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,x,_)=>E=>s.getValueFromScale(v,x,_,E),d=u(this.xScale,l,a),h=u(this.yScale,c,o),p=y(this.getOptions(),"zoomBar",z.TOP,"type"),f=be.height[p],g=eu().x(v=>d(v)).y0(f).y1(v=>f-h(v)),m=N.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=pn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=be.height[s],o=vs()([[n,a],[r,a]]);N.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),N.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ue.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(O.ZoomBar.UPDATE,this.render.bind(this))}}class Nk extends gt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=it.SVG,this.positionService=new oo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===z.LEFT||c===z.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===nt.LABELS,[g,m]=h.range(),[v,x]=p.range(),{cartesianScales:_}=l.services,E=_.getOrientation(),b=R=>_.getDomainValue(R),T=R=>_.getRangeValue(R),[M,D]=bn(b,T,E),A=I(this);c===z.TOP||c===z.BOTTOM?(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",v).attr("x1",({datum:R})=>M(R)+(f?u.step()/2:0)).attr("x2",({datum:R})=>M(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-M(R)).attr("width",Math.abs(v-x)).classed("rotate",!0)):(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",g).attr("x2",m).attr("y1",({datum:R})=>D(R)+(f?u.step()/2:0)).attr("y2",({datum:R})=>D(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:R})=>D(R)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(O.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(O.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===nt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),p=Wl(d.ticks(),y(h,"timeInterval"));return jl(n,0,d.ticks(),p,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${de}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=er(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Vt.RIGHT,Vt.LEFT,Vt.TOP,Vt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:I(this),datum:I(this).datum()})})}}class Pk extends gt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=it.SVG,this.positionService=new oo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,g]=d.range(),{cartesianScales:m}=l.services,v=m.getOrientation(),x=M=>m.getDomainValue(M),_=M=>m.getRangeValue(M),[E,b]=bn(x,_,v),T=I(this);c===z.TOP||c===z.BOTTOM?T.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("y",Math.max(g+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:M,...D})=>E(D[M])).attr("width",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(E(A[D])-E(A[M]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null):T.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:M,...D})=>b(D[M])).attr("height",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(b(A[M])-b(A[D]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null)})}}class Lg extends hu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const f=h[p];d=[{label:l,value:u},...Array.isArray(f)&&f.length===2?[{label:"Start",value:f[0]},{label:"End",value:f[1]}]:[{label:c,value:h[p]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const p=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(p)&&p.length===2?`${p[0]} - ${p[1]}`:p,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function kg(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function Uk(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function du(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function Bk(e){return e.depth}function Hk(e,t){return t-1-e.height}function Dg(e,t){return e.sourceLinks.length?e.depth:t-1}function lo(e){return function(){return e}}function Rg(e,t){return co(e.source,t.source)||e.index-t.index}function Ig(e,t){return co(e.target,t.target)||e.index-t.index}function co(e,t){return e.y0-t.y0}function pu(e){return e.value}function Vk(e){return e.index}function Gk(e){return e.nodes}function zk(e){return e.links}function Ng(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Pg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function Fk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=Vk,l=Dg,c,u,d=Gk,h=zk,p=6;function f(){const S={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(S),m(S),v(S),x(S),b(S),Pg(S),S}f.update=function(S){return Pg(S),S},f.nodeId=function(S){return arguments.length?(o=typeof S=="function"?S:lo(S),f):o},f.nodeAlign=function(S){return arguments.length?(l=typeof S=="function"?S:lo(S),f):l},f.nodeSort=function(S){return arguments.length?(c=S,f):c},f.nodeWidth=function(S){return arguments.length?(i=+S,f):i},f.nodePadding=function(S){return arguments.length?(s=a=+S,f):s},f.nodes=function(S){return arguments.length?(d=typeof S=="function"?S:lo(S),f):d},f.links=function(S){return arguments.length?(h=typeof S=="function"?S:lo(S),f):h},f.linkSort=function(S){return arguments.length?(u=S,f):u},f.size=function(S){return arguments.length?(e=t=0,n=+S[0],r=+S[1],f):[n-e,r-t]},f.extent=function(S){return arguments.length?(e=+S[0][0],n=+S[1][0],t=+S[0][1],r=+S[1][1],f):[[e,t],[n,r]]},f.iterations=function(S){return arguments.length?(p=+S,f):p};function g({nodes:S,links:w}){for(const[k,U]of S.entries())U.index=k,U.sourceLinks=[],U.targetLinks=[];const L=new Map(S.map((k,U)=>[o(k,U,S),k]));for(const[k,U]of w.entries()){U.index=k;let{source:K,target:W}=U;typeof K!="object"&&(K=U.source=Ng(L,K)),typeof W!="object"&&(W=U.target=Ng(L,W)),K.sourceLinks.push(U),W.targetLinks.push(U)}if(u!=null)for(const{sourceLinks:k,targetLinks:U}of S)k.sort(u),U.sort(u)}function m({nodes:S}){for(const w of S)w.value=w.fixedValue===void 0?Math.max(du(w.sourceLinks,pu),du(w.targetLinks,pu)):w.fixedValue}function v({nodes:S}){const w=S.length;let L=new Set(S),k=new Set,U=0;for(;L.size;){for(const K of L){K.depth=U;for(const{target:W}of K.sourceLinks)k.add(W)}if(++U>w)throw new Error("circular link");L=k,k=new Set}}function x({nodes:S}){const w=S.length;let L=new Set(S),k=new Set,U=0;for(;L.size;){for(const K of L){K.height=U;for(const{source:W}of K.targetLinks)k.add(W)}if(++U>w)throw new Error("circular link");L=k,k=new Set}}function _({nodes:S}){const w=kg(S,U=>U.depth)+1,L=(n-e-i)/(w-1),k=new Array(w);for(const U of S){const K=Math.max(0,Math.min(w-1,Math.floor(l.call(null,U,w))));U.layer=K,U.x0=e+K*L,U.x1=U.x0+i,k[K]?k[K].push(U):k[K]=[U]}if(c)for(const U of k)U.sort(c);return k}function E(S){const w=Uk(S,L=>(r-t-(L.length-1)*a)/du(L,pu));for(const L of S){let k=t;for(const U of L){U.y0=k,U.y1=k+U.value*w,k=U.y1+a;for(const K of U.sourceLinks)K.width=K.value*w}k=(r-k+a)/(L.length+1);for(let U=0;UL.length)-1)),E(w);for(let L=0;L0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(co),D(K,L)}}function M(S,w,L){for(let k=S.length,U=k-2;U>=0;--U){const K=S[U];for(const W of K){let j=0,X=0;for(const{target:J,value:Y}of W.sourceLinks){let et=Y*(J.layer-W.layer);j+=B(W,J)*et,X+=et}if(!(X>0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(co),D(K,L)}}function D(S,w){const L=S.length>>1,k=S[L];R(S,k.y0-a,L-1,w),A(S,k.y1+a,L+1,w),R(S,r,S.length-1,w),A(S,t,0,w)}function A(S,w,L,k){for(;L1e-6&&(U.y0+=K,U.y1+=K),w=U.y1+a}}function R(S,w,L,k){for(;L>=0;--L){const U=S[L],K=(U.y1-w)*k;K>1e-6&&(U.y0-=K,U.y1-=K),w=U.y0-a}}function $({sourceLinks:S,targetLinks:w}){if(u===void 0){for(const{source:{sourceLinks:L}}of w)L.sort(Ig);for(const{target:{targetLinks:L}}of S)L.sort(Rg)}}function H(S){if(u===void 0)for(const{sourceLinks:w,targetLinks:L}of S)w.sort(Ig),L.sort(Rg)}function P(S,w){let L=S.y0-(S.sourceLinks.length-1)*a/2;for(const{target:k,width:U}of S.sourceLinks){if(k===w)break;L+=U+a}for(const{source:k,width:U}of w.targetLinks){if(k===S)break;L-=U}return L}function B(S,w){let L=w.y0-(w.targetLinks.length-1)*a/2;for(const{source:k,width:U}of w.targetLinks){if(k===S)break;L+=U+a}for(const{target:k,width:U}of S.sourceLinks){if(k===w)break;L-=U}return L}return f}var fu=Math.PI,mu=2*fu,xr=1e-6,jk=mu-xr;function gu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ug(){return new gu}gu.prototype=Ug.prototype={constructor:gu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>xr)if(!(Math.abs(u*o-l*c)>xr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,f=o*o+l*l,g=h*h+p*p,m=Math.sqrt(f),v=Math.sqrt(d),x=i*Math.tan((fu-Math.acos((f+d-g)/(2*m*v)))/2),_=x/v,E=x/m;Math.abs(_-1)>xr&&(this._+="L"+(e+_*c)+","+(t+_*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+E*o)+","+(this._y1=t+E*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>xr||Math.abs(this._y1-c)>xr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%mu+mu),d>jk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>xr&&(this._+="A"+n+","+n+",0,"+ +(d>=fu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function Bg(e){return function(){return e}}function Wk(e){return e[0]}function qk(e){return e[1]}var Yk=Array.prototype.slice;function Xk(e){return e.source}function Zk(e){return e.target}function Kk(e){var t=Xk,n=Zk,r=Wk,i=qk,s=null;function a(){var o,l=Yk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Ug()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:Bg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Bg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function Qk(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function Jk(){return Kk(Qk)}function tD(e){return[e.source.x1,e.y0]}function eD(e){return[e.target.x0,e.y1]}function nD(){return Jk().source(tD).target(eD)}class rD extends gt{constructor(){super(...arguments),this.type="alluvial",this.renderType=it.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=We.minNodePadding;s.alluvial.nodePadding>We.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Dg;c===zt.LEFT?u=Bk:c===zt.RIGHT&&(u=Hk);const d=Fk().nodeId(x=>x.name).nodeWidth(We.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(x=>Object.assign({},x)),links:a.map(x=>Object.assign({},x))}),this.graph.nodes=this.graph.nodes.filter(x=>x.value!==0);const h={};this.graph.nodes.forEach(x=>{const _=x.x0;x.category&&(h[_]=x==null?void 0:x.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",x=>`translate(${x}, 0)`).append("text").attr("id",(x,_)=>this.services.domUtils.generateElementIDString(`alluvial-category-${_}`)).style("font-size","14px").text(x=>h[x]?h[x]:"").attr("y",20).attr("x",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-category-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});let T=0;return x+T>=b&&(T=-b+4),T});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const x=y(this.getOptions(),"color","scale");x&&p.enter().append("linearGradient").attr("id",_=>`${this.gradient_id}-link-${_.index}`).attr("gradientUnits","userSpaceOnUse").call(_=>_.append("stop").attr("offset","0%").attr("stop-color",E=>x[E.source.name])).call(_=>_.append("stop").attr("offset","100%").attr("stop-color",E=>x[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",nD()).attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-line-${x.index}`)).attr("class",x=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:x.source.index,originalClassName:"link"})).style("stroke",x=>o?`url(#${this.gradient_id}-link-${x.index})`:this.model.getFillColor(x.source.name,null,{...x,source:x.source.name,target:x.target.name})).attr("stroke-width",x=>Math.max(1,x.width)).style("stroke-opacity",We.opacity.default).attr("aria-label",x=>`${x.source.name} → ${x.target.name} (${x.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-${x.index}`)).classed("node-group",!0).attr("transform",x=>`translate(${x.x0}, ${x.y0})`);f.append("rect").classed("node",!0).attr("height",x=>x.y1-x.y0).attr("width",x=>x.x1-x.x0).attr("fill","black");const g=f.append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${x.index}`)),{code:m,number:v}=y(s,"locale");g.append("text").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${x.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(x=>`${x.name} (${v(x.value,m)})`).attr("aria-label",x=>`${x.name} (${x.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0}),T=(x.y1-x.y0)/2-9;let M=x.x1-x.x0;return x.x1>=b?M=M-(b+16):M+=4,`translate(${M}, ${T})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=y(this.getOptions(),"locale"),s=ya((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",We.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),We.opacity.selected):We.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=ya((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",We.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(I(this).classed("link-hovered",!0).raise(),We.opacity.selected):We.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ji(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=ji(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEMOVE,{event:r,element:I(this),datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=ji(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",We.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ji(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return` `}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Te extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=it.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(N.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(N.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=mc(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=rm(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(xn(u).tx)-Number(xn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=eu().curve(this.services.curves.getD3Curve()).defined(b=>{const T=s.getRangeIdentifier();return b[T]!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(b,T)=>{y(r,"axes",b,"includeZero")===!1&&T[0]>0&&T[1]>0&&(d=T[0])},p=b=>u?s.getBoundedScaledValues(b)[0]:s.getRangeValue(d),f=b=>u?s.getBoundedScaledValues(b)[1]:s.getRangeValue(b);a===Gt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(b=>s.getDomainValue(b)).y0(b=>p(b)).y1(b=>f(b))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(b=>p(b)).x1(b=>f(b)).y(b=>s.getDomainValue(b)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,b=>b.name),x=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const b=x.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let T;if(b)T=getComputedStyle(b,null).getPropertyValue("stroke");else{const M=y(this.model.getOptions(),"color","scale");if(M!==null){const D=Object.keys(M);T=M[D[0]]}}pc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:pc.getStops(i,T)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const _=this,E=v.enter().append("path");m?E.merge(v).style("fill",b=>`url(#${this.services.domUtils.generateElementIDString(`${b.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:b.name,originalClassName:"area"})).attr("d",b=>{const{data:T}=b;return o(T)}):(E.attr("opacity",0).merge(v).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:b.name,originalClassName:"area"})).style("fill",b=>_.model.getFillColor(b.name,null,b.data)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"area-update-enter",animate:t})).attr("opacity",u?1:vn.opacity.selected).attr("d",b=>{const{data:T}=b;return o(T)}),u&&E.attr("fill-opacity",vn.opacity.selected).style("stroke",b=>_.model.getStrokeColor(b.name,null,b.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class oi extends gt{constructor(){super(...arguments),this.type="line",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=bn(s,a,r.getOrientation()),c=this.getOptions(),u=vs().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const f=r.getRangeIdentifier(p);return p[f]!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(g=>c.axes[g].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(g=>{const m=this.services.cartesianScales.getDomainIdentifier(g),v=this.services.cartesianScales.getRangeIdentifier(g);return{name:y(g,0,f),data:g.map(x=>({[m]:x.data.sharedStackKey,[f]:x[f],[v]:x[1]})),hidden:!MC(g,x=>x[0]!==x[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(g=>{const m=this.services.cartesianScales.getRangeIdentifier(g);return g[m]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:f}=p;return u(f)})}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Vg=5;function iD(e,t){return e>t-Vg&&e({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>iD(m.domainValue,u));if(this.pointsWithinLine&&f.length===this.pointsWithinLine.length&&f.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=f,this.services.events.dispatchEvent(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const x=m[0].domainValue,_=Math.abs(u-v.domainValue),E=Math.abs(u-x);return _>E||(_0){const m=g.map(E=>E.originalData).filter(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]!=null}),v=g.map(E=>E.domainValue),x=p.filter(E=>{const b=this.services.cartesianScales.getDomainValue(E);return v.includes(b)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!tm(this.elementsToHighlight,x)&&this.hideRuler(),x.dispatch("mouseover"),this.elementsToHighlight=x,this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const _=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",_.domainValue).attr("y2",_.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",_.domainValue).attr("x2",_.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=N.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(O.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=er(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=JO(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-grid-backdrop")}}let cn=class extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=it.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=bn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=bn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>a.getDomainValue(p),c=p=>a.getRangeValue(p),[u,d]=bn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=a.getDomainIdentifier(p),g=this.model.getIsFilled(p[o],p[f],p,i)?[st.FILL,st.STROKE]:[st.STROKE];return this.model.getColorClassName({classNameTypes:g,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=a.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=a.getDomainIdentifier(p);return!this.model.getIsFilled(p[o],p[f],p,i)}).transition().call(p=>{var f;return(f=this.services.transitions)==null?void 0:f.setupTransition({transition:p,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",p=>{const f=a.getDomainIdentifier(p);if(this.model.getIsFilled(p[o],p[f],p,i))return this.model.getFillColor(p[o],p[f],p)}).style("stroke",p=>{const f=a.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=a.getRangeIdentifier(p);return p[f]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=I(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=I(this);(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=I(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class Gg extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=it.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=N.getSVGElementSize(s,{useAttrs:!0}),l=N.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===nt.LABELS||this.scaleType===nt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=rm;break;case z.BOTTOM:h=mc;break;case z.RIGHT:h=PC;break;case z.TOP:h=NC;break}l.attr("aria-label",`${n} axis`);const p=!l.select("g.ticks").empty();let f=N.appendOrSelect(l,"g.ticks");p||(f.attr("role",`${ht.GRAPHICS_OBJECT} ${ht.GROUP}`),f.attr("aria-label",`${n} ticks`));const g=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===nt.TIME||m.scaleType===nt.TIME,x=n===z.LEFT||n===z.RIGHT,_=this.model.get("zoomDomain");if(_&&v&&!x&&d.domain(_),!i){f.attr("aria-hidden",!0);return}const E=y(m,"scaleType"),b=y(r,"data","loading"),T=y(m,"ticks","number"),M=y(m,"ticks","values"),D=y(m,"truncation","type"),A=y(m,"truncation","threshold"),R=y(m,"truncation","numCharacter"),$=T!==null,H=y(r,"timeScale"),P=N.appendOrSelect(g,"g.tick"),B=N.appendOrSelect(P,"text").text("0"),S=N.getSVGElementSize(B.node(),{useBBox:!0}).height;P.remove();const w=this.scaleType||m.scaleType||nt.LINEAR,L=h(d).tickSizeOuter(0);if(d.ticks){let Y;if($?Y=T:(Y=In.ticks.number,x&&(Y=this.getNumberOfFittingTicks(o,S,In.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Y=0),L.ticks(Y),v)if(!d.ticks(Y).length)L.tickValues([]);else{const et=y(r,"timeScale","addSpaceOnEdges"),ut=y(r,"axes",n,"domain"),F=d.copy();et&&!ut&&F.nice(Y);const q=F.ticks(Y);et&&q.length>2&&!ut&&(q.splice(q.length-1,1),q.splice(0,1)),L.tickValues(q)}}let k;const U=y(m,"ticks","formatter"),{code:K,number:W}=y(r,"locale");if(v){const Y=Wl(L.tickValues(),y(r,"timeScale","timeInterval"));U===null?k=(et,ut)=>jl(et,ut,L.tickValues(),Y,H,r.locale):k=(et,ut)=>{const F=jl(et,ut,L.tickValues(),Y,H,r.locale);return U(et,ut,F)}}else U===null?w===nt.LINEAR&&(k=Y=>W(Y,K)):k=U;L.tickFormat(k);const[j,X]=this.services.cartesianScales.getScaleByPosition(n).domain();let ct;if(M){if(v)M.forEach((Y,et)=>{Y.getTime===void 0&&(M[et]=new Date(Y))}),ct=M.filter(Y=>{const et=Y.getTime();return et>=new Date(j).getTime()&&et<=new Date(X).getTime()});else if(E===nt.LABELS){const Y=this.services.cartesianScales.getScaleByPosition(n).domain();ct=M.filter(et=>Y.includes(et))}else ct=M.filter(Y=>Y>=j&&Y<=X);L.tickValues(ct)}switch(n){case z.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const J=this.model.isDataEmpty();if(m.title){const Y=N.appendOrSelect(l,"text.axis-title").html(J||b?"":ln(m.title)),et=y(m,"titleOrientation");let ut;switch(n){case z.LEFT:et===Ls.RIGHT?Y.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Y.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:et===Ls.LEFT?Y.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Y.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ut=N.getSVGElementSize(Y,{useBBox:!0}).height,Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ut/2})`).style("text-anchor","middle");break}}if(v){const Y=Wl(L.tickValues(),y(r,"timeScale","timeInterval")),et=H.showDayName,ut=f;t&&(f=f.transition().call(F=>this.services.transitions.setupTransition({transition:F,name:"axis-update",animate:t}))),f=f.call(L),ut.selectAll(".tick").data(L.tickValues(),d).order().select("text").attr("class",(F,q)=>Ip(F,q,L.tickValues(),Y,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(L):f=f.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:t})).call(L);if(g.call(L),n===z.BOTTOM||n===z.TOP){let Y=!1;const et=y(m,"ticks","rotation");if(et===mi.ALWAYS)Y=!0;else if(et===mi.NEVER)Y=!1;else if(!et||et===mi.AUTO)if(d.step)Y=g.selectAll("g.tick text").nodes().some(ut=>N.getSVGElementSize(ut,{useBBox:!0}).width>=d.step());else{Y=!1;const ut=g.append("text").text("A"),F=N.getSVGElementSize(ut.node(),{useBBox:!0}).width;let q;g.selectAll("g.tick").each(function(){const Z=I(this),G=parseFloat(y(xn(this),"tx"));G!==null&&q+Z.text().length*F*.8>=G&&(Y=!0),q=G}),ut.remove()}Y?($||(L.ticks(this.getNumberOfFittingTicks(a,S,In.ticks.horizontalSpaceRatio)),g.call(L),f.call(L)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(b?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",Y=>Y),g.selectAll("g.tick").attr("aria-label",Y=>Y),D!==we.NONE&&E===nt.LABELS&&!M){const Y=this.services.cartesianScales.getScaleDomain(n);if(Y.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const ut=this;l.selectAll("g.tick text").data(Y).text(function(F){return F.length>A?(ut.truncation[n]=!0,Wi(F,D,R)):F}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Y).text(function(F){return F.length>A?Wi(F,D,R):F}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Y)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===nt.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Jf(i,2,In.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class sD extends Gg{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=N.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0}),h=N.appendOrSelect(l,"rect.axis-holder");let p=0,f=0;switch(n){case z.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case z.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case z.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:p=-(u/2),f=d/2-2,s.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-In.hover.rectanglePadding).attr("y",f).attr("width",u+In.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===nt.LABELS&&d.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===nt.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(O.Tooltip.HIDE),l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=it.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(a=>{i[z[a]]&&(n[z[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=z[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===vi.DEFAULT?new Gg(this.model,this.services,l):new sD(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=N.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===z.LEFT||l===z.RIGHT)&&(h+=5)),l){case z.TOP:s.top=d+h;break;case z.BOTTOM:s.bottom=d+h;break;case z.LEFT:s.left=u+h;break;case z.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(O.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(O.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class ce extends gt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Ft.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Ft.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Ft.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Ft.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Gt.VERTICAL&&this.drawYGrid(t),n===Gt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=je().domain([0,1]).range(t),this.yScale=je().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});this.backdrop=N.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=N.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=N.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=gs().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,p=N.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+Lt.xOffset;c===zt.CENTER?f=s/2:c===zt.RIGHT&&(f=s-t-Lt.xOffset);const g=t+Lt.yOffset;p.attr("transform",`translate(${f}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=N.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=` `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(VC).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class aD extends gt{constructor(){super(...arguments),this.type="boxplot",this.renderType=it.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,p=u-d;if(h===0)return;const{cartesianScales:f}=this.services,g=f.getOrientation(),m=g===Gt.VERTICAL,[v,x]=bn($=>this.services.cartesianScales.getDomainValue($),$=>this.services.cartesianScales.getRangeValue($),g),_=Math.floor((m?h:p)/s.length),E=Math.min(_/2,16),b=this.model.getBoxplotData(),T=n.selectAll(".box-group").data(b);T.exit().remove();const M=T.enter().append("g").attr("class","box-group"),D=T.merge(M);M.append("path").merge(T.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalstartline",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i]),P=H,B=f.getRangeValue($.whiskers.min),S=f.getRangeValue($.quartiles.q_25);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalendline",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i]),P=H,B=f.getRangeValue($.whiskers.max),S=f.getRangeValue($.quartiles.q_75);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"box"})).attr("fill-opacity",Le.box.opacity.default).attr("stroke-width",Le.strokeWidth.default).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",$=>$[i]).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-quartiles",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/2,P=H+E,B=f.getRangeValue(Math[m?"max":"min"]($.quartiles.q_75,$.quartiles.q_25)),S=B+Math.abs(f.getRangeValue($.quartiles.q_75)-f.getRangeValue($.quartiles.q_25));return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",$=>{const H=f.getDomainValue($[i])-E/2,P=H+E,B=f.getRangeValue($.whiskers.min),S=f.getRangeValue($.whiskers.max);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-startingwhisker",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/4,P=H+E/2,B=f.getRangeValue($.whiskers.min),S=f.getRangeValue($.whiskers.min);return ie({x0:H,x1:P,y0:B,y1:S},g)}),M.append("path").merge(T.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-median",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/2,P=H+E,B=f.getRangeValue($.quartiles.q_50);return ie({x0:H,x1:P,y0:B,y1:B},g)}),M.append("path").merge(T.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-endingwhisker",animate:t})).attr("d",$=>{const H=f.getDomainValue($[i])-E/4,P=H+E/2,B=f.getRangeValue($.whiskers.max),S=f.getRangeValue($.whiskers.max);return ie({x0:H,x1:P,y0:B,y1:S},g)});const A=D.selectAll("circle.outlier").data($=>$.outliers.map(H=>({min:$.whiskers.min,max:$.whiskers.max,[i]:$[i],value:H})));A.exit().remove();const R=A.enter().append("circle");A.merge(R).attr("r",Le.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Le.circle.opacity.default).attr("cx",v).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-circles",animate:t})).attr("cy",x),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Le.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=I(this);t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(O.Boxplot.BOX_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Le.box.opacity.default),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("fill-opacity",Le.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Boxplot.OUTLIER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);o.classed("hovered",!1).attr("fill-opacity",Le.circle.opacity.default),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class li extends gt{constructor(){super(...arguments),this.type="zero-line",this.renderType=it.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer({isPresentational:!0});if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const d=Tp({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());N.appendOrSelect(o,"line.domain").transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class oD extends cn{constructor(){super(...arguments),this.type="bubble",this.renderType=it.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?Ge(s):[1,1];return je().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=bn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",h=>{const p=o.getRangeIdentifier(h);return h[p]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[p],h)}).style("stroke",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[p],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=y(this.getOptions(),"bubble");return[{label:y(n,"radiusLabel"),value:t[y(n,"radiusMapsTo")]}]}}class lD extends gt{constructor(){super(...arguments),this.type="bullet",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bullet graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const g=[];s.forEach(v=>{v.ranges?v.ranges.forEach((x,_)=>{x!=null&&x`${v[r]}-${v.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let x,_,E,b;return v.order===1?(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=c-2,b=l+1):(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=this.services.cartesianScales.getRangeValue(v.value),b=c),ie({x0:x,x1:_,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const v=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[v],m)}).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-4,x=v+8,_=this.services.cartesianScales.getRangeValue(0)+1,E=this.services.cartesianScales.getRangeValue(m);return ie({x0:v,x1:x,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const g=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>y(m,"marker")!==null),m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-12,x=v+24,_=this.services.cartesianScales.getRangeValue(m.marker);return ie({x0:v,x1:x,y0:_,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let g=[];s.filter(v=>y(v,"marker")!==null).forEach(v=>{const x=v.marker,_=v[o];g=g.concat([{datum:v,value:x*.25,barValue:_},{datum:v,value:x*.5,barValue:_},{datum:v,value:x*.75,barValue:_}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,v=>v[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:x})=>{let _=4;v.ranges&&v.ranges.indexOf(x)!==-1&&(_=8);const E=this.services.cartesianScales.getDomainValue(v)-_/2,b=E+_,T=this.services.cartesianScales.getRangeValue(x);return ie({x0:E,x1:b,y0:T,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),p(),f(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=y(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=I(this);c.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=y(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:o,element:I(this),datum:l}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:o,element:I(this),datum:l})}).on("mouseout",function(o,l){const c=I(this);c.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function cD(e){return e}function uD(e){if(e==null)return cD;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c1)for(var d=1,h=o(c[0]),p,f;dh&&(f=c[0],c[0]=c[d],c[d]=f,h=p);return c}).filter(function(l){return l.length>0})}}class vD extends Gn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=it.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===Gt.VERTICAL?n:r),p=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=N.appendOrSelect(p,"line.ruler-line"),g=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(yt(m,"data.x0"))<=h&&parseFloat(yt(m,"data.x1"))>=h)return!0});if(g.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!tm(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g;const m=I(g.nodes()[0]).datum(),v=parseFloat(yt(m,"data.x0")),x=parseFloat(yt(m,"data.x1")),_=this.model.getActiveDataGroupNames(),E=_.reverse().map(b=>({label:b,value:yt(m,`data.${b}`),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:b})})).filter(b=>b.value!==0);if(E.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:yt(s,"bins.rangeLabel")||"Range",value:`${v} – ${x}`},...E,...y(s,"tooltip","showTotal")===!0?[{label:yt(s,"locale.translations.total")||yt(s,"tooltip.totalLabel")||"Total",value:_.reduce((T,M)=>T+parseFloat(yt(m,`data.${M}`)),0)}]:[]]}),p.attr("opacity",1);const b=d((v+x)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",b).attr("y2",b):f.attr("y1",u).attr("y2",c).attr("x1",b).attr("x2",b)}else this.hideRuler()}else this.hideRuler()}}class uo extends Gn{formatTooltipData(t){return t.reverse()}}const yD=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=dm();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},xD={d:"M7 0v8L0 4z"},bD={d:"M0 0v8l7-4z"},_D={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z"},ED={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z"},SD={d:"M0 .44974747h8v8H0v-3.6830331z"},TD={d:"M0 0h1.5v8H0z"};class Fg extends uu{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=it.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=N.getSVGElementSize(i,{useAttrs:!0}),a=y(this.getOptions(),"data","loading");if(s>Nt.color.barWidth&&!a){const o=y(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=N.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),d=c[0]-u-9;d>1?i.select("g.legend-title").attr("transform",`translate(${d}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer({ariaLabel:"legend"}),{width:i}=N.getSVGElementSize(r,{useAttrs:!0}),s=y(n,"color","gradient","colors"),a=y(n,this.chartType,"colorLegend","type");let o=y(n,"color","pairing","option");const l=y(n,"heatmap","colorLegend","title");if(y(this.getOptions(),"data","loading")){r.html("");return}const c=!Ve(s),u=Pp(this.model.getDisplayData()),d=!(i<=Nt.color.barWidth),h=d?Nt.color.barWidth:i,p=N.appendOrSelect(r,"g.legend"),f=N.appendOrSelect(p,"g.legend-axis");if(l){const A=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(A,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const g=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&g==="mono"||o<1&&o>2&&g==="diverge")&&(o=1);let m=[];const v=g==="diverge"?17:11;if(c)m=s;else for(let A=1;AM(A,T));let D;switch(a){case gi.LINEAR:this.drawLinear(m,p,h);break;case gi.QUANTIZE:D=this.drawQuantize(m,g,c,p,h),E.range([D,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${Nt.color.axisYTranslation})`).call(b),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",d?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",d&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);N.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),N.appendOrSelect(n,"rect").attr("width",r).attr("height",Nt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=Xi().domain(t).range([0,s]);return N.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Nt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class OD extends Ss{constructor(){super(...arguments),this.type="meter-title",this.renderType=it.SVG}render(t=!1){const n=y(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(y(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=N.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=y(n,"meter","proportional","total"),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=y(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=y(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${p(r,h)} ${s} used (${p(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=N.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"meter","proportional","total"),i=r?y(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"",a=y(n,"meter","proportional","totalFormatter"),{code:o,number:l}=y(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=N.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-Kt.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=N.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=Kt.status.indicatorSize/2,a=N.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=y(this.model.getDisplayData(),0,"value"),{code:n,number:r}=y(this.getOptions(),"locale"),i=this.getComponentContainer(),s=N.appendOrSelect(i,"text.meter-title"),a=y(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=Kt.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=N.appendOrSelect(this.parent,"tspan"),i=Kt.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());N.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=y(this.getOptions(),"meter","proportional"),n=N.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=N.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=N.getSVGElementSize(r,{useBBox:!0}).width;return n-i-Kt.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=Kt.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(a,{useBBox:!0}).width+Kt.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case fi.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case fi.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case fi.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class yu extends gt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=N.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=y(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return ti(r[1])}return!1}}class wD extends gt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:Vr.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"circle packs",withinChartClip:!0}),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=y(l,"canvasZoom","enabled");a&&y(s,0,"children")&&(s=y(s,0,"children"));const u=ps({children:s}).sum(f=>f.value).sort((f,g)=>g.value-f.value),d=DL().size([r,i]).padding(f=>f.depth>=1?Vr.padding.children+3:Vr.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=o),h=n.selectAll("circle.node").data(d);h.exit().attr("width",0).attr("height",0).remove();const p=h.enter().append("circle").classed("node",!0);p.merge(h).attr("class",f=>{const g=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${g}`:`node node-leaf ${g}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",Vr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Hr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName,null,r.data))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",Vr.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){I(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=I(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,Hr)})}getZoomIcon(){return` `}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(f=>{if(f!==null)return typeof f.data.value=="number"?{label:f.data.name,value:f.data.value}:{label:f.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:yt(p,"locale.translations.total")||yt(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Hr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Hr),n.stopPropagation()}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function $D(e,t){const n=Pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class jg extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=it.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(A=>A[a]>0),l=this.computeRadius();this.arc=gs().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=gs().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const c=ek().value(A=>A[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",ht.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,A=>A.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",A=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:A.data[s],originalClassName:"slice"})).style("fill",A=>n.model.getFillColor(A.data[s],null,A.data)).attr("d",this.arc).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",A=>`${A[a]}, ${Vl(A.data[a],o,a)+"%"}`).attrTween("d",function(A){return $D.bind(this)(A,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=y(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(A=>A.data[a]>0):[],g=N.appendOrSelect(r,"g.labels").attr("role",ht.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,A=>A.data[s]);g.exit().attr("opacity",0).remove();const m=g.enter().append("text").classed("pie-label",!0),v=[];m.merge(g).style("text-anchor","middle").text(A=>i.pie.labels.formatter?i.pie.labels.formatter({...A,percentageValue:Vl(A.data[a],o,a,!0)}):h(Vl(A.data[a],o,a),d)+"%").datum(function(A){const R=l+7,$=(A.endAngle-A.startAngle)/2+A.startAngle,H=$/Math.PI*180,P=this.getComputedTextLength();return A.textOffsetX=P/2,A.textOffsetY=H>90&&H<270?10:0,A.xPosition=(A.textOffsetX+R)*Math.sin($),A.yPosition=(A.textOffsetY+R)*-Math.cos($),A}).attr("transform",function(A,R){const $=f.length,H=(A.endAngle-A.startAngle)*(180/Math.PI);if(R>=$-2&&H0&&(D+=Lt.yOffsetCallout),r.attr("x",M+7).attr("y",D),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ht.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ht.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===pi.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Lt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Lt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);EC(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class MD extends jg{constructor(){super(...arguments),this.type="donut",this.renderType=it.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Nd:s=xe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const Wg="4,10 8,6 12,10",qg="12,6 8,10 4,6";class CD extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=it.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Jf(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===Wn.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case As.UP:return Wg;case As.DOWN:return qg;default:return t>0?Wg:qg}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=gs().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=gs().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const p=n.selectAll("path.arc-foreground").data([i]);p.enter().append("path").merge(p).attr("class",this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=y(r,"gauge","alignment"),{width:g}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===zt.CENTER?m=g/2:f===zt.RIGHT&&(m=g-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===Wn.FULL&&!s?d=l(a):r===Wn.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(a),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),x=f.selectAll("text.gauge-value-number").data([i]);x.enter().append("text").attr("class","gauge-value-number").merge(x).style("font-size",`${p}px`).attr("text-anchor","middle").text(A=>{let R;return A!=null?R=Number(A.toFixed(2))%1!==0?A.toFixed(2):A.toFixed():R=0,v?v(R):m(Number(R),g)});const{width:_}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),E=p/2,b=u?"%":"",T=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${E}px`).attr("x",_/2).text(b),{width:M,height:D}=N.getSVGElementSize(T,{useBBox:!0});T.attr("y",`-${D/2}px`),f.attr("transform",`translate(-${M/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(E=>{let b;return E!=null?b=Number(E.toFixed(2))%1!==0?E.toFixed(2):E.toFixed():b=0,c?`${c(b)}${m}`:`${a(Number(b),s)}${m}`});const{width:v}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),x=y(r,"gauge","deltaArrow","enabled"),_=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&x?[i]:[]);_.enter().append("svg").merge(_).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const E=I(this);N.appendOrSelect(E,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=y(r,"gauge","status");N.appendOrSelect(E,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),_.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===Wn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Yg extends yu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=it.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ki(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Gt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),p=d,f=d+h,g=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(g),v=this.services.cartesianScales.getValueThroughAxisPosition(g,m),x=this.services.cartesianScales.getRangeValue(u),_=this.services.cartesianScales.getDomainValue(u)-h/2,E=_+h;if(!this.isOutsideZoomedDomain(_,E))return ie({x0:p,x1:f,y0:v,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Xi().domain(t).rangeRound([0,this.getGroupWidth()])}}class AD extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=it.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,p=null;this.matrix[r]!==void 0?(u=a,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const g=this.matrix[r][f].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=gp?g:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const g=this.matrix[f][r].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=gp?g:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Rn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Rn(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const p=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",p).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const f=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${p})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(f.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==$r.OFF&&(t===$r.AUTO&&dp.minCellDividerDimension<=this.xBandwidth&&dp.minCellDividerDimension<=this.yBandwidth||t===$r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ji(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const d=I(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class LD extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ht.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?m+=1:m-=1),ie({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(O.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class kD extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=it.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?yn.weight.unselected:yn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",yn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,p]=bn(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const g=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Gt.HORIZONTAL?g.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):g.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>p(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class DD extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=it.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;y(i,"meter","proportional")===null?u=100:u=y(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=je().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=y(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?Kt.height.proportional:Kt.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?Kt.height.proportional:Kt.height.default));const f=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",_=>_.x).attr("y",0).attr("height",()=>p||(s?Kt.height.proportional:Kt.height.default)).attr("class",_=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:_[c],originalClassName:g})).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"meter-bar-update",animate:t})).attr("width",_=>_.value>u?d(u):Math.max(_.width,2)).style("fill",_=>n.model.getFillColor(_[c],null,_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",_=>_.value),f.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const x=r.selectAll("line.peak").data(v==null?[]:[v]);x.enter().append("line").classed("peak",!0).merge(x).attr("y1",0).attr("y2",()=>p||(s?Kt.height.proportional:Kt.height.default)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"peak-line-update",animate:t})).attr("x1",_=>d(_)).attr("x2",_=>d(_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",_=>_),x.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class RD extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=it.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=wC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return at(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:at(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:sr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",sr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:g,xAxisRectHeight:m}=sr;this.uniqueKeys=Array.from(new Set(s.map(S=>S[u]))),this.uniqueGroups=Array.from(new Set(s.map(S=>S[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),x=(Math.min(r,i)-v)/2;if(x<=0)return;const _=Xi().domain(this.fullDataNormalized.map(S=>S[u])).range([0,2*Math.PI].map(S=>S-Math.PI/2)),E=Rn(this.fullDataNormalized.map(S=>S[d])),b=je().domain([E>=0?0:E,tr(this.fullDataNormalized.map(S=>S[d]))]).range([g,x]).nice(f),T=b.ticks(f),M=(S,w,L)=>this.model.getFillColor(S,w,L),D=ik().angle(S=>_(S[u])+Math.PI/2).radius(S=>b(S[d])).curve(mf),A=this.uniqueKeys.map(S=>{const w=this.getLabelDimensions(S).width,L=A2(_(S),x);return w+L}),R={x:tr(A)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",ht.GROUP).selectAll("path").data(T,S=>S),H=S=>this.uniqueKeys.map(w=>({[u]:w,[d]:S}));$.join(S=>S.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",L=>D(H(L)))),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(H(L)))),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_exit",animate:t})).attr("d",L=>D(H(L))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",ht.GROUP).selectAll("line").data(this.uniqueKeys,S=>S).join(S=>S.append("line").attr("opacity",0).attr("class",w=>`x-axis-${Qr(w)}`).attr("stroke-dasharray","0").attr("x1",w=>Ut(_(w),0,R).x).attr("y1",w=>Ut(_(w),0,R).y).attr("x2",w=>Ut(_(w),0,R).x).attr("y2",w=>Ut(_(w),0,R).y).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",ht.GROUP).selectAll("text").data(this.uniqueKeys).join(S=>S.append("text").text(w=>w).attr("opacity",0).attr("x",w=>Ut(_(w),b.range()[1]+h,R).x).attr("y",w=>Ut(_(w),b.range()[1]+h,R).y).style("text-anchor",w=>Df(_(w)).textAnchor).style("dominant-baseline",w=>Df(_(w)).dominantBaseline).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",L=>Ut(_(L),b.range()[1]+h,R).x).attr("y",L=>Ut(_(L),b.range()[1]+h,R).y).end().finally(()=>{const L=y(o,"radar","alignment"),k=this.getAlignmentXOffset(L,n,this.getParent());n.attr("x",k)})),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",ht.GROUP).selectAll("path").data(this.groupedDataNormalized,S=>S.name).join(S=>S.append("path").attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",w=>M(w.name,null,w.data)).style("fill-opacity",sr.opacity.selected).style("stroke",w=>M(w.name,null,w.data)).call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_enter",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),L.attr("opacity",1).attr("d",k=>D(k.data))}),S=>(S.attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).style("fill",w=>M(w.name,null,w.data)).style("stroke",w=>M(w.name,null,w.data)),S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(L.data))),S),S=>S.call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_exit",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),L.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",ht.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(S=>y(S,d)!==null)).join(S=>S.append("circle").attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w[c]),S=>S,S=>S.remove()).attr("class",S=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:S[l],originalClassName:Qr(S[u])})).attr("cx",S=>Ut(_(S[u]),b(S[d]),R).x).attr("cy",S=>Ut(_(S[u]),b(S[d]),R).y).attr("r",0).attr("opacity",0).style("fill",S=>M(S[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",ht.GROUP).selectAll("rect").data(this.uniqueKeys).join(S=>S.append("rect"),S=>S,S=>S.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",b.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",S=>`rotate(${Rf(_(S))}, ${R.x}, ${R.y})`);const{code:P,number:B}=y(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",ht.GROUP).selectAll("text").data(Ge(T)).join(S=>S.append("text").attr("opacity",0).text(w=>B(w,P)).attr("x",w=>Ut(-Math.PI/2,b(w),R).x+p).attr("y",w=>Ut(-Math.PI/2,b(w),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_update",animate:t})).text(L=>L).attr("opacity",1).attr("x",L=>Ut(-Math.PI/2,b(L),R).x+p).attr("y",L=>Ut(-Math.PI/2,b(L),R).y)),S=>S.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===zt.CENTER?a=Math.floor((s-i.width)/2):t===zt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Qr(i)}`),o=t.parent.selectAll(`.dots circle.${Qr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",sr.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(p=>typeof p[d]=="number").map(p=>({label:p[u],value:p[d],color:t.model.getFillColor(p[u],null,p),class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Qr(i)}`),o=t.parent.selectAll(`.dots circle.${Qr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE)})}}class Xg extends yu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,p=h+u;let f,g;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),g=this.services.cartesianScales.getRangeValue(d[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,v)),g=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(g-f);if(m!==0&&m<2&&(d>0&&a===Gt.VERTICAL||d<0&&a===Gt.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(h,p))return ie({x0:h,x1:p,y0:f,y1:g},a)}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ID extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Zg extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=eu().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",vn.opacity.selected).attr("d",this.areaGenerator)}}class Kg extends yu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,p=h+d,f=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(g-f)>0&&Math.abs(g-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Qg extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=it.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>y(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",ht.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[p]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[v]:f}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Ts=6;class ND extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=it.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+Ts:30-Ts},h=ps({name:o,children:a}),p=10,f=r/6,g=T=>{const M=h.descendants().reverse(),D=h.links();let A=h,R=h;h.eachBefore(k=>{k.xR.x&&(R=k)});const $=R.x-A.x,H=n.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,A.x,r,$].join(" ")),P=b.selectAll("g").data(M,k=>k.id),B=this,S=P.enter().append("g").attr("transform",()=>`translate(${T.y0},${T.x0})`).attr("class",k=>k.depth!==0&&k.children&&k.children.length>0?"clickable":null).on("mouseover",function(k,U){B.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:k,element:I(this),datum:U})}).on("click",function(k,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),B.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:k,element:I(this),datum:U})}).on("mouseout",function(k,U){B.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:k,element:I(this),datum:U})});S.append("circle").attr("r",2.5).attr("class",k=>k._children?"parent":"child").attr("stroke-width",10),S.append("text").attr("dy","0.31em").attr("x",k=>k._children?-6:Ts).attr("text-anchor",k=>k._children?"end":"start").text(k=>k.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(S).transition(H).attr("transform",k=>`translate(${k.y},${k.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${T.y},${T.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const w=E.selectAll("path").data(D,k=>k.target.id),L=w.enter().append("path").attr("d",()=>{const k={x:T.x0,y:T.y0};return _({source:k,target:k})});w.merge(L).transition(H).attr("d",_),w.exit().transition(H).remove().attr("d",()=>{const k={x:T.x,y:T.y};return _({source:k,target:k})}),h.eachBefore(k=>{k.x0=k.x,k.y0=k.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===Cs.DENDROGRAM?tL().size([i,r-u-v*Ts-l]):VL().nodeSize([p,f]).size([i,r-u-v*Ts-l]),_=uk().x(T=>T.y).y(T=>T.x);h.x0=f/2,h.y0=0,h.descendants().forEach((T,M)=>{T.id=M,T._children=T.children}),x(h),n.attr("viewBox",[-d.left,-0,r,p]).style("user-select","none");const E=n.append("g").attr("class","links"),b=n.append("g").attr("class","nodes");g(h)}}var PD="#000000",UD="#ffffff",BD="#fcf4d6",HD="#fddc69",VD="#f1c21b",GD="#d2a106",zD="#b28600",FD="#8e6a00",jD="#684e00",WD="#483700",qD="#302400",YD="#1c1500",XD={10:BD,20:HD,30:VD,40:GD,50:zD,60:FD,70:jD,80:WD,90:qD,100:YD},ZD="#fff2e8",KD="#ffd9be",QD="#ffb784",JD="#ff832b",tR="#eb6200",eR="#ba4e00",nR="#8a3800",rR="#5e2900",iR="#3e1a00",sR="#231000",aR={10:ZD,20:KD,30:QD,40:JD,50:tR,60:eR,70:nR,80:rR,90:iR,100:sR},oR="#fff1f1",lR="#ffd7d9",cR="#ffb3b8",uR="#ff8389",hR="#fa4d56",dR="#da1e28",pR="#a2191f",fR="#750e13",mR="#520408",gR="#2d0709",vR={10:oR,20:lR,30:cR,40:uR,50:hR,60:dR,70:pR,80:fR,90:mR,100:gR},yR="#fff0f7",xR="#ffd6e8",bR="#ffafd2",_R="#ff7eb6",ER="#ee5396",SR="#d02670",TR="#9f1853",OR="#740937",wR="#510224",$R="#2a0a18",MR={10:yR,20:xR,30:bR,40:_R,50:ER,60:SR,70:TR,80:OR,90:wR,100:$R},CR="#f6f2ff",AR="#e8daff",LR="#d4bbff",kR="#be95ff",DR="#a56eff",RR="#8a3ffc",IR="#6929c4",NR="#491d8b",PR="#31135e",UR="#1c0f30",BR={10:CR,20:AR,30:LR,40:kR,50:DR,60:RR,70:IR,80:NR,90:PR,100:UR},HR="#edf5ff",VR="#d0e2ff",GR="#a6c8ff",zR="#78a9ff",FR="#4589ff",jR="#0f62fe",WR="#0043ce",qR="#002d9c",YR="#001d6c",XR="#001141",ZR={10:HR,20:VR,30:GR,40:zR,50:FR,60:jR,70:WR,80:qR,90:YR,100:XR},KR="#e5f6ff",QR="#bae6ff",JR="#82cfff",tI="#33b1ff",eI="#1192e8",nI="#0072c3",rI="#00539a",iI="#003a6d",sI="#012749",aI="#061727",oI={10:KR,20:QR,30:JR,40:tI,50:eI,60:nI,70:rI,80:iI,90:sI,100:aI},lI="#d9fbfb",cI="#9ef0f0",uI="#3ddbd9",hI="#08bdba",dI="#009d9a",pI="#007d79",fI="#005d5d",mI="#004144",gI="#022b30",vI="#081a1c",yI={10:lI,20:cI,30:uI,40:hI,50:dI,60:pI,70:fI,80:mI,90:gI,100:vI},xI="#defbe6",bI="#a7f0ba",_I="#6fdc8c",EI="#42be65",SI="#24a148",TI="#198038",OI="#0e6027",wI="#044317",$I="#022d0d",MI="#071908",CI={10:xI,20:bI,30:_I,40:EI,50:SI,60:TI,70:OI,80:wI,90:$I,100:MI},AI="#f2f4f8",LI="#dde1e6",kI="#c1c7cd",DI="#a2a9b0",RI="#878d96",II="#697077",NI="#4d5358",PI="#343a3f",UI="#21272a",BI="#121619",HI={10:AI,20:LI,30:kI,40:DI,50:RI,60:II,70:NI,80:PI,90:UI,100:BI},VI="#f4f4f4",GI="#e0e0e0",zI="#c6c6c6",FI="#a8a8a8",jI="#8d8d8d",WI="#6f6f6f",qI="#525252",YI="#393939",XI="#262626",ZI="#161616",KI={10:VI,20:GI,30:zI,40:FI,50:jI,60:WI,70:qI,80:YI,90:XI,100:ZI},QI="#f7f3f2",JI="#e5e0df",tN="#cac5c4",eN="#ada8a8",nN="#8f8b8b",rN="#726e6e",iN="#565151",sN="#3c3838",aN="#272525",oN="#171414",lN={10:QI,20:JI,30:tN,40:eN,50:nN,60:rN,70:iN,80:sN,90:aN,100:oN},Jg={black:{100:PD},blue:ZR,coolGray:HI,cyan:oI,gray:KI,green:CI,magenta:MR,orange:aR,purple:BR,red:vR,teal:yI,warmGray:lN,white:{0:UD},yellow:XD};const cN=e=>{if(!e)return null;for(const t of Object.keys(Jg)){const n=Jg[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},tv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=fn(n);let i;if(r&&(i=cN(r?r.hex():null)),i==null){const s=kd(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let uN=0;class hN extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=ps({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=WL().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),p=>p.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>uN++).merge(u);d.attr("data-name","leaf").transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-group-update",animate:t})).attr("transform",p=>`translate(${p.x0},${p.y0})`);const h=d.selectAll("rect.leaf").data(p=>[p]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const p=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${p}`}).attr("class",p=>{for(;p.depth>1;)p=p.parent;return this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:p.data.name,originalClassName:"leaf"})}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-leaf-update-enter",animate:t})).attr("width",p=>p.x1-p.x0).attr("height",p=>p.y1-p.y0).style("fill",p=>{for(;p.depth>1;)p=p.parent;return this.model.getFillColor(p.data.name,null,p.data)}),d.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=I(this.parentNode.parentNode).attr("data-uid"),g=`${i.style.prefix}-leaf-${f}`;return new URL(`#${g}`,s)+""}),p=>null,p=>p.remove()),d.selectAll("text").data(p=>{if(p.data.showLabel!==!0)return[];let f=p;for(;f.depth>1;)f=f.parent;return[{text:p.data.name,backgroundColor:this.model.getFillColor(f.data.name)}]},p=>p).join(p=>{const f=p.append("text").text(g=>g.text).style("fill",tv).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const g=I(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${g}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",tv),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),fn(s).darker(.7).toString()}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}}function dN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var fN={value:function(){}};function ev(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ho.prototype=ev.prototype={constructor:ho,on:function(e,t){var n=this._,r=mN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s0)for(var n=new Array(i),r=0,i,s;r>5)*E[1]),ct=null,J=P.length,Y=-1,et=[],ut=P.map(function(q,Z){return q.text=b.call(this,q,Z),q.font=T.call(this,q,Z),q.style=D.call(this,q,Z),q.weight=A.call(this,q,Z),q.rotate=R.call(this,q,Z),q.size=~~M.call(this,q,Z),q.padding=$.call(this,q,Z),q}).sort(function(q,Z){return Z.size-q.size});return w&&clearInterval(w),w=setInterval(F,0),F(),k;function F(){for(var q=Date.now();Date.now()-q>1,Z.y=E[1]*(L()+.5)>>1,d(j,Z,ut,Y),Z.hasText&&W(X,Z,ct)&&(et.push(Z),S.call("word",k,Z),ct?p(ct,Z):ct=[{x:Z.x+Z.x0,y:Z.y+Z.y0},{x:Z.x+Z.x1,y:Z.y+Z.y1}],Z.x-=E[0]>>1,Z.y-=E[1]>>1)}Y>=J&&(k.stop(),S.call("end",k,et,ct))}},k.stop=function(){w&&(clearInterval(w),w=null);for(const j of P)delete j.sprite;return k};function K(j){const X=j.getContext("2d",{willReadFrequently:!0});j.width=j.height=1;const ct=Math.sqrt(X.getImageData(0,0,1,1).data.length>>2);return j.width=(r<<5)/ct,j.height=i/ct,X.fillStyle=X.strokeStyle="red",{context:X,ratio:ct}}function W(j,X,ct){E[0],E[1];for(var J=X.x,Y=X.y,et=Math.sqrt(E[0]*E[0]+E[1]*E[1]),ut=H(E),F=L()<.5?1:-1,q=-F,Z,G,dt;(Z=ut(q+=F))&&(G=~~Z[0],dt=~~Z[1],!(Math.min(Math.abs(G),Math.abs(dt))>=et));)if(X.x=J+G,X.y=Y+dt,!(X.x+X.x0<0||X.y+X.y0<0||X.x+X.x1>E[0]||X.y+X.y1>E[1])&&(!ct||f(X,ct))&&!h(X,j,E[0])){for(var ot=X.sprite,It=X.width>>5,Ht=E[0]>>5,rt=X.x-(It<<4),Et=rt&127,Ne=32-Et,Oe=X.y1-X.y0,ws=(X.y+X.y0)*Ht+(rt>>5),$s,_r=0;_r>>Et:0);ws+=Ht}return!0}return!1}return k.timeInterval=function(j){return arguments.length?(B=j??1/0,k):B},k.words=function(j){return arguments.length?(P=j,k):P},k.size=function(j){return arguments.length?(E=[+j[0],+j[1]],k):E},k.font=function(j){return arguments.length?(T=_(j),k):T},k.fontStyle=function(j){return arguments.length?(D=_(j),k):D},k.fontWeight=function(j){return arguments.length?(A=_(j),k):A},k.rotate=function(j){return arguments.length?(R=_(j),k):R},k.text=function(j){return arguments.length?(b=_(j),k):b},k.spiral=function(j){return arguments.length?(H=n[j]||j,k):H},k.fontSize=function(j){return arguments.length?(M=_(j),k):M},k.padding=function(j){return arguments.length?($=_(j),k):$},k.random=function(j){return arguments.length?(L=j,k):L},k.on=function(){var j=S.on.apply(S,arguments);return j===S?k:j},k};function s(E){return E.text}function a(){return"serif"}function o(){return"normal"}function l(E){return Math.sqrt(E.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(E,b,T,M){if(!b.sprite){var D=E.context,A=E.ratio;D.clearRect(0,0,(r<<5)/A,i/A);var R=0,$=0,H=0,P=T.length;for(--M;++M>5<<5,ot=~~Math.max(Math.abs(L+k),Math.abs(L-k))}else dt=dt+31>>5<<5;if(ot>H&&(H=ot),R+dt>=r<<5&&(R=0,$+=H,H=0),$+ot>=i)break;D.translate((R+(dt>>1))/A,($+(ot>>1))/A),b.rotate&&D.rotate(b.rotate*t),D.fillText(b.text,G,0),b.padding&&(D.lineWidth=2*b.padding,D.strokeText(b.text,G,0)),D.restore(),b.width=dt,b.height=ot,b.xoff=R,b.yoff=$,b.x1=dt>>1,b.y1=ot>>1,b.x0=-b.x1,b.y0=-b.y1,b.hasText=!0,R+=dt}for(var K=D.getImageData(0,0,(r<<5)/A,i/A).data,W=[];--M>=0;)if(b=T[M],!!b.hasText){for(var j=b.width,X=j>>5,ct=b.y1-b.y0,J=0;J>5),q=K[($+ut)*(r<<5)+(R+J)<<2]?1<<31-J%32:0;W[F]|=q,Y|=q}Y?et=ut:(b.y0++,ct--,ut--,$++)}b.y1=b.y0+et,b.sprite=W.slice(0,(b.y1-b.y0)*X)}}}function h(E,b,T){T>>=5;for(var M=E.sprite,D=E.width>>5,A=E.x-(D<<4),R=A&127,$=32-R,H=E.y1-E.y0,P=(E.y+E.y0)*T+(A>>5),B,S=0;S>>R:0))&b[P+w])return!0;P+=T}return!1}function p(E,b){var T=E[0],M=E[1];b.x+b.x0M.x&&(M.x=b.x+b.x1),b.y+b.y1>M.y&&(M.y=b.y+b.y1)}function f(E,b){return E.x+E.x1>b[0].x&&E.x+E.x0b[0].y&&E.y+E.y0{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=_N().size([u,d]).words(i.map(function(f){const g=f[o];if(typeof f[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:f[c],text:f[l],size:g,value:g}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const g=N.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(f,v=>`${v[c]}-${v.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ge(i):[1,1];return je().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=ya(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class SN extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=it.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=mD(s,Object.values(l)),u=dD(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=wA().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=N.appendOrSelect(t,"defs");N.appendOrSelect(f,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",vs()([[0,0],[0,10]]));const g=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(g,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case Je.geoEqualEarth:t=jA();break;case Je.geoAlbers:t=UA();break;case Je.geoConicEqualArea:t=Km();break;case Je.geoConicEquidistant:t=zA();break;case Je.geoEquirectangular:t=VA();break;case Je.geoMercator:t=BA();break;case Je.geoNaturalEarth1:t=WA();break;default:throw new Error("Projection is not supported.")}return t}}class TN extends SN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Tr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Tr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Tr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Tr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.HIDE,{event:r,hoveredElement:s})})}}function bu(e){var t=e==null?0:e.length;return t?Vs(e,1):[]}function ON(e){return oh(uh(e,void 0,bu),e+"")}function iv(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r1),s}),Mr(e,Dh(e),n),r&&(n=Ai(n,CN|AN|LN,MN));for(var i=t.length;i--;)$N(n,t[i]);return n});function sv(e){return Math.log(e)}function av(e){return Math.exp(e)}function DN(e){return-Math.log(-e)}function RN(e){return-Math.exp(-e)}function IN(e){return isFinite(e)?+("1e"+e):e<0?0:e}function NN(e){return e===10?IN:e===Math.E?Math.exp:t=>Math.pow(e,t)}function PN(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function ov(e){return(t,n)=>-e(-t,n)}function UN(e){const t=e(sv,av),n=t.domain;let r=10,i,s;function a(){return i=PN(r),s=NN(r),n()[0]<0?(i=ov(i),s=ov(s),e(DN,RN)):e(sv,av),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u0){for(;h<=p;++h)for(f=1;fu)break;v.push(g)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(g=h>0?f/s(-h):f*s(h),!(gu)break;v.push(g)}v.length*2{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Gi(l)).precision==null&&(l.trim=!0),l=Nl(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*rn(Fp(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function lv(){const e=UN(lp()).domain([1,10]);return e.copy=()=>Ul(e,lv()).base(e.base()),Ur.apply(e,arguments),e}function po(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fo(e){this._context=e}fo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:po(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BN(e){return new fo(e)}function cv(e){this._context=e}cv.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function HN(e){return new cv(e)}function uv(e){this._context=e}uv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:po(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function VN(e){return new uv(e)}function hv(e,t){this._basis=new fo(e),this._beta=t}hv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const GN=function e(t){function n(r){return t===1?new fo(r):new hv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function mo(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function _u(e,t){this._context=e,this._k=(1-t)/6}_u.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:mo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:mo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zN=function e(t){function n(r){return new _u(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Eu(e,t){this._context=e,this._k=(1-t)/6}Eu.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:mo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const FN=function e(t){function n(r){return new Eu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Su(e,t){this._context=e,this._k=(1-t)/6}Su.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jN=function e(t){function n(r){return new Su(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Tu(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ee){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ee){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function dv(e,t){this._context=e,this._alpha=t}dv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Tu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const WN=function e(t){function n(r){return t?new dv(r,t):new _u(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function pv(e,t){this._context=e,this._alpha=t}pv.prototype={areaStart:Un,areaEnd:Un,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Tu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const qN=function e(t){function n(r){return t?new pv(r,t):new Eu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function fv(e,t){this._context=e,this._alpha=t}fv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const YN=function e(t){function n(r){return t?new fv(r,t):new Su(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function mv(e){return e<0?-1:1}function gv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(mv(s)+mv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function vv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ou(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function go(e){this._context=e}go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ou(this,this._t0,vv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ou(this,vv(this,n=gv(this,e,t)),n);break;default:Ou(this,this._t0,n=gv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function yv(e){this._context=new xv(e)}(yv.prototype=Object.create(go.prototype)).point=function(e,t){go.prototype.point.call(this,t,e)};function xv(e){this._context=e}xv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function XN(e){return new go(e)}function ZN(e){return new yv(e)}function bv(e){this._context=e}bv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=_v(e),i=_v(t),s=0,a=1;a=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function QN(e){return new vo(e,.5)}function JN(e){return new vo(e,0)}function tP(e){return new vo(e,1)}class eP extends On{zoomIn(t,n,r){let i,s,a;const o=r||Hr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_IN,{element:I(t)})}zoomOut(t,n){const r=n||Hr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class nP extends On{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class rP extends On{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class iP extends On{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(y(mp,n,"duration")||mp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Os(e,t){const n=+Pt(e)-+Pt(t);return n<0?-1:n>0?1:n}function sP(e,t,n){const[r,i]=qn(void 0,e,t);return r.getFullYear()-i.getFullYear()}function aP(e,t,n){const[r,i]=qn(void 0,e,t),s=Os(r,i),a=Math.abs(sP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Os(r,i)===-s,l=s*(a-+o);return l===0?0:l}function wu(e,t,n){const r=Pt(e,void 0);if(isNaN(t))return $e(e,NaN);if(!t)return r;const i=r.getDate(),s=$e(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Ev(e,t,n){return wu(e,t*12)}function oP(e,t,n){return Ev(e,-t)}function lP(e,t,n){const[r,i]=qn(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function cP(e,t){const n=Pt(e,void 0);return n.setHours(23,59,59,999),n}function uP(e,t){const n=Pt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function hP(e,t){const n=Pt(e,void 0);return+cP(n)==+uP(n)}function dP(e,t,n){const[r,i,s]=qn(void 0,e,e,t),a=Os(i,s),o=Math.abs(lP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Os(i,s)===-a;hP(r)&&o===1&&Os(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function pP(e,t,n){return wu(e,-t)}function fP(e,t,n){const[r,i]=qn(void 0,e,t),s=Sv(r,i),a=Math.abs($p(r,i));r.setDate(r.getDate()-s*a);const o=+(Sv(r,i)===-s),l=s*(a-o);return l===0?0:l}function Sv(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Tv(e,t,n){const r=Pt(e,void 0);return isNaN(t)?$e(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function mP(e,t,n){return Tv(e,-t)}function $u(e){return t=>{const n=(0,Math.trunc)(t);return n===0?0:n}}function gP(e,t,n){const[r,i]=qn(void 0,e,t),s=(+r-+i)/Xu;return $u()(s)}function Ov(e,t,n){return $e(e,+Pt(e)+t)}function wv(e,t,n){return Ov(e,t*Xu)}function vP(e,t,n){return wv(e,-t)}function $v(e,t){return+Pt(e)-+Pt(t)}function Mv(e,t,n){const r=$v(e,t)/Yu;return $u()(r)}function Mu(e,t,n){const r=Pt(e,void 0);return r.setTime(r.getTime()+t*Yu),r}function Cv(e,t,n){return Mu(e,-t)}function Av(e,t,n){const r=$v(e,t)/1e3;return $u()(r)}function Cu(e,t,n){return Ov(e,t*1e3)}function Lv(e,t,n){return Cu(e,-t)}class yP extends On{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(t=>z[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Gt.VERTICAL:this.orientation=Gt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=y(s,"axes");((t=a[z.LEFT])!=null&&t.correspondingDatasets&&a[z.RIGHT]||(n=a[z.RIGHT])!=null&&n.correspondingDatasets&&a[z.LEFT]||(r=a[z.TOP])!=null&&r.correspondingDatasets&&a[z.BOTTOM]||(i=a[z.BOTTOM])!=null&&i.correspondingDatasets&&a[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===nt.LINEAR||this.scaleTypes[t]===nt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=y(i,o)!==null?i[o]:i;let c;switch(n){case nt.LABELS:c=t(l)+t.step()/2;break;case nt.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===nt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return xP(n,s)}else return bP(n,In.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||nt.LINEAR,o=s.scaleType||nt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===nt.LABELS||o===nt.TIME)&&a===nt.LABELS||a===nt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||nt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,tr(v,x=>x.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),x=this.model.getStackKeys({bins:v});return[x[0].split(":")[0],x[x.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=In.ratio;if(r.domain)return a===nt.LABELS?r.domain:(a===nt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===nt.LABELS)return ki(o.map(v=>v[c]));let f,g;const m=this.model.getDataGroupNames();if(a===nt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[p]}`);if(a===nt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,x=this.model.getDataValuesGroupedByKeys({groups:m}),_=o.filter(b=>!m.includes(b[v])),E=[];x.forEach(b=>{const{...T}=b;let M=0,D=0;Object.values(kN(T,"sharedStackKey")).forEach(A=>{isNaN(A)||(A<0?D+=A:M+=A)}),E.push([D,M])}),g=[...bu(E),..._.map(b=>b[c])]}else g=[],o.forEach(v=>{const x=v[c];Array.isArray(x)&&x.length===2?(g.push(x[0]),g.push(x[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(x))});return a!==nt.TIME&&a!==nt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const x=y(v,"value");x!==null&&g.push(x)}),f=Ge(g),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||nt.LINEAR;this.scaleTypes[t]=i;let s;return i===nt.TIME?s=uf():i===nt.LOG?s=lv().base(r.base||10):i===nt.LABELS||i===nt.LABELS_RATIO?s=Xi():s=je(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Gt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===nt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function xP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return aP(r,n)>1?[oP(n,t),Ev(r,t)]:dP(r,n)>1?[pP(n,t),wu(r,t)]:fP(r,n)>1?[mP(n,t),Tv(r,t)]:gP(r,n)>1?[vP(n,t),wv(r,t)]:Mv(r,n)>30?[Cv(n,t*30),Mu(r,t*30)]:Mv(r,n)>1?[Cv(n,t),Mu(r,t)]:Av(r,n)>15?[Lv(n,t*15),Cu(r,t*15)]:Av(r,n)>1?[Lv(n,t),Cu(r,t)]:[n,r]}function bP([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===nt.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}class _P extends On{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:mf,curveBasis:BN,curveBasisClosed:HN,curveBasisOpen:VN,curveBundle:GN,curveCardinal:zN,curveCardinalClosed:FN,curveCardinalOpen:jN,curveCatmullRom:WN,curveCatmullRomClosed:qN,curveCatmullRomOpen:YN,curveMonotoneX:XN,curveMonotoneY:ZN,curveNatural:KN,curveStep:QN,curveStepAfter:tP,curveStepBefore:JN}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class EP extends On{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===nt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Ge(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=be.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const p=[s.invert(d),s.invert(h)];(r[0].valueOf()!==p[0].valueOf()||r[1].valueOf()!==p[1].valueOf())&&this.handleDomainChange(p)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!y(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s={id:"legend",components:[new uu(this.model,this.services)],growth:lt.PREFERRED},a=y(r,"canvasZoom","enabled");a&&a===!0&&t.push(new Dk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},c={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},u={id:"header",components:[new Se(this.model,this.services,[l,...i?[c]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},d={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:y(n,"graphFrameRenderType")||it.SVG},h=y(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Mt.COLUMN;if(h){const v=y(r,"legend","position");v==="left"?(p=Mt.ROW,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="right"?(p=Mt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="bottom"&&(p=Mt.COLUMN_REVERSE)}const f={id:"spacer",components:[new Cn(this.model,this.services)],growth:lt.PREFERRED},g={id:"full-frame",components:[new Se(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:lt.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new Cn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};m.push(v)}return m.push(g),[new hu(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,m,{direction:Mt.COLUMN})]}}class ge extends Xe{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:yP,curves:_P,zoom:EP}),this.model=new lr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===nt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},h={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},p={id:"header",components:[new Se(this.model,this.services,[d,...s?[h]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},f={id:"legend",components:[new uu(this.model,this.services)],growth:lt.PREFERRED};l&&!c&&t.push(new $g(this.model,this.services),new Rk(this.model,this.services)),t.push(new Nk(this.model,this.services)),t.push(new Pk(this.model,this.services));const g={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Mt.COLUMN;if(m){const T=y(this.model.getOptions(),"legend","position");T===Or.LEFT?(v=Mt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):T===Or.RIGHT?(v=Mt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):T===Or.BOTTOM&&(v=Mt.COLUMN_REVERSE)}const x={id:"spacer",components:[new Cn(this.model,this.services)],growth:lt.PREFERRED},_={id:"full-frame",components:[new Se(this.model,this.services,[...m?[f]:[],...m?[x]:[],g],{direction:v})],growth:lt.STRETCH},E={id:"zoom-bar",components:[new Ik(this.model,this.services)],growth:lt.PREFERRED,renderType:it.SVG},b=[];if(u||s){b.push(p);const T={id:"spacer",components:[new Cn(this.model,this.services,s?{size:15}:void 0)],growth:lt.PREFERRED};b.push(T)}return l&&b.push(E),b.push(_),[new Lg(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,b,{direction:Mt.COLUMN})]}}class KP extends Xe{constructor(t,n){super(t,n),this.model=new qw(this.services),this.model.setOptions(Rt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new rD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class QP extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(pn(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new oi(this.model,this.services),new Hg(this.model,this.services),new cn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class JP extends ge{constructor(t,n){super(t,n),this.model=new Yw(this.services),this.model.setOptions(Rt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new aD(this.model,this.services),new li(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class t3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new oD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class e3 extends ge{constructor(t,n){super(t,n),this.model=new Xw(this.services),this.model.setOptions(Rt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new lD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class n3 extends Xe{constructor(t,n){super(t,n),this.model=new Zw(this.services),this.model.setOptions(Rt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Fg(this.model,this.services,{chartType:"choropleth"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new Cn(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Se(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Cn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new hu(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new TN(this.model,this.services)];return this.getChartComponents(t)}}class r3 extends Xe{constructor(t,n){super(t,n),this.model=new Kw(this.services),this.model.setOptions(Rt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new wD(this.model,this.services)];return this.getChartComponents(t)}}const Bv={[ve.LINE]:[oi,cn],[ve.SCATTER]:[cn],[ve.AREA]:[Hg,oi,cn],[ve.STACKED_AREA]:[Zg,oi,Qg,uo],[ve.SIMPLE_BAR]:[Xg],[ve.GROUPED_BAR]:[Yg,li],[ve.STACKED_BAR]:[Kg,uo]};class i3 extends ge{constructor(t,n){super(t,n);const r=Rt(Ct.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ve.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Bv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${ZP(i.type)}Chart`;return a=at({},Ct[l],this.model.getOptions(),i.options),i.type===ve.STACKED_AREA&&(o=!0),Bv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=at({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return bu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===ve.STACKED_BAR||i.type===ve.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID}),...n?[]:[new Gn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Hv extends Xe{constructor(t,n,r=!1){super(t,n),this.model=new Qw(this.services),!r&&(this.model.setOptions(Rt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new jg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class s3 extends Hv{constructor(t,n){super(t,n,!0),this.model.setOptions(Rt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new MD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.DONUT})];return this.getChartComponents(t)}}class a3 extends Xe{constructor(t,n){super(t,n),this.model=new Jw(this.services),this.model.setOptions(Rt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new CD(this.model,this.services)];return this.getChartComponents(t)}}class o3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Yg(this.model,this.services),new li(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class l3 extends ge{constructor(t,n){super(t,n),this.model=new t$(this.services),this.model.setOptions(Rt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Ss(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new so(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Fg(this.model,this.services,{chartType:"heatmap"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new Cn(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Se(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Cn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new Lg(this.model,this.services),new ao(this.model,this.services),new Se(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new AD(this.model,this.services)];return this.getAxisChartComponents(t)}}class c3 extends ge{constructor(t,n){super(t,n),this.model=new e$(this.services),this.model.setOptions(Rt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new vD(this.model,this.services),new LD(this.model,this.services)];return this.getAxisChartComponents(t)}}class u3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new oi(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new ID(this.model,this.services),new li(this.model,this.services)];return this.getAxisChartComponents(t)}}class h3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new kD(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class d3 extends Xe{constructor(t,n){var r;super(t,n),this.model=new n$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?at(pn(Ct.proportionalMeterChart),n.options):at(pn(Ct.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new OD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG},{id:"spacer",components:[new Cn(this.model,this.services,{size:8})],growth:lt.STRETCH}]:[],{id:"meter-graph",components:[new DD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG}],n=[new Se(this.model,this.services,t,{direction:Mt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:it.HTML})}}class p3 extends Xe{constructor(t,n){super(t,n),this.model=new r$(this.services),this.model.setOptions(Rt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new RD(this.model,this.services)];return this.getChartComponents(t)}}class f3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Gn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class m3 extends Xe{constructor(t,n){super(t,n),this.model=new i$(this.services),this.model.setOptions(Rt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new ND(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class g3 extends Xe{constructor(t,n){super(t,n),this.model=new s$(this.services),this.model.setOptions(Rt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new hN(this.model,this.services)];return this.getChartComponents(t)}}class v3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Xg(this.model,this.services),new li(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class y3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new uo(this.model,this.services),new Zg(this.model,this.services),new oi(this.model,this.services,{stacked:!0}),new Qg(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class x3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new uo(this.model,this.services),new Kg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ}),new li(this.model,this.services)];return this.getAxisChartComponents(t)}}class b3 extends Xe{constructor(t,n){super(t,n),this.model=new a$(this.services),this.model.setOptions(Rt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new EN(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class Dt extends ft.PureComponent{constructor(){super(...arguments);Uu(this,"chart");Uu(this,"chartRef",ft.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}render(){return ft.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class _3 extends Dt{createChart(t,n,r){return new KP(t,{data:n,options:r})}}class E3 extends Dt{createChart(t,n,r){return new QP(t,{data:n,options:r})}}class S3 extends Dt{createChart(t,n,r){return new JP(t,{data:n,options:r})}}class T3 extends Dt{createChart(t,n,r){return new t3(t,{data:n,options:r})}}class O3 extends Dt{createChart(t,n,r){return new e3(t,{data:n,options:r})}}class Vv extends Dt{createChart(t,n,r){return new n3(t,{data:n,options:r})}}class w3 extends Dt{createChart(t,n,r){return new r3(t,{data:n,options:r})}}class $3 extends Dt{createChart(t,n,r){return new i3(t,{data:n,options:r})}}class M3 extends Dt{createChart(t,n,r){return new s3(t,{data:n,options:r})}}class C3 extends Dt{createChart(t,n,r){return new a3(t,{data:n,options:r})}}class A3 extends Dt{createChart(t,n,r){return new o3(t,{data:n,options:r})}}class L3 extends Dt{createChart(t,n,r){return new l3(t,{data:n,options:r})}}class k3 extends Dt{createChart(t,n,r){return new c3(t,{data:n,options:r})}}class D3 extends Dt{createChart(t,n,r){return new u3(t,{data:n,options:r})}}class R3 extends Dt{createChart(t,n,r){return new h3(t,{data:n,options:r})}}class I3 extends Dt{createChart(t,n,r){return new d3(t,{data:n,options:r})}}class N3 extends Dt{createChart(t,n,r){return new Hv(t,{data:n,options:r})}}class P3 extends Dt{createChart(t,n,r){return new p3(t,{data:n,options:r})}}class U3 extends Dt{createChart(t,n,r){return new f3(t,{data:n,options:r})}}class B3 extends Dt{createChart(t,n,r){return new v3(t,{data:n,options:r})}}class H3 extends Dt{createChart(t,n,r){return new y3(t,{data:n,options:r})}}class V3 extends Dt{createChart(t,n,r){return new x3(t,{data:n,options:r})}}class G3 extends Dt{createChart(t,n,r){return new m3(t,{data:n,options:r})}}class z3 extends Dt{createChart(t,n,r){return new g3(t,{data:n,options:r})}}class F3 extends Dt{createChart(t,n,r){return new b3(t,{data:n,options:r})}}function j3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ku={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */var Gv;function W3(){return Gv||(Gv=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a{const l=i?"a":o.onClick?"button":e,c=`${Fn}--cc--card-node`,u=zn(c,{[`${c}--stacked`]:a,[`${c}--${l}`]:l,[t]:t});return ft.createElement(l,{className:u,style:{borderColor:r,position:s},tabIndex:0,...o},n)},X3=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Fn}--cc--card-node`,i=zn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return ft.createElement("div",{className:i,...n},e)},Z3=({children:e,...t})=>{const n=`${Fn}--cc--card-node`,r=zn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return ft.createElement("label",{className:r,...t},e)},K3=({children:e,...t})=>{const n=`${Fn}--cc--card-node`,r=zn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return ft.createElement("div",{className:r,...t},e)},Q3=({children:e,...t})=>{const n=`${Fn}--cc--card-node`,r=zn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return ft.createElement("div",{className:r,...t},e)},J3=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${Fn}--cc--edge`,c=zn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=yD(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return ft.createElement("g",{className:c,...o},ft.createElement("path",{d:u,className:`${l}__container`}),ft.createElement("path",{d:u,className:`${l}__outer`}),ft.createElement("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}}))},br=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const d=`${Fn}--cc--marker`,h=zn(d,o),p=a==="end"?(s||0)/2+.5:.5,f=(i||0)/2;return ft.createElement("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u},ft.createElement("path",{d:t,style:{fill:e}}))},tU=e=>ft.createElement(br,{d:xD.d,...e}),eU=e=>ft.createElement(br,{d:bD.d,...e}),nU=e=>ft.createElement(br,{d:_D.d,...e}),rU=e=>ft.createElement(br,{d:ED.d,...e}),iU=e=>ft.createElement(br,{d:SD.d,...e}),sU=e=>ft.createElement(br,{d:TD.d,...e}),aU=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:s,renderIcon:a,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const p=o?"a":h.onClick?"button":t,f=`${Fn}--cc--shape-node`,g=zn(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?ft.createElement("div",{className:`${f}__title`},n):null,v=i?ft.createElement("div",{className:`${f}__subtitle`},i):null,x=s?ft.createElement("div",{className:`${f}__description`},s):null;return ft.createElement(p,{className:g,style:{height:l,width:l,position:u},tabIndex:0,...h},ft.createElement("div",{className:`${f}__icon`},a),ft.createElement("div",{className:`${f}__body`,style:{position:d}},m,v,x))};V.Alignments=zt,V.AlluvialChart=_3,V.AreaChart=E3,V.AreaEvent=Ao,V.ArrowDirections=As,V.ArrowLeftMarker=tU,V.ArrowRightMarker=eU,V.AxisEvent=Co,V.AxisFlavor=vi,V.AxisPositions=z,V.AxisTitleOrientations=Ls,V.BarEvent=Ro,V.BoxplotChart=S3,V.BoxplotEvent=Io,V.BubbleChart=T3,V.BulletChart=O3,V.CalloutDirections=pi,V.CanvasZoomEvent=Mo,V.CardNode=Y3,V.CardNodeColumn=X3,V.CardNodeLabel=Z3,V.CardNodeSubtitle=K3,V.CardNodeTitle=Q3,V.CartesianOrientations=Gt,V.ChartEvent=Dn,V.ChartTheme=Go,V.ChartTypes=ve,V.ChoroplethChart=Vv,V.CircleMarker=nU,V.CirclePackChart=w3,V.ColorClassNameTypes=st,V.ColorLegendType=gi,V.ComboChart=$3,V.DiamondMarker=rU,V.DividerStatus=$r,V.DominantBaseline=Qe,V.DonutChart=M3,V.Edge=J3,V.ExperimentalChoroplethChart=Vv,V.GaugeChart=C3,V.GaugeEvent=Do,V.GaugeTypes=Wn,V.GroupedBarChart=A3,V.HeatmapChart=L3,V.HistogramChart=k3,V.LayoutAlignItems=jn,V.LayoutDirection=Mt,V.LayoutGrowth=lt,V.LegendItemType=jt,V.LegendOrientations=wr,V.LegendPositions=Or,V.LineChart=D3,V.LineEvent=Po,V.LollipopChart=R3,V.Marker=br,V.MeterChart=I3,V.ModalEvent=To,V.ModelEvent=Oo,V.PieChart=N3,V.PieEvent=ko,V.Projection=Je,V.RadarChart=P3,V.RadarEvent=Uo,V.RenderTypes=it,V.ScaleTypes=nt,V.ScatterChart=U3,V.ScatterEvent=No,V.ShapeNode=aU,V.SimpleBarChart=B3,V.Skeletons=Ft,V.SquareMarker=iU,V.StackedAreaChart=H3,V.StackedBarChart=V3,V.Statuses=fi,V.TeeMarker=sU,V.TextAnchor=Ke,V.ThresholdEvent=Vo,V.TickRotations=mi,V.ToolbarControlTypes=bt,V.TooltipEvent=Sr,V.TreeChart=G3,V.TreeEvent=Bo,V.TreeTypes=Cs,V.TreemapChart=z3,V.TreemapEvent=Ho,V.TruncationTypes=we,V.WordCloudChart=F3,V.WordCloudEvent=Lo,V.ZoomBarTypes=Ue,V.ZoomDomainEvent=$o,V.ZoombarEvent=wo,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=index.umd.cjs.map