@carbon/charts-react 1.19.2 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,18 +1,18 @@
1
- (function(V,ce){typeof exports=="object"&&typeof module<"u"?ce(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ce):(V=typeof globalThis<"u"?globalThis:V||self,ce(V.ChartsReact={},V.React))})(this,function(V,ce){"use strict";var _5=Object.defineProperty;var E5=(V,ce,zn)=>ce in V?_5(V,ce,{enumerable:!0,configurable:!0,writable:!0,value:zn}):V[ce]=zn;var Ph=(V,ce,zn)=>E5(V,typeof ce!="symbol"?ce+"":ce,zn);var zn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(zn||{}),cl=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(cl||{}),ul=(e=>(e.UPDATE="model-update",e))(ul||{}),Bh=(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))(Bh||{}),hl=(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))(hl||{}),dl=(e=>(e.CHANGE="zoom-domain-change",e))(dl||{}),pl=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(pl||{}),fl=(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))(fl||{}),ml=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(ml||{}),gl=(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))(gl||{}),vl=(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))(vl||{}),yl=(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))(yl||{}),bl=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(bl||{}),xl=(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))(xl||{}),_l=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(_l||{}),El=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(El||{}),Ol=(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))(Ol||{}),wl=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(wl||{}),Sl=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Sl||{}),Nr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Nr||{}),Tl=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Tl||{}),Hh=(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))(Hh||{}),Vh=(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))(Vh||{}),Fh=(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))(Fh||{}),Gh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Gh||{}),jh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(jh||{}),Pr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Pr||{});const Y0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Fh,Area:ml,Axis:fl,Bar:bl,Boxplot:xl,CanvasZoom:pl,Chart:zn,Choropleth:Pr,CirclePack:Vh,Gauge:yl,Heatmap:jh,Legend:Hh,Line:El,Meter:Gh,Modal:cl,Model:ul,Pie:vl,Radar:Ol,Scatter:_l,Threshold:Tl,Toolbar:Bh,Tooltip:Nr,Tree:wl,Treemap:Sl,WordCloud:gl,ZoomBar:hl,ZoomDomain:dl},Symbol.toStringTag,{value:"Module"})),S=Y0;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),$l=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))($l||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),G=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(G||{}),qe=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(qe||{}),Ue=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ue||{}),Jt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Jt||{}),tt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(tt||{}),Ur=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Ur||{}),te=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(te||{}),Br=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Br||{}),Ka=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Ka||{}),Nt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Nt||{}),ht=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ht||{}),sr=(e=>(e.CENTER="center",e))(sr||{}),Ci=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ci||{}),ee=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(ee||{}),ln=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(ln||{}),cn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(cn||{}),or=(e=>(e.SEMI="semi",e.FULL="full",e))(or||{}),Qa=(e=>(e.UP="up",e.DOWN="down",e))(Qa||{}),Ai=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ai||{}),ki=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ki||{}),Me=(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))(Me||{}),Tt=(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))(Tt||{}),Ja=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ja||{}),ne=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(ne||{}),Ri=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Ri||{}),Hr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Hr||{}),Li=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Li||{}),un=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(un||{}),zh=(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))(zh||{});function Ml(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Di(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):s;i=e.formattingValues[o]||e.formattingValues[s]}else{const s=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function Ii(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?X0(o,d=>d.test(s)):Z0(o,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function Z0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function X0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function K0(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const o=t.slice(i.length);return{value:s,rest:o}}}function wt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let Q0={};function ts(){return Q0}function Ni(e,t){var n,r,i,a;const s=ts(),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)??s.weekStartsOn??((a=(i=s.locale)==null?void 0:i.options)==null?void 0:a.weekStartsOn)??0,l=wt(e),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const J0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},t1=(e,t,n)=>{let r;const i=J0[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},e1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},n1=(e,t,n,r)=>e1[e],r1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},i1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},a1={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"]},s1={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"]},o1={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"}},l1={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"}},c1=(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"},u1={ordinalNumber:c1,era:Di({values:r1,defaultWidth:"wide"}),quarter:Di({values:i1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Di({values:a1,defaultWidth:"wide"}),day:Di({values:s1,defaultWidth:"wide"}),dayPeriod:Di({values:o1,defaultWidth:"wide",formattingValues:l1,defaultFormattingWidth:"wide"})},h1=/^(\d+)(th|st|nd|rd)?/i,d1=/\d+/i,p1={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},f1={any:[/^b/i,/^(a|c)/i]},m1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},g1={any:[/1/i,/2/i,/3/i,/4/i]},v1={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},y1={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]},b1={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},x1={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]},_1={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},E1={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}},O1={ordinalNumber:K0({matchPattern:h1,parsePattern:d1,valueCallback:e=>parseInt(e,10)}),era:Ii({matchPatterns:p1,defaultMatchWidth:"wide",parsePatterns:f1,defaultParseWidth:"any"}),quarter:Ii({matchPatterns:m1,defaultMatchWidth:"wide",parsePatterns:g1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ii({matchPatterns:v1,defaultMatchWidth:"wide",parsePatterns:y1,defaultParseWidth:"any"}),day:Ii({matchPatterns:b1,defaultMatchWidth:"wide",parsePatterns:x1,defaultParseWidth:"any"}),dayPeriod:Ii({matchPatterns:_1,defaultMatchWidth:"any",parsePatterns:E1,defaultParseWidth:"any"})},w1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},S1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},T1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},$1={date:Ml({formats:w1,defaultWidth:"full"}),time:Ml({formats:S1,defaultWidth:"full"}),dateTime:Ml({formats:T1,defaultWidth:"full"})},Wh={code:"en-US",formatDistance:t1,formatLong:$1,formatRelative:n1,localize:u1,match:O1,options:{weekStartsOn:0,firstWeekContainsDate:1}};var qh=typeof global=="object"&&global&&global.Object===Object&&global,M1=typeof self=="object"&&self&&self.Object===Object&&self,Ye=qh||M1||Function("return this")(),Be=Ye.Symbol,Yh=Object.prototype,C1=Yh.hasOwnProperty,A1=Yh.toString,Pi=Be?Be.toStringTag:void 0;function k1(e){var t=C1.call(e,Pi),n=e[Pi];try{e[Pi]=void 0;var r=!0}catch{}var i=A1.call(e);return r&&(t?e[Pi]=n:delete e[Pi]),i}var R1=Object.prototype,L1=R1.toString;function D1(e){return L1.call(e)}var I1="[object Null]",N1="[object Undefined]",Zh=Be?Be.toStringTag:void 0;function lr(e){return e==null?e===void 0?N1:I1:Zh&&Zh in Object(e)?k1(e):D1(e)}function hn(e){return e!=null&&typeof e=="object"}var P1="[object Symbol]";function es(e){return typeof e=="symbol"||hn(e)&&lr(e)==P1}function Cl(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ae=Array.isArray,U1=1/0,Xh=Be?Be.prototype:void 0,Kh=Xh?Xh.toString:void 0;function Qh(e){if(typeof e=="string")return e;if(ae(e))return Cl(e,Qh)+"";if(es(e))return Kh?Kh.call(e):"";var t=e+"";return t=="0"&&1/e==-U1?"-0":t}function He(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Al(e){return e}var B1="[object AsyncFunction]",H1="[object Function]",V1="[object GeneratorFunction]",F1="[object Proxy]";function kl(e){if(!He(e))return!1;var t=lr(e);return t==H1||t==V1||t==B1||t==F1}var Rl=Ye["__core-js_shared__"],Jh=function(){var e=/[^.]+$/.exec(Rl&&Rl.keys&&Rl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function G1(e){return!!Jh&&Jh in e}var j1=Function.prototype,z1=j1.toString;function cr(e){if(e!=null){try{return z1.call(e)}catch{}try{return e+""}catch{}}return""}var W1=/[\\^$.*+?()[\]{}|]/g,q1=/^\[object .+?Constructor\]$/,Y1=Function.prototype,Z1=Object.prototype,X1=Y1.toString,K1=Z1.hasOwnProperty,Q1=RegExp("^"+X1.call(K1).replace(W1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function J1(e){if(!He(e)||G1(e))return!1;var t=kl(e)?Q1:q1;return t.test(cr(e))}function ty(e,t){return e==null?void 0:e[t]}function ur(e,t){var n=ty(e,t);return J1(n)?n:void 0}var Ll=ur(Ye,"WeakMap"),td=Object.create,ey=function(){function e(){}return function(t){if(!He(t))return{};if(td)return td(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ny(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ry(){}function ed(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var iy=800,ay=16,sy=Date.now;function oy(e){var t=0,n=0;return function(){var r=sy(),i=ay-(r-n);if(n=r,i>0){if(++t>=iy)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ly(e){return function(){return e}}var ns=function(){try{var e=ur(Object,"defineProperty");return e({},"",{}),e}catch{}}(),cy=ns?function(e,t){return ns(e,"toString",{configurable:!0,enumerable:!1,value:ly(t),writable:!0})}:Al,nd=oy(cy);function uy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function hy(e,t,n,r){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}function dy(e){return e!==e}function py(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function fy(e,t,n){return t===t?py(e,t,n):hy(e,dy,n)}function my(e,t){var n=e==null?0:e.length;return!!n&&fy(e,t,0)>-1}var gy=9007199254740991,vy=/^(?:0|[1-9]\d*)$/;function Dl(e,t){var n=typeof e;return t=t??gy,!!t&&(n=="number"||n!="symbol"&&vy.test(e))&&e>-1&&e%1==0&&e<t}function rs(e,t,n){t=="__proto__"&&ns?ns(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ui(e,t){return e===t||e!==e&&t!==t}var yy=Object.prototype,by=yy.hasOwnProperty;function rd(e,t,n){var r=e[t];(!(by.call(e,t)&&Ui(r,n))||n===void 0&&!(t in e))&&rs(e,t,n)}function Vr(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var o=t[a],l=void 0;l===void 0&&(l=e[o]),i?rs(n,o,l):rd(n,o,l)}return n}var id=Math.max;function ad(e,t,n){return t=id(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=id(r.length-t,0),s=Array(a);++i<a;)s[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(s),ny(e,this,o)}}function Il(e,t){return nd(ad(e,t,Al),e+"")}var xy=9007199254740991;function Nl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=xy}function hr(e){return e!=null&&Nl(e.length)&&!kl(e)}function _y(e,t,n){if(!He(n))return!1;var r=typeof t;return(r=="number"?hr(n)&&Dl(t,n.length):r=="string"&&t in n)?Ui(n[t],e):!1}function Ey(e){return Il(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,s&&_y(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,a)}return t})}var Oy=Object.prototype;function is(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Oy;return e===n}function wy(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Sy="[object Arguments]";function sd(e){return hn(e)&&lr(e)==Sy}var od=Object.prototype,Ty=od.hasOwnProperty,$y=od.propertyIsEnumerable,Fr=sd(function(){return arguments}())?sd:function(e){return hn(e)&&Ty.call(e,"callee")&&!$y.call(e,"callee")};function My(){return!1}var ld=typeof V=="object"&&V&&!V.nodeType&&V,cd=ld&&typeof module=="object"&&module&&!module.nodeType&&module,Cy=cd&&cd.exports===ld,ud=Cy?Ye.Buffer:void 0,Ay=ud?ud.isBuffer:void 0,Gr=Ay||My,ky="[object Arguments]",Ry="[object Array]",Ly="[object Boolean]",Dy="[object Date]",Iy="[object Error]",Ny="[object Function]",Py="[object Map]",Uy="[object Number]",By="[object Object]",Hy="[object RegExp]",Vy="[object Set]",Fy="[object String]",Gy="[object WeakMap]",jy="[object ArrayBuffer]",zy="[object DataView]",Wy="[object Float32Array]",qy="[object Float64Array]",Yy="[object Int8Array]",Zy="[object Int16Array]",Xy="[object Int32Array]",Ky="[object Uint8Array]",Qy="[object Uint8ClampedArray]",Jy="[object Uint16Array]",tb="[object Uint32Array]",Ft={};Ft[Wy]=Ft[qy]=Ft[Yy]=Ft[Zy]=Ft[Xy]=Ft[Ky]=Ft[Qy]=Ft[Jy]=Ft[tb]=!0,Ft[ky]=Ft[Ry]=Ft[jy]=Ft[Ly]=Ft[zy]=Ft[Dy]=Ft[Iy]=Ft[Ny]=Ft[Py]=Ft[Uy]=Ft[By]=Ft[Hy]=Ft[Vy]=Ft[Fy]=Ft[Gy]=!1;function eb(e){return hn(e)&&Nl(e.length)&&!!Ft[lr(e)]}function Pl(e){return function(t){return e(t)}}var hd=typeof V=="object"&&V&&!V.nodeType&&V,Bi=hd&&typeof module=="object"&&module&&!module.nodeType&&module,nb=Bi&&Bi.exports===hd,Ul=nb&&qh.process,jr=function(){try{var e=Bi&&Bi.require&&Bi.require("util").types;return e||Ul&&Ul.binding&&Ul.binding("util")}catch{}}(),dd=jr&&jr.isTypedArray,as=dd?Pl(dd):eb,rb=Object.prototype,ib=rb.hasOwnProperty;function pd(e,t){var n=ae(e),r=!n&&Fr(e),i=!n&&!r&&Gr(e),a=!n&&!r&&!i&&as(e),s=n||r||i||a,o=s?wy(e.length,String):[],l=o.length;for(var c in e)(t||ib.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Dl(c,l)))&&o.push(c);return o}function fd(e,t){return function(n){return e(t(n))}}var ab=fd(Object.keys,Object),sb=Object.prototype,ob=sb.hasOwnProperty;function md(e){if(!is(e))return ab(e);var t=[];for(var n in Object(e))ob.call(e,n)&&n!="constructor"&&t.push(n);return t}function Hi(e){return hr(e)?pd(e):md(e)}function lb(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var cb=Object.prototype,ub=cb.hasOwnProperty;function hb(e){if(!He(e))return lb(e);var t=is(e),n=[];for(var r in e)r=="constructor"&&(t||!ub.call(e,r))||n.push(r);return n}function Vi(e){return hr(e)?pd(e,!0):hb(e)}var db=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pb=/^\w*$/;function Bl(e,t){if(ae(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||es(e)?!0:pb.test(e)||!db.test(e)||t!=null&&e in Object(t)}var Fi=ur(Object,"create");function fb(){this.__data__=Fi?Fi(null):{},this.size=0}function mb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gb="__lodash_hash_undefined__",vb=Object.prototype,yb=vb.hasOwnProperty;function bb(e){var t=this.__data__;if(Fi){var n=t[e];return n===gb?void 0:n}return yb.call(t,e)?t[e]:void 0}var xb=Object.prototype,_b=xb.hasOwnProperty;function Eb(e){var t=this.__data__;return Fi?t[e]!==void 0:_b.call(t,e)}var Ob="__lodash_hash_undefined__";function wb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Fi&&t===void 0?Ob:t,this}function dr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dr.prototype.clear=fb,dr.prototype.delete=mb,dr.prototype.get=bb,dr.prototype.has=Eb,dr.prototype.set=wb;function Sb(){this.__data__=[],this.size=0}function ss(e,t){for(var n=e.length;n--;)if(Ui(e[n][0],t))return n;return-1}var Tb=Array.prototype,$b=Tb.splice;function Mb(e){var t=this.__data__,n=ss(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():$b.call(t,n,1),--this.size,!0}function Cb(e){var t=this.__data__,n=ss(t,e);return n<0?void 0:t[n][1]}function Ab(e){return ss(this.__data__,e)>-1}function kb(e,t){var n=this.__data__,r=ss(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function En(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}En.prototype.clear=Sb,En.prototype.delete=Mb,En.prototype.get=Cb,En.prototype.has=Ab,En.prototype.set=kb;var Gi=ur(Ye,"Map");function Rb(){this.size=0,this.__data__={hash:new dr,map:new(Gi||En),string:new dr}}function Lb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function os(e,t){var n=e.__data__;return Lb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Db(e){var t=os(this,e).delete(e);return this.size-=t?1:0,t}function Ib(e){return os(this,e).get(e)}function Nb(e){return os(this,e).has(e)}function Pb(e,t){var n=os(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function On(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}On.prototype.clear=Rb,On.prototype.delete=Db,On.prototype.get=Ib,On.prototype.has=Nb,On.prototype.set=Pb;var Ub="Expected a function";function Hl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ub);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(Hl.Cache||On),n}Hl.Cache=On;var Bb=500;function Hb(e){var t=Hl(e,function(r){return n.size===Bb&&n.clear(),r}),n=t.cache;return t}var Vb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fb=/\\(\\)?/g,Gb=Hb(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Vb,function(n,r,i,a){t.push(i?a.replace(Fb,"$1"):r||n)}),t});function ji(e){return e==null?"":Qh(e)}function ls(e,t){return ae(e)?e:Bl(e,t)?[e]:Gb(ji(e))}var jb=1/0;function zi(e){if(typeof e=="string"||es(e))return e;var t=e+"";return t=="0"&&1/e==-jb?"-0":t}function Vl(e,t){t=ls(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[zi(t[n++])];return n&&n==r?e:void 0}function Et(e,t,n){var r=e==null?void 0:Vl(e,t);return r===void 0?n:r}function Fl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var gd=Be?Be.isConcatSpreadable:void 0;function zb(e){return ae(e)||Fr(e)||!!(gd&&e&&e[gd])}function cs(e,t,n,r,i){var a=-1,s=e.length;for(n||(n=zb),i||(i=[]);++a<s;){var o=e[a];t>0&&n(o)?t>1?cs(o,t-1,n,r,i):Fl(i,o):r||(i[i.length]=o)}return i}var Gl=fd(Object.getPrototypeOf,Object),Wb="[object Object]",qb=Function.prototype,Yb=Object.prototype,vd=qb.toString,Zb=Yb.hasOwnProperty,Xb=vd.call(Object);function yd(e){if(!hn(e)||lr(e)!=Wb)return!1;var t=Gl(e);if(t===null)return!0;var n=Zb.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vd.call(n)==Xb}function Kb(){this.__data__=new En,this.size=0}function Qb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Jb(e){return this.__data__.get(e)}function tx(e){return this.__data__.has(e)}var ex=200;function nx(e,t){var n=this.__data__;if(n instanceof En){var r=n.__data__;if(!Gi||r.length<ex-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new On(r)}return n.set(e,t),this.size=n.size,this}function Ze(e){var t=this.__data__=new En(e);this.size=t.size}Ze.prototype.clear=Kb,Ze.prototype.delete=Qb,Ze.prototype.get=Jb,Ze.prototype.has=tx,Ze.prototype.set=nx;function rx(e,t){return e&&Vr(t,Hi(t),e)}function ix(e,t){return e&&Vr(t,Vi(t),e)}var bd=typeof V=="object"&&V&&!V.nodeType&&V,xd=bd&&typeof module=="object"&&module&&!module.nodeType&&module,ax=xd&&xd.exports===bd,_d=ax?Ye.Buffer:void 0,Ed=_d?_d.allocUnsafe:void 0;function Od(e,t){if(t)return e.slice();var n=e.length,r=Ed?Ed(n):new e.constructor(n);return e.copy(r),r}function sx(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var s=e[n];t(s,n,e)&&(a[i++]=s)}return a}function wd(){return[]}var ox=Object.prototype,lx=ox.propertyIsEnumerable,Sd=Object.getOwnPropertySymbols,jl=Sd?function(e){return e==null?[]:(e=Object(e),sx(Sd(e),function(t){return lx.call(e,t)}))}:wd;function cx(e,t){return Vr(e,jl(e),t)}var ux=Object.getOwnPropertySymbols,Td=ux?function(e){for(var t=[];e;)Fl(t,jl(e)),e=Gl(e);return t}:wd;function hx(e,t){return Vr(e,Td(e),t)}function $d(e,t,n){var r=t(e);return ae(e)?r:Fl(r,n(e))}function zl(e){return $d(e,Hi,jl)}function Md(e){return $d(e,Vi,Td)}var Wl=ur(Ye,"DataView"),ql=ur(Ye,"Promise"),zr=ur(Ye,"Set"),Cd="[object Map]",dx="[object Object]",Ad="[object Promise]",kd="[object Set]",Rd="[object WeakMap]",Ld="[object DataView]",px=cr(Wl),fx=cr(Gi),mx=cr(ql),gx=cr(zr),vx=cr(Ll),Ve=lr;(Wl&&Ve(new Wl(new ArrayBuffer(1)))!=Ld||Gi&&Ve(new Gi)!=Cd||ql&&Ve(ql.resolve())!=Ad||zr&&Ve(new zr)!=kd||Ll&&Ve(new Ll)!=Rd)&&(Ve=function(e){var t=lr(e),n=t==dx?e.constructor:void 0,r=n?cr(n):"";if(r)switch(r){case px:return Ld;case fx:return Cd;case mx:return Ad;case gx:return kd;case vx:return Rd}return t});var yx=Object.prototype,bx=yx.hasOwnProperty;function xx(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&bx.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var us=Ye.Uint8Array;function Yl(e){var t=new e.constructor(e.byteLength);return new us(t).set(new us(e)),t}function _x(e,t){var n=t?Yl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ex=/\w*$/;function Ox(e){var t=new e.constructor(e.source,Ex.exec(e));return t.lastIndex=e.lastIndex,t}var Dd=Be?Be.prototype:void 0,Id=Dd?Dd.valueOf:void 0;function wx(e){return Id?Object(Id.call(e)):{}}function Nd(e,t){var n=t?Yl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Sx="[object Boolean]",Tx="[object Date]",$x="[object Map]",Mx="[object Number]",Cx="[object RegExp]",Ax="[object Set]",kx="[object String]",Rx="[object Symbol]",Lx="[object ArrayBuffer]",Dx="[object DataView]",Ix="[object Float32Array]",Nx="[object Float64Array]",Px="[object Int8Array]",Ux="[object Int16Array]",Bx="[object Int32Array]",Hx="[object Uint8Array]",Vx="[object Uint8ClampedArray]",Fx="[object Uint16Array]",Gx="[object Uint32Array]";function jx(e,t,n){var r=e.constructor;switch(t){case Lx:return Yl(e);case Sx:case Tx:return new r(+e);case Dx:return _x(e,n);case Ix:case Nx:case Px:case Ux:case Bx:case Hx:case Vx:case Fx:case Gx:return Nd(e,n);case $x:return new r;case Mx:case kx:return new r(e);case Cx:return Ox(e);case Ax:return new r;case Rx:return wx(e)}}function Pd(e){return typeof e.constructor=="function"&&!is(e)?ey(Gl(e)):{}}var zx="[object Map]";function Wx(e){return hn(e)&&Ve(e)==zx}var Ud=jr&&jr.isMap,qx=Ud?Pl(Ud):Wx,Yx="[object Set]";function Zx(e){return hn(e)&&Ve(e)==Yx}var Bd=jr&&jr.isSet,Xx=Bd?Pl(Bd):Zx,Kx=1,Qx=2,Jx=4,Hd="[object Arguments]",t_="[object Array]",e_="[object Boolean]",n_="[object Date]",r_="[object Error]",Vd="[object Function]",i_="[object GeneratorFunction]",a_="[object Map]",s_="[object Number]",Fd="[object Object]",o_="[object RegExp]",l_="[object Set]",c_="[object String]",u_="[object Symbol]",h_="[object WeakMap]",d_="[object ArrayBuffer]",p_="[object DataView]",f_="[object Float32Array]",m_="[object Float64Array]",g_="[object Int8Array]",v_="[object Int16Array]",y_="[object Int32Array]",b_="[object Uint8Array]",x_="[object Uint8ClampedArray]",__="[object Uint16Array]",E_="[object Uint32Array]",Ht={};Ht[Hd]=Ht[t_]=Ht[d_]=Ht[p_]=Ht[e_]=Ht[n_]=Ht[f_]=Ht[m_]=Ht[g_]=Ht[v_]=Ht[y_]=Ht[a_]=Ht[s_]=Ht[Fd]=Ht[o_]=Ht[l_]=Ht[c_]=Ht[u_]=Ht[b_]=Ht[x_]=Ht[__]=Ht[E_]=!0,Ht[r_]=Ht[Vd]=Ht[h_]=!1;function Wi(e,t,n,r,i,a){var s,o=t&Kx,l=t&Qx,c=t&Jx;if(n&&(s=i?n(e,r,i,a):n(e)),s!==void 0)return s;if(!He(e))return e;var u=ae(e);if(u){if(s=xx(e),!o)return ed(e,s)}else{var d=Ve(e),h=d==Vd||d==i_;if(Gr(e))return Od(e,o);if(d==Fd||d==Hd||h&&!i){if(s=l||h?{}:Pd(e),!o)return l?hx(e,ix(s,e)):cx(e,rx(s,e))}else{if(!Ht[d])return i?e:{};s=jx(e,d,o)}}a||(a=new Ze);var p=a.get(e);if(p)return p;a.set(e,s),Xx(e)?e.forEach(function(m){s.add(Wi(m,t,n,m,e,a))}):qx(e)&&e.forEach(function(m,y){s.set(y,Wi(m,t,n,y,e,a))});var f=c?l?Md:zl:l?Vi:Hi,v=u?void 0:f(e);return uy(v||e,function(m,y){v&&(y=m,m=e[y]),rd(s,y,Wi(m,t,n,y,e,a))}),s}var O_=1,w_=4;function wn(e){return Wi(e,O_|w_)}var S_="__lodash_hash_undefined__";function T_(e){return this.__data__.set(e,S_),this}function $_(e){return this.__data__.has(e)}function qi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new On;++t<n;)this.add(e[t])}qi.prototype.add=qi.prototype.push=T_,qi.prototype.has=$_;function Gd(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function jd(e,t){return e.has(t)}var M_=1,C_=2;function zd(e,t,n,r,i,a){var s=n&M_,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&C_?new qi:void 0;for(a.set(e,t),a.set(t,e);++d<o;){var f=e[d],v=t[d];if(r)var m=s?r(v,f,d,t,e,a):r(f,v,d,e,t,a);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!Gd(t,function(y,g){if(!jd(p,g)&&(f===y||i(f,y,n,r,a)))return p.push(g)})){h=!1;break}}else if(!(f===v||i(f,v,n,r,a))){h=!1;break}}return a.delete(e),a.delete(t),h}function A_(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Zl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var k_=1,R_=2,L_="[object Boolean]",D_="[object Date]",I_="[object Error]",N_="[object Map]",P_="[object Number]",U_="[object RegExp]",B_="[object Set]",H_="[object String]",V_="[object Symbol]",F_="[object ArrayBuffer]",G_="[object DataView]",Wd=Be?Be.prototype:void 0,Xl=Wd?Wd.valueOf:void 0;function j_(e,t,n,r,i,a,s){switch(n){case G_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case F_:return!(e.byteLength!=t.byteLength||!a(new us(e),new us(t)));case L_:case D_:case P_:return Ui(+e,+t);case I_:return e.name==t.name&&e.message==t.message;case U_:case H_:return e==t+"";case N_:var o=A_;case B_:var l=r&k_;if(o||(o=Zl),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=R_,s.set(e,t);var u=zd(o(e),o(t),r,i,a,s);return s.delete(e),u;case V_:if(Xl)return Xl.call(e)==Xl.call(t)}return!1}var z_=1,W_=Object.prototype,q_=W_.hasOwnProperty;function Y_(e,t,n,r,i,a){var s=n&z_,o=zl(e),l=o.length,c=zl(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var h=o[d];if(!(s?h in t:q_.call(t,h)))return!1}var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var v=!0;a.set(e,t),a.set(t,e);for(var m=s;++d<l;){h=o[d];var y=e[h],g=t[h];if(r)var x=s?r(g,y,h,t,e,a):r(y,g,h,e,t,a);if(!(x===void 0?y===g||i(y,g,n,r,a):x)){v=!1;break}m||(m=h=="constructor")}if(v&&!m){var O=e.constructor,E=t.constructor;O!=E&&"constructor"in e&&"constructor"in t&&!(typeof O=="function"&&O instanceof O&&typeof E=="function"&&E instanceof E)&&(v=!1)}return a.delete(e),a.delete(t),v}var Z_=1,qd="[object Arguments]",Yd="[object Array]",hs="[object Object]",X_=Object.prototype,Zd=X_.hasOwnProperty;function K_(e,t,n,r,i,a){var s=ae(e),o=ae(t),l=s?Yd:Ve(e),c=o?Yd:Ve(t);l=l==qd?hs:l,c=c==qd?hs:c;var u=l==hs,d=c==hs,h=l==c;if(h&&Gr(e)){if(!Gr(t))return!1;s=!0,u=!1}if(h&&!u)return a||(a=new Ze),s||as(e)?zd(e,t,n,r,i,a):j_(e,t,l,n,r,i,a);if(!(n&Z_)){var p=u&&Zd.call(e,"__wrapped__"),f=d&&Zd.call(t,"__wrapped__");if(p||f){var v=p?e.value():e,m=f?t.value():t;return a||(a=new Ze),i(v,m,n,r,a)}}return h?(a||(a=new Ze),Y_(e,t,n,r,i,a)):!1}function ds(e,t,n,r,i){return e===t?!0:e==null||t==null||!hn(e)&&!hn(t)?e!==e&&t!==t:K_(e,t,n,r,ds,i)}var Q_=1,J_=2;function tE(e,t,n,r){var i=n.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var o=s[0],l=e[o],c=s[1];if(s[2]){if(l===void 0&&!(o in e))return!1}else{var u=new Ze,d;if(!(d===void 0?ds(c,l,Q_|J_,r,u):d))return!1}}return!0}function Xd(e){return e===e&&!He(e)}function eE(e){for(var t=Hi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Xd(i)]}return t}function Kd(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function nE(e){var t=eE(e);return t.length==1&&t[0][2]?Kd(t[0][0],t[0][1]):function(n){return n===e||tE(n,e,t)}}function rE(e,t){return e!=null&&t in Object(e)}function iE(e,t,n){t=ls(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var s=zi(t[r]);if(!(a=e!=null&&n(e,s)))break;e=e[s]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Nl(i)&&Dl(s,i)&&(ae(e)||Fr(e)))}function aE(e,t){return e!=null&&iE(e,t,rE)}var sE=1,oE=2;function lE(e,t){return Bl(e)&&Xd(t)?Kd(zi(e),t):function(n){var r=Et(n,e);return r===void 0&&r===t?aE(n,e):ds(t,r,sE|oE)}}function cE(e){return function(t){return t==null?void 0:t[e]}}function uE(e){return function(t){return Vl(t,e)}}function hE(e){return Bl(e)?cE(zi(e)):uE(e)}function ps(e){return typeof e=="function"?e:e==null?Al:typeof e=="object"?ae(e)?lE(e[0],e[1]):nE(e):hE(e)}function dE(e){return function(t,n,r){for(var i=-1,a=Object(t),s=r(t),o=s.length;o--;){var l=s[++i];if(n(a[l],l,a)===!1)break}return t}}var Qd=dE();function Kl(e,t,n){(n!==void 0&&!Ui(e[t],n)||n===void 0&&!(t in e))&&rs(e,t,n)}function Ql(e){return hn(e)&&hr(e)}function Jl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function pE(e){return Vr(e,Vi(e))}function fE(e,t,n,r,i,a,s){var o=Jl(e,n),l=Jl(t,n),c=s.get(l);if(c){Kl(e,n,c);return}var u=a?a(o,l,n+"",e,t,s):void 0,d=u===void 0;if(d){var h=ae(l),p=!h&&Gr(l),f=!h&&!p&&as(l);u=l,h||p||f?ae(o)?u=o:Ql(o)?u=ed(o):p?(d=!1,u=Od(l,!0)):f?(d=!1,u=Nd(l,!0)):u=[]:yd(l)||Fr(l)?(u=o,Fr(o)?u=pE(o):(!He(o)||kl(o))&&(u=Pd(l))):d=!1}d&&(s.set(l,u),i(u,l,r,a,s),s.delete(l)),Kl(e,n,u)}function Jd(e,t,n,r,i){e!==t&&Qd(t,function(a,s){if(i||(i=new Ze),He(a))fE(e,t,s,n,Jd,r,i);else{var o=r?r(Jl(e,s),a,s+"",e,t,i):void 0;o===void 0&&(o=a),Kl(e,s,o)}},Vi)}function tp(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var mE="[object Map]",gE="[object Set]",vE=Object.prototype,yE=vE.hasOwnProperty;function Xe(e){if(e==null)return!0;if(hr(e)&&(ae(e)||typeof e=="string"||typeof e.splice=="function"||Gr(e)||as(e)||Fr(e)))return!e.length;var t=Ve(e);if(t==mE||t==gE)return!e.size;if(is(e))return!md(e).length;for(var n in e)if(yE.call(e,n))return!1;return!0}var ct=Ey(function(e,t,n){Jd(e,t,n)}),bE=1/0,xE=zr&&1/Zl(new zr([,-0]))[1]==bE?function(e){return new zr(e)}:ry,_E=200;function ep(e,t,n){var r=-1,i=my,a=e.length,s=!0,o=[],l=o;if(a>=_E){var c=t?null:xE(e);if(c)return Zl(c);s=!1,i=jd,l=new qi}else l=t?[]:o;t:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,s&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var EE=Il(function(e){var t=tp(e);return Ql(t)&&(t=void 0),ep(cs(e,1,Ql,!0),ps(t))});function Yi(e){return e&&e.length?ep(e):[]}function pr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function OE(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tc(e){let t,n,r;e.length!==2?(t=pr,n=(o,l)=>pr(e(o),l),r=(o,l)=>e(o)-l):(t=e===pr||e===OE?e:wE,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function wE(){return 0}function SE(e){return e===null?NaN:+e}function*TE(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const $E=tc(pr),ec=$E.right;tc(SE).center;function Ke(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<i&&(r=i)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}let np=class extends Map{constructor(t,n=AE){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(rp(this,t))}has(t){return super.has(rp(this,t))}set(t,n){return super.set(ME(this,t),n)}delete(t){return super.delete(CE(this,t))}};function rp({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ME({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function CE({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function AE(e){return e!==null&&typeof e=="object"?e.valueOf():e}const kE=Math.sqrt(50),RE=Math.sqrt(10),LE=Math.sqrt(2);function fs(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=kE?10:a>=RE?5:a>=LE?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/s,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?fs(e,t,n*2):[o,l,c]}function ms(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?fs(t,e,n):fs(e,t,n);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(r)if(s<0)for(let c=0;c<o;++c)l[c]=(a-c)/-s;else for(let c=0;c<o;++c)l[c]=(a-c)*s;else if(s<0)for(let c=0;c<o;++c)l[c]=(i+c)/-s;else for(let c=0;c<o;++c)l[c]=(i+c)*s;return l}function Wr(e,t,n){return t=+t,e=+e,n=+n,fs(e,t,n)[2]}function nc(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Wr(t,e,n):Wr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function fr(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 Wn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var DE={value:()=>{}};function rc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new gs(n)}function gs(e){this._=e}function IE(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=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}})}gs.prototype=rc.prototype={constructor:gs,on:function(e,t){var n=this._,r=IE(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=NE(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=ip(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ip(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gs(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function NE(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ip(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=DE,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ic="http://www.w3.org/1999/xhtml";const ap={svg:"http://www.w3.org/2000/svg",xhtml:ic,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ap.hasOwnProperty(t)?{space:ap[t],local:e}:e}function PE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ic&&t.documentElement.namespaceURI===ic?t.createElement(e):t.createElementNS(n,e)}}function UE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sp(e){var t=vs(e);return(t.local?UE:PE)(t)}function BE(){}function ac(e){return e==null?BE:function(){return this.querySelector(e)}}function HE(e){typeof e!="function"&&(e=ac(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=new Array(s),l,c,u=0;u<s;++u)(l=a[u])&&(c=e.call(l,l.__data__,u,a))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Ce(r,this._parents)}function VE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FE(){return[]}function op(e){return e==null?FE:function(){return this.querySelectorAll(e)}}function GE(e){return function(){return VE(e.apply(this,arguments))}}function jE(e){typeof e=="function"?e=GE(e):e=op(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var s=t[a],o=s.length,l,c=0;c<o;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),i.push(l));return new Ce(r,i)}function lp(e){return function(){return this.matches(e)}}function cp(e){return function(t){return t.matches(e)}}var zE=Array.prototype.find;function WE(e){return function(){return zE.call(this.children,e)}}function qE(){return this.firstElementChild}function YE(e){return this.select(e==null?qE:WE(typeof e=="function"?e:cp(e)))}var ZE=Array.prototype.filter;function XE(){return Array.from(this.children)}function KE(e){return function(){return ZE.call(this.children,e)}}function QE(e){return this.selectAll(e==null?XE:KE(typeof e=="function"?e:cp(e)))}function JE(e){typeof e!="function"&&(e=lp(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&o.push(l);return new Ce(r,this._parents)}function up(e){return new Array(e.length)}function tO(){return new Ce(this._enter||this._groups.map(up),this._parents)}function ys(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ys.prototype={constructor:ys,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function eO(e){return function(){return e}}function nO(e,t,n,r,i,a){for(var s=0,o,l=t.length,c=a.length;s<c;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new ys(e,a[s]);for(;s<l;++s)(o=t[s])&&(i[s]=o)}function rO(e,t,n,r,i,a,s){var o,l,c=new Map,u=t.length,d=a.length,h=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<d;++o)p=s.call(e,a[o],o,a)+"",(l=c.get(p))?(r[o]=l,l.__data__=a[o],c.delete(p)):n[o]=new ys(e,a[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function iO(e){return e.__data__}function aO(e,t){if(!arguments.length)return Array.from(this,iO);var n=t?rO:nO,r=this._parents,i=this._groups;typeof e!="function"&&(e=eO(e));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],d=i[c],h=d.length,p=sO(e.call(u,u&&u.__data__,c,r)),f=p.length,v=o[c]=new Array(f),m=s[c]=new Array(f),y=l[c]=new Array(h);n(u,d,v,m,y,p,t);for(var g=0,x=0,O,E;g<f;++g)if(O=v[g]){for(g>=x&&(x=g+1);!(E=m[x])&&++x<f;);O._next=E||null}}return s=new Ce(s,r),s._enter=o,s._exit=l,s}function sO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oO(){return new Ce(this._exit||this._groups.map(up),this._parents)}function lO(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function cO(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||u[f])&&(h[f]=p);for(;l<i;++l)o[l]=n[l];return new Ce(o,this._parents)}function uO(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function hO(e){e||(e=dO);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),a=0;a<r;++a){for(var s=n[a],o=s.length,l=i[a]=new Array(o),c,u=0;u<o;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new Ce(i,this._parents).order()}function dO(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pO(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fO(){return Array.from(this)}function mO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function gO(){let e=0;for(const t of this)++e;return e}function vO(){return!this.node()}function yO(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function bO(e){return function(){this.removeAttribute(e)}}function xO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _O(e,t){return function(){this.setAttribute(e,t)}}function EO(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function OO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function wO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function SO(e,t){var n=vs(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?xO:bO:typeof t=="function"?n.local?wO:OO:n.local?EO:_O)(n,t))}function hp(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function TO(e){return function(){this.style.removeProperty(e)}}function $O(e,t,n){return function(){this.style.setProperty(e,t,n)}}function MO(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function CO(e,t,n){return arguments.length>1?this.each((t==null?TO:typeof t=="function"?MO:$O)(e,t,n??"")):qr(this.node(),e)}function qr(e,t){return e.style.getPropertyValue(t)||hp(e).getComputedStyle(e,null).getPropertyValue(t)}function AO(e){return function(){delete this[e]}}function kO(e,t){return function(){this[e]=t}}function RO(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function LO(e,t){return arguments.length>1?this.each((t==null?AO:typeof t=="function"?RO:kO)(e,t)):this.node()[e]}function dp(e){return e.trim().split(/^|\s+/)}function sc(e){return e.classList||new pp(e)}function pp(e){this._node=e,this._names=dp(e.getAttribute("class")||"")}pp.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 fp(e,t){for(var n=sc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function mp(e,t){for(var n=sc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function DO(e){return function(){fp(this,e)}}function IO(e){return function(){mp(this,e)}}function NO(e,t){return function(){(t.apply(this,arguments)?fp:mp)(this,e)}}function PO(e,t){var n=dp(e+"");if(arguments.length<2){for(var r=sc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?NO:t?DO:IO)(n,t))}function UO(){this.textContent=""}function BO(e){return function(){this.textContent=e}}function HO(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function VO(e){return arguments.length?this.each(e==null?UO:(typeof e=="function"?HO:BO)(e)):this.node().textContent}function FO(){this.innerHTML=""}function GO(e){return function(){this.innerHTML=e}}function jO(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function zO(e){return arguments.length?this.each(e==null?FO:(typeof e=="function"?jO:GO)(e)):this.node().innerHTML}function WO(){this.nextSibling&&this.parentNode.appendChild(this)}function qO(){return this.each(WO)}function YO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ZO(){return this.each(YO)}function XO(e){var t=typeof e=="function"?e:sp(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function KO(){return null}function QO(e,t){var n=typeof e=="function"?e:sp(e),r=t==null?KO:typeof t=="function"?t:ac(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function JO(){var e=this.parentNode;e&&e.removeChild(this)}function tw(){return this.each(JO)}function ew(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nw(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rw(e){return this.select(e?nw:ew)}function iw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function aw(e){return function(t){e.call(this,t,this.__data__)}}function sw(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ow(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function lw(e,t,n){return function(){var r=this.__on,i,a=aw(t);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function cw(e,t,n){var r=sw(e+""),i,a=r.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<a;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(o=t?lw:ow,i=0;i<a;++i)this.each(o(r[i],t,n));return this}function gp(e,t,n){var r=hp(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function uw(e,t){return function(){return gp(this,e,t)}}function hw(e,t){return function(){return gp(this,e,t.apply(this,arguments))}}function dw(e,t){return this.each((typeof t=="function"?hw:uw)(e,t))}function*pw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var vp=[null];function Ce(e,t){this._groups=e,this._parents=t}function Zi(){return new Ce([[document.documentElement]],vp)}function fw(){return this}Ce.prototype=Zi.prototype={constructor:Ce,select:HE,selectAll:jE,selectChild:YE,selectChildren:QE,filter:JE,data:aO,enter:tO,exit:oO,join:lO,merge:cO,selection:fw,order:uO,sort:hO,call:pO,nodes:fO,node:mO,size:gO,empty:vO,each:yO,attr:SO,style:CO,property:LO,classed:PO,text:VO,html:zO,raise:qO,lower:ZO,append:XO,insert:QO,remove:tw,clone:rw,datum:iw,on:cw,dispatch:dw,[Symbol.iterator]:pw};function mw(e){let t;for(;t=e.sourceEvent;)e=t;return e}function mr(e,t){if(e=mw(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function oc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yp(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xi(){}var Ki=.7,bs=1/Ki,Yr="\\s*([+-]?\\d+)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gw=/^#([0-9a-f]{3,8})$/,vw=new RegExp(`^rgb\\(${Yr},${Yr},${Yr}\\)$`),yw=new RegExp(`^rgb\\(${dn},${dn},${dn}\\)$`),bw=new RegExp(`^rgba\\(${Yr},${Yr},${Yr},${Qi}\\)$`),xw=new RegExp(`^rgba\\(${dn},${dn},${dn},${Qi}\\)$`),_w=new RegExp(`^hsl\\(${Qi},${dn},${dn}\\)$`),Ew=new RegExp(`^hsla\\(${Qi},${dn},${dn},${Qi}\\)$`),bp={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};oc(Xi,Sn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xp,formatHex:xp,formatHex8:Ow,formatHsl:ww,formatRgb:_p,toString:_p});function xp(){return this.rgb().formatHex()}function Ow(){return this.rgb().formatHex8()}function ww(){return Tp(this).formatHsl()}function _p(){return this.rgb().formatRgb()}function Sn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ep(t):n===3?new _e(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xs(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=vw.exec(e))?new _e(t[1],t[2],t[3],1):(t=yw.exec(e))?new _e(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bw.exec(e))?xs(t[1],t[2],t[3],t[4]):(t=xw.exec(e))?xs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_w.exec(e))?Sp(t[1],t[2]/100,t[3]/100,1):(t=Ew.exec(e))?Sp(t[1],t[2]/100,t[3]/100,t[4]):bp.hasOwnProperty(e)?Ep(bp[e]):e==="transparent"?new _e(NaN,NaN,NaN,0):null}function Ep(e){return new _e(e>>16&255,e>>8&255,e&255,1)}function xs(e,t,n,r){return r<=0&&(e=t=n=NaN),new _e(e,t,n,r)}function Sw(e){return e instanceof Xi||(e=Sn(e)),e?(e=e.rgb(),new _e(e.r,e.g,e.b,e.opacity)):new _e}function lc(e,t,n,r){return arguments.length===1?Sw(e):new _e(e,t,n,r??1)}function _e(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}oc(_e,lc,yp(Xi,{brighter(e){return e=e==null?bs:Math.pow(bs,e),new _e(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new _e(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _e(gr(this.r),gr(this.g),gr(this.b),_s(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:Op,formatHex:Op,formatHex8:Tw,formatRgb:wp,toString:wp}));function Op(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function Tw(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}${vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function wp(){const e=_s(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function _s(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function Sp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qe(e,t,n,r)}function Tp(e){if(e instanceof Qe)return new Qe(e.h,e.s,e.l,e.opacity);if(e instanceof Xi||(e=Sn(e)),!e)return new Qe;if(e instanceof Qe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new Qe(s,o,l,e.opacity)}function cc(e,t,n,r){return arguments.length===1?Tp(e):new Qe(e,t,n,r??1)}function Qe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}oc(Qe,cc,yp(Xi,{brighter(e){return e=e==null?bs:Math.pow(bs,e),new Qe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new Qe(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 _e(uc(e>=240?e-240:e+120,i,r),uc(e,i,r),uc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qe($p(this.h),Es(this.s),Es(this.l),_s(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=_s(this.opacity);return`${e===1?"hsl(":"hsla("}${$p(this.h)}, ${Es(this.s)*100}%, ${Es(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $p(e){return e=(e||0)%360,e<0?e+360:e}function Es(e){return Math.max(0,Math.min(1,e||0))}function uc(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 hc=e=>()=>e;function $w(e,t){return function(n){return e+n*t}}function Mw(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 Cw(e){return(e=+e)==1?Mp:function(t,n){return n-t?Mw(t,n,e):hc(isNaN(t)?n:t)}}function Mp(e,t){var n=t-e;return n?$w(e,n):hc(isNaN(e)?t:e)}const Os=function e(t){var n=Cw(t);function r(i,a){var s=n((i=lc(i)).r,(a=lc(a)).r),o=n(i.g,a.g),l=n(i.b,a.b),c=Mp(i.opacity,a.opacity);return function(u){return i.r=s(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function Aw(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function kw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Rw(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Ji(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function Lw(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ae(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Dw(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ji(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var dc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pc=new RegExp(dc.source,"g");function Iw(e){return function(){return e}}function Nw(e){return function(t){return e(t)+""}}function Cp(e,t){var n=dc.lastIndex=pc.lastIndex=0,r,i,a,s=-1,o=[],l=[];for(e=e+"",t=t+"";(r=dc.exec(e))&&(i=pc.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Ae(r,i)})),n=pc.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?Nw(l[0].x):Iw(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Ji(e,t){var n=typeof t,r;return t==null||n==="boolean"?hc(t):(n==="number"?Ae:n==="string"?(r=Sn(t))?(t=r,Os):Cp:t instanceof Sn?Os:t instanceof Date?Lw:kw(t)?Aw:Array.isArray(t)?Rw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Dw:Ae)(e,t)}function Ap(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var kp=180/Math.PI,Rp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lp(e,t,n,r,i,a){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*kp,skewX:Math.atan(l)*kp,scaleX:s,scaleY:o}}var ws;function Pw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Rp:Lp(t.a,t.b,t.c,t.d,t.e,t.f)}function Uw(e){return e==null||(ws||(ws=document.createElementNS("http://www.w3.org/2000/svg","g")),ws.setAttribute("transform",e),!(e=ws.transform.baseVal.consolidate()))?Rp:(e=e.matrix,Lp(e.a,e.b,e.c,e.d,e.e,e.f))}function Dp(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function a(c,u,d,h,p,f){if(c!==d||u!==h){var v=p.push("translate(",null,t,null,n);f.push({i:v-4,x:Ae(c,d)},{i:v-2,x:Ae(u,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function s(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ae(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:Ae(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var v=p.push(i(p)+"scale(",null,",",null,")");f.push({i:v-4,x:Ae(c,d)},{i:v-2,x:Ae(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),a(c.translateX,c.translateY,u.translateX,u.translateY,d,h),s(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,v=h.length,m;++f<v;)d[(m=h[f]).i]=m.x(p);return d.join("")}}}var Bw=Dp(Pw,"px, ","px)","deg)"),Hw=Dp(Uw,", ",")",")"),Zr=0,ta=0,ea=0,Ip=1e3,Ss,na,Ts=0,yr=0,$s=0,ra=typeof performance=="object"&&performance.now?performance:Date,Np=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function fc(){return yr||(Np(Vw),yr=ra.now()+$s)}function Vw(){yr=0}function Ms(){this._call=this._time=this._next=null}Ms.prototype=Pp.prototype={constructor:Ms,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?fc():+n)+(t==null?0:+t),!this._next&&na!==this&&(na?na._next=this:Ss=this,na=this),this._call=e,this._time=n,mc()},stop:function(){this._call&&(this._call=null,this._time=1/0,mc())}};function Pp(e,t,n){var r=new Ms;return r.restart(e,t,n),r}function Fw(){fc(),++Zr;for(var e=Ss,t;e;)(t=yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zr}function Up(){yr=(Ts=ra.now())+$s,Zr=ta=0;try{Fw()}finally{Zr=0,jw(),yr=0}}function Gw(){var e=ra.now(),t=e-Ts;t>Ip&&($s-=t,Ts=e)}function jw(){for(var e,t=Ss,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:Ss=n);na=e,mc(r)}function mc(e){if(!Zr){ta&&(ta=clearTimeout(ta));var t=e-yr;t>24?(e<1/0&&(ta=setTimeout(Up,e-ra.now()-$s)),ea&&(ea=clearInterval(ea))):(ea||(Ts=ra.now(),ea=setInterval(Gw,Ip)),Zr=1,Np(Up))}}function Bp(e,t,n){var r=new Ms;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var zw=rc("start","end","cancel","interrupt"),Ww=[],Hp=0,Vp=1,gc=2,Cs=3,Fp=4,vc=5,As=6;function ks(e,t,n,r,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;qw(e,n,{name:t,index:r,group:i,on:zw,tween:Ww,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Hp})}function yc(e,t){var n=Je(e,t);if(n.state>Hp)throw new Error("too late; already scheduled");return n}function pn(e,t){var n=Je(e,t);if(n.state>Cs)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function qw(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Pp(a,0,n.time);function a(c){n.state=Vp,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,h,p;if(n.state!==Vp)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===Cs)return Bp(s);p.state===Fp?(p.state=As,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=As,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Bp(function(){n.state===Cs&&(n.state=Fp,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=gc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===gc){for(n.state=Cs,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=vc,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===vc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=As,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function bc(e,t){var n=e.__transition,r,i,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}i=r.state>gc&&r.state<vc,r.state=As,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function Yw(e){return this.each(function(){bc(this,e)})}function Zw(e,t){var n,r;return function(){var i=pn(this,e),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Xw(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=pn(this,e),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}a.tween=i}}function Kw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Je(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?Zw:Xw)(n,e,t))}function xc(e,t,n){var r=e._id;return e.each(function(){var i=pn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Je(i,r).value[t]}}function Gp(e,t){var n;return(typeof t=="number"?Ae:t instanceof Sn?Os:(n=Sn(t))?(t=n,Os):Cp)(e,t)}function Qw(e){return function(){this.removeAttribute(e)}}function Jw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tS(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===r?a:a=t(r=s,n)}}function eS(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?a:a=t(r=s,n)}}function nS(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function rS(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function iS(e,t){var n=vs(e),r=n==="transform"?Hw:Gp;return this.attrTween(e,typeof t=="function"?(n.local?rS:nS)(n,r,xc(this,"attr."+e,t)):t==null?(n.local?Jw:Qw)(n):(n.local?eS:tS)(n,r,t))}function aS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function sS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function oS(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&sS(e,a)),n}return i._value=t,i}function lS(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&aS(e,a)),n}return i._value=t,i}function cS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=vs(e);return this.tween(n,(r.local?oS:lS)(r,t))}function uS(e,t){return function(){yc(this,e).delay=+t.apply(this,arguments)}}function hS(e,t){return t=+t,function(){yc(this,e).delay=t}}function dS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uS:hS)(t,e)):Je(this.node(),t).delay}function pS(e,t){return function(){pn(this,e).duration=+t.apply(this,arguments)}}function fS(e,t){return t=+t,function(){pn(this,e).duration=t}}function mS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pS:fS)(t,e)):Je(this.node(),t).duration}function gS(e,t){if(typeof t!="function")throw new Error;return function(){pn(this,e).ease=t}}function vS(e){var t=this._id;return arguments.length?this.each(gS(t,e)):Je(this.node(),t).ease}function yS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pn(this,e).ease=n}}function bS(e){if(typeof e!="function")throw new Error;return this.each(yS(this._id,e))}function xS(e){typeof e!="function"&&(e=lp(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&o.push(l);return new Tn(r,this._parents,this._name,this._id)}function _S(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var l=t[o],c=n[o],u=l.length,d=s[o]=new Array(u),h,p=0;p<u;++p)(h=l[p]||c[p])&&(d[p]=h);for(;o<r;++o)s[o]=t[o];return new Tn(s,this._parents,this._name,this._id)}function ES(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function OS(e,t,n){var r,i,a=ES(t)?yc:pn;return function(){var s=a(this,e),o=s.on;o!==r&&(i=(r=o).copy()).on(t,n),s.on=i}}function wS(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(OS(n,e,t))}function SS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function TS(){return this.on("end.remove",SS(this._id))}function $S(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ac(e));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],l=o.length,c=a[s]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,ks(c[h],t,n,h,c,Je(u,n)));return new Tn(a,this._parents,t,n)}function MS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=op(e));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),p,f=Je(u,n),v=0,m=h.length;v<m;++v)(p=h[v])&&ks(p,t,n,v,h,f);a.push(h),s.push(u)}return new Tn(a,s,t,n)}var CS=Zi.prototype.constructor;function AS(){return new CS(this._groups,this._parents)}function kS(e,t){var n,r,i;return function(){var a=qr(this,e),s=(this.style.removeProperty(e),qr(this,e));return a===s?null:a===n&&s===r?i:i=t(n=a,r=s)}}function jp(e){return function(){this.style.removeProperty(e)}}function RS(e,t,n){var r,i=n+"",a;return function(){var s=qr(this,e);return s===i?null:s===r?a:a=t(r=s,n)}}function LS(e,t,n){var r,i,a;return function(){var s=qr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),qr(this,e))),s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o))}}function DS(e,t){var n,r,i,a="style."+t,s="end."+a,o;return function(){var l=pn(this,e),c=l.on,u=l.value[a]==null?o||(o=jp(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(s,i=u),l.on=r}}function IS(e,t,n){var r=(e+="")=="transform"?Bw:Gp;return t==null?this.styleTween(e,kS(e,r)).on("end.style."+e,jp(e)):typeof t=="function"?this.styleTween(e,LS(e,r,xc(this,"style."+e,t))).each(DS(this._id,e)):this.styleTween(e,RS(e,r,t),n).on("end.style."+e,null)}function NS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function PS(e,t,n){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&NS(e,s,n)),r}return a._value=t,a}function US(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,PS(e,t,n??""))}function BS(e){return function(){this.textContent=e}}function HS(e){return function(){var t=e(this);this.textContent=t??""}}function VS(e){return this.tween("text",typeof e=="function"?HS(xc(this,"text",e)):BS(e==null?"":e+""))}function FS(e){return function(t){this.textContent=e.call(this,t)}}function GS(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&FS(i)),t}return r._value=e,r}function jS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,GS(e))}function zS(){for(var e=this._name,t=this._id,n=zp(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,c=0;c<o;++c)if(l=s[c]){var u=Je(l,t);ks(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Tn(r,this._parents,e,n)}function WS(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};n.each(function(){var c=pn(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&a()})}var qS=0;function Tn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function zp(){return++qS}var $n=Zi.prototype;Tn.prototype={constructor:Tn,select:$S,selectAll:MS,selectChild:$n.selectChild,selectChildren:$n.selectChildren,filter:xS,merge:_S,selection:AS,transition:zS,call:$n.call,nodes:$n.nodes,node:$n.node,size:$n.size,empty:$n.empty,each:$n.each,on:wS,attr:iS,attrTween:cS,style:IS,styleTween:US,text:VS,textTween:jS,remove:TS,tween:Kw,delay:dS,duration:mS,ease:vS,easeVarying:bS,end:WS,[Symbol.iterator]:$n[Symbol.iterator]};function Wp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var YS={time:null,delay:0,duration:250,ease:Wp};function ZS(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function XS(e){var t,n;e instanceof Tn?(t=e._id,e=e._name):(t=zp(),(n=YS).time=fc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,c=0;c<o;++c)(l=s[c])&&ks(l,e,t,c,s,n||ZS(l,t));return new Tn(r,this._parents,e,t)}Zi.prototype.interrupt=Yw,Zi.prototype.transition=XS;function KS(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Rs(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 Xr(e){return e=Rs(Math.abs(e)),e?e[1]:NaN}function QS(e,t){return function(n,r){for(var i=n.length,a=[],s=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),a.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function JS(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var tT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ia(e){if(!(t=tT.exec(e)))throw new Error("invalid format: "+e);var t;return new _c({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]})}ia.prototype=_c.prototype;function _c(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+""}_c.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 eT(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var qp;function nT(e,t){var n=Rs(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(qp=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Rs(e,Math.max(0,t+a-1))[0]}function Yp(e,t){var n=Rs(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 Zp={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:KS,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)=>Yp(e*100,t),r:Yp,s:nT,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Xp(e){return e}var Kp=Array.prototype.map,Qp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function rT(e){var t=e.grouping===void 0||e.thousands===void 0?Xp:QS(Kp.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+"",a=e.numerals===void 0?Xp:JS(Kp.call(e.numerals,String)),s=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=ia(d);var h=d.fill,p=d.align,f=d.sign,v=d.symbol,m=d.zero,y=d.width,g=d.comma,x=d.precision,O=d.trim,E=d.type;E==="n"?(g=!0,E="g"):Zp[E]||(x===void 0&&(x=12),O=!0,E="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=v==="$"?n:v==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",A=v==="$"?r:/[%p]/.test(E)?s:"",I=Zp[E],R=/[defgprs%]/.test(E);x=x===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function L($){var F=w,P=A,H,_,C;if(E==="c")P=I($)+P,$="";else{$=+$;var k=$<0||1/$<0;if($=isNaN($)?l:I(Math.abs($),x),O&&($=eT($)),k&&+$==0&&f!=="+"&&(k=!1),F=(k?f==="("?f:o:f==="-"||f==="("?"":f)+F,P=(E==="s"?Qp[8+qp/3]:"")+P+(k&&f==="("?")":""),R){for(H=-1,_=$.length;++H<_;)if(C=$.charCodeAt(H),48>C||C>57){P=(C===46?i+$.slice(H+1):$.slice(H))+P,$=$.slice(0,H);break}}}g&&!m&&($=t($,1/0));var U=F.length+$.length+P.length,B=U<y?new Array(y-U+1).join(h):"";switch(g&&m&&($=t(B+$,B.length?y-P.length:1/0),B=""),p){case"<":$=F+$+P+B;break;case"=":$=F+B+$+P;break;case"^":$=B.slice(0,U=B.length>>1)+F+$+P+B.slice(U);break;default:$=B+F+$+P;break}return a($)}return L.toString=function(){return d+""},L}function u(d,h){var p=c((d=ia(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Xr(h)/3)))*3,v=Math.pow(10,-f),m=Qp[8+f/3];return function(y){return p(v*y)+m}}return{format:c,formatPrefix:u}}var Ls,Ec,Jp;iT({thousands:",",grouping:[3],currency:["$",""]});function iT(e){return Ls=rT(e),Ec=Ls.format,Jp=Ls.formatPrefix,Ls}function aT(e){return Math.max(0,-Xr(Math.abs(e)))}function sT(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xr(t)/3)))*3-Xr(Math.abs(e)))}function oT(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xr(t)-Xr(e))+1}function Kr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const tf=Symbol("implicit");function Ds(){var e=new np,t=[],n=[],r=tf;function i(a){let s=e.get(a);if(s===void 0){if(r!==tf)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new np;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Ds(t,n).unknown(r)},Kr.apply(i,arguments),i}function lT(e){return function(){return e}}function cT(e){return+e}var ef=[0,1];function Qr(e){return e}function Oc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:lT(isNaN(t)?NaN:.5)}function uT(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function hT(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Oc(i,r),a=n(s,a)):(r=Oc(r,i),a=n(a,s)),function(o){return a(r(o))}}function dT(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Oc(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var l=ec(e,o,1,r)-1;return a[l](i[l](o))}}function wc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function nf(){var e=ef,t=ef,n=Ji,r,i,a,s=Qr,o,l,c;function u(){var h=Math.min(e.length,t.length);return s!==Qr&&(s=uT(e[0],e[h-1])),o=h>2?dT:hT,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?a:(l||(l=o(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((c||(c=o(t,e.map(r),Ae)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,cT),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=Ap,u()},d.clamp=function(h){return arguments.length?(s=h?!0:Qr,u()):s!==Qr},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,p){return r=h,i=p,u()}}function rf(){return nf()(Qr,Qr)}function pT(e,t,n,r){var i=nc(e,t,n),a;switch(r=ia(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=sT(i,s))&&(r.precision=a),Jp(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=oT(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=aT(i))&&(r.precision=a-(r.type==="%")*2);break}}return Ec(r)}function af(e){var t=e.domain;return e.ticks=function(n){var r=t();return ms(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return pT(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],o=r[a],l,c,u=10;for(o<s&&(c=s,s=o,o=c,c=i,i=a,a=c);u-- >0;){if(c=Wr(s,o,n),c===l)return r[i]=s,r[a]=o,t(r);if(c>0)s=Math.floor(s/c)*c,o=Math.ceil(o/c)*c;else if(c<0)s=Math.ceil(s*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function tn(){var e=rf();return e.copy=function(){return wc(e,tn())},Kr.apply(e,arguments),af(e)}function Sc(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(l){return l!=null&&l<=l?i[ec(r,l,0,n)]:a}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return s}return s.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},s.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},s.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(a=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return Sc().domain([e,t]).range(i).unknown(a)},Kr.apply(af(s),arguments)}function aa(e,t,n){this.k=e,this.x=t,this.y=n}aa.prototype={constructor:aa,scale:function(e){return e===1?this:new aa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new aa(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+")"}},aa.prototype;const Ee="cds",Mn={opacity:{unselected:.05,selected:.4}},qn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Jr={duration:1e3,ease:Wp,zoomLevel:3},ti={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},sf={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Fe={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},fT={defaultBins:10},Yt={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}},Cn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},se={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Vt={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}},br={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},en={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},of={minCellDividerDimension:16,chartPadding:.5},lf={default:{size:24}},cf={defaultOffset:4,horizontalOffset:10},uf={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}},ke={height:{[qe.GRAPH_VIEW]:32,[qe.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},mT=[{type:ne.RADIUS,name:"Radius"},{type:ne.AREA,name:"Poor area"},{type:ne.AREA,name:"Satisfactory area"},{type:ne.AREA,name:"Great area"},{type:ne.QUARTILE,name:"Quartiles"}],ei={type:Ue.END_LINE,threshold:16,numCharacter:14},gT={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"}}},vT={enabled:!0,position:Ur.BOTTOM,clickable:!0,truncation:ei,alignment:te.LEFT,order:null,additionalItems:[]},yT={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},bT={enabled:!0},hf={enabled:!0,showTotal:!0,truncation:ei,groupLabel:"Group"},df={top:{visible:!0,includeZero:!0,truncation:ei},bottom:{visible:!0,includeZero:!0,truncation:ei},left:{visible:!0,includeZero:!0,truncation:ei},right:{visible:!0,includeZero:!0,truncation:ei}},Is={addSpaceOnEdges:1,showDayName:!1,localeObject:Wh,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 pf=!1;try{pf=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const ue={width:null,height:null,resizable:!0,theme:$l.WHITE,tooltip:hf,legend:vT,locale:gT,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:Tt.SHOW_AS_DATATABLE},...pf?[{type:Tt.MAKE_FULLSCREEN}]:[],{type:Tt.EXPORT_CSV},{type:Tt.EXPORT_PNG},{type:Tt.EXPORT_JPG}]}},ff=ct({},ue,{thematic:{projection:un.geoNaturalEarth1}}),sa=ct({},ue,{axes:df,timeScale:Is,grid:yT,ruler:bT,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:qe.GRAPH_VIEW}}}),xr=ct({},sa,{bars:{maxWidth:16,spacingFactor:.25},timeScale:ct(Is,{addSpaceOnEdges:1})}),xT=ct({},xr,{}),_T=ct({},xr,{}),ET=ct({},xr,{bars:ct({},xr.bars,{dividerSize:1.5})}),OT=ct({},xr,{}),Tc=ct({},sa,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),wT=Tc,mf=ct({},Tc,{points:{radius:3,filled:!1,enabled:!0}}),gf=ct({},mf,{timeScale:ct(Is,{addSpaceOnEdges:0})}),ST=gf,TT=ct({},sa,{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:ne.RADIUS,name:"Radius"}]}}),$T=ct({},sa,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:ne.AREA,name:"Poor area"},{type:ne.AREA,name:"Satisfactory area"},{type:ne.AREA,name:"Great area"},{type:ne.QUARTILE,name:"Quartiles"}]}}),MT=ct({},xr,{bars:{dividerSize:1.5},timeScale:ct(Is,{addSpaceOnEdges:0})}),CT=ct({},ue,{tooltip:ct({},hf,{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"}}),vf=ct({},ue,{pie:{labels:{formatter:null,enabled:!0},alignment:te.LEFT,sortFunction:null,valueMapsTo:"value"}}),AT=ct({},ue,{legend:{enabled:!1},gauge:{type:or.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:te.LEFT}}),kT=ct({},vf,{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:te.LEFT}}),yf=ct({},ue,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),RT=ct({},yf,{legend:{enabled:!0}}),LT=ct({},ue,{radar:{axes:{angle:"key",value:"value"},alignment:te.LEFT},tooltip:{gridline:{enabled:!0}}}),DT=ct({},xr,{comboChartTypes:[]}),IT=ct({tree:{type:Ka.TREE}},ue,{}),NT=ct({},ue,{data:ct(ue.data,{groupMapsTo:"name"})}),PT=ct({},ue,ti,{data:ct(ue.data,{groupMapsTo:"name"})}),UT=ct({},ue,{alluvial:{data:ct(ue.data,{groupMapsTo:"source"}),nodeAlignment:te.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),BT=ct({},ue,{axes:df,heatmap:{divider:{state:Hr.AUTO},colorLegend:{type:"linear"}}}),HT=ct({},ff,{choropleth:{colorLegend:{type:"linear"}}}),Pt={alluvialChart:UT,areaChart:gf,axisChart:sa,boxplotChart:OT,bubbleChart:TT,bulletChart:$T,chart:ue,circlePackChart:PT,choroplethChart:HT,comboChart:DT,donutChart:kT,gaugeChart:AT,groupedBarChart:_T,heatmapChart:BT,histogramChart:MT,lineChart:mf,lollipopChart:wT,meterChart:yf,pieChart:vf,proportionalMeterChart:RT,radarChart:LT,scatterChart:Tc,simpleBarChart:xT,stackedAreaChart:ST,stackedBarChart:ET,thematicChart:ff,treeChart:IT,treemapChart:NT,wordCloudChart:CT};function VT(e,t,n){let r=null;return function(...i){const a=this;a.mousePosition=mr(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(a,i)},t)}}function zt(e,t){var n;const r=wn(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 a in r.axes)if(i.includes(a)){const s=t.axes[a];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),s.mapsTo==null){const l=s.scaleType;l==null?s.mapsTo="value":l===tt.TIME?s.mapsTo="date":l===tt.LABELS&&(s.mapsTo="key")}}else delete r.axes[a];return Mc(r,t),ct(r,t)}function An(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 oa(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 $c(e,t,n="value",r=!1){const i=e/t.reduce((a,s)=>a+s[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function la(e,t,n){if(n>e.length)return e;if(t===Ue.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ue.FRONT_LINE)return"..."+e.substr(-n);if(t===Ue.END_LINE)return e.substr(0,n)+"..."}function Mc(e,t){const n=b(e,"legend","additionalItems"),r=b(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),a=n.map(o=>o.type),s=mT.filter(o=>a.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=s,t.legend.additionalItems=EE(s,r,"name")}}const b=(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},bf=(e,t)=>t===Jt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,me=(e,t)=>{const{x0:n,x1:r,y0:i,y1:a}=bf(e,t);return`M${n},${i}L${n},${a}L${r},${a}L${r},${i}L${n},${i}`};function kn(e,t,n){return n===Jt.VERTICAL?[e,t]:[t,e]}const xf=6048e5,FT=864e5,_f=6e4,Ef=36e5;function Of(e){const t=wt(e);return t.setHours(0,0,0,0),t}function wf(e){const t=wt(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 Sf(e,t){const n=Of(e),r=Of(t),i=+n-wf(n),a=+r-wf(r);return Math.round((i-a)/FT)}function nn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function GT(e){const t=wt(e),n=nn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function jT(e){const t=wt(e);return Sf(t,GT(t))+1}function Ns(e){return Ni(e,{weekStartsOn:1})}function Tf(e){const t=wt(e),n=t.getFullYear(),r=nn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Ns(r),a=nn(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=Ns(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function zT(e){const t=Tf(e),n=nn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ns(n)}function WT(e){const t=wt(e),n=+Ns(t)-+zT(t);return Math.round(n/xf)+1}function $f(e,t){var n,r,i,a;const s=wt(e),o=s.getFullYear(),l=ts(),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??((a=(i=l.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,u=nn(e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=Ni(u,t),h=nn(e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=Ni(h,t);return s.getTime()>=d.getTime()?o+1:s.getTime()>=p.getTime()?o:o-1}function qT(e,t){var n,r,i,a;const s=ts(),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)??s.firstWeekContainsDate??((a=(i=s.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,l=$f(e,t),c=nn(e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),Ni(c,t)}function YT(e,t){const n=wt(e),r=+Ni(n,t)-+qT(n,t);return Math.round(r/xf)+1}function kt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Yn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return kt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):kt(n+1,2)},d(e,t){return kt(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 kt(e.getHours()%12||12,t.length)},H(e,t){return kt(e.getHours(),t.length)},m(e,t){return kt(e.getMinutes(),t.length)},s(e,t){return kt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return kt(i,t.length)}},ni={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Mf={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 Yn.y(e,t)},Y:function(e,t,n,r){const i=$f(e,r),a=i>0?i:1-i;if(t==="YY"){const s=a%100;return kt(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):kt(a,t.length)},R:function(e,t){const n=Tf(e);return kt(n,t.length)},u:function(e,t){const n=e.getFullYear();return kt(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 kt(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 kt(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 Yn.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 kt(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=YT(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):kt(i,t.length)},I:function(e,t,n){const r=WT(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):kt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Yn.d(e,t)},D:function(e,t,n){const r=jT(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):kt(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(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return kt(a,2);case"eo":return n.ordinalNumber(a,{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(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return kt(a,t.length);case"co":return n.ordinalNumber(a,{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 kt(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=ni.noon:r===0?i=ni.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=ni.evening:r>=12?i=ni.afternoon:r>=4?i=ni.morning:i=ni.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 Yn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Yn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Yn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Yn.s(e,t)},S:function(e,t){return Yn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Af(r);case"XXXX":case"XX":return _r(r);case"XXXXX":case"XXX":default:return _r(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Af(r);case"xxxx":case"xx":return _r(r);case"xxxxx":case"xxx":default:return _r(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Cf(r,":");case"OOOO":default:return"GMT"+_r(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Cf(r,":");case"zzzz":default:return"GMT"+_r(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return kt(r,t.length)},T:function(e,t,n){const r=e.getTime();return kt(r,t.length)}};function Cf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+kt(a,2)}function Af(e,t){return e%60===0?(e>0?"-":"+")+kt(Math.abs(e)/60,2):_r(e,t)}function _r(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=kt(Math.trunc(r/60),2),a=kt(r%60,2);return n+i+t+a}const kf=(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"})}},Rf=(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"})}},ZT=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return kf(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",kf(r,t)).replace("{{time}}",Rf(i,t))},XT={p:Rf,P:ZT},KT=/^D+$/,QT=/^Y+$/,JT=["D","DD","YY","YYYY"];function t$(e){return KT.test(e)}function e$(e){return QT.test(e)}function n$(e,t,n){const r=r$(e,t,n);if(console.warn(r),JT.includes(e))throw new RangeError(r)}function r$(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 i$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function a$(e){if(!i$(e)&&typeof e!="number")return!1;const t=wt(e);return!isNaN(Number(t))}const s$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,o$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,l$=/^'([^]*?)'?$/,c$=/''/g,u$=/[a-zA-Z]/;function Cc(e,t,n){var r,i,a,s,o,l,c,u;const d=ts(),h=(n==null?void 0:n.locale)??d.locale??Wh,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??((s=(a=d.locale)==null?void 0:a.options)==null?void 0:s.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,v=wt(e);if(!a$(v))throw new RangeError("Invalid time value");let m=t.match(o$).map(g=>{const x=g[0];if(x==="p"||x==="P"){const O=XT[x];return O(g,h.formatLong)}return g}).join("").match(s$).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const x=g[0];if(x==="'")return{isToken:!1,value:h$(g)};if(Mf[x])return{isToken:!0,value:g};if(x.match(u$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:g}});h.localize.preprocessor&&(m=h.localize.preprocessor(v,m));const y={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(g=>{if(!g.isToken)return g.value;const x=g.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&e$(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&t$(x))&&n$(x,t,String(e));const O=Mf[x[0]];return O(v,x,h.localize,y)}).join("")}function h$(e){const t=e.match(l$);return t?t[1].replace(c$,"'"):e}const Ac=[["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 Lf(e,t,n,r,i){const a=t===0,s=Number(Cc(new Date(e),"c"))===2,o=Number(Cc(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return a||Us(e)||ca(e,l)||Zn(e);case"minute":return a||Us(e)||ca(e,l)||Zn(e);case"30minutes":return a||Us(e)||ca(e,l)||Zn(e);case"hourly":return a||Us(e)||ca(e,l)||Zn(e);case"daily":return i?a||s||Zn(e):a||ca(e,l)||Zn(e);case"weekly":return a||s||Zn(e);case"monthly":return a||Zn(e);case"quarterly":return a||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function kc(e,t,n,r,i,a){const s=i.showDayName,o=r==="daily"&&s?"weekly":r,l=new Date(e),c=b(i,"timeIntervalFormats")[o],u=b(c,"primary"),d=b(c,"secondary"),h=Lf(e,t,n,r,s);let p=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(p=p.replace("pp","h:mm:ss.SSS a"));const f=i.localeObject,{code:v,optionsObject:m}=a,y=m[r].type,g=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!g){const x=Cc(l,p,{locale:f}).split("").map(O=>{const E=Number(O);return O!==" "&&!Number.isNaN(E)?E.toLocaleString(v):O});return a[y](l,v,{},x.join(""))}else return a[y](l,v,g)}function Ps(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function d$(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function p$(e){const t=Ac.reduce((n,[,r],i)=>{const a=Ac[n][1],s=Math.abs(a-e),o=Math.abs(r-e);return s<o?n:i},0);return Ac[t][0]}function Rc(e,t){if(zh[t])return t;if(e.length===1)return"15seconds";const n=d$(e),r=Wn(n);return p$(r)}function Us(e){const{s:t,m:n,H:r}=Ps(e);return r===0&&n===0&&t===0}function ca(e,t){const n=Ps(e).M,r=Ps(t).M;return n!==r}function Zn(e){const{M:t,d:n,s:r,m:i,H:a}=Ps(e);return t===1&&n===1&&a===0&&i===0&&r===0}function Df(e){return e===void 0?"":e.toISOString()}function If(e){const t=Ke(e,r=>r.value),n=tn().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 Nf(e,t){const n=b(t,"gradient","colors"),r=!Xe(n);let i=b(t,"pairing","option");const a=If(e),s=a[0]<0&&a[1]>0?"diverge":"mono";(i<1&&i>4&&s==="mono"||i<1&&i>2&&s==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=s==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${s}-${i}-${c}`)}return Sc().domain(a).range(o)}var pt=(e=>(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))(pt||{});function f$(e,t){return e&&Qd(e,t,Hi)}function m$(e,t){return function(n,r){if(n==null)return n;if(!hr(n))return e(n,r);for(var i=n.length,a=-1,s=Object(n);++a<i&&r(s[a],a,s)!==!1;);return n}}var Lc=m$(f$);function ft(e){return function(){return e}}var g$=Array.prototype.slice;function Bs(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function v$(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var s=e[i];t(r,s,n(s),e)}return r}function y$(e,t,n,r){return Lc(e,function(i,a,s){t(r,i,n(i),s)}),r}function b$(e,t){return function(n,r){var i=ae(n)?v$:y$,a={};return i(n,e,ps(r),a)}}function x$(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var _$=Object.prototype,E$=_$.hasOwnProperty,O$=b$(function(e,t,n){E$.call(e,n)?e[n].push(t):rs(e,n,[t])});function w$(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function S$(e){return e}function T$(e=pr){if(e===pr)return Pf;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 Pf(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var $$=Array.prototype,M$=$$.slice;function Dc(e){return()=>e}function C$(e,t,n){let r;for(;;){const i=Wr(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 A$(e){return Math.max(1,Math.ceil(Math.log(w$(e))/Math.LN2)+1)}function k$(){var e=S$,t=Ke,n=A$;function r(i){Array.isArray(i)||(i=Array.from(i));var a,s=i.length,o,l,c=new Array(s);for(a=0;a<s;++a)c[a]=e(i[a],a,i);var u=t(c),d=u[0],h=u[1],p=n(c,d,h);if(!Array.isArray(p)){const x=h,O=+p;if(t===Ke&&([d,h]=C$(d,h,O)),p=ms(d,h,O),p[0]<=d&&(l=Wr(d,h,O)),p[p.length-1]>=h)if(x>=h&&t===Ke){const E=Wr(d,h,O);isFinite(E)&&(E>0?h=(Math.floor(h/E)+1)*E:E<0&&(h=(Math.ceil(h*-E)+1)/-E))}else p.pop()}for(var f=p.length,v=0,m=f;p[v]<=d;)++v;for(;p[m-1]>h;)--m;(v||m<f)&&(p=p.slice(v,m),f=m-v);var y=new Array(f+1),g;for(a=0;a<=f;++a)g=y[a]=[],g.x0=a>0?p[a-1]:d,g.x1=a<f?p[a]:h;if(isFinite(l)){if(l>0)for(a=0;a<s;++a)(o=c[a])!=null&&d<=o&&o<=h&&y[Math.min(f,Math.floor((o-d)/l))].push(i[a]);else if(l<0){for(a=0;a<s;++a)if((o=c[a])!=null&&d<=o&&o<=h){const x=Math.floor((d-o)*l);y[Math.min(f,x+(p[x]<=o))].push(i[a])}}}else for(a=0;a<s;++a)(o=c[a])!=null&&d<=o&&o<=h&&y[ec(p,o,0,f)].push(i[a]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Dc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Dc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Dc(Array.isArray(i)?M$.call(i):i),r):n},r}function Uf(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Pf:T$(i);r>n;){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));Uf(e,t,p,f,i)}const a=e[t];let s=n,o=r;for(ua(e,n,t),i(e[r],a)>0&&ua(e,n,r);s<o;){for(ua(e,s,o),++s,--o;i(e[s],a)<0;)++s;for(;i(e[o],a)>0;)--o}i(e[n],a)===0?ua(e,n,o):(++o,ua(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ua(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ic(e,t,n){if(e=Float64Array.from(TE(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Wn(e);if(t>=1)return fr(e);var r,i=(r-1)*t,a=Math.floor(i),s=fr(Uf(e,a).subarray(0,a+1)),o=Wn(e.subarray(a+1));return s+(o-s)*(i-a)}}function Bf(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Hf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function R$(e,t){return e[t]}function L$(e){const t=[];return t.key=e,t}function Nc(){var e=ft([]),t=Hf,n=Bf,r=R$;function i(a){var s=Array.from(e.apply(this,arguments),L$),o,l=s.length,c=-1,u;for(const d of a)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(d,s[o].key,c,a)]).data=d;for(o=0,u=Bs(t(s));o<l;++o)s[u[o]].index=o;return n(s,u),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ft(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ft(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Hf:typeof a=="function"?a:ft(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Bf,i):n},i}function D$(e,t){if((l=e.length)>0)for(var n,r=0,i,a,s,o,l,c=e[t[0]].length;r<c;++r)for(s=o=0,n=0;n<l;++n)(a=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=s,i[1]=s+=a):a<0?(i[1]=o,i[0]=o+=a):(i[0]=0,i[1]=a)}function I$(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class fn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:a,number:s}=b(r,"locale"),o=b(r,"tabularRepModal","tableHeadingFormatter"),l=b(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===tt.TIME&&(d=h=>a(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]=s(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:a}=b(n,"data"),s=b(n,"axes");return t&&(r=r.filter(o=>t.includes(o[a]))),s&&Object.keys(s).forEach(o=>{const l=s[o].mapsTo,c=s[o].scaleType;if((c===tt.LINEAR||c===tt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&s[o].domain)if(c===tt.LABELS)r=r.filter(u=>s[o].domain.includes(u[l]));else{const[u,d]=s[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[a]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Yt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>r.find(s=>s.name===a[i]&&s.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(wn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Yt.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 O$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),a=n.axes[r],{groupMapsTo:s}=n.data,{bins:o=fT.defaultBins}=a,l=Array.isArray(o),c=k$().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[s]))),h=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,v=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:v[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(),a=this.getDataValuesGroupedByKeys({bins:i});return Nc().keys(r)(a).map((s,o)=>Object.keys(s).filter(l=>!isNaN(l)).map(l=>{const c=s[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(a=>{const s=a[i];r[s]!==null&&r[s]!==void 0?r[s].push(a):r[s]=[a]}),Object.keys(r).map(a=>({name:a,data:r[a]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let a;t?a=t.map(l=>`${l.x0}:${l.x1}`):a=Yi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Df(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const s=this.services.cartesianScales.domainAxisPosition,o=r.axes[s].scaleType;return o===tt.TIME?a.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===tt.LOG||o===tt.LINEAR)&&a.sort((l,c)=>l-c),a}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.getDisplayData(n),s=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 s.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return s.forEach(u=>{const d=a.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Df(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:a}=i.data,s=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=x$(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{s.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{s.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Nc().offset(D$):Nc()).keys(s)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[a]=s[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();Mc(n,t),this.set({options:ct(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(S.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Yt.items.status,i=this.getDataGroups(),a=i.some(c=>c.status===r),s=i.filter(c=>c.status===n);if(a)if(s.length===1&&s[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(S.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const a=this.getOptions();return a.getIsFilled?a.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),a=b(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,a):a}getStrokeColor(t,n,r){const i=this.getOptions(),a=b(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,a):a}isUserProvidedColorScaleValid(){const t=b(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(a=>{a.data.forEach((s,o)=>{let l;const c=b(a,"label");if(c===null){const d=b(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(s)?(u.value=s.value,u.date=s.date):u.value=s,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(a=>a.map(s=>`"${(s==="&ndash;"?"–":s).split(/[,;'"`]/).map(o=>I$(o)).join("")}"`)).map(a=>a.join(",")).join(`
2
- `),n=this.getOptions();let r="myChart";const i=b(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}=Yt.items.status,a=this.getOptions(),s=Yi(t.map(l=>l[n]));a.data.selectedGroups.length&&(a.data.selectedGroups.every(l=>s.includes(l))||(a.data.selectedGroups=[]));const o=l=>!a.data.selectedGroups.length||a.data.selectedGroups.includes(l)?r:i;return s.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=b(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=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=b(t,"option");const i=sf.pairingOptions,a=n>5?14:n,s=`${a}-color`;r=r<=i[s]?r:1;const o=this.allDataGroups.map((l,c)=>`${a}-${r}-${c%14+1}`);this.colorClassNames=Ds().range(o).domain(this.allDataGroups)}}class Er extends fn{constructor(t){super(t),this.axisFlavor=Li.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(a=>{const s=i[a];t.scales[s]?i[a]={position:s,label:t.getScaleLabel(s),identifier:b(n,"axes",s,"mapsTo")}:i[a]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:a,secondaryDomain:s,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=b(this.getOptions(),"locale"),u=["Group",i.label,a.label,...s?[s.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"&ndash;":l(h[a.identifier],c),...s?[h[s.identifier]===null?"&ndash;":h[s.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",G.TOP,"enabled"))){const r=b(this.getOptions(),"zoomBar",G.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(wn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const a=i.getDomainIdentifier(),s=i.getRangeIdentifier();let o=n.map(l=>l[a].getTime());o=Yi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[a].getTime()===l&&(c+=d[s])}),u[a]=new Date(l),u[s]=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(G).forEach(i=>{const a=G[i],s=n.axes[a];if(s&&s.scaleType===tt.TIME){const o=s.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(a=>{b(i,a,"getTime")===null&&(i[a]=new Date(i[a]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}class N$ extends Er{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale");t.sort((s,o)=>s.source.localeCompare(o.source));const i=["Source","Target","Value"],a=[...t.map(s=>[s.source,s.target,s.value===null?"&ndash;":n(s.value,r)])];return super.formatTable({headers:i,cells:a})}}class P$ extends Er{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Ic(t,.25),q_50:Ic(t,.5),q_75:Ic(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:a,data:s}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=s.map(x=>x[o]).sort(pr),c={[n]:a,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,v=[],m=[];for(const x of l)x<p||x>f?v.push(x):m.push(x);c.outliers=v;const y=Wn(m),g=fr(m);c.whiskers={min:y||Wn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:g||fr([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:a}=b(t,"locale"),s=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=b(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],b(l,"whiskers","min")!==null?i(b(l,"whiskers","min"),a):"&ndash;",b(l,"quartiles","q_25")!==null?i(b(l,"quartiles","q_25"),a):"&ndash;",b(l,"quartiles","q_50")!==null?i(b(l,"quartiles","q_50"),a):"&ndash;",b(l,"quartiles","q_75")!==null?i(b(l,"quartiles","q_75"),a):"&ndash;",b(l,"whiskers","max")!==null?i(b(l,"whiskers","max"),a):"&ndash;",b(l,"quartiles","q_75")!==null&&b(l,"quartiles","q_25")!==null?(i(b(l,"quartiles","q_75")-b(l,"quartiles","q_25")),a):"&ndash;",c.map(u=>i(u,a)).join(",")]})];return super.formatTable({headers:s,cells:o})}setColorClassNames(){const t=b(this.getOptions(),"color","pairing");let n=b(t,"option");const r=sf.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Ds().range(i).domain(this.allDataGroups)}}class U$ extends Er{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:a,code:s}=b(n,"locale"),o=b(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":a(u.value,s),b(u,"marker")===null?"&ndash;":a(u.marker,s),b(u,"marker")===null?"&ndash;":`${a(Math.floor(u[i]/u.marker*100),s)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}}let B$=class extends fn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Xe(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Xe(n)&&!Xe(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}=b(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],a=[...t.map(s=>[s.id===null?"&ndash;":s.id,s.name,s.value===null?"&ndash;":n(s.value,r)])];return super.formatTable({headers:i,cells:a})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=Nf(this.getDisplayData(),t)}},H$=class extends fn{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=ct({},t,this.getZoomOptions(t));Mc(n,r);const i=this.getHierarchyLevel(),a=b(n,"circlePack","depth");this.set({options:ct(n,r),depth:a&&a<4?a:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&b(n,0,"children")?b(n,0,"children"):n;let a=this.getHierarchyLevel();return i.some(s=>{if(s.children&&s.children.some(o=>o.children))return a=3,!1}),b(r,"canvasZoom","enabled")===!0&&a>2?{legend:{additionalItems:[{type:ne.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(a=>{const s=a[r];return this.setChildrenDataGroup(a,s)});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}=b(this.getOptions(),"locale"),i=["Child","Parent","Value"],a=[];return t.forEach(s=>{let o=s.value?s.value:0;s.children&&(o+=this.getChildrenDatums(s.children,s.name,a,0)),a.push(["&ndash;",s.name,n(o,r)])}),super.formatTable({headers:i,cells:a})}getChildrenDatums(t,n,r=[],i=0){const a=n,{number:s,code:o}=b(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,a,s(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,a,s(d,o)])}}),i}},V$=class extends fn{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:a,code:s}=b(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":a(c[i],s)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}};class F$ extends fn{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:a}=b(this.getOptions(),"locale"),s=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,a)])];return super.formatTable({headers:s,cells:o})}}class G$ extends Er{constructor(t){super(t),this.axisFlavor=Li.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==tt.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==tt.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==tt.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==tt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ke(this.getDisplayData(),r=>r.value),n=tn().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(Xe(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),a=n.getCustomDomainValuesByposition(i);if(a)return a;this._domains=Array.from(new Set(t.map(s=>s[r])))}return this._domains}getUniqueRanges(){if(Xe(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),a=n.getCustomDomainValuesByposition(i);if(a)return a;this._ranges=Array.from(new Set(t.map(s=>s[r])))}return this._ranges}getMatrix(){if(Xe(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),a={};n.forEach(s=>{a[s]={value:null,index:-1}}),t.forEach(s=>{this._matrix[s]=wn(a)}),this.getDisplayData().forEach((s,o)=>{this._matrix[s[r]][s[i]]={value:s.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(wn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Xe(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),a=[];return t.forEach(s=>{n.forEach(o=>{const l={value:this._matrix[s][o].value,index:this._matrix[s][o].index};l[r]=s,l[i]=o,a.push(l)})}),a}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:a}=b(this.getOptions(),"locale"),s=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,a)])];return super.formatTable({headers:s,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),r=!Xe(n);let i=b(t,"color","pairing","option");const a=this.getValueDomain(),s=a[0]<0&&a[1]>0?"diverge":"mono";(i<1&&i>4&&s==="mono"||i<1&&i>2&&s==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=s==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${s}-${i}-${u}`)}this._colorScale=Sc().domain(a).range(o);const l=b(this.getOptions(),"color");this._colorScale=Nf(this.getDisplayData(),l)}}let j$=class extends Er{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=b(this.getOptions(),"locale"),a=this.getBinnedStackedData(),s=[Et(t,"bins.rangeLabel")||"Range",...a.map(l=>Et(l,`0.${n}`))],o=[...Et(a,0).map((l,c)=>[`${r(Number(Et(l,"data.x0")),i)} – ${r(Number(Et(l,"data.x1")),i)}`,...a.map(u=>r(Et(u[c],`data.${Et(u[c],n)}`),i))])];return super.formatTable({headers:s,cells:o})}};class z$ extends fn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=b(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),r=(n==null?void 0:n.reduce((s,o)=>s+o.value,0))??0,i=b(t,"meter","proportional")?r:r>100?100:r,a=b(t,"meter","status","ranges");if(a){const s=a.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(s.length>0)return s[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),a=b(n,"meter","proportional"),{number:s,code:o}=b(this.getOptions(),"locale");let l=[],c=[],u;if(a===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":s(d.value,o),...i?[i]:[]]]}else u=b(a,"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?"&ndash;":s(p,o),s(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}class W$ extends Er{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=b(t,"radar","axes"),{number:a,code:s}=b(t,"locale"),o=b(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>b(u,"data",h,i)!==null?a(b(u,"data",h,i),s):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}let q$=class extends fn{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,"&ndash;"])}),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 Y$ extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Child","Group","Value"],a=[];return t.forEach(s=>{Array.isArray(s.children)?s.children.forEach(o=>{a.push([o.name,s.name,o.value===null?"&ndash;":n(o.value,r)])}):b(s.name)!==null&&b(s.value)&&a.push(["–",s.name,n(s.value,r)])}),super.formatTable({headers:i,cells:a})}}let Z$=class extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:a}=n.data,{code:s,number:o}=b(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[a],o(u[r],s)])];return super.formatTable({headers:l,cells:c})}};var X$=/\s/;function K$(e){for(var t=e.length;t--&&X$.test(e.charAt(t)););return t}var Q$=/^\s+/;function J$(e){return e&&e.slice(0,K$(e)+1).replace(Q$,"")}var Vf=NaN,tM=/^[-+]0x[0-9a-f]+$/i,eM=/^0b[01]+$/i,nM=/^0o[0-7]+$/i,rM=parseInt;function ri(e){if(typeof e=="number")return e;if(es(e))return Vf;if(He(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=He(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=J$(e);var n=eM.test(e);return n||nM.test(e)?rM(e.slice(2),n?2:8):tM.test(e)?Vf:+e}var Pc=function(){return Ye.Date.now()},iM="Expected a function",aM=Math.max,sM=Math.min;function Hs(e,t,n){var r,i,a,s,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(iM);t=ri(t)||0,He(n)&&(u=!!n.leading,d="maxWait"in n,a=d?aM(ri(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(w){var A=r,I=i;return r=i=void 0,c=w,s=e.apply(I,A),s}function f(w){return c=w,o=setTimeout(y,t),u?p(w):s}function v(w){var A=w-l,I=w-c,R=t-A;return d?sM(R,a-I):R}function m(w){var A=w-l,I=w-c;return l===void 0||A>=t||A<0||d&&I>=a}function y(){var w=Pc();if(m(w))return g(w);o=setTimeout(y,v(w))}function g(w){return o=void 0,h&&r?p(w):(r=i=void 0,s)}function x(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function O(){return o===void 0?s:g(Pc())}function E(){var w=Pc(),A=m(w);if(r=arguments,i=this,l=w,A){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(y,t),p(l)}return o===void 0&&(o=setTimeout(y,t)),s}return E.cancel=x,E.flush=O,E}function oM(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,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function D(e){return typeof e=="string"?new Ce([[document.querySelector(e)]],[document.documentElement]):new Ce([[e]],vp)}function ha(){var e=Ds().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,p=i<r,f=p?i:r,v=p?r:i;a=(v-f)/Math.max(1,h-l+c*2),o&&(a=Math.floor(a)),f+=(v-f-a*(h-l))*u,s=a*(1-l),o&&(f=Math.round(f),s=Math.round(s));var m=oM(h).map(function(y){return f+a*y});return n(p?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return ha(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Kr.apply(d(),arguments)}function Ff(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}const Uc=new Date,Bc=new Date;function re(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let c;do l.push(c=new Date(+a)),t(a,o),e(a);while(c<a&&a<s);return l},i.filter=a=>re(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(Uc.setTime(+a),Bc.setTime(+s),e(Uc),e(Bc),Math.floor(n(Uc,Bc))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Vs=re(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Vs.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?re(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Vs),Vs.range;const Rn=1e3,Ge=Rn*60,Ln=Ge*60,Dn=Ln*24,Hc=Dn*7,Gf=Dn*30,Vc=Dn*365,ii=re(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rn)},(e,t)=>(t-e)/Rn,e=>e.getUTCSeconds());ii.range;const Fc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getMinutes());Fc.range,re(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getUTCMinutes()).range;const Gc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn-e.getMinutes()*Ge)},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getHours());Gc.range,re(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getUTCHours()).range;const da=re(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ge)/Dn,e=>e.getDate()-1);da.range;const jc=re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dn,e=>e.getUTCDate()-1);jc.range,re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dn,e=>Math.floor(e/Dn)).range;function Or(e){return re(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())*Ge)/Hc)}const Fs=Or(0),Gs=Or(1),lM=Or(2),cM=Or(3),ai=Or(4),uM=Or(5),hM=Or(6);Fs.range,Gs.range,lM.range,cM.range,ai.range,uM.range,hM.range;function wr(e){return re(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)/Hc)}const jf=wr(0),js=wr(1),dM=wr(2),pM=wr(3),si=wr(4),fM=wr(5),mM=wr(6);jf.range,js.range,dM.range,pM.range,si.range,fM.range,mM.range;const zc=re(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());zc.range,re(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 In=re(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());In.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)}),In.range;const Sr=re(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());Sr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)}),Sr.range;function gM(e,t,n,r,i,a){const s=[[ii,1,Rn],[ii,5,5*Rn],[ii,15,15*Rn],[ii,30,30*Rn],[a,1,Ge],[a,5,5*Ge],[a,15,15*Ge],[a,30,30*Ge],[i,1,Ln],[i,3,3*Ln],[i,6,6*Ln],[i,12,12*Ln],[r,1,Dn],[r,2,2*Dn],[n,1,Hc],[t,1,Gf],[t,3,3*Gf],[e,1,Vc]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const p=d&&typeof d.range=="function"?d:l(c,u,d),f=p?p.range(c,+u+1):[];return h?f.reverse():f}function l(c,u,d){const h=Math.abs(u-c)/d,p=tc(([,,m])=>m).right(s,h);if(p===s.length)return e.every(nc(c/Vc,u/Vc,d));if(p===0)return Vs.every(Math.max(nc(c,u,d),1));const[f,v]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return f.every(v)}return[o,l]}const[vM,yM]=gM(In,zc,Fs,da,Gc,Fc);function Wc(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function qc(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function pa(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function bM(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,c=fa(i),u=ma(i),d=fa(a),h=ma(a),p=fa(s),f=ma(s),v=fa(o),m=ma(o),y=fa(l),g=ma(l),x={a:k,A:U,b:B,B:X,c:null,d:Xf,e:Xf,f:FM,g:QM,G:tC,H:BM,I:HM,j:VM,L:Kf,m:GM,M:jM,p:Y,q:ot,Q:rm,s:im,S:zM,u:WM,U:qM,V:YM,w:ZM,W:XM,x:null,X:null,y:KM,Y:JM,Z:eC,"%":nm},O={a:it,A:xt,b:at,B:K,c:null,d:Jf,e:Jf,f:aC,g:mC,G:vC,H:nC,I:rC,j:iC,L:tm,m:sC,M:oC,p:et,q:mt,Q:rm,s:im,S:lC,u:cC,U:uC,V:hC,w:dC,W:pC,x:null,X:null,y:fC,Y:gC,Z:yC,"%":nm},E={a:L,A:$,b:F,B:P,c:H,d:Yf,e:Yf,f:IM,g:qf,G:Wf,H:Zf,I:Zf,j:kM,L:DM,m:AM,M:RM,p:R,q:CM,Q:PM,s:UM,S:LM,u:wM,U:SM,V:TM,w:OM,W:$M,x:_,X:C,y:qf,Y:Wf,Z:MM,"%":NM};x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),O.x=w(n,O),O.X=w(r,O),O.c=w(t,O);function w(q,J){return function(dt){var j=[],It=-1,gt=0,qt=q.length,jt,nt,Mt;for(dt instanceof Date||(dt=new Date(+dt));++It<qt;)q.charCodeAt(It)===37&&(j.push(q.slice(gt,It)),(nt=zf[jt=q.charAt(++It)])!=null?jt=q.charAt(++It):nt=jt==="e"?" ":"0",(Mt=J[jt])&&(jt=Mt(dt,nt)),j.push(jt),gt=It+1);return j.push(q.slice(gt,It)),j.join("")}}function A(q,J){return function(dt){var j=pa(1900,void 0,1),It=I(j,q,dt+="",0),gt,qt;if(It!=dt.length)return null;if("Q"in j)return new Date(j.Q);if("s"in j)return new Date(j.s*1e3+("L"in j?j.L:0));if(J&&!("Z"in j)&&(j.Z=0),"p"in j&&(j.H=j.H%12+j.p*12),j.m===void 0&&(j.m="q"in j?j.q:0),"V"in j){if(j.V<1||j.V>53)return null;"w"in j||(j.w=1),"Z"in j?(gt=qc(pa(j.y,0,1)),qt=gt.getUTCDay(),gt=qt>4||qt===0?js.ceil(gt):js(gt),gt=jc.offset(gt,(j.V-1)*7),j.y=gt.getUTCFullYear(),j.m=gt.getUTCMonth(),j.d=gt.getUTCDate()+(j.w+6)%7):(gt=Wc(pa(j.y,0,1)),qt=gt.getDay(),gt=qt>4||qt===0?Gs.ceil(gt):Gs(gt),gt=da.offset(gt,(j.V-1)*7),j.y=gt.getFullYear(),j.m=gt.getMonth(),j.d=gt.getDate()+(j.w+6)%7)}else("W"in j||"U"in j)&&("w"in j||(j.w="u"in j?j.u%7:"W"in j?1:0),qt="Z"in j?qc(pa(j.y,0,1)).getUTCDay():Wc(pa(j.y,0,1)).getDay(),j.m=0,j.d="W"in j?(j.w+6)%7+j.W*7-(qt+5)%7:j.w+j.U*7-(qt+6)%7);return"Z"in j?(j.H+=j.Z/100|0,j.M+=j.Z%100,qc(j)):Wc(j)}}function I(q,J,dt,j){for(var It=0,gt=J.length,qt=dt.length,jt,nt;It<gt;){if(j>=qt)return-1;if(jt=J.charCodeAt(It++),jt===37){if(jt=J.charAt(It++),nt=E[jt in zf?J.charAt(It++):jt],!nt||(j=nt(q,dt,j))<0)return-1}else if(jt!=dt.charCodeAt(j++))return-1}return j}function R(q,J,dt){var j=c.exec(J.slice(dt));return j?(q.p=u.get(j[0].toLowerCase()),dt+j[0].length):-1}function L(q,J,dt){var j=p.exec(J.slice(dt));return j?(q.w=f.get(j[0].toLowerCase()),dt+j[0].length):-1}function $(q,J,dt){var j=d.exec(J.slice(dt));return j?(q.w=h.get(j[0].toLowerCase()),dt+j[0].length):-1}function F(q,J,dt){var j=y.exec(J.slice(dt));return j?(q.m=g.get(j[0].toLowerCase()),dt+j[0].length):-1}function P(q,J,dt){var j=v.exec(J.slice(dt));return j?(q.m=m.get(j[0].toLowerCase()),dt+j[0].length):-1}function H(q,J,dt){return I(q,t,J,dt)}function _(q,J,dt){return I(q,n,J,dt)}function C(q,J,dt){return I(q,r,J,dt)}function k(q){return s[q.getDay()]}function U(q){return a[q.getDay()]}function B(q){return l[q.getMonth()]}function X(q){return o[q.getMonth()]}function Y(q){return i[+(q.getHours()>=12)]}function ot(q){return 1+~~(q.getMonth()/3)}function it(q){return s[q.getUTCDay()]}function xt(q){return a[q.getUTCDay()]}function at(q){return l[q.getUTCMonth()]}function K(q){return o[q.getUTCMonth()]}function et(q){return i[+(q.getUTCHours()>=12)]}function mt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var J=w(q+="",x);return J.toString=function(){return q},J},parse:function(q){var J=A(q+="",!1);return J.toString=function(){return q},J},utcFormat:function(q){var J=w(q+="",O);return J.toString=function(){return q},J},utcParse:function(q){var J=A(q+="",!0);return J.toString=function(){return q},J}}}var zf={"-":"",_:" ",0:"0"},ie=/^\s*\d+/,xM=/^%/,_M=/[\\^$*+?|[\]().{}]/g;function St(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function EM(e){return e.replace(_M,"\\$&")}function fa(e){return new RegExp("^(?:"+e.map(EM).join("|")+")","i")}function ma(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function OM(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wM(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function SM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function TM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function $M(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Wf(e,t,n){var r=ie.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qf(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function MM(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 CM(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function AM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Yf(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function kM(e,t,n){var r=ie.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Zf(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function RM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function LM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function DM(e,t,n){var r=ie.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function IM(e,t,n){var r=ie.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function NM(e,t,n){var r=xM.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function PM(e,t,n){var r=ie.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function UM(e,t,n){var r=ie.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Xf(e,t){return St(e.getDate(),t,2)}function BM(e,t){return St(e.getHours(),t,2)}function HM(e,t){return St(e.getHours()%12||12,t,2)}function VM(e,t){return St(1+da.count(In(e),e),t,3)}function Kf(e,t){return St(e.getMilliseconds(),t,3)}function FM(e,t){return Kf(e,t)+"000"}function GM(e,t){return St(e.getMonth()+1,t,2)}function jM(e,t){return St(e.getMinutes(),t,2)}function zM(e,t){return St(e.getSeconds(),t,2)}function WM(e){var t=e.getDay();return t===0?7:t}function qM(e,t){return St(Fs.count(In(e)-1,e),t,2)}function Qf(e){var t=e.getDay();return t>=4||t===0?ai(e):ai.ceil(e)}function YM(e,t){return e=Qf(e),St(ai.count(In(e),e)+(In(e).getDay()===4),t,2)}function ZM(e){return e.getDay()}function XM(e,t){return St(Gs.count(In(e)-1,e),t,2)}function KM(e,t){return St(e.getFullYear()%100,t,2)}function QM(e,t){return e=Qf(e),St(e.getFullYear()%100,t,2)}function JM(e,t){return St(e.getFullYear()%1e4,t,4)}function tC(e,t){var n=e.getDay();return e=n>=4||n===0?ai(e):ai.ceil(e),St(e.getFullYear()%1e4,t,4)}function eC(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+St(t/60|0,"0",2)+St(t%60,"0",2)}function Jf(e,t){return St(e.getUTCDate(),t,2)}function nC(e,t){return St(e.getUTCHours(),t,2)}function rC(e,t){return St(e.getUTCHours()%12||12,t,2)}function iC(e,t){return St(1+jc.count(Sr(e),e),t,3)}function tm(e,t){return St(e.getUTCMilliseconds(),t,3)}function aC(e,t){return tm(e,t)+"000"}function sC(e,t){return St(e.getUTCMonth()+1,t,2)}function oC(e,t){return St(e.getUTCMinutes(),t,2)}function lC(e,t){return St(e.getUTCSeconds(),t,2)}function cC(e){var t=e.getUTCDay();return t===0?7:t}function uC(e,t){return St(jf.count(Sr(e)-1,e),t,2)}function em(e){var t=e.getUTCDay();return t>=4||t===0?si(e):si.ceil(e)}function hC(e,t){return e=em(e),St(si.count(Sr(e),e)+(Sr(e).getUTCDay()===4),t,2)}function dC(e){return e.getUTCDay()}function pC(e,t){return St(js.count(Sr(e)-1,e),t,2)}function fC(e,t){return St(e.getUTCFullYear()%100,t,2)}function mC(e,t){return e=em(e),St(e.getUTCFullYear()%100,t,2)}function gC(e,t){return St(e.getUTCFullYear()%1e4,t,4)}function vC(e,t){var n=e.getUTCDay();return e=n>=4||n===0?si(e):si.ceil(e),St(e.getUTCFullYear()%1e4,t,4)}function yC(){return"+0000"}function nm(){return"%"}function rm(e){return+e}function im(e){return Math.floor(+e/1e3)}var oi,am;bC({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 bC(e){return oi=bM(e),am=oi.format,oi.parse,oi.utcFormat,oi.utcParse,oi}function xC(e){return new Date(e)}function _C(e){return e instanceof Date?+e:+new Date(+e)}function sm(e,t,n,r,i,a,s,o,l,c){var u=rf(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),v=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),g=c("%b %d"),x=c("%B"),O=c("%Y");function E(w){return(l(w)<w?p:o(w)<w?f:s(w)<w?v:a(w)<w?m:r(w)<w?i(w)<w?y:g:n(w)<w?x:O)(w)}return u.invert=function(w){return new Date(d(w))},u.domain=function(w){return arguments.length?h(Array.from(w,_C)):h().map(xC)},u.ticks=function(w){var A=h();return e(A[0],A[A.length-1],w??10)},u.tickFormat=function(w,A){return A==null?E:c(A)},u.nice=function(w){var A=h();return(!w||typeof w.range!="function")&&(w=t(A[0],A[A.length-1],w??10)),w?h(Ff(A,w)):u},u.copy=function(){return wc(u,sm(e,t,n,r,i,a,s,o,l,c))},u}function om(){return Kr.apply(sm(vM,yM,In,zc,Fs,da,Gc,Fc,ii,am).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const lm=Math.abs,he=Math.atan2,Tr=Math.cos,EC=Math.max,Yc=Math.min,mn=Math.sin,li=Math.sqrt,de=1e-12,ga=Math.PI,zs=ga/2,Ws=2*ga;function OC(e){return e>1?0:e<-1?ga:Math.acos(e)}function cm(e){return e>=1?zs:e<=-1?-zs:Math.asin(e)}function um(e){this._context=e}um.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 qs(e){return new um(e)}function Xn(){}function hm(e){this._context=e}hm.prototype={areaStart:Xn,areaEnd:Xn,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 dm(e){return new hm(e)}function wC(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 SC=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Nn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ys(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function TC(e){const t=Ys(e,"border-left-width"),n=Ys(e,"border-right-width");return e.clientWidth+t+n}function $C(e){const t=Ys(e,"border-top-width"),n=Ys(e,"border-bottom-width");return e.clientHeight+t+n}function pm(e,t={}){const n=t.width||TC(e),r=t.height||$C(e);return{width:n,height:r}}function MC(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Re=16384;function CC(e){(e.width>Re||e.height>Re)&&(e.width>Re&&e.height>Re?e.width>e.height?(e.height*=Re/e.width,e.width=Re):(e.width*=Re/e.height,e.height=Re):e.width>Re?(e.height*=Re/e.width,e.width=Re):(e.width*=Re/e.height,e.height=Re))}function Zs(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function AC(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function kC(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),AC(i)}const Oe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Oe(n,t)};function RC(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function LC(e){return Nn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function DC(e,t,n){const r=`.${e}:${t}`,i=n.cssText?RC(n):LC(n);return document.createTextNode(`${r}{${i}}`)}function fm(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const a=SC();try{t.className=`${t.className} ${a}`}catch{return}const s=document.createElement("style");s.appendChild(DC(a,n,r)),t.appendChild(s)}function IC(e,t){fm(e,t,":before"),fm(e,t,":after")}const mm="application/font-woff",gm="image/jpeg",NC={woff:mm,woff2:mm,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:gm,jpeg:gm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function PC(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Zc(e){const t=PC(e).toLowerCase();return NC[t]||""}function UC(e){return e.split(/,/)[1]}function Xc(e){return e.search(/^(data:)/)!==-1}function BC(e,t){return`data:${t};base64,${e}`}async function vm(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((a,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{a(n({res:r,result:o.result}))}catch(l){s(l)}},o.readAsDataURL(i)})}const Kc={};function HC(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 Qc(e,t,n){const r=HC(e,t,n.includeQueryParams);if(Kc[r]!=null)return Kc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await vm(e,n.fetchRequestInit,({res:s,result:o})=>(t||(t=s.headers.get("Content-Type")||""),UC(o)));i=BC(a,t)}catch(a){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${e}`;a&&(s=typeof a=="string"?a:a.message),s&&console.warn(s)}return Kc[r]=i,i}async function VC(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Zs(t)}async function FC(e,t){if(e.currentSrc){const a=document.createElement("canvas"),s=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,s==null||s.drawImage(e,0,0,a.width,a.height);const o=a.toDataURL();return Zs(o)}const n=e.poster,r=Zc(n),i=await Qc(n,r,t);return Zs(i)}async function GC(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await Xs(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function jC(e,t){return Oe(e,HTMLCanvasElement)?VC(e):Oe(e,HTMLVideoElement)?FC(e,t):Oe(e,HTMLIFrameElement)?GC(e):e.cloneNode(!1)}const zC=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function WC(e,t,n){var r,i;let a=[];return zC(e)&&e.assignedNodes?a=Nn(e.assignedNodes()):Oe(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?a=Nn(e.contentDocument.body.childNodes):a=Nn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Oe(e,HTMLVideoElement)||await a.reduce((s,o)=>s.then(()=>Xs(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function qC(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Nn(r).forEach(i=>{let a=r.getPropertyValue(i);i==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Oe(e,HTMLIFrameElement)&&i==="display"&&a==="inline"&&(a="block"),i==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),n.setProperty(i,a,r.getPropertyPriority(i))})}function YC(e,t){Oe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Oe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function ZC(e,t){if(Oe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function XC(e,t){return Oe(t,Element)&&(qC(e,t),IC(e,t),YC(e,t),ZC(e,t)),t}async function KC(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const s=n[a].getAttribute("xlink:href");if(s){const o=e.querySelector(s),l=document.querySelector(s);!o&&l&&!r[s]&&(r[s]=await Xs(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",s=document.createElementNS(a,"svg");s.setAttribute("xmlns",a),s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.overflow="hidden",s.style.display="none";const o=document.createElementNS(a,"defs");s.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(s)}return e}async function Xs(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>jC(r,t)).then(r=>WC(e,r,t)).then(r=>XC(e,r)).then(r=>KC(r,t))}const ym=/url\((['"]?)([^'"]+?)\1\)/g,QC=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,JC=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function t2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function e2(e){const t=[];return e.replace(ym,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Xc(n))}async function n2(e,t,n,r,i){try{const a=n?wC(t,n):t,s=Zc(t);let o;return i||(o=await Qc(a,s,r)),e.replace(t2(t),`$1${o}$3`)}catch{}return e}function r2(e,{preferredFontFormat:t}){return t?e.replace(JC,n=>{for(;;){const[r,,i]=QC.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function bm(e){return e.search(ym)!==-1}async function xm(e,t,n){if(!bm(e))return e;const r=r2(e,n);return e2(r).reduce((i,a)=>i.then(s=>n2(s,a,t,n)),Promise.resolve(r))}async function Ks(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await xm(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function i2(e,t){await Ks("background",e,t)||await Ks("background-image",e,t),await Ks("mask",e,t)||await Ks("mask-image",e,t)}async function a2(e,t){const n=Oe(e,HTMLImageElement);if(!(n&&!Xc(e.src))&&!(Oe(e,SVGImageElement)&&!Xc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Qc(r,Zc(r),t);await new Promise((a,s)=>{e.onload=a,e.onerror=s;const o=e;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function s2(e,t){const n=Nn(e.childNodes).map(r=>_m(r,t));await Promise.all(n).then(()=>e)}async function _m(e,t){Oe(e,Element)&&(await i2(e,t),await a2(e,t),await s2(e,t))}function o2(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 Em={};async function Om(e){let t=Em[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Em[e]=t,t}async function wm(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(r,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),vm(s,t.fetchRequestInit,({result:o})=>(n=n.replace(a,`url(${o})`),[a,o]))});return Promise.all(i).then(()=>n)}function Sm(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 a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let l=a.exec(r);if(l===null){if(l=o.exec(r),l===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;t.push(l[0])}return t}async function l2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Nn(i.cssRules||[]).forEach((a,s)=>{if(a.type===CSSRule.IMPORT_RULE){let o=s+1;const l=a.href,c=Om(l).then(u=>wm(u,t)).then(u=>Sm(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(a){const s=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Om(i.href).then(o=>wm(o,t)).then(o=>Sm(o).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Nn(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function c2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>bm(t.style.getPropertyValue("src")))}async function u2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Nn(e.ownerDocument.styleSheets),r=await l2(n,t);return c2(r)}async function h2(e,t){const n=await u2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return xm(r.cssText,i,t)}))).join(`
3
- `)}async function d2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await h2(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 p2(e,t={}){const{width:n,height:r}=pm(e,t),i=await Xs(e,t,!0);return await d2(i,t),await _m(i,t),o2(i,t),await kC(i,n,r)}async function Tm(e,t={}){const{width:n,height:r}=pm(e,t),i=await p2(e,t),a=await Zs(i),s=document.createElement("canvas"),o=s.getContext("2d"),l=t.pixelRatio||MC(),c=t.canvasWidth||n,u=t.canvasHeight||r;return s.width=c*l,s.height=u*l,t.skipAutoScale||CC(s),s.style.width=`${c}`,s.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(a,0,0,s.width,s.height),s}async function f2(e,t={}){return(await Tm(e,t)).toDataURL()}async function m2(e,t={}){return(await Tm(e,t)).toDataURL("image/jpeg",t.quality||1)}let Pn=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const g2="DONT_STYLE_ME_css_styles_verifier";let N=class Uh extends Pn{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=D(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],v=parseFloat(f);f&&v>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=v)}})},a={width:t.attr("width"),height:t.attr("height")},s=t.node();let o,l,c,u;try{typeof s.getBBox=="function"&&(o=s.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(s==null?void 0:s.getBoundingClientRect)=="function"&&(c=s.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(s instanceof SVGSVGElement&&(d={width:s.clientWidth,height:s.clientHeight}),n){if(n.useAttrs&&(i(a),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:b(t.node(),"width","baseVal","value"),height:b(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(a)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),a,s;return i.length===2?(a=i[0],i=i[1].split("."),s=i[0]):(i=n.split("."),a=i[0]),t.append(a).attr("id",s).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(),a=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-a.left,r.top=i.top-a.top}catch(s){console.error(s)}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=b(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${Ee}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",g2),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),D(this.getHolder()).classed(`${Ee}--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=D(r);i.classed("filled",!0),m2(this.getMainContainer(),{quality:1,filter:a=>!(a.classList&&a.classList.contains("cds--cc--toolbar"))}).then(function(a){var s;let o="myChart";const l=b(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(s=t.services.files)==null||s.downloadImage(a,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=D(r);i.classed("filled",!0),f2(this.getMainContainer(),{quality:1,filter:a=>!(a.classList&&a.classList.contains("cds--cc--toolbar"))}).then(function(a){var s;let o="myChart";const l=b(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(s=t.services.files)==null||s.downloadImage(a,`${o}.png`),i.classed("filled",!1)}).catch(function(a){console.error("oops, something went wrong!",a)})}isFullScreenMode(){return D(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();D(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=D(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Uh.getSVGElementSize(D(this.mainContainer),{useBBox:!0}),n=D(this.mainContainer).attr("class"),r=D(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(a){i+=Number(Uh.getSVGElementSize(D(a),{useBBox:!0}).height)}),i<=t?D(this.mainContainer).attr("height",i):D(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&D(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(S.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(S.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Hs(()=>{var a;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(a=this.services.events)==null||a.dispatchEvent(S.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},Jc=class z0 extends Pn{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:z0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function $m(e){const t=v2(Mm(e),360);return Kn(t,[0,10])||Kn(t,[350,0])?{textAnchor:ln.START,dominantBaseline:cn.MIDDLE}:Kn(t,[10,80])?{textAnchor:ln.START,dominantBaseline:cn.HANGING}:Kn(t,[80,100])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.HANGING}:Kn(t,[100,170])?{textAnchor:ln.END,dominantBaseline:cn.HANGING}:Kn(t,[170,190])?{textAnchor:ln.END,dominantBaseline:cn.MIDDLE}:Kn(t,[190,260])?{textAnchor:ln.END,dominantBaseline:cn.BASELINE}:Kn(t,[260,280])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.BASELINE}:{textAnchor:ln.START,dominantBaseline:cn.BASELINE}}function v2(e,t){return(e%t+t)%t}function Kn(e,[t,n]){return e>=t&&e<=n}function Mm(e){return e*(180/Math.PI)}function Zt(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 y2(e,t){return t*Math.sin(e-Math.PI/2)}function b2(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;)n=t(n,e[i],i,e);return n}function x2(e){return function(t){return e==null?void 0:e[t]}}var _2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},E2=x2(_2),O2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,w2="\\u0300-\\u036f",S2="\\ufe20-\\ufe2f",T2="\\u20d0-\\u20ff",$2=w2+S2+T2,M2="["+$2+"]",C2=RegExp(M2,"g");function A2(e){return e=ji(e),e&&e.replace(O2,E2).replace(C2,"")}var k2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function R2(e){return e.match(k2)||[]}var L2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function D2(e){return L2.test(e)}var Cm="\\ud800-\\udfff",I2="\\u0300-\\u036f",N2="\\ufe20-\\ufe2f",P2="\\u20d0-\\u20ff",U2=I2+N2+P2,Am="\\u2700-\\u27bf",km="a-z\\xdf-\\xf6\\xf8-\\xff",B2="\\xac\\xb1\\xd7\\xf7",H2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",V2="\\u2000-\\u206f",F2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rm="A-Z\\xc0-\\xd6\\xd8-\\xde",G2="\\ufe0e\\ufe0f",Lm=B2+H2+V2+F2,Dm="['’]",Im="["+Lm+"]",j2="["+U2+"]",Nm="\\d+",z2="["+Am+"]",Pm="["+km+"]",Um="[^"+Cm+Lm+Nm+Am+km+Rm+"]",W2="\\ud83c[\\udffb-\\udfff]",q2="(?:"+j2+"|"+W2+")",Y2="[^"+Cm+"]",Bm="(?:\\ud83c[\\udde6-\\uddff]){2}",Hm="[\\ud800-\\udbff][\\udc00-\\udfff]",ci="["+Rm+"]",Z2="\\u200d",Vm="(?:"+Pm+"|"+Um+")",X2="(?:"+ci+"|"+Um+")",Fm="(?:"+Dm+"(?:d|ll|m|re|s|t|ve))?",Gm="(?:"+Dm+"(?:D|LL|M|RE|S|T|VE))?",jm=q2+"?",zm="["+G2+"]?",K2="(?:"+Z2+"(?:"+[Y2,Bm,Hm].join("|")+")"+zm+jm+")*",Q2="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",J2="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tA=zm+jm+K2,eA="(?:"+[z2,Bm,Hm].join("|")+")"+tA,nA=RegExp([ci+"?"+Pm+"+"+Fm+"(?="+[Im,ci,"$"].join("|")+")",X2+"+"+Gm+"(?="+[Im,ci+Vm,"$"].join("|")+")",ci+"?"+Vm+"+"+Fm,ci+"+"+Gm,J2,Q2,Nm,eA].join("|"),"g");function rA(e){return e.match(nA)||[]}function iA(e,t,n){return e=ji(e),t=t,t===void 0?D2(e)?rA(e):R2(e):e.match(t)||[]}var aA="['’]",sA=RegExp(aA,"g");function Wm(e){return function(t){return b2(iA(A2(t).replace(sA,"")),e,"")}}function oA(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function qm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=ri(n),n=n===n?n:0),t!==void 0&&(t=ri(t),t=t===t?t:0),oA(ri(e),t,n)}var lA="Expected a function";function cA(e,t,n){if(typeof e!="function")throw new TypeError(lA);return setTimeout(function(){e.apply(void 0,n)},t)}var uA=Il(function(e,t,n){return cA(e,ri(t)||0,n)});function hA(e,t){var n=-1,r=hr(e)?Array(e.length):[];return Lc(e,function(i,a,s){r[++n]=t(i,a,s)}),r}function dA(e,t){var n=ae(e)?Cl:hA;return n(e,ps(t))}var pA=1/0;function fA(e,t){return cs(dA(e,t),pA)}function Ym(e,t){return ds(e,t)}var ui=Wm(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function mA(e,t){var n;return Lc(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}function gA(e,t,n){var r=ae(e)?Gd:mA;return r(e,ps(t))}class $r{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const a=n[i],s=t+a,o=Math.abs(t)<Math.abs(a)?t-(s-a):a-(s-t);o&&(n[r++]=o),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,a,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,a=i-(s-r),!a););n>0&&(a<0&&t[n-1]<0||a>0&&t[n-1]>0)&&(i=a*2,r=s+i,i==r-s&&(s=r))}return s}}function*vA(e){for(const t of e)yield*t}function Zm(e){return Array.from(vA(e))}function yA(e){return e}var Qs=1,Js=2,tu=3,va=4,Xm=1e-6;function bA(e){return"translate("+e+",0)"}function xA(e){return"translate(0,"+e+")"}function _A(e){return t=>+e(t)}function EA(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function OA(){return!this.__axis}function to(e,t){var n=[],r=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Qs||e===va?-1:1,u=e===va||e===Js?"x":"y",d=e===Qs||e===tu?bA:xA;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),v=i??(t.tickFormat?t.tickFormat.apply(t,n):yA),m=Math.max(a,0)+o,y=t.range(),g=+y[0]+l,x=+y[y.length-1]+l,O=(t.bandwidth?EA:_A)(t.copy(),l),E=p.selection?p.selection():p,w=E.selectAll(".domain").data([null]),A=E.selectAll(".tick").data(f,t).order(),I=A.exit(),R=A.enter().append("g").attr("class","tick"),L=A.select("line"),$=A.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(R),L=L.merge(R.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),$=$.merge(R.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Qs?"0em":e===tu?"0.71em":"0.32em")),p!==E&&(w=w.transition(p),A=A.transition(p),L=L.transition(p),$=$.transition(p),I=I.transition(p).attr("opacity",Xm).attr("transform",function(F){return isFinite(F=O(F))?d(F+l):this.getAttribute("transform")}),R.attr("opacity",Xm).attr("transform",function(F){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(F))?P:O(F))+l)})),I.remove(),w.attr("d",e===va||e===Js?s?"M"+c*s+","+g+"H"+l+"V"+x+"H"+c*s:"M"+l+","+g+"V"+x:s?"M"+g+","+c*s+"V"+l+"H"+x+"V"+c*s:"M"+g+","+l+"H"+x),A.attr("opacity",1).attr("transform",function(F){return d(O(F)+l)}),L.attr(u+"2",c*a),$.attr(u,c*m).text(v),E.filter(OA).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Js?"start":e===va?"end":"middle"),E.each(function(){this.__axis=O})}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?(a=s=+p,h):a},h.tickSizeInner=function(p){return arguments.length?(a=+p,h):a},h.tickSizeOuter=function(p){return arguments.length?(s=+p,h):s},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function wA(e){return to(Qs,e)}function SA(e){return to(Js,e)}function eu(e){return to(tu,e)}function Km(e){return to(va,e)}const nu={capture:!0,passive:!1};function ru(e){e.preventDefault(),e.stopImmediatePropagation()}function TA(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",ru,nu);"onselectstart"in t?n.on("selectstart.drag",ru,nu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $A(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",ru,nu),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 MA(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const CA=e=>+e,iu=e=>()=>e;function AA(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:a}){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:a}})}function kA(e){e.stopImmediatePropagation()}function au(e){e.preventDefault(),e.stopImmediatePropagation()}var Qm={name:"drag"},su={name:"space"},hi={name:"handle"},di={name:"center"};const{abs:Jm,max:pe,min:fe}=Math;function tg(e){return[+e[0],+e[1]]}function eg(e){return[tg(e[0]),tg(e[1])]}var eo={name:"x",handles:["w","e"].map(no),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]]}},ou={name:"y",handles:["n","s"].map(no),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Un={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"},ng={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},rg={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},RA={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},LA={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function no(e){return{type:e}}function DA(e){return!e.ctrlKey&&!e.button}function IA(){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 NA(){return navigator.maxTouchPoints||"ontouchstart"in this}function lu(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function PA(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function ig(){return UA(eo)}function UA(e){var t=IA,n=DA,r=NA,i=!0,a=rc("start","brush","end"),s=6,o;function l(m){var y=m.property("__brush",v).selectAll(".overlay").data([no("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Un.overlay).merge(y).each(function(){var x=lu(this).extent;D(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([no("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Un.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var g=m.selectAll(".handle").data(e.handles,function(x){return x.type});g.exit().remove(),g.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return Un[x.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,y,g){m.tween?m.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,O=x.__brush,E=u(x,arguments),w=O.selection,A=e.input(typeof y=="function"?y.apply(this,arguments):y,O.extent),I=Ji(w,A);function R(L){O.selection=L===1&&A===null?null:I(L),c.call(x),E.brush()}return w!==null&&A!==null?R:R(1)}):m.each(function(){var x=this,O=arguments,E=x.__brush,w=e.input(typeof y=="function"?y.apply(x,O):y,E.extent),A=u(x,O).beforestart();bc(x),E.selection=w===null?null:w,c.call(x),A.start(g).brush(g).end(g)})},l.clear=function(m,y){l.move(m,null,y)};function c(){var m=D(this),y=lu(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(g){return g.type[g.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(g){return g.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(g){return g.type==="n"||g.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(g){return g.type==="e"||g.type==="w"?y[1][1]-y[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,y,g){var x=m.__brush.emitter;return x&&(!g||!x.clean)?x:new d(m,y,g)}function d(m,y,g){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=g}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,g){var x=D(this.that).datum();a.call(m,this.that,new AA(m,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:g,dispatch:a}),x)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var y=this,g=m.target.__data__.type,x=(i&&m.metaKey?g="overlay":g)==="selection"?Qm:i&&m.altKey?di:hi,O=e===ou?null:RA[g],E=e===eo?null:LA[g],w=lu(y),A=w.extent,I=w.selection,R=A[0][0],L,$,F=A[0][1],P,H,_=A[1][0],C,k,U=A[1][1],B,X,Y=0,ot=0,it,xt=O&&E&&i&&m.shiftKey,at,K,et=Array.from(m.touches||[m],nt=>{const Mt=nt.identifier;return nt=mr(nt,y),nt.point0=nt.slice(),nt.identifier=Mt,nt});bc(y);var mt=u(y,arguments,!0).beforestart();if(g==="overlay"){I&&(it=!0);const nt=[et[0],et[1]||et[0]];w.selection=I=[[L=e===ou?R:fe(nt[0][0],nt[1][0]),P=e===eo?F:fe(nt[0][1],nt[1][1])],[C=e===ou?_:pe(nt[0][0],nt[1][0]),B=e===eo?U:pe(nt[0][1],nt[1][1])]],et.length>1&&It(m)}else L=I[0][0],P=I[0][1],C=I[1][0],B=I[1][1];$=L,H=P,k=C,X=B;var q=D(y).attr("pointer-events","none"),J=q.selectAll(".overlay").attr("cursor",Un[g]);if(m.touches)mt.moved=j,mt.ended=gt;else{var dt=D(m.view).on("mousemove.brush",j,!0).on("mouseup.brush",gt,!0);i&&dt.on("keydown.brush",qt,!0).on("keyup.brush",jt,!0),TA(m.view)}c.call(y),mt.start(m,x.name);function j(nt){for(const Mt of nt.changedTouches||[nt])for(const xe of et)xe.identifier===Mt.identifier&&(xe.cur=mr(Mt,y));if(xt&&!at&&!K&&et.length===1){const Mt=et[0];Jm(Mt.cur[0]-Mt[0])>Jm(Mt.cur[1]-Mt[1])?K=!0:at=!0}for(const Mt of et)Mt.cur&&(Mt[0]=Mt.cur[0],Mt[1]=Mt.cur[1]);it=!0,au(nt),It(nt)}function It(nt){const Mt=et[0],xe=Mt.point0;var Pe;switch(Y=Mt[0]-xe[0],ot=Mt[1]-xe[1],x){case su:case Qm:{O&&(Y=pe(R-L,fe(_-C,Y)),$=L+Y,k=C+Y),E&&(ot=pe(F-P,fe(U-B,ot)),H=P+ot,X=B+ot);break}case hi:{et[1]?(O&&($=pe(R,fe(_,et[0][0])),k=pe(R,fe(_,et[1][0])),O=1),E&&(H=pe(F,fe(U,et[0][1])),X=pe(F,fe(U,et[1][1])),E=1)):(O<0?(Y=pe(R-L,fe(_-L,Y)),$=L+Y,k=C):O>0&&(Y=pe(R-C,fe(_-C,Y)),$=L,k=C+Y),E<0?(ot=pe(F-P,fe(U-P,ot)),H=P+ot,X=B):E>0&&(ot=pe(F-B,fe(U-B,ot)),H=P,X=B+ot));break}case di:{O&&($=pe(R,fe(_,L-Y*O)),k=pe(R,fe(_,C+Y*O))),E&&(H=pe(F,fe(U,P-ot*E)),X=pe(F,fe(U,B+ot*E)));break}}k<$&&(O*=-1,Pe=L,L=C,C=Pe,Pe=$,$=k,k=Pe,g in ng&&J.attr("cursor",Un[g=ng[g]])),X<H&&(E*=-1,Pe=P,P=B,B=Pe,Pe=H,H=X,X=Pe,g in rg&&J.attr("cursor",Un[g=rg[g]])),w.selection&&(I=w.selection),at&&($=I[0][0],k=I[1][0]),K&&(H=I[0][1],X=I[1][1]),(I[0][0]!==$||I[0][1]!==H||I[1][0]!==k||I[1][1]!==X)&&(w.selection=[[$,H],[k,X]],c.call(y),mt.brush(nt,x.name))}function gt(nt){if(kA(nt),nt.touches){if(nt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else $A(nt.view,it),dt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),J.attr("cursor",Un.overlay),w.selection&&(I=w.selection),PA(I)&&(w.selection=null,c.call(y)),mt.end(nt,x.name)}function qt(nt){switch(nt.keyCode){case 16:{xt=O&&E;break}case 18:{x===hi&&(O&&(C=k-Y*O,L=$+Y*O),E&&(B=X-ot*E,P=H+ot*E),x=di,It(nt));break}case 32:{(x===hi||x===di)&&(O<0?C=k-Y:O>0&&(L=$-Y),E<0?B=X-ot:E>0&&(P=H-ot),x=su,J.attr("cursor",Un.selection),It(nt));break}default:return}au(nt)}function jt(nt){switch(nt.keyCode){case 16:{xt&&(at=K=xt=!1,It(nt));break}case 18:{x===di&&(O<0?C=k:O>0&&(L=$),E<0?B=X:E>0&&(P=H),x=hi,It(nt));break}case 32:{x===su&&(nt.altKey?(O&&(C=k-Y*O,L=$+Y*O),E&&(B=X-ot*E,P=H+ot*E),x=di):(O<0?C=k:O>0&&(L=$),E<0?B=X:E>0&&(P=H),x=hi),J.attr("cursor",Un[g]),It(nt));break}default:return}au(nt)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function v(){var m=this.__brush||{selection:null};return m.extent=eg(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:iu(eg(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:iu(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:iu(!!m),l):r},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=a.on.apply(a,arguments);return m===a?l:m},l}const cu=Math.PI,uu=2*cu,Mr=1e-6,BA=uu-Mr;function ag(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function HA(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ag;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let hu=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?ag:HA(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw new Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,o=n-e,l=r-t,c=a-e,u=s-t,d=c*c+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Mr)if(!(Math.abs(u*o-l*c)>Mr)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let h=n-a,p=r-s,f=o*o+l*l,v=h*h+p*p,m=Math.sqrt(f),y=Math.sqrt(d),g=i*Math.tan((cu-Math.acos((f+d-v)/(2*m*y)))/2),x=g/y,O=g/m;Math.abs(x-1)>Mr&&this._append`L${e+x*c},${t+x*u}`,this._append`A${i},${i},0,0,${+(u*h>c*p)},${this._x1=e+O*o},${this._y1=t+O*l}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),o=n*Math.sin(r),l=e+s,c=t+o,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Mr||Math.abs(this._y1-c)>Mr)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%uu+uu),d>BA?this._append`A${n},${n},0,1,${u},${e-s},${t-o}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>Mr&&this._append`A${n},${n},0,${+(d>=cu)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function sg(){return new hu}sg.prototype=hu.prototype;var Rt=1e-6,og=1e-12,vt=Math.PI,we=vt/2,lg=vt/4,Le=vt*2,ge=180/vt,Xt=vt/180,Lt=Math.abs,cg=Math.atan,Cr=Math.atan2,Dt=Math.cos,VA=Math.exp,FA=Math.log,$t=Math.sin,Qn=Math.sign||function(e){return e>0?1:e<0?-1:0},rn=Math.sqrt,GA=Math.tan;function jA(e){return e>1?0:e<-1?vt:Math.acos(e)}function Bn(e){return e>1?we:e<-1?-we:Math.asin(e)}function je(){}function ro(e,t){e&&hg.hasOwnProperty(e.type)&&hg[e.type](e,t)}var ug={Feature:function(e,t){ro(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ro(n[r].geometry,t)}},hg={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){du(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)du(n[r],t,0)},Polygon:function(e,t){dg(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)dg(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ro(n[r],t)}};function du(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function dg(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)du(e[n],t,1);t.polygonEnd()}function pi(e,t){e&&ug.hasOwnProperty(e.type)?ug[e.type](e,t):ro(e,t)}function pu(e){return[Cr(e[1],e[0]),Bn(e[2])]}function fi(e){var t=e[0],n=e[1],r=Dt(n);return[r*Dt(t),r*$t(t),$t(n)]}function io(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ao(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function fu(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function so(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function mu(e){var t=rn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function gu(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function vu(e,t){return Lt(e)>vt&&(e-=Math.round(e/Le)*Le),[e,t]}vu.invert=vu;function pg(e,t,n){return(e%=Le)?t||n?gu(mg(e),gg(t,n)):mg(e):t||n?gg(t,n):vu}function fg(e){return function(t,n){return t+=e,Lt(t)>vt&&(t-=Math.round(t/Le)*Le),[t,n]}}function mg(e){var t=fg(e);return t.invert=fg(-e),t}function gg(e,t){var n=Dt(e),r=$t(e),i=Dt(t),a=$t(t);function s(o,l){var c=Dt(l),u=Dt(o)*c,d=$t(o)*c,h=$t(l),p=h*n+u*r;return[Cr(d*i-p*a,u*n-h*r),Bn(p*i+d*a)]}return s.invert=function(o,l){var c=Dt(l),u=Dt(o)*c,d=$t(o)*c,h=$t(l),p=h*i-d*a;return[Cr(d*i+h*a,u*n+p*r),Bn(p*n-u*r)]},s}function zA(e){e=pg(e[0]*Xt,e[1]*Xt,e.length>2?e[2]*Xt:0);function t(n){return n=e(n[0]*Xt,n[1]*Xt),n[0]*=ge,n[1]*=ge,n}return t.invert=function(n){return n=e.invert(n[0]*Xt,n[1]*Xt),n[0]*=ge,n[1]*=ge,n},t}function WA(e,t,n,r,i,a){if(n){var s=Dt(t),o=$t(t),l=r*n;i==null?(i=t+r*Le,a=t-l/2):(i=vg(s,i),a=vg(s,a),(r>0?i<a:i>a)&&(i+=r*Le));for(var c,u=i;r>0?u>a:u<a;u-=l)c=pu([s,-o*Dt(u),-o*$t(u)]),e.point(c[0],c[1])}}function vg(e,t){t=fi(t),t[0]-=e,mu(t);var n=jA(-t[1]);return((-t[2]<0?-n:n)+Le-Rt)%Le}function yg(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:je,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function oo(e,t){return Lt(e[0]-t[0])<Rt&&Lt(e[1]-t[1])<Rt}function lo(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function bg(e,t,n,r,i){var a=[],s=[],o,l;if(e.forEach(function(f){if(!((v=f.length-1)<=0)){var v,m=f[0],y=f[v],g;if(oo(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),o=0;o<v;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}y[0]+=2*Rt}a.push(g=new lo(m,f,null,!0)),s.push(g.o=new lo(m,null,g,!1)),a.push(g=new lo(y,f,null,!1)),s.push(g.o=new lo(y,null,g,!0))}}),!!a.length){for(s.sort(t),xg(a),xg(s),o=0,l=s.length;o<l;++o)s[o].e=n=!n;for(var c=a[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(u=h.p.z,o=u.length-1;o>=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 xg(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function yu(e){return Lt(e[0])<=vt?e[0]:Qn(e[0])*((Lt(e[0])+vt)%Le-vt)}function qA(e,t){var n=yu(t),r=t[1],i=$t(r),a=[$t(n),-Dt(n),0],s=0,o=0,l=new $r;i===1?r=we+Rt:i===-1&&(r=-we-Rt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],f=yu(p),v=p[1]/2+lg,m=$t(v),y=Dt(v),g=0;g<h;++g,f=O,m=w,y=A,p=x){var x=d[g],O=yu(x),E=x[1]/2+lg,w=$t(E),A=Dt(E),I=O-f,R=I>=0?1:-1,L=R*I,$=L>vt,F=m*w;if(l.add(Cr(F*R*$t(L),y*A+F*Dt(L))),s+=$?I+R*Le:I,$^f>=n^O>=n){var P=ao(fi(p),fi(x));mu(P);var H=ao(a,P);mu(H);var _=($^I>=0?-1:1)*Bn(H[2]);(r>_||r===_&&(P[0]||P[1]))&&(o+=$^I>=0?1:-1)}}return(s<-Rt||s<Rt&&l<-og)^o&1}function _g(e,t,n,r){return function(i){var a=t(i),s=yg(),o=t(s),l=!1,c,u,d,h={point:p,lineStart:v,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=g,h.lineEnd=x,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=v,h.lineEnd=m,u=Zm(u);var O=qA(c,r);u.length?(l||(i.polygonStart(),l=!0),bg(u,ZA,O,n,i)):O&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(O,E){e(O,E)&&i.point(O,E)}function f(O,E){a.point(O,E)}function v(){h.point=f,a.lineStart()}function m(){h.point=p,a.lineEnd()}function y(O,E){d.push([O,E]),o.point(O,E)}function g(){o.lineStart(),d=[]}function x(){y(d[0][0],d[0][1]),o.lineEnd();var O=o.clean(),E=s.result(),w,A=E.length,I,R,L;if(d.pop(),c.push(d),d=null,!!A){if(O&1){if(R=E[0],(I=R.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),w=0;w<I;++w)i.point((L=R[w])[0],L[1]);i.lineEnd()}return}A>1&&O&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(YA))}}return h}}function YA(e){return e.length>1}function ZA(e,t){return((e=e.x)[0]<0?e[1]-we-Rt:we-e[1])-((t=t.x)[0]<0?t[1]-we-Rt:we-t[1])}const Eg=_g(function(){return!0},XA,QA,[-vt,-we]);function XA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,s){var o=a>0?vt:-vt,l=Lt(a-t);Lt(l-vt)<Rt?(e.point(t,n=(n+s)/2>0?we:-we),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(a,n),i=0):r!==o&&l>=vt&&(Lt(t-r)<Rt&&(t-=r*Rt),Lt(a-o)<Rt&&(a-=o*Rt),n=KA(t,n,a,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=a,n=s),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function KA(e,t,n,r){var i,a,s=$t(e-n);return Lt(s)>Rt?cg(($t(t)*(a=Dt(r))*$t(n)-$t(r)*(i=Dt(t))*$t(e))/(i*a*s)):(t+r)/2}function QA(e,t,n,r){var i;if(e==null)i=n*we,r.point(-vt,i),r.point(0,i),r.point(vt,i),r.point(vt,0),r.point(vt,-i),r.point(0,-i),r.point(-vt,-i),r.point(-vt,0),r.point(-vt,i);else if(Lt(e[0]-t[0])>Rt){var a=e[0]<t[0]?vt:-vt;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(t[0],t[1])}function JA(e){var t=Dt(e),n=2*Xt,r=t>0,i=Lt(t)>Rt;function a(u,d,h,p){WA(p,e,n,h,u,d)}function s(u,d){return Dt(u)*Dt(d)>t}function o(u){var d,h,p,f,v;return{lineStart:function(){f=p=!1,v=1},point:function(m,y){var g=[m,y],x,O=s(m,y),E=r?O?0:c(m,y):O?c(m+(m<0?vt:-vt),y):0;if(!d&&(f=p=O)&&u.lineStart(),O!==p&&(x=l(d,g),(!x||oo(d,x)||oo(g,x))&&(g[2]=1)),O!==p)v=0,O?(u.lineStart(),x=l(g,d),u.point(x[0],x[1])):(x=l(d,g),u.point(x[0],x[1],2),u.lineEnd()),d=x;else if(i&&d&&r^O){var w;!(E&h)&&(w=l(g,d,!0))&&(v=0,r?(u.lineStart(),u.point(w[0][0],w[0][1]),u.point(w[1][0],w[1][1]),u.lineEnd()):(u.point(w[1][0],w[1][1]),u.lineEnd(),u.lineStart(),u.point(w[0][0],w[0][1],3)))}O&&(!d||!oo(d,g))&&u.point(g[0],g[1]),d=g,p=O,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return v|(f&&p)<<1}}}function l(u,d,h){var p=fi(u),f=fi(d),v=[1,0,0],m=ao(p,f),y=io(m,m),g=m[0],x=y-g*g;if(!x)return!h&&u;var O=t*y/x,E=-t*g/x,w=ao(v,m),A=so(v,O),I=so(m,E);fu(A,I);var R=w,L=io(A,R),$=io(R,R),F=L*L-$*(io(A,A)-1);if(!(F<0)){var P=rn(F),H=so(R,(-L-P)/$);if(fu(H,A),H=pu(H),!h)return H;var _=u[0],C=d[0],k=u[1],U=d[1],B;C<_&&(B=_,_=C,C=B);var X=C-_,Y=Lt(X-vt)<Rt,ot=Y||X<Rt;if(!Y&&U<k&&(B=k,k=U,U=B),ot?Y?k+U>0^H[1]<(Lt(H[0]-_)<Rt?k:U):k<=H[1]&&H[1]<=U:X>vt^(_<=H[0]&&H[0]<=C)){var it=so(R,(-L+P)/$);return fu(it,A),[H,pu(it)]}}}function c(u,d){var h=r?e:vt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return _g(s,o,a,r?[0,-e]:[-vt,e-vt])}function tk(e,t,n,r,i,a){var s=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-s,p=c-o,f;if(f=n-s,!(!h&&f>0)){if(f/=h,h<0){if(f<u)return;f<d&&(d=f)}else if(h>0){if(f>d)return;f>u&&(u=f)}if(f=i-s,!(!h&&f<0)){if(f/=h,h<0){if(f>d)return;f>u&&(u=f)}else if(h>0){if(f<u)return;f<d&&(d=f)}if(f=r-o,!(!p&&f>0)){if(f/=p,p<0){if(f<u)return;f<d&&(d=f)}else if(p>0){if(f>d)return;f>u&&(u=f)}if(f=a-o,!(!p&&f<0)){if(f/=p,p<0){if(f>d)return;f>u&&(u=f)}else if(p>0){if(f<u)return;f<d&&(d=f)}return u>0&&(e[0]=s+u*h,e[1]=o+u*p),d<1&&(t[0]=s+d*h,t[1]=o+d*p),!0}}}}}var ya=1e9,co=-ya;function ek(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function a(c,u,d,h){var p=0,f=0;if(c==null||(p=s(c,d))!==(f=s(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 s(c,u){return Lt(c[0]-e)<Rt?u>0?0:3:Lt(c[0]-n)<Rt?u>0?2:1:Lt(c[1]-t)<Rt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),h=s(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=yg(),h,p,f,v,m,y,g,x,O,E,w,A={point:I,lineStart:F,lineEnd:P,polygonStart:L,polygonEnd:$};function I(_,C){i(_,C)&&u.point(_,C)}function R(){for(var _=0,C=0,k=p.length;C<k;++C)for(var U=p[C],B=1,X=U.length,Y=U[0],ot,it,xt=Y[0],at=Y[1];B<X;++B)ot=xt,it=at,Y=U[B],xt=Y[0],at=Y[1],it<=r?at>r&&(xt-ot)*(r-it)>(at-it)*(e-ot)&&++_:at<=r&&(xt-ot)*(r-it)<(at-it)*(e-ot)&&--_;return _}function L(){u=d,h=[],p=[],w=!0}function $(){var _=R(),C=w&&_,k=(h=Zm(h)).length;(C||k)&&(c.polygonStart(),C&&(c.lineStart(),a(null,null,1,c),c.lineEnd()),k&&bg(h,o,_,a,c),c.polygonEnd()),u=c,h=p=f=null}function F(){A.point=H,p&&p.push(f=[]),E=!0,O=!1,g=x=NaN}function P(){h&&(H(v,m),y&&O&&d.rejoin(),h.push(d.result())),A.point=I,O&&u.lineEnd()}function H(_,C){var k=i(_,C);if(p&&f.push([_,C]),E)v=_,m=C,y=k,E=!1,k&&(u.lineStart(),u.point(_,C));else if(k&&O)u.point(_,C);else{var U=[g=Math.max(co,Math.min(ya,g)),x=Math.max(co,Math.min(ya,x))],B=[_=Math.max(co,Math.min(ya,_)),C=Math.max(co,Math.min(ya,C))];tk(U,B,e,t,n,r)?(O||(u.lineStart(),u.point(U[0],U[1])),u.point(B[0],B[1]),k||u.lineEnd(),w=!1):k&&(u.lineStart(),u.point(_,C),w=!1)}g=_,x=C,O=k}return A}}const bu=e=>e;var xu=new $r,_u=new $r,Og,wg,Eu,Ou,Hn={point:je,lineStart:je,lineEnd:je,polygonStart:function(){Hn.lineStart=nk,Hn.lineEnd=ik},polygonEnd:function(){Hn.lineStart=Hn.lineEnd=Hn.point=je,xu.add(Lt(_u)),_u=new $r},result:function(){var e=xu/2;return xu=new $r,e}};function nk(){Hn.point=rk}function rk(e,t){Hn.point=Sg,Og=Eu=e,wg=Ou=t}function Sg(e,t){_u.add(Ou*e-Eu*t),Eu=e,Ou=t}function ik(){Sg(Og,wg)}var mi=1/0,uo=mi,ba=-mi,ho=ba,po={point:ak,lineStart:je,lineEnd:je,polygonStart:je,polygonEnd:je,result:function(){var e=[[mi,uo],[ba,ho]];return ba=ho=-(uo=mi=1/0),e}};function ak(e,t){e<mi&&(mi=e),e>ba&&(ba=e),t<uo&&(uo=t),t>ho&&(ho=t)}var wu=0,Su=0,xa=0,fo=0,mo=0,gi=0,Tu=0,$u=0,_a=0,Tg,$g,gn,vn,ze={point:Ar,lineStart:Mg,lineEnd:Cg,polygonStart:function(){ze.lineStart=lk,ze.lineEnd=ck},polygonEnd:function(){ze.point=Ar,ze.lineStart=Mg,ze.lineEnd=Cg},result:function(){var e=_a?[Tu/_a,$u/_a]:gi?[fo/gi,mo/gi]:xa?[wu/xa,Su/xa]:[NaN,NaN];return wu=Su=xa=fo=mo=gi=Tu=$u=_a=0,e}};function Ar(e,t){wu+=e,Su+=t,++xa}function Mg(){ze.point=sk}function sk(e,t){ze.point=ok,Ar(gn=e,vn=t)}function ok(e,t){var n=e-gn,r=t-vn,i=rn(n*n+r*r);fo+=i*(gn+e)/2,mo+=i*(vn+t)/2,gi+=i,Ar(gn=e,vn=t)}function Cg(){ze.point=Ar}function lk(){ze.point=uk}function ck(){Ag(Tg,$g)}function uk(e,t){ze.point=Ag,Ar(Tg=gn=e,$g=vn=t)}function Ag(e,t){var n=e-gn,r=t-vn,i=rn(n*n+r*r);fo+=i*(gn+e)/2,mo+=i*(vn+t)/2,gi+=i,i=vn*e-gn*t,Tu+=i*(gn+e),$u+=i*(vn+t),_a+=i*3,Ar(gn=e,vn=t)}function kg(e){this._context=e}kg.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,Le);break}}},result:je};var Mu=new $r,Cu,Rg,Lg,Ea,Oa,wa={point:je,lineStart:function(){wa.point=hk},lineEnd:function(){Cu&&Dg(Rg,Lg),wa.point=je},polygonStart:function(){Cu=!0},polygonEnd:function(){Cu=null},result:function(){var e=+Mu;return Mu=new $r,e}};function hk(e,t){wa.point=Dg,Rg=Ea=e,Lg=Oa=t}function Dg(e,t){Ea-=e,Oa-=t,Mu.add(rn(Ea*Ea+Oa*Oa)),Ea=e,Oa=t}let Ig,go,Ng,Pg;class Ug{constructor(t){this._append=t==null?Bg:dk(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!==Ng||this._append!==go){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`,Ng=r,go=this._append,Pg=this._,this._=i}this._+=Pg;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Bg(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function dk(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Bg;if(t!==Ig){const n=10**t;Ig=t,go=function(r){let i=1;this._+=r[0];for(const a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return go}function pk(e,t){let n=3,r=4.5,i,a;function s(o){return o&&(typeof r=="function"&&a.pointRadius(+r.apply(this,arguments)),pi(o,i(a))),a.result()}return s.area=function(o){return pi(o,i(Hn)),Hn.result()},s.measure=function(o){return pi(o,i(wa)),wa.result()},s.bounds=function(o){return pi(o,i(po)),po.result()},s.centroid=function(o){return pi(o,i(ze)),ze.result()},s.projection=function(o){return arguments.length?(i=o==null?(e=null,bu):(e=o).stream,s):e},s.context=function(o){return arguments.length?(a=o==null?(t=null,new Ug(n)):new kg(t=o),typeof r!="function"&&a.pointRadius(r),s):t},s.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(a.pointRadius(+o),+o),s):r},s.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(a=new Ug(n)),s},s.projection(e).digits(n).context(t)}function Au(e){return function(t){var n=new ku;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ku(){}ku.prototype={constructor:ku,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 Ru(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),pi(n,e.stream(po)),t(po.result()),r!=null&&e.clipExtent(r),e}function Hg(e,t,n){return Ru(e,function(r){var i=t[1][0]-t[0][0],a=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(a-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([o,l])},n)}function fk(e,t,n){return Hg(e,[[0,0],t],n)}function mk(e,t,n){return Ru(e,function(r){var i=+t,a=i/(r[1][0]-r[0][0]),s=(i-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];e.scale(150*a).translate([s,o])},n)}function gk(e,t,n){return Ru(e,function(r){var i=+t,a=i/(r[1][1]-r[0][1]),s=-a*r[0][0],o=(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,o])},n)}var Vg=16,vk=Dt(30*Xt);function Fg(e,t){return+t?bk(e,t):yk(e)}function yk(e){return Au({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function bk(e,t){function n(r,i,a,s,o,l,c,u,d,h,p,f,v,m){var y=c-r,g=u-i,x=y*y+g*g;if(x>4*t&&v--){var O=s+h,E=o+p,w=l+f,A=rn(O*O+E*E+w*w),I=Bn(w/=A),R=Lt(Lt(w)-1)<Rt||Lt(a-d)<Rt?(a+d)/2:Cr(E,O),L=e(R,I),$=L[0],F=L[1],P=$-r,H=F-i,_=g*P-y*H;(_*_/x>t||Lt((y*P+g*H)/x-.5)>.3||s*h+o*p+l*f<vk)&&(n(r,i,a,s,o,l,$,F,R,O/=A,E/=A,w,v,m),m.point($,F),n($,F,R,O,E,w,c,u,d,h,p,f,v,m))}}return function(r){var i,a,s,o,l,c,u,d,h,p,f,v,m={point:y,lineStart:g,lineEnd:O,polygonStart:function(){r.polygonStart(),m.lineStart=E},polygonEnd:function(){r.polygonEnd(),m.lineStart=g}};function y(I,R){I=e(I,R),r.point(I[0],I[1])}function g(){d=NaN,m.point=x,r.lineStart()}function x(I,R){var L=fi([I,R]),$=e(I,R);n(d,h,u,p,f,v,d=$[0],h=$[1],u=I,p=L[0],f=L[1],v=L[2],Vg,r),r.point(d,h)}function O(){m.point=y,r.lineEnd()}function E(){g(),m.point=w,m.lineEnd=A}function w(I,R){x(i=I,R),a=d,s=h,o=p,l=f,c=v,m.point=x}function A(){n(d,h,u,p,f,v,a,s,i,o,l,c,Vg,r),m.lineEnd=O,O()}return m}}var xk=Au({point:function(e,t){this.stream.point(e*Xt,t*Xt)}});function _k(e){return Au({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Ek(e,t,n,r,i){function a(s,o){return s*=r,o*=i,[t+e*s,n-e*o]}return a.invert=function(s,o){return[(s-t)/e*r,(n-o)/e*i]},a}function Gg(e,t,n,r,i,a){if(!a)return Ek(e,t,n,r,i);var s=Dt(a),o=$t(a),l=s*e,c=o*e,u=s/e,d=o/e,h=(o*n-s*t)/e,p=(o*t+s*n)/e;function f(v,m){return v*=r,m*=i,[l*v-c*m+t,n-c*v-l*m]}return f.invert=function(v,m){return[r*(u*v-d*m+h),i*(p-d*v-u*m)]},f}function vo(e){return jg(function(){return e})()}function jg(e){var t,n=150,r=480,i=250,a=0,s=0,o=0,l=0,c=0,u,d=0,h=1,p=1,f=null,v=Eg,m=null,y,g,x,O=bu,E=.5,w,A,I,R,L;function $(_){return I(_[0]*Xt,_[1]*Xt)}function F(_){return _=I.invert(_[0],_[1]),_&&[_[0]*ge,_[1]*ge]}$.stream=function(_){return R&&L===_?R:R=xk(_k(u)(v(w(O(L=_)))))},$.preclip=function(_){return arguments.length?(v=_,f=void 0,H()):v},$.postclip=function(_){return arguments.length?(O=_,m=y=g=x=null,H()):O},$.clipAngle=function(_){return arguments.length?(v=+_?JA(f=_*Xt):(f=null,Eg),H()):f*ge},$.clipExtent=function(_){return arguments.length?(O=_==null?(m=y=g=x=null,bu):ek(m=+_[0][0],y=+_[0][1],g=+_[1][0],x=+_[1][1]),H()):m==null?null:[[m,y],[g,x]]},$.scale=function(_){return arguments.length?(n=+_,P()):n},$.translate=function(_){return arguments.length?(r=+_[0],i=+_[1],P()):[r,i]},$.center=function(_){return arguments.length?(a=_[0]%360*Xt,s=_[1]%360*Xt,P()):[a*ge,s*ge]},$.rotate=function(_){return arguments.length?(o=_[0]%360*Xt,l=_[1]%360*Xt,c=_.length>2?_[2]%360*Xt:0,P()):[o*ge,l*ge,c*ge]},$.angle=function(_){return arguments.length?(d=_%360*Xt,P()):d*ge},$.reflectX=function(_){return arguments.length?(h=_?-1:1,P()):h<0},$.reflectY=function(_){return arguments.length?(p=_?-1:1,P()):p<0},$.precision=function(_){return arguments.length?(w=Fg(A,E=_*_),H()):rn(E)},$.fitExtent=function(_,C){return Hg($,_,C)},$.fitSize=function(_,C){return fk($,_,C)},$.fitWidth=function(_,C){return mk($,_,C)},$.fitHeight=function(_,C){return gk($,_,C)};function P(){var _=Gg(n,0,0,h,p,d).apply(null,t(a,s)),C=Gg(n,r-_[0],i-_[1],h,p,d);return u=pg(o,l,c),A=gu(t,C),I=gu(u,A),w=Fg(A,E),H()}function H(){return R=L=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&F,P()}}function zg(e){var t=0,n=vt/3,r=jg(e),i=r(t,n);return i.parallels=function(a){return arguments.length?r(t=a[0]*Xt,n=a[1]*Xt):[t*ge,n*ge]},i}function Ok(e){var t=Dt(e);function n(r,i){return[r*t,$t(i)/t]}return n.invert=function(r,i){return[r/t,Bn(i*t)]},n}function wk(e,t){var n=$t(e),r=(n+$t(t))/2;if(Lt(r)<Rt)return Ok(e);var i=1+n*(2*r-n),a=rn(i)/r;function s(o,l){var c=rn(i-2*r*$t(l))/r;return[c*$t(o*=r),a-c*Dt(o)]}return s.invert=function(o,l){var c=a-l,u=Cr(o,Lt(c))*Qn(c);return c*r<0&&(u-=vt*Qn(o)*Qn(c)),[u/r,Bn((i-(o*o+c*c)*r*r)/(2*r))]},s}function Wg(){return zg(wk).scale(155.424).center([0,33.6442])}function Sk(){return Wg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Lu(e,t){return[e,FA(GA((we+t)/2))]}Lu.invert=function(e,t){return[e,2*cg(VA(t))-we]};function Tk(){return $k(Lu).scale(961/Le)}function $k(e){var t=vo(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,s=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=o=l=c=null:(s=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,o],[l,c]]};function u(){var d=vt*r(),h=t(zA(t.rotate()).invert([0,0]));return a(s==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Lu?[[Math.max(h[0]-d,s),o],[Math.min(h[0]+d,l),c]]:[[s,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function yo(e,t){return[e,t]}yo.invert=yo;function Mk(){return vo(yo).scale(152.63)}function Ck(e,t){var n=Dt(e),r=e===t?$t(e):(n-Dt(t))/(t-e),i=n/r+e;if(Lt(r)<Rt)return yo;function a(s,o){var l=i-o,c=r*s;return[l*$t(c),i-l*Dt(c)]}return a.invert=function(s,o){var l=i-o,c=Cr(s,Lt(l))*Qn(l);return l*r<0&&(c-=vt*Qn(s)*Qn(l)),[c/r,i-Qn(r)*rn(s*s+l*l)]},a}function Ak(){return zg(Ck).scale(131.154).center([0,13.9389])}var Sa=1.340264,Ta=-.081106,$a=893e-6,Ma=.003796,bo=rn(3)/2,kk=12;function qg(e,t){var n=Bn(bo*$t(t)),r=n*n,i=r*r*r;return[e*Dt(n)/(bo*(Sa+3*Ta*r+i*(7*$a+9*Ma*r))),n*(Sa+Ta*r+i*($a+Ma*r))]}qg.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,s,o,l;a<kk&&(o=n*(Sa+Ta*r+i*($a+Ma*r))-t,l=Sa+3*Ta*r+i*(7*$a+9*Ma*r),n-=s=o/l,r=n*n,i=r*r*r,!(Lt(s)<og));++a);return[bo*e*(Sa+3*Ta*r+i*(7*$a+9*Ma*r))/Dt(n),Bn($t(n)/bo)]};function Rk(){return vo(qg).scale(177.158)}function Yg(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Yg.invert=function(e,t){var n=t,r=25,i;do{var a=n*n,s=a*a;n-=i=(n*(1.007226+a*(.015085+s*(-.044475+.028874*a-.005916*s)))-t)/(1.007226+a*(.015085*3+s*(-.044475*7+.028874*9*a-.005916*11*s)))}while(Lt(i)>Rt&&--r>0);return[e/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]};function Lk(){return vo(Yg).scale(175.295)}function Dk(e,t){return e.parent===t.parent?1:2}function Ik(e){return e.reduce(Nk,0)/e.length}function Nk(e,t){return e+t.x}function Pk(e){return 1+e.reduce(Uk,0)}function Uk(e,t){return Math.max(e,t.y)}function Bk(e){for(var t;t=e.children;)e=t[0];return e}function Hk(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Vk(){var e=Dk,t=1,n=1,r=!1;function i(a){var s,o=0;a.eachAfter(function(h){var p=h.children;p?(h.x=Ik(p),h.y=Pk(p)):(h.x=s?o+=e(h,s):0,h.y=0,s=h)});var l=Bk(a),c=Hk(a),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return a.eachAfter(r?function(h){h.x=(h.x-a.x)*t,h.y=(a.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(a.y?h.y/a.y:1))*n})}return i.separation=function(a){return arguments.length?(e=a,i):e},i.size=function(a){return arguments.length?(r=!1,t=+a[0],n=+a[1],i):r?null:[t,n]},i.nodeSize=function(a){return arguments.length?(r=!0,t=+a[0],n=+a[1],i):r?[t,n]:null},i}function Fk(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 Gk(){return this.eachAfter(Fk)}function jk(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function zk(e,t){for(var n=this,r=[n],i,a,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function Wk(e,t){for(var n=this,r=[n],i=[],a,s,o,l=-1;n=r.pop();)if(i.push(n),a=n.children)for(s=0,o=a.length;s<o;++s)r.push(a[s]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function qk(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Yk(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Zk(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Xk(e){for(var t=this,n=Kk(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 Kk(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 Qk(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Jk(){return Array.from(this)}function tR(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function eR(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*nR(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function Ca(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=aR)):t===void 0&&(t=iR);for(var n=new Aa(e),r,i=[n],a,s,o,l;r=i.pop();)if((s=t(r.data))&&(l=(s=Array.from(s)).length))for(r.children=s,o=l-1;o>=0;--o)i.push(a=s[o]=new Aa(s[o])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(oR)}function rR(){return Ca(this).eachBefore(sR)}function iR(e){return e.children}function aR(e){return Array.isArray(e)?e[1]:null}function sR(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function oR(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Aa(e){this.data=e,this.depth=this.height=0,this.parent=null}Aa.prototype=Ca.prototype={constructor:Aa,count:Gk,each:jk,eachAfter:Wk,eachBefore:zk,find:qk,sum:Yk,sort:Zk,path:Xk,ancestors:Qk,descendants:Jk,leaves:tR,links:eR,copy:rR,[Symbol.iterator]:nR};function lR(e){return e==null?null:Zg(e)}function Zg(e){if(typeof e!="function")throw new Error;return e}function kr(){return 0}function vi(e){return function(){return e}}const cR=1664525,uR=1013904223,Xg=4294967296;function hR(){let e=1;return()=>(e=(cR*e+uR)%Xg)/Xg}function dR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pR(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 fR(e,t){for(var n=0,r=(e=pR(Array.from(e),t)).length,i=[],a,s;n<r;)a=e[n],s&&Kg(s,a)?++n:(s=gR(i=mR(i,a)),n=0);return s}function mR(e,t){var n,r;if(Du(t,e))return[t];for(n=0;n<e.length;++n)if(xo(t,e[n])&&Du(ka(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(xo(ka(e[n],e[r]),t)&&xo(ka(e[n],t),e[r])&&xo(ka(e[r],t),e[n])&&Du(Qg(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function xo(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Kg(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Du(e,t){for(var n=0;n<t.length;++n)if(!Kg(e,t[n]))return!1;return!0}function gR(e){switch(e.length){case 1:return vR(e[0]);case 2:return ka(e[0],e[1]);case 3:return Qg(e[0],e[1],e[2])}}function vR(e){return{x:e.x,y:e.y,r:e.r}}function ka(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,s=t.y,o=t.r,l=a-n,c=s-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+a+l/d*u)/2,y:(r+s+c/d*u)/2,r:(d+i+o)/2}}function Qg(e,t,n){var r=e.x,i=e.y,a=e.r,s=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-s,p=r-c,f=i-o,v=i-u,m=l-a,y=d-a,g=r*r+i*i-a*a,x=g-s*s-o*o+l*l,O=g-c*c-u*u+d*d,E=p*f-h*v,w=(f*O-v*x)/(E*2)-r,A=(v*m-f*y)/E,I=(p*x-h*O)/(E*2)-i,R=(h*y-p*m)/E,L=A*A+R*R-1,$=2*(a+w*A+I*R),F=w*w+I*I-a*a,P=-(Math.abs(L)>1e-6?($+Math.sqrt($*$-4*L*F))/(2*L):F/$);return{x:r+w+A*P,y:i+I+R*P,r:P}}function Jg(e,t,n){var r=e.x-t.x,i,a,s=e.y-t.y,o,l,c=r*r+s*s;c?(a=t.r+n.r,a*=a,l=e.r+n.r,l*=l,a>l?(i=(c+l-a)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*s,n.y=e.y-i*s+o*r):(i=(c+a-l)/(2*c),o=Math.sqrt(Math.max(0,a/c-i*i)),n.x=t.x+i*r-o*s,n.y=t.y+i*s+o*r)):(n.x=t.x+n.r,n.y=t.y)}function tv(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 ev(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function _o(e){this._=e,this.next=null,this.previous=null}function yR(e,t){if(!(a=(e=dR(e)).length))return 0;var n,r,i,a,s,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(a>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;Jg(r,n,i=e[2]),n=new _o(n),r=new _o(r),i=new _o(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<a;++l){Jg(n._,r._,i=e[l]),i=new _o(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(tv(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(tv(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,s=ev(n);(i=i.next)!==r;)(o=ev(i))<s&&(n=i,s=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=fR(n,t),l=0;l<a;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function bR(e){return Math.sqrt(e.value)}function xR(){var e=null,t=1,n=1,r=kr;function i(a){const s=hR();return a.x=t/2,a.y=n/2,e?a.eachBefore(nv(e)).eachAfter(Iu(r,.5,s)).eachBefore(rv(1)):a.eachBefore(nv(bR)).eachAfter(Iu(kr,1,s)).eachAfter(Iu(r,a.r/Math.min(t,n),s)).eachBefore(rv(Math.min(t,n)/(2*a.r))),a}return i.radius=function(a){return arguments.length?(e=lR(a),i):e},i.size=function(a){return arguments.length?(t=+a[0],n=+a[1],i):[t,n]},i.padding=function(a){return arguments.length?(r=typeof a=="function"?a:vi(+a),i):r},i}function nv(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Iu(e,t,n){return function(r){if(i=r.children){var i,a,s=i.length,o=e(r)*t||0,l;if(o)for(a=0;a<s;++a)i[a].r+=o;if(l=yR(i,n),o)for(a=0;a<s;++a)i[a].r-=o;r.r=l+o}}}function rv(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function _R(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ER(e,t,n,r,i){for(var a=e.children,s,o=-1,l=a.length,c=e.value&&(r-t)/e.value;++o<l;)s=a[o],s.y0=n,s.y1=i,s.x0=t,s.x1=t+=s.value*c}function OR(e,t){return e.parent===t.parent?1:2}function Nu(e){var t=e.children;return t?t[0]:e.t}function Pu(e){var t=e.children;return t?t[t.length-1]:e.t}function wR(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function SR(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function TR(e,t,n){return e.a.parent===t.parent?e.a:n}function Eo(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}Eo.prototype=Object.create(Aa.prototype);function $R(e){for(var t=new Eo(e,0),n,r=[t],i,a,s,o;n=r.pop();)if(a=n._.children)for(n.children=new Array(o=a.length),s=o-1;s>=0;--s)r.push(i=n.children[s]=new Eo(a[s],s)),i.parent=n;return(t.parent=new Eo(null,0)).children=[t],t}function MR(){var e=OR,t=1,n=1,r=null;function i(c){var u=$R(c);if(u.eachAfter(a),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(g){g.x<d.x&&(d=g),g.x>h.x&&(h=g),g.depth>p.depth&&(p=g)});var f=d===h?1:e(d,h)/2,v=f-d.x,m=t/(h.x+f+v),y=n/(p.depth||1);c.eachBefore(function(g){g.x=(g.x+v)*m,g.y=g.depth*y})}return c}function a(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){SR(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 s(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,v=h.parent.children[0],m=h.m,y=p.m,g=f.m,x=v.m,O;f=Pu(f),h=Nu(h),f&&h;)v=Nu(v),p=Pu(p),p.a=c,O=f.z+g-h.z-m+e(f._,h._),O>0&&(wR(TR(f,c,d),c,O),m+=O,y+=O),g+=f.m,m+=h.m,x+=v.m,y+=p.m;f&&!Pu(p)&&(p.t=f,p.m+=g-y),h&&!Nu(v)&&(v.t=h,v.m+=m-x,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 CR(e,t,n,r,i){for(var a=e.children,s,o=-1,l=a.length,c=e.value&&(i-n)/e.value;++o<l;)s=a[o],s.x0=t,s.x1=r,s.y0=n,s.y1=n+=s.value*c}var AR=(1+Math.sqrt(5))/2;function kR(e,t,n,r,i,a){for(var s=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,v=t.value,m,y,g,x,O,E,w;u<h;){p=i-n,f=a-r;do m=o[d++].value;while(!m&&d<h);for(y=g=m,E=Math.max(f/p,p/f)/(v*e),w=m*m*E,O=Math.max(g/w,w/y);d<h;++d){if(m+=c=o[d].value,c<y&&(y=c),c>g&&(g=c),w=m*m*E,x=Math.max(g/w,w/y),x>O){m-=c;break}O=x}s.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?ER(l,n,r,i,v?r+=f*m/v:a):CR(l,n,r,v?n+=p*m/v:i,a),v-=m,u=d}return s}const RR=function e(t){function n(r,i,a,s,o){kR(t,r,i,a,s,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(AR);function LR(){var e=RR,t=!1,n=1,r=1,i=[0],a=kr,s=kr,o=kr,l=kr,c=kr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(_R),h}function d(h){var p=i[h.depth],f=h.x0+p,v=h.y0+p,m=h.x1-p,y=h.y1-p;m<f&&(f=m=(f+m)/2),y<v&&(v=y=(v+y)/2),h.x0=f,h.y0=v,h.x1=m,h.y1=y,h.children&&(p=i[h.depth+1]=a(h)/2,f+=c(h)-p,v+=s(h)-p,m-=o(h)-p,y-=l(h)-p,m<f&&(f=m=(f+m)/2),y<v&&(v=y=(v+y)/2),e(h,f,v,m,y))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Zg(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(a=typeof h=="function"?h:vi(+h),u):a},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(s=typeof h=="function"?h:vi(+h),u):s},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:vi(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:vi(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:vi(+h),u):c},u}function Oo(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new hu(t)}function DR(e){return e.innerRadius}function IR(e){return e.outerRadius}function NR(e){return e.startAngle}function PR(e){return e.endAngle}function UR(e){return e&&e.padAngle}function BR(e,t,n,r,i,a,s,o){var l=n-e,c=r-t,u=s-i,d=o-a,h=d*l-u*c;if(!(h*h<de))return h=(u*(t-a)-d*(e-i))/h,[e+h*l,t+h*c]}function wo(e,t,n,r,i,a,s){var o=e-n,l=t-r,c=(s?a:-a)/li(o*o+l*l),u=c*l,d=-c*o,h=e+u,p=t+d,f=n+u,v=r+d,m=(h+f)/2,y=(p+v)/2,g=f-h,x=v-p,O=g*g+x*x,E=i-a,w=h*v-f*p,A=(x<0?-1:1)*li(EC(0,E*E*O-w*w)),I=(w*x-g*A)/O,R=(-w*g-x*A)/O,L=(w*x+g*A)/O,$=(-w*g+x*A)/O,F=I-m,P=R-y,H=L-m,_=$-y;return F*F+P*P>H*H+_*_&&(I=L,R=$),{cx:I,cy:R,x01:-u,y01:-d,x11:I*(i/E-1),y11:R*(i/E-1)}}function Ra(){var e=DR,t=IR,n=ft(0),r=null,i=NR,a=PR,s=UR,o=null,l=Oo(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-zs,v=a.apply(this,arguments)-zs,m=lm(v-f),y=v>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>de))o.moveTo(0,0);else if(m>Ws-de)o.moveTo(p*Tr(f),p*mn(f)),o.arc(0,0,p,f,v,!y),h>de&&(o.moveTo(h*Tr(v),h*mn(v)),o.arc(0,0,h,v,f,y));else{var g=f,x=v,O=f,E=v,w=m,A=m,I=s.apply(this,arguments)/2,R=I>de&&(r?+r.apply(this,arguments):li(h*h+p*p)),L=Yc(lm(p-h)/2,+n.apply(this,arguments)),$=L,F=L,P,H;if(R>de){var _=cm(R/h*mn(I)),C=cm(R/p*mn(I));(w-=_*2)>de?(_*=y?1:-1,O+=_,E-=_):(w=0,O=E=(f+v)/2),(A-=C*2)>de?(C*=y?1:-1,g+=C,x-=C):(A=0,g=x=(f+v)/2)}var k=p*Tr(g),U=p*mn(g),B=h*Tr(E),X=h*mn(E);if(L>de){var Y=p*Tr(x),ot=p*mn(x),it=h*Tr(O),xt=h*mn(O),at;if(m<ga)if(at=BR(k,U,it,xt,Y,ot,B,X)){var K=k-at[0],et=U-at[1],mt=Y-at[0],q=ot-at[1],J=1/mn(OC((K*mt+et*q)/(li(K*K+et*et)*li(mt*mt+q*q)))/2),dt=li(at[0]*at[0]+at[1]*at[1]);$=Yc(L,(h-dt)/(J-1)),F=Yc(L,(p-dt)/(J+1))}else $=F=0}A>de?F>de?(P=wo(it,xt,k,U,p,F,y),H=wo(Y,ot,B,X,p,F,y),o.moveTo(P.cx+P.x01,P.cy+P.y01),F<L?o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,p,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),!y),o.arc(H.cx,H.cy,F,he(H.y11,H.x11),he(H.y01,H.x01),!y))):(o.moveTo(k,U),o.arc(0,0,p,g,x,!y)):o.moveTo(k,U),!(h>de)||!(w>de)?o.lineTo(B,X):$>de?(P=wo(B,X,Y,ot,h,-$,y),H=wo(k,U,it,xt,h,-$,y),o.lineTo(P.cx+P.x01,P.cy+P.y01),$<L?o.arc(P.cx,P.cy,$,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,$,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,h,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),y),o.arc(H.cx,H.cy,$,he(H.y11,H.x11),he(H.y01,H.x01),!y))):o.arc(0,0,h,E,O,y)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-ga/2;return[Tr(d)*u,mn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ft(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ft(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ft(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ft(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ft(+u),c):i},c.endAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ft(+u),c):a},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ft(+u),c):s},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function Uu(e){return e[0]}function Bu(e){return e[1]}function La(e,t){var n=ft(!0),r=null,i=qs,a=null,s=Oo(o);e=typeof e=="function"?e:e===void 0?Uu:ft(e),t=typeof t=="function"?t:t===void 0?Bu:ft(t);function o(l){var c,u=(l=Bs(l)).length,d,h=!1,p;for(r==null&&(a=i(p=s())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(d,c,l),+t(d,c,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ft(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ft(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ft(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),o):r},o}function Hu(e,t,n){var r=null,i=ft(!0),a=null,s=qs,o=null,l=Oo(c);e=typeof e=="function"?e:e===void 0?Uu:ft(+e),t=typeof t=="function"?t:ft(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Bu:ft(+n);function c(d){var h,p,f,v=(d=Bs(d)).length,m,y=!1,g,x=new Array(v),O=new Array(v);for(a==null&&(o=s(g=l())),h=0;h<=v;++h){if(!(h<v&&i(m=d[h],h,d))===y)if(y=!y)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(x[f],O[f]);o.lineEnd(),o.areaEnd()}y&&(x[h]=+e(m,h,d),O[h]=+t(m,h,d),o.point(r?+r(m,h,d):x[h],n?+n(m,h,d):O[h]))}if(g)return o=null,g+""||null}function u(){return La().defined(i).curve(s).context(a)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ft(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:ft(+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:ft(!!d),c):i},c.curve=function(d){return arguments.length?(s=d,a!=null&&(o=s(a)),c):s},c.context=function(d){return arguments.length?(d==null?a=o=null:o=s(a=d),c):a},c}function HR(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function VR(e){return e}function FR(){var e=VR,t=HR,n=null,r=ft(0),i=ft(Ws),a=ft(0);function s(o){var l,c=(o=Bs(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),v=+r.apply(this,arguments),m=Math.min(Ws,Math.max(-Ws,i.apply(this,arguments)-v)),y,g=Math.min(Math.abs(m)/c,a.apply(this,arguments)),x=g*(m<0?-1:1),O;for(l=0;l<c;++l)(O=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=O);for(t!=null?p.sort(function(E,w){return t(f[E],f[w])}):n!=null&&p.sort(function(E,w){return n(o[E],o[w])}),l=0,d=h?(m-c*x)/h:0;l<c;++l,v=y)u=p[l],O=f[u],y=v+(O>0?O*d:0)+x,f[u]={data:o[u],index:l,value:O,startAngle:v,endAngle:y,padAngle:g};return f}return s.value=function(o){return arguments.length?(e=typeof o=="function"?o:ft(+o),s):e},s.sortValues=function(o){return arguments.length?(t=o,n=null,s):t},s.sort=function(o){return arguments.length?(n=o,t=null,s):n},s.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:ft(+o),s):r},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ft(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:ft(+o),s):a},s}var GR=av(qs);function iv(e){this._curve=e}iv.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 av(e){function t(n){return new iv(e(n))}return t._curve=e,t}function jR(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(av(n)):t()._curve},e}function zR(){return jR(La().curve(GR))}class WR{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 qR(e){return new WR(e,!0)}function YR(e){return e.source}function ZR(e){return e.target}function XR(e){let t=YR,n=ZR,r=Uu,i=Bu,a=null,s=null,o=Oo(l);function l(){let c;const u=g$.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(a==null&&(s=e(c=o())),s.lineStart(),u[0]=d,s.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,s.point(+r.apply(this,u),+i.apply(this,u)),s.lineEnd(),c)return s=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:ft(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ft(+c),l):i},l.context=function(c){return arguments.length?(c==null?a=s=null:s=e(a=c),l):a},l}function KR(){return XR(qR)}let yt=class{constructor(t,n,r){if(this.type="",this.renderType=rt.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=b(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(D(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=b(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Ee}--${i}--${this.type}`,!0),r&&r.classed(`${Ee}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=b(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${Ee}--${n}--${this.type}`);if(t.withinChartClip){const a=this.model.get("chartClipId");if(a){const s=D(`#${a}`).select("rect");s.size()!==0&&parseFloat(s.attr("height"))>0&&i.attr("clip-path",`url(#${a})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ct({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:sv,setPrototypeOf:ov,isFrozen:QR,getPrototypeOf:JR,getOwnPropertyDescriptor:tL}=Object;let{freeze:ve,seal:We,create:lv}=Object,{apply:Vu,construct:Fu}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e}),We||(We=function(e){return e}),Vu||(Vu=function(e,t,n){return e.apply(t,n)}),Fu||(Fu=function(e,t){return new e(...t)});const So=De(Array.prototype.forEach),cv=De(Array.prototype.pop),Da=De(Array.prototype.push),To=De(String.prototype.toLowerCase),Gu=De(String.prototype.toString),uv=De(String.prototype.match),Ia=De(String.prototype.replace),eL=De(String.prototype.indexOf),nL=De(String.prototype.trim),an=De(Object.prototype.hasOwnProperty),ye=De(RegExp.prototype.test),Na=rL(TypeError);function De(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Vu(e,t,r)}}function rL(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fu(e,n)}}function bt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:To;ov&&ov(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(QR(t)||(t[r]=a),i=a)}e[i]=!0}return e}function iL(e){for(let t=0;t<e.length;t++)an(e,t)||(e[t]=null);return e}function Rr(e){const t=lv(null);for(const[n,r]of sv(e))an(e,n)&&(Array.isArray(r)?t[n]=iL(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Rr(r):t[n]=r);return t}function Pa(e,t){for(;e!==null;){const r=tL(e,t);if(r){if(r.get)return De(r.get);if(typeof r.value=="function")return De(r.value)}e=JR(e)}function n(){return null}return n}const hv=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ju=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),zu=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),aL=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Wu=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sL=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dv=ve(["#text"]),pv=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qu=ve(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fv=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),$o=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),oL=We(/\{\{[\w\W]*|[\w\W]*\}\}/gm),lL=We(/<%[\w\W]*|[\w\W]*%>/gm),cL=We(/\${[\w\W]*}/gm),uL=We(/^data-[\-\w.\u00B7-\uFFFF]/),hL=We(/^aria-[\-\w]+$/),mv=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dL=We(/^(?:\w+script|data):/i),pL=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gv=We(/^html$/i),fL=We(/^[a-z][.\w]*(-[.\w]+)+$/i);var vv=Object.freeze({__proto__:null,MUSTACHE_EXPR:oL,ERB_EXPR:lL,TMPLIT_EXPR:cL,DATA_ATTR:uL,ARIA_ATTR:hL,IS_ALLOWED_URI:mv,IS_SCRIPT_OR_DATA:dL,ATTR_WHITESPACE:pL,DOCTYPE_NAME:gv,CUSTOM_ELEMENT:fL});const Ua={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mL=function(){return typeof window>"u"?null:window},gL=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(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function yv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mL();const t=T=>yv(T);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Ua.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,v=Pa(f,"cloneNode"),m=Pa(f,"remove"),y=Pa(f,"nextSibling"),g=Pa(f,"childNodes"),x=Pa(f,"parentNode");if(typeof s=="function"){const T=n.createElement("template");T.content&&T.content.ownerDocument&&(n=T.content.ownerDocument)}let O,E="";const{implementation:w,createNodeIterator:A,createDocumentFragment:I,getElementsByTagName:R}=n,{importNode:L}=r;let $={};t.isSupported=typeof sv=="function"&&typeof x=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:P,TMPLIT_EXPR:H,DATA_ATTR:_,ARIA_ATTR:C,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:B}=vv;let{IS_ALLOWED_URI:X}=vv,Y=null;const ot=bt({},[...hv,...ju,...zu,...Wu,...dv]);let it=null;const xt=bt({},[...pv,...qu,...fv,...$o]);let at=Object.seal(lv(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}})),K=null,et=null,mt=!0,q=!0,J=!1,dt=!0,j=!1,It=!0,gt=!1,qt=!1,jt=!1,nt=!1,Mt=!1,xe=!1,Pe=!0,Yo=!1;const za="user-content-";let Wa=!0,Ir=!1,Fn={},Gn=null;const rr=bt({},["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 Zo=null;const qa=bt({},["audio","video","img","source","image","track"]);let Oi=null;const wi=bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Si="http://www.w3.org/1998/Math/MathML",Ti="http://www.w3.org/2000/svg",on="http://www.w3.org/1999/xhtml";let ir=on,Ya=!1,Za=null;const Nh=bt({},[Si,Ti,on],Gu);let jn=null;const Xo=["application/xhtml+xml","text/html"],ar="text/html";let Kt=null,xn=null;const Ko=n.createElement("form"),Qo=function(T){return T instanceof RegExp||T instanceof Function},$i=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xn&&xn===T)){if((!T||typeof T!="object")&&(T={}),T=Rr(T),jn=Xo.indexOf(T.PARSER_MEDIA_TYPE)===-1?ar:T.PARSER_MEDIA_TYPE,Kt=jn==="application/xhtml+xml"?Gu:To,Y=an(T,"ALLOWED_TAGS")?bt({},T.ALLOWED_TAGS,Kt):ot,it=an(T,"ALLOWED_ATTR")?bt({},T.ALLOWED_ATTR,Kt):xt,Za=an(T,"ALLOWED_NAMESPACES")?bt({},T.ALLOWED_NAMESPACES,Gu):Nh,Oi=an(T,"ADD_URI_SAFE_ATTR")?bt(Rr(wi),T.ADD_URI_SAFE_ATTR,Kt):wi,Zo=an(T,"ADD_DATA_URI_TAGS")?bt(Rr(qa),T.ADD_DATA_URI_TAGS,Kt):qa,Gn=an(T,"FORBID_CONTENTS")?bt({},T.FORBID_CONTENTS,Kt):rr,K=an(T,"FORBID_TAGS")?bt({},T.FORBID_TAGS,Kt):{},et=an(T,"FORBID_ATTR")?bt({},T.FORBID_ATTR,Kt):{},Fn=an(T,"USE_PROFILES")?T.USE_PROFILES:!1,mt=T.ALLOW_ARIA_ATTR!==!1,q=T.ALLOW_DATA_ATTR!==!1,J=T.ALLOW_UNKNOWN_PROTOCOLS||!1,dt=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,j=T.SAFE_FOR_TEMPLATES||!1,It=T.SAFE_FOR_XML!==!1,gt=T.WHOLE_DOCUMENT||!1,nt=T.RETURN_DOM||!1,Mt=T.RETURN_DOM_FRAGMENT||!1,xe=T.RETURN_TRUSTED_TYPE||!1,jt=T.FORCE_BODY||!1,Pe=T.SANITIZE_DOM!==!1,Yo=T.SANITIZE_NAMED_PROPS||!1,Wa=T.KEEP_CONTENT!==!1,Ir=T.IN_PLACE||!1,X=T.ALLOWED_URI_REGEXP||mv,ir=T.NAMESPACE||on,at=T.CUSTOM_ELEMENT_HANDLING||{},T.CUSTOM_ELEMENT_HANDLING&&Qo(T.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(at.tagNameCheck=T.CUSTOM_ELEMENT_HANDLING.tagNameCheck),T.CUSTOM_ELEMENT_HANDLING&&Qo(T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(at.attributeNameCheck=T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(at.allowCustomizedBuiltInElements=T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),j&&(q=!1),Mt&&(nt=!0),Fn&&(Y=bt({},dv),it=[],Fn.html===!0&&(bt(Y,hv),bt(it,pv)),Fn.svg===!0&&(bt(Y,ju),bt(it,qu),bt(it,$o)),Fn.svgFilters===!0&&(bt(Y,zu),bt(it,qu),bt(it,$o)),Fn.mathMl===!0&&(bt(Y,Wu),bt(it,fv),bt(it,$o))),T.ADD_TAGS&&(Y===ot&&(Y=Rr(Y)),bt(Y,T.ADD_TAGS,Kt)),T.ADD_ATTR&&(it===xt&&(it=Rr(it)),bt(it,T.ADD_ATTR,Kt)),T.ADD_URI_SAFE_ATTR&&bt(Oi,T.ADD_URI_SAFE_ATTR,Kt),T.FORBID_CONTENTS&&(Gn===rr&&(Gn=Rr(Gn)),bt(Gn,T.FORBID_CONTENTS,Kt)),Wa&&(Y["#text"]=!0),gt&&bt(Y,["html","head","body"]),Y.table&&(bt(Y,["tbody"]),delete K.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Na('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Na('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=T.TRUSTED_TYPES_POLICY,E=O.createHTML("")}else O===void 0&&(O=gL(p,i)),O!==null&&typeof E=="string"&&(E=O.createHTML(""));ve&&ve(T),xn=T}},Jo=bt({},["mi","mo","mn","ms","mtext"]),Xa=bt({},["foreignobject","annotation-xml"]),tl=bt({},["title","style","font","a","script"]),el=bt({},[...ju,...zu,...aL]),nl=bt({},[...Wu,...sL]),rl=function(T){let Z=x(T);(!Z||!Z.tagName)&&(Z={namespaceURI:ir,tagName:"template"});const W=To(T.tagName),lt=To(Z.tagName);return Za[T.namespaceURI]?T.namespaceURI===Ti?Z.namespaceURI===on?W==="svg":Z.namespaceURI===Si?W==="svg"&&(lt==="annotation-xml"||Jo[lt]):!!el[W]:T.namespaceURI===Si?Z.namespaceURI===on?W==="math":Z.namespaceURI===Ti?W==="math"&&Xa[lt]:!!nl[W]:T.namespaceURI===on?Z.namespaceURI===Ti&&!Xa[lt]||Z.namespaceURI===Si&&!Jo[lt]?!1:!nl[W]&&(tl[W]||!el[W]):!!(jn==="application/xhtml+xml"&&Za[T.namespaceURI]):!1},_n=function(T){Da(t.removed,{element:T});try{x(T).removeChild(T)}catch{m(T)}},Mi=function(T,Z){try{Da(t.removed,{attribute:Z.getAttributeNode(T),from:Z})}catch{Da(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(T),T==="is"&&!it[T])if(nt||Mt)try{_n(Z)}catch{}else try{Z.setAttribute(T,"")}catch{}},il=function(T){let Z=null,W=null;if(jt)T="<remove></remove>"+T;else{const Ut=uv(T,/^[\r\n\t ]+/);W=Ut&&Ut[0]}jn==="application/xhtml+xml"&&ir===on&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const lt=O?O.createHTML(T):T;if(ir===on)try{Z=new h().parseFromString(lt,jn)}catch{}if(!Z||!Z.documentElement){Z=w.createDocument(ir,"template",null);try{Z.documentElement.innerHTML=Ya?E:lt}catch{}}const At=Z.body||Z.documentElement;return T&&W&&At.insertBefore(n.createTextNode(W),At.childNodes[0]||null),ir===on?R.call(Z,gt?"html":"body")[0]:gt?Z.documentElement:At},al=function(T){return A.call(T.ownerDocument||T,T,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},sl=function(T){return T instanceof d&&(typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||!(T.attributes instanceof u)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function")},M=function(T){return typeof o=="function"&&T instanceof o},z=function(T,Z,W){$[T]&&So($[T],lt=>{lt.call(t,Z,W,xn)})},Q=function(T){let Z=null;if(z("beforeSanitizeElements",T,null),sl(T))return _n(T),!0;const W=Kt(T.nodeName);if(z("uponSanitizeElement",T,{tagName:W,allowedTags:Y}),T.hasChildNodes()&&!M(T.firstElementChild)&&ye(/<[/\w]/g,T.innerHTML)&&ye(/<[/\w]/g,T.textContent)||T.nodeType===Ua.progressingInstruction||It&&T.nodeType===Ua.comment&&ye(/<[/\w]/g,T.data))return _n(T),!0;if(!Y[W]||K[W]){if(!K[W]&&Ot(W)&&(at.tagNameCheck instanceof RegExp&&ye(at.tagNameCheck,W)||at.tagNameCheck instanceof Function&&at.tagNameCheck(W)))return!1;if(Wa&&!Gn[W]){const lt=x(T)||T.parentNode,At=g(T)||T.childNodes;if(At&&lt){const Ut=At.length;for(let oe=Ut-1;oe>=0;--oe){const Bt=v(At[oe],!0);Bt.__removalCount=(T.__removalCount||0)+1,lt.insertBefore(Bt,y(T))}}}return _n(T),!0}return T instanceof l&&!rl(T)||(W==="noscript"||W==="noembed"||W==="noframes")&&ye(/<\/no(script|embed|frames)/i,T.innerHTML)?(_n(T),!0):(j&&T.nodeType===Ua.text&&(Z=T.textContent,So([F,P,H],lt=>{Z=Ia(Z,lt," ")}),T.textContent!==Z&&(Da(t.removed,{element:T.cloneNode()}),T.textContent=Z)),z("afterSanitizeElements",T,null),!1)},ut=function(T,Z,W){if(Pe&&(Z==="id"||Z==="name")&&(W in n||W in Ko))return!1;if(!(q&&!et[Z]&&ye(_,Z))&&!(mt&&ye(C,Z))){if(!it[Z]||et[Z]){if(!(Ot(T)&&(at.tagNameCheck instanceof RegExp&&ye(at.tagNameCheck,T)||at.tagNameCheck instanceof Function&&at.tagNameCheck(T))&&(at.attributeNameCheck instanceof RegExp&&ye(at.attributeNameCheck,Z)||at.attributeNameCheck instanceof Function&&at.attributeNameCheck(Z))||Z==="is"&&at.allowCustomizedBuiltInElements&&(at.tagNameCheck instanceof RegExp&&ye(at.tagNameCheck,W)||at.tagNameCheck instanceof Function&&at.tagNameCheck(W))))return!1}else if(!Oi[Z]&&!ye(X,Ia(W,U,""))&&!((Z==="src"||Z==="xlink:href"||Z==="href")&&T!=="script"&&eL(W,"data:")===0&&Zo[T])&&!(J&&!ye(k,Ia(W,U,"")))&&W)return!1}return!0},Ot=function(T){return T!=="annotation-xml"&&uv(T,B)},Ct=function(T){z("beforeSanitizeAttributes",T,null);const{attributes:Z}=T;if(!Z)return;const W={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:it};let lt=Z.length;for(;lt--;){const At=Z[lt],{name:Ut,namespaceURI:oe,value:Bt}=At,$e=Kt(Ut);let le=Ut==="value"?Bt:nL(Bt);if(W.attrName=$e,W.attrValue=le,W.keepAttr=!0,W.forceKeepAttr=void 0,z("uponSanitizeAttribute",T,W),le=W.attrValue,It&&ye(/((--!?|])>)|<\/(style|title)/i,le)){Mi(Ut,T);continue}if(W.forceKeepAttr||(Mi(Ut,T),!W.keepAttr))continue;if(!dt&&ye(/\/>/i,le)){Mi(Ut,T);continue}j&&So([F,P,H],x5=>{le=Ia(le,x5," ")});const ol=Kt(T.nodeName);if(ut(ol,$e,le)){if(Yo&&($e==="id"||$e==="name")&&(Mi(Ut,T),le=za+le),O&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!oe)switch(p.getAttributeType(ol,$e)){case"TrustedHTML":{le=O.createHTML(le);break}case"TrustedScriptURL":{le=O.createScriptURL(le);break}}try{oe?T.setAttributeNS(oe,Ut,le):T.setAttribute(Ut,le),sl(T)?_n(T):cv(t.removed)}catch{}}}z("afterSanitizeAttributes",T,null)},_t=function T(Z){let W=null;const lt=al(Z);for(z("beforeSanitizeShadowDOM",Z,null);W=lt.nextNode();)z("uponSanitizeShadowNode",W,null),!Q(W)&&(W.content instanceof a&&T(W.content),Ct(W));z("afterSanitizeShadowDOM",Z,null)};return t.sanitize=function(T){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,lt=null,At=null,Ut=null;if(Ya=!T,Ya&&(T="<!-->"),typeof T!="string"&&!M(T))if(typeof T.toString=="function"){if(T=T.toString(),typeof T!="string")throw Na("dirty is not a string, aborting")}else throw Na("toString is not a function");if(!t.isSupported)return T;if(qt||$i(Z),t.removed=[],typeof T=="string"&&(Ir=!1),Ir){if(T.nodeName){const $e=Kt(T.nodeName);if(!Y[$e]||K[$e])throw Na("root node is forbidden and cannot be sanitized in-place")}}else if(T instanceof o)W=il("<!---->"),lt=W.ownerDocument.importNode(T,!0),lt.nodeType===Ua.element&&lt.nodeName==="BODY"||lt.nodeName==="HTML"?W=lt:W.appendChild(lt);else{if(!nt&&!j&&!gt&&T.indexOf("<")===-1)return O&&xe?O.createHTML(T):T;if(W=il(T),!W)return nt?null:xe?E:""}W&&jt&&_n(W.firstChild);const oe=al(Ir?T:W);for(;At=oe.nextNode();)Q(At)||(At.content instanceof a&&_t(At.content),Ct(At));if(Ir)return T;if(nt){if(Mt)for(Ut=I.call(W.ownerDocument);W.firstChild;)Ut.appendChild(W.firstChild);else Ut=W;return(it.shadowroot||it.shadowrootmode)&&(Ut=L.call(r,Ut,!0)),Ut}let Bt=gt?W.outerHTML:W.innerHTML;return gt&&Y["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&ye(gv,W.ownerDocument.doctype.name)&&(Bt="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
4
- `+Bt),j&&So([F,P,H],$e=>{Bt=Ia(Bt,$e," ")}),O&&xe?O.createHTML(Bt):Bt},t.setConfig=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$i(T),qt=!0},t.clearConfig=function(){xn=null,qt=!1},t.isValidAttribute=function(T,Z,W){xn||$i({});const lt=Kt(T),At=Kt(Z);return ut(lt,At,W)},t.addHook=function(T,Z){typeof Z=="function"&&($[T]=$[T]||[],Da($[T],Z))},t.removeHook=function(T){if($[T])return cv($[T])},t.removeHooks=function(T){$[T]&&($[T]=[])},t.removeAllHooks=function(){$={}},t}var Yu=yv();const Mo=e=>Yu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),vL=e=>Yu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),yn=e=>Yu.sanitize(e,{ALLOWED_TAGS:[]}),bv=class W0 extends yt{constructor(){super(...arguments),this.type="toolbar",this.renderType=rt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(S.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(S.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar");if(b(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("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const a=n.selectAll("div.toolbar-control").data(r,l=>l.id);a.exit().remove();const s=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;s.merge(a).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
1
+ (function(V,ce){typeof exports=="object"&&typeof module<"u"?ce(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ce):(V=typeof globalThis<"u"?globalThis:V||self,ce(V.ChartsReact={},V.React))})(this,function(V,ce){"use strict";var _5=Object.defineProperty;var E5=(V,ce,zn)=>ce in V?_5(V,ce,{enumerable:!0,configurable:!0,writable:!0,value:zn}):V[ce]=zn;var Ph=(V,ce,zn)=>E5(V,typeof ce!="symbol"?ce+"":ce,zn);var zn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(zn||{}),cl=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(cl||{}),ul=(e=>(e.UPDATE="model-update",e))(ul||{}),Bh=(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))(Bh||{}),hl=(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))(hl||{}),dl=(e=>(e.CHANGE="zoom-domain-change",e))(dl||{}),pl=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(pl||{}),fl=(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))(fl||{}),ml=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(ml||{}),gl=(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))(gl||{}),vl=(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))(vl||{}),yl=(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))(yl||{}),bl=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(bl||{}),xl=(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))(xl||{}),_l=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(_l||{}),El=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(El||{}),Ol=(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))(Ol||{}),wl=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(wl||{}),Sl=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Sl||{}),Nr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Nr||{}),Tl=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Tl||{}),Hh=(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))(Hh||{}),Vh=(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))(Vh||{}),Fh=(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))(Fh||{}),Gh=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Gh||{}),jh=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(jh||{}),Pr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Pr||{});const Y0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Fh,Area:ml,Axis:fl,Bar:bl,Boxplot:xl,CanvasZoom:pl,Chart:zn,Choropleth:Pr,CirclePack:Vh,Gauge:yl,Heatmap:jh,Legend:Hh,Line:El,Meter:Gh,Modal:cl,Model:ul,Pie:vl,Radar:Ol,Scatter:_l,Threshold:Tl,Toolbar:Bh,Tooltip:Nr,Tree:wl,Treemap:Sl,WordCloud:gl,ZoomBar:hl,ZoomDomain:dl},Symbol.toStringTag,{value:"Module"})),S=Y0;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),$l=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))($l||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),G=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(G||{}),qe=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(qe||{}),Ue=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ue||{}),Jt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Jt||{}),tt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(tt||{}),Ur=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Ur||{}),te=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(te||{}),Br=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Br||{}),Ka=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Ka||{}),Nt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Nt||{}),ht=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ht||{}),sr=(e=>(e.CENTER="center",e))(sr||{}),Ci=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ci||{}),ee=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(ee||{}),ln=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(ln||{}),cn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(cn||{}),or=(e=>(e.SEMI="semi",e.FULL="full",e))(or||{}),Qa=(e=>(e.UP="up",e.DOWN="down",e))(Qa||{}),Ai=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ai||{}),ki=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ki||{}),Me=(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))(Me||{}),Tt=(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))(Tt||{}),Ja=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ja||{}),ne=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(ne||{}),Li=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Li||{}),Hr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Hr||{}),Di=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Di||{}),un=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(un||{}),zh=(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))(zh||{});function Ml(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Ri(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):s;i=e.formattingValues[o]||e.formattingValues[s]}else{const s=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function Ii(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?X0(o,d=>d.test(s)):Z0(o,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function Z0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function X0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function K0(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const o=t.slice(i.length);return{value:s,rest:o}}}function wt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let Q0={};function ts(){return Q0}function Ni(e,t){var n,r,i,a;const s=ts(),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)??s.weekStartsOn??((a=(i=s.locale)==null?void 0:i.options)==null?void 0:a.weekStartsOn)??0,l=wt(e),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const J0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},t1=(e,t,n)=>{let r;const i=J0[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},e1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},n1=(e,t,n,r)=>e1[e],r1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},i1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},a1={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"]},s1={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"]},o1={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"}},l1={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"}},c1=(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"},u1={ordinalNumber:c1,era:Ri({values:r1,defaultWidth:"wide"}),quarter:Ri({values:i1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ri({values:a1,defaultWidth:"wide"}),day:Ri({values:s1,defaultWidth:"wide"}),dayPeriod:Ri({values:o1,defaultWidth:"wide",formattingValues:l1,defaultFormattingWidth:"wide"})},h1=/^(\d+)(th|st|nd|rd)?/i,d1=/\d+/i,p1={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},f1={any:[/^b/i,/^(a|c)/i]},m1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},g1={any:[/1/i,/2/i,/3/i,/4/i]},v1={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},y1={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]},b1={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},x1={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]},_1={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},E1={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}},O1={ordinalNumber:K0({matchPattern:h1,parsePattern:d1,valueCallback:e=>parseInt(e,10)}),era:Ii({matchPatterns:p1,defaultMatchWidth:"wide",parsePatterns:f1,defaultParseWidth:"any"}),quarter:Ii({matchPatterns:m1,defaultMatchWidth:"wide",parsePatterns:g1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ii({matchPatterns:v1,defaultMatchWidth:"wide",parsePatterns:y1,defaultParseWidth:"any"}),day:Ii({matchPatterns:b1,defaultMatchWidth:"wide",parsePatterns:x1,defaultParseWidth:"any"}),dayPeriod:Ii({matchPatterns:_1,defaultMatchWidth:"any",parsePatterns:E1,defaultParseWidth:"any"})},w1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},S1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},T1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},$1={date:Ml({formats:w1,defaultWidth:"full"}),time:Ml({formats:S1,defaultWidth:"full"}),dateTime:Ml({formats:T1,defaultWidth:"full"})},Wh={code:"en-US",formatDistance:t1,formatLong:$1,formatRelative:n1,localize:u1,match:O1,options:{weekStartsOn:0,firstWeekContainsDate:1}};var qh=typeof global=="object"&&global&&global.Object===Object&&global,M1=typeof self=="object"&&self&&self.Object===Object&&self,Ye=qh||M1||Function("return this")(),Be=Ye.Symbol,Yh=Object.prototype,C1=Yh.hasOwnProperty,A1=Yh.toString,Pi=Be?Be.toStringTag:void 0;function k1(e){var t=C1.call(e,Pi),n=e[Pi];try{e[Pi]=void 0;var r=!0}catch{}var i=A1.call(e);return r&&(t?e[Pi]=n:delete e[Pi]),i}var L1=Object.prototype,D1=L1.toString;function R1(e){return D1.call(e)}var I1="[object Null]",N1="[object Undefined]",Zh=Be?Be.toStringTag:void 0;function lr(e){return e==null?e===void 0?N1:I1:Zh&&Zh in Object(e)?k1(e):R1(e)}function hn(e){return e!=null&&typeof e=="object"}var P1="[object Symbol]";function es(e){return typeof e=="symbol"||hn(e)&&lr(e)==P1}function Cl(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ae=Array.isArray,U1=1/0,Xh=Be?Be.prototype:void 0,Kh=Xh?Xh.toString:void 0;function Qh(e){if(typeof e=="string")return e;if(ae(e))return Cl(e,Qh)+"";if(es(e))return Kh?Kh.call(e):"";var t=e+"";return t=="0"&&1/e==-U1?"-0":t}function He(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Al(e){return e}var B1="[object AsyncFunction]",H1="[object Function]",V1="[object GeneratorFunction]",F1="[object Proxy]";function kl(e){if(!He(e))return!1;var t=lr(e);return t==H1||t==V1||t==B1||t==F1}var Ll=Ye["__core-js_shared__"],Jh=function(){var e=/[^.]+$/.exec(Ll&&Ll.keys&&Ll.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function G1(e){return!!Jh&&Jh in e}var j1=Function.prototype,z1=j1.toString;function cr(e){if(e!=null){try{return z1.call(e)}catch{}try{return e+""}catch{}}return""}var W1=/[\\^$.*+?()[\]{}|]/g,q1=/^\[object .+?Constructor\]$/,Y1=Function.prototype,Z1=Object.prototype,X1=Y1.toString,K1=Z1.hasOwnProperty,Q1=RegExp("^"+X1.call(K1).replace(W1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function J1(e){if(!He(e)||G1(e))return!1;var t=kl(e)?Q1:q1;return t.test(cr(e))}function ty(e,t){return e==null?void 0:e[t]}function ur(e,t){var n=ty(e,t);return J1(n)?n:void 0}var Dl=ur(Ye,"WeakMap"),td=Object.create,ey=function(){function e(){}return function(t){if(!He(t))return{};if(td)return td(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ny(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ry(){}function ed(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var iy=800,ay=16,sy=Date.now;function oy(e){var t=0,n=0;return function(){var r=sy(),i=ay-(r-n);if(n=r,i>0){if(++t>=iy)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ly(e){return function(){return e}}var ns=function(){try{var e=ur(Object,"defineProperty");return e({},"",{}),e}catch{}}(),cy=ns?function(e,t){return ns(e,"toString",{configurable:!0,enumerable:!1,value:ly(t),writable:!0})}:Al,nd=oy(cy);function uy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function hy(e,t,n,r){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}function dy(e){return e!==e}function py(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function fy(e,t,n){return t===t?py(e,t,n):hy(e,dy,n)}function my(e,t){var n=e==null?0:e.length;return!!n&&fy(e,t,0)>-1}var gy=9007199254740991,vy=/^(?:0|[1-9]\d*)$/;function Rl(e,t){var n=typeof e;return t=t??gy,!!t&&(n=="number"||n!="symbol"&&vy.test(e))&&e>-1&&e%1==0&&e<t}function rs(e,t,n){t=="__proto__"&&ns?ns(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ui(e,t){return e===t||e!==e&&t!==t}var yy=Object.prototype,by=yy.hasOwnProperty;function rd(e,t,n){var r=e[t];(!(by.call(e,t)&&Ui(r,n))||n===void 0&&!(t in e))&&rs(e,t,n)}function Vr(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var o=t[a],l=void 0;l===void 0&&(l=e[o]),i?rs(n,o,l):rd(n,o,l)}return n}var id=Math.max;function ad(e,t,n){return t=id(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=id(r.length-t,0),s=Array(a);++i<a;)s[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(s),ny(e,this,o)}}function Il(e,t){return nd(ad(e,t,Al),e+"")}var xy=9007199254740991;function Nl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=xy}function hr(e){return e!=null&&Nl(e.length)&&!kl(e)}function _y(e,t,n){if(!He(n))return!1;var r=typeof t;return(r=="number"?hr(n)&&Rl(t,n.length):r=="string"&&t in n)?Ui(n[t],e):!1}function Ey(e){return Il(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,s&&_y(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,a)}return t})}var Oy=Object.prototype;function is(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Oy;return e===n}function wy(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Sy="[object Arguments]";function sd(e){return hn(e)&&lr(e)==Sy}var od=Object.prototype,Ty=od.hasOwnProperty,$y=od.propertyIsEnumerable,Fr=sd(function(){return arguments}())?sd:function(e){return hn(e)&&Ty.call(e,"callee")&&!$y.call(e,"callee")};function My(){return!1}var ld=typeof V=="object"&&V&&!V.nodeType&&V,cd=ld&&typeof module=="object"&&module&&!module.nodeType&&module,Cy=cd&&cd.exports===ld,ud=Cy?Ye.Buffer:void 0,Ay=ud?ud.isBuffer:void 0,Gr=Ay||My,ky="[object Arguments]",Ly="[object Array]",Dy="[object Boolean]",Ry="[object Date]",Iy="[object Error]",Ny="[object Function]",Py="[object Map]",Uy="[object Number]",By="[object Object]",Hy="[object RegExp]",Vy="[object Set]",Fy="[object String]",Gy="[object WeakMap]",jy="[object ArrayBuffer]",zy="[object DataView]",Wy="[object Float32Array]",qy="[object Float64Array]",Yy="[object Int8Array]",Zy="[object Int16Array]",Xy="[object Int32Array]",Ky="[object Uint8Array]",Qy="[object Uint8ClampedArray]",Jy="[object Uint16Array]",tb="[object Uint32Array]",Ft={};Ft[Wy]=Ft[qy]=Ft[Yy]=Ft[Zy]=Ft[Xy]=Ft[Ky]=Ft[Qy]=Ft[Jy]=Ft[tb]=!0,Ft[ky]=Ft[Ly]=Ft[jy]=Ft[Dy]=Ft[zy]=Ft[Ry]=Ft[Iy]=Ft[Ny]=Ft[Py]=Ft[Uy]=Ft[By]=Ft[Hy]=Ft[Vy]=Ft[Fy]=Ft[Gy]=!1;function eb(e){return hn(e)&&Nl(e.length)&&!!Ft[lr(e)]}function Pl(e){return function(t){return e(t)}}var hd=typeof V=="object"&&V&&!V.nodeType&&V,Bi=hd&&typeof module=="object"&&module&&!module.nodeType&&module,nb=Bi&&Bi.exports===hd,Ul=nb&&qh.process,jr=function(){try{var e=Bi&&Bi.require&&Bi.require("util").types;return e||Ul&&Ul.binding&&Ul.binding("util")}catch{}}(),dd=jr&&jr.isTypedArray,as=dd?Pl(dd):eb,rb=Object.prototype,ib=rb.hasOwnProperty;function pd(e,t){var n=ae(e),r=!n&&Fr(e),i=!n&&!r&&Gr(e),a=!n&&!r&&!i&&as(e),s=n||r||i||a,o=s?wy(e.length,String):[],l=o.length;for(var c in e)(t||ib.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Rl(c,l)))&&o.push(c);return o}function fd(e,t){return function(n){return e(t(n))}}var ab=fd(Object.keys,Object),sb=Object.prototype,ob=sb.hasOwnProperty;function md(e){if(!is(e))return ab(e);var t=[];for(var n in Object(e))ob.call(e,n)&&n!="constructor"&&t.push(n);return t}function Hi(e){return hr(e)?pd(e):md(e)}function lb(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var cb=Object.prototype,ub=cb.hasOwnProperty;function hb(e){if(!He(e))return lb(e);var t=is(e),n=[];for(var r in e)r=="constructor"&&(t||!ub.call(e,r))||n.push(r);return n}function Vi(e){return hr(e)?pd(e,!0):hb(e)}var db=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pb=/^\w*$/;function Bl(e,t){if(ae(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||es(e)?!0:pb.test(e)||!db.test(e)||t!=null&&e in Object(t)}var Fi=ur(Object,"create");function fb(){this.__data__=Fi?Fi(null):{},this.size=0}function mb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gb="__lodash_hash_undefined__",vb=Object.prototype,yb=vb.hasOwnProperty;function bb(e){var t=this.__data__;if(Fi){var n=t[e];return n===gb?void 0:n}return yb.call(t,e)?t[e]:void 0}var xb=Object.prototype,_b=xb.hasOwnProperty;function Eb(e){var t=this.__data__;return Fi?t[e]!==void 0:_b.call(t,e)}var Ob="__lodash_hash_undefined__";function wb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Fi&&t===void 0?Ob:t,this}function dr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dr.prototype.clear=fb,dr.prototype.delete=mb,dr.prototype.get=bb,dr.prototype.has=Eb,dr.prototype.set=wb;function Sb(){this.__data__=[],this.size=0}function ss(e,t){for(var n=e.length;n--;)if(Ui(e[n][0],t))return n;return-1}var Tb=Array.prototype,$b=Tb.splice;function Mb(e){var t=this.__data__,n=ss(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():$b.call(t,n,1),--this.size,!0}function Cb(e){var t=this.__data__,n=ss(t,e);return n<0?void 0:t[n][1]}function Ab(e){return ss(this.__data__,e)>-1}function kb(e,t){var n=this.__data__,r=ss(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function En(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}En.prototype.clear=Sb,En.prototype.delete=Mb,En.prototype.get=Cb,En.prototype.has=Ab,En.prototype.set=kb;var Gi=ur(Ye,"Map");function Lb(){this.size=0,this.__data__={hash:new dr,map:new(Gi||En),string:new dr}}function Db(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function os(e,t){var n=e.__data__;return Db(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Rb(e){var t=os(this,e).delete(e);return this.size-=t?1:0,t}function Ib(e){return os(this,e).get(e)}function Nb(e){return os(this,e).has(e)}function Pb(e,t){var n=os(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function On(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}On.prototype.clear=Lb,On.prototype.delete=Rb,On.prototype.get=Ib,On.prototype.has=Nb,On.prototype.set=Pb;var Ub="Expected a function";function Hl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ub);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(Hl.Cache||On),n}Hl.Cache=On;var Bb=500;function Hb(e){var t=Hl(e,function(r){return n.size===Bb&&n.clear(),r}),n=t.cache;return t}var Vb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fb=/\\(\\)?/g,Gb=Hb(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Vb,function(n,r,i,a){t.push(i?a.replace(Fb,"$1"):r||n)}),t});function ji(e){return e==null?"":Qh(e)}function ls(e,t){return ae(e)?e:Bl(e,t)?[e]:Gb(ji(e))}var jb=1/0;function zi(e){if(typeof e=="string"||es(e))return e;var t=e+"";return t=="0"&&1/e==-jb?"-0":t}function Vl(e,t){t=ls(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[zi(t[n++])];return n&&n==r?e:void 0}function Et(e,t,n){var r=e==null?void 0:Vl(e,t);return r===void 0?n:r}function Fl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var gd=Be?Be.isConcatSpreadable:void 0;function zb(e){return ae(e)||Fr(e)||!!(gd&&e&&e[gd])}function cs(e,t,n,r,i){var a=-1,s=e.length;for(n||(n=zb),i||(i=[]);++a<s;){var o=e[a];t>0&&n(o)?t>1?cs(o,t-1,n,r,i):Fl(i,o):r||(i[i.length]=o)}return i}var Gl=fd(Object.getPrototypeOf,Object),Wb="[object Object]",qb=Function.prototype,Yb=Object.prototype,vd=qb.toString,Zb=Yb.hasOwnProperty,Xb=vd.call(Object);function yd(e){if(!hn(e)||lr(e)!=Wb)return!1;var t=Gl(e);if(t===null)return!0;var n=Zb.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vd.call(n)==Xb}function Kb(){this.__data__=new En,this.size=0}function Qb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Jb(e){return this.__data__.get(e)}function tx(e){return this.__data__.has(e)}var ex=200;function nx(e,t){var n=this.__data__;if(n instanceof En){var r=n.__data__;if(!Gi||r.length<ex-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new On(r)}return n.set(e,t),this.size=n.size,this}function Ze(e){var t=this.__data__=new En(e);this.size=t.size}Ze.prototype.clear=Kb,Ze.prototype.delete=Qb,Ze.prototype.get=Jb,Ze.prototype.has=tx,Ze.prototype.set=nx;function rx(e,t){return e&&Vr(t,Hi(t),e)}function ix(e,t){return e&&Vr(t,Vi(t),e)}var bd=typeof V=="object"&&V&&!V.nodeType&&V,xd=bd&&typeof module=="object"&&module&&!module.nodeType&&module,ax=xd&&xd.exports===bd,_d=ax?Ye.Buffer:void 0,Ed=_d?_d.allocUnsafe:void 0;function Od(e,t){if(t)return e.slice();var n=e.length,r=Ed?Ed(n):new e.constructor(n);return e.copy(r),r}function sx(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var s=e[n];t(s,n,e)&&(a[i++]=s)}return a}function wd(){return[]}var ox=Object.prototype,lx=ox.propertyIsEnumerable,Sd=Object.getOwnPropertySymbols,jl=Sd?function(e){return e==null?[]:(e=Object(e),sx(Sd(e),function(t){return lx.call(e,t)}))}:wd;function cx(e,t){return Vr(e,jl(e),t)}var ux=Object.getOwnPropertySymbols,Td=ux?function(e){for(var t=[];e;)Fl(t,jl(e)),e=Gl(e);return t}:wd;function hx(e,t){return Vr(e,Td(e),t)}function $d(e,t,n){var r=t(e);return ae(e)?r:Fl(r,n(e))}function zl(e){return $d(e,Hi,jl)}function Md(e){return $d(e,Vi,Td)}var Wl=ur(Ye,"DataView"),ql=ur(Ye,"Promise"),zr=ur(Ye,"Set"),Cd="[object Map]",dx="[object Object]",Ad="[object Promise]",kd="[object Set]",Ld="[object WeakMap]",Dd="[object DataView]",px=cr(Wl),fx=cr(Gi),mx=cr(ql),gx=cr(zr),vx=cr(Dl),Ve=lr;(Wl&&Ve(new Wl(new ArrayBuffer(1)))!=Dd||Gi&&Ve(new Gi)!=Cd||ql&&Ve(ql.resolve())!=Ad||zr&&Ve(new zr)!=kd||Dl&&Ve(new Dl)!=Ld)&&(Ve=function(e){var t=lr(e),n=t==dx?e.constructor:void 0,r=n?cr(n):"";if(r)switch(r){case px:return Dd;case fx:return Cd;case mx:return Ad;case gx:return kd;case vx:return Ld}return t});var yx=Object.prototype,bx=yx.hasOwnProperty;function xx(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&bx.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var us=Ye.Uint8Array;function Yl(e){var t=new e.constructor(e.byteLength);return new us(t).set(new us(e)),t}function _x(e,t){var n=t?Yl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ex=/\w*$/;function Ox(e){var t=new e.constructor(e.source,Ex.exec(e));return t.lastIndex=e.lastIndex,t}var Rd=Be?Be.prototype:void 0,Id=Rd?Rd.valueOf:void 0;function wx(e){return Id?Object(Id.call(e)):{}}function Nd(e,t){var n=t?Yl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Sx="[object Boolean]",Tx="[object Date]",$x="[object Map]",Mx="[object Number]",Cx="[object RegExp]",Ax="[object Set]",kx="[object String]",Lx="[object Symbol]",Dx="[object ArrayBuffer]",Rx="[object DataView]",Ix="[object Float32Array]",Nx="[object Float64Array]",Px="[object Int8Array]",Ux="[object Int16Array]",Bx="[object Int32Array]",Hx="[object Uint8Array]",Vx="[object Uint8ClampedArray]",Fx="[object Uint16Array]",Gx="[object Uint32Array]";function jx(e,t,n){var r=e.constructor;switch(t){case Dx:return Yl(e);case Sx:case Tx:return new r(+e);case Rx:return _x(e,n);case Ix:case Nx:case Px:case Ux:case Bx:case Hx:case Vx:case Fx:case Gx:return Nd(e,n);case $x:return new r;case Mx:case kx:return new r(e);case Cx:return Ox(e);case Ax:return new r;case Lx:return wx(e)}}function Pd(e){return typeof e.constructor=="function"&&!is(e)?ey(Gl(e)):{}}var zx="[object Map]";function Wx(e){return hn(e)&&Ve(e)==zx}var Ud=jr&&jr.isMap,qx=Ud?Pl(Ud):Wx,Yx="[object Set]";function Zx(e){return hn(e)&&Ve(e)==Yx}var Bd=jr&&jr.isSet,Xx=Bd?Pl(Bd):Zx,Kx=1,Qx=2,Jx=4,Hd="[object Arguments]",t_="[object Array]",e_="[object Boolean]",n_="[object Date]",r_="[object Error]",Vd="[object Function]",i_="[object GeneratorFunction]",a_="[object Map]",s_="[object Number]",Fd="[object Object]",o_="[object RegExp]",l_="[object Set]",c_="[object String]",u_="[object Symbol]",h_="[object WeakMap]",d_="[object ArrayBuffer]",p_="[object DataView]",f_="[object Float32Array]",m_="[object Float64Array]",g_="[object Int8Array]",v_="[object Int16Array]",y_="[object Int32Array]",b_="[object Uint8Array]",x_="[object Uint8ClampedArray]",__="[object Uint16Array]",E_="[object Uint32Array]",Ht={};Ht[Hd]=Ht[t_]=Ht[d_]=Ht[p_]=Ht[e_]=Ht[n_]=Ht[f_]=Ht[m_]=Ht[g_]=Ht[v_]=Ht[y_]=Ht[a_]=Ht[s_]=Ht[Fd]=Ht[o_]=Ht[l_]=Ht[c_]=Ht[u_]=Ht[b_]=Ht[x_]=Ht[__]=Ht[E_]=!0,Ht[r_]=Ht[Vd]=Ht[h_]=!1;function Wi(e,t,n,r,i,a){var s,o=t&Kx,l=t&Qx,c=t&Jx;if(n&&(s=i?n(e,r,i,a):n(e)),s!==void 0)return s;if(!He(e))return e;var u=ae(e);if(u){if(s=xx(e),!o)return ed(e,s)}else{var d=Ve(e),h=d==Vd||d==i_;if(Gr(e))return Od(e,o);if(d==Fd||d==Hd||h&&!i){if(s=l||h?{}:Pd(e),!o)return l?hx(e,ix(s,e)):cx(e,rx(s,e))}else{if(!Ht[d])return i?e:{};s=jx(e,d,o)}}a||(a=new Ze);var p=a.get(e);if(p)return p;a.set(e,s),Xx(e)?e.forEach(function(m){s.add(Wi(m,t,n,m,e,a))}):qx(e)&&e.forEach(function(m,y){s.set(y,Wi(m,t,n,y,e,a))});var f=c?l?Md:zl:l?Vi:Hi,v=u?void 0:f(e);return uy(v||e,function(m,y){v&&(y=m,m=e[y]),rd(s,y,Wi(m,t,n,y,e,a))}),s}var O_=1,w_=4;function wn(e){return Wi(e,O_|w_)}var S_="__lodash_hash_undefined__";function T_(e){return this.__data__.set(e,S_),this}function $_(e){return this.__data__.has(e)}function qi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new On;++t<n;)this.add(e[t])}qi.prototype.add=qi.prototype.push=T_,qi.prototype.has=$_;function Gd(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function jd(e,t){return e.has(t)}var M_=1,C_=2;function zd(e,t,n,r,i,a){var s=n&M_,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&C_?new qi:void 0;for(a.set(e,t),a.set(t,e);++d<o;){var f=e[d],v=t[d];if(r)var m=s?r(v,f,d,t,e,a):r(f,v,d,e,t,a);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!Gd(t,function(y,g){if(!jd(p,g)&&(f===y||i(f,y,n,r,a)))return p.push(g)})){h=!1;break}}else if(!(f===v||i(f,v,n,r,a))){h=!1;break}}return a.delete(e),a.delete(t),h}function A_(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Zl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var k_=1,L_=2,D_="[object Boolean]",R_="[object Date]",I_="[object Error]",N_="[object Map]",P_="[object Number]",U_="[object RegExp]",B_="[object Set]",H_="[object String]",V_="[object Symbol]",F_="[object ArrayBuffer]",G_="[object DataView]",Wd=Be?Be.prototype:void 0,Xl=Wd?Wd.valueOf:void 0;function j_(e,t,n,r,i,a,s){switch(n){case G_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case F_:return!(e.byteLength!=t.byteLength||!a(new us(e),new us(t)));case D_:case R_:case P_:return Ui(+e,+t);case I_:return e.name==t.name&&e.message==t.message;case U_:case H_:return e==t+"";case N_:var o=A_;case B_:var l=r&k_;if(o||(o=Zl),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=L_,s.set(e,t);var u=zd(o(e),o(t),r,i,a,s);return s.delete(e),u;case V_:if(Xl)return Xl.call(e)==Xl.call(t)}return!1}var z_=1,W_=Object.prototype,q_=W_.hasOwnProperty;function Y_(e,t,n,r,i,a){var s=n&z_,o=zl(e),l=o.length,c=zl(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var h=o[d];if(!(s?h in t:q_.call(t,h)))return!1}var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var v=!0;a.set(e,t),a.set(t,e);for(var m=s;++d<l;){h=o[d];var y=e[h],g=t[h];if(r)var x=s?r(g,y,h,t,e,a):r(y,g,h,e,t,a);if(!(x===void 0?y===g||i(y,g,n,r,a):x)){v=!1;break}m||(m=h=="constructor")}if(v&&!m){var O=e.constructor,E=t.constructor;O!=E&&"constructor"in e&&"constructor"in t&&!(typeof O=="function"&&O instanceof O&&typeof E=="function"&&E instanceof E)&&(v=!1)}return a.delete(e),a.delete(t),v}var Z_=1,qd="[object Arguments]",Yd="[object Array]",hs="[object Object]",X_=Object.prototype,Zd=X_.hasOwnProperty;function K_(e,t,n,r,i,a){var s=ae(e),o=ae(t),l=s?Yd:Ve(e),c=o?Yd:Ve(t);l=l==qd?hs:l,c=c==qd?hs:c;var u=l==hs,d=c==hs,h=l==c;if(h&&Gr(e)){if(!Gr(t))return!1;s=!0,u=!1}if(h&&!u)return a||(a=new Ze),s||as(e)?zd(e,t,n,r,i,a):j_(e,t,l,n,r,i,a);if(!(n&Z_)){var p=u&&Zd.call(e,"__wrapped__"),f=d&&Zd.call(t,"__wrapped__");if(p||f){var v=p?e.value():e,m=f?t.value():t;return a||(a=new Ze),i(v,m,n,r,a)}}return h?(a||(a=new Ze),Y_(e,t,n,r,i,a)):!1}function ds(e,t,n,r,i){return e===t?!0:e==null||t==null||!hn(e)&&!hn(t)?e!==e&&t!==t:K_(e,t,n,r,ds,i)}var Q_=1,J_=2;function tE(e,t,n,r){var i=n.length,a=i;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var o=s[0],l=e[o],c=s[1];if(s[2]){if(l===void 0&&!(o in e))return!1}else{var u=new Ze,d;if(!(d===void 0?ds(c,l,Q_|J_,r,u):d))return!1}}return!0}function Xd(e){return e===e&&!He(e)}function eE(e){for(var t=Hi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Xd(i)]}return t}function Kd(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function nE(e){var t=eE(e);return t.length==1&&t[0][2]?Kd(t[0][0],t[0][1]):function(n){return n===e||tE(n,e,t)}}function rE(e,t){return e!=null&&t in Object(e)}function iE(e,t,n){t=ls(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var s=zi(t[r]);if(!(a=e!=null&&n(e,s)))break;e=e[s]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Nl(i)&&Rl(s,i)&&(ae(e)||Fr(e)))}function aE(e,t){return e!=null&&iE(e,t,rE)}var sE=1,oE=2;function lE(e,t){return Bl(e)&&Xd(t)?Kd(zi(e),t):function(n){var r=Et(n,e);return r===void 0&&r===t?aE(n,e):ds(t,r,sE|oE)}}function cE(e){return function(t){return t==null?void 0:t[e]}}function uE(e){return function(t){return Vl(t,e)}}function hE(e){return Bl(e)?cE(zi(e)):uE(e)}function ps(e){return typeof e=="function"?e:e==null?Al:typeof e=="object"?ae(e)?lE(e[0],e[1]):nE(e):hE(e)}function dE(e){return function(t,n,r){for(var i=-1,a=Object(t),s=r(t),o=s.length;o--;){var l=s[++i];if(n(a[l],l,a)===!1)break}return t}}var Qd=dE();function Kl(e,t,n){(n!==void 0&&!Ui(e[t],n)||n===void 0&&!(t in e))&&rs(e,t,n)}function Ql(e){return hn(e)&&hr(e)}function Jl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function pE(e){return Vr(e,Vi(e))}function fE(e,t,n,r,i,a,s){var o=Jl(e,n),l=Jl(t,n),c=s.get(l);if(c){Kl(e,n,c);return}var u=a?a(o,l,n+"",e,t,s):void 0,d=u===void 0;if(d){var h=ae(l),p=!h&&Gr(l),f=!h&&!p&&as(l);u=l,h||p||f?ae(o)?u=o:Ql(o)?u=ed(o):p?(d=!1,u=Od(l,!0)):f?(d=!1,u=Nd(l,!0)):u=[]:yd(l)||Fr(l)?(u=o,Fr(o)?u=pE(o):(!He(o)||kl(o))&&(u=Pd(l))):d=!1}d&&(s.set(l,u),i(u,l,r,a,s),s.delete(l)),Kl(e,n,u)}function Jd(e,t,n,r,i){e!==t&&Qd(t,function(a,s){if(i||(i=new Ze),He(a))fE(e,t,s,n,Jd,r,i);else{var o=r?r(Jl(e,s),a,s+"",e,t,i):void 0;o===void 0&&(o=a),Kl(e,s,o)}},Vi)}function tp(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var mE="[object Map]",gE="[object Set]",vE=Object.prototype,yE=vE.hasOwnProperty;function Xe(e){if(e==null)return!0;if(hr(e)&&(ae(e)||typeof e=="string"||typeof e.splice=="function"||Gr(e)||as(e)||Fr(e)))return!e.length;var t=Ve(e);if(t==mE||t==gE)return!e.size;if(is(e))return!md(e).length;for(var n in e)if(yE.call(e,n))return!1;return!0}var ct=Ey(function(e,t,n){Jd(e,t,n)}),bE=1/0,xE=zr&&1/Zl(new zr([,-0]))[1]==bE?function(e){return new zr(e)}:ry,_E=200;function ep(e,t,n){var r=-1,i=my,a=e.length,s=!0,o=[],l=o;if(a>=_E){var c=t?null:xE(e);if(c)return Zl(c);s=!1,i=jd,l=new qi}else l=t?[]:o;t:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,s&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var EE=Il(function(e){var t=tp(e);return Ql(t)&&(t=void 0),ep(cs(e,1,Ql,!0),ps(t))});function Yi(e){return e&&e.length?ep(e):[]}function pr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function OE(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tc(e){let t,n,r;e.length!==2?(t=pr,n=(o,l)=>pr(e(o),l),r=(o,l)=>e(o)-l):(t=e===pr||e===OE?e:wE,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function wE(){return 0}function SE(e){return e===null?NaN:+e}function*TE(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const $E=tc(pr),ec=$E.right;tc(SE).center;function Ke(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<i&&(r=i)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}let np=class extends Map{constructor(t,n=AE){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(rp(this,t))}has(t){return super.has(rp(this,t))}set(t,n){return super.set(ME(this,t),n)}delete(t){return super.delete(CE(this,t))}};function rp({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ME({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function CE({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function AE(e){return e!==null&&typeof e=="object"?e.valueOf():e}const kE=Math.sqrt(50),LE=Math.sqrt(10),DE=Math.sqrt(2);function fs(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=kE?10:a>=LE?5:a>=DE?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/s,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?fs(e,t,n*2):[o,l,c]}function ms(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?fs(t,e,n):fs(e,t,n);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(r)if(s<0)for(let c=0;c<o;++c)l[c]=(a-c)/-s;else for(let c=0;c<o;++c)l[c]=(a-c)*s;else if(s<0)for(let c=0;c<o;++c)l[c]=(i+c)/-s;else for(let c=0;c<o;++c)l[c]=(i+c)*s;return l}function Wr(e,t,n){return t=+t,e=+e,n=+n,fs(e,t,n)[2]}function nc(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Wr(t,e,n):Wr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function fr(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 Wn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var RE={value:()=>{}};function rc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new gs(n)}function gs(e){this._=e}function IE(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=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}})}gs.prototype=rc.prototype={constructor:gs,on:function(e,t){var n=this._,r=IE(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=NE(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=ip(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ip(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gs(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function NE(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ip(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=RE,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ic="http://www.w3.org/1999/xhtml";const ap={svg:"http://www.w3.org/2000/svg",xhtml:ic,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ap.hasOwnProperty(t)?{space:ap[t],local:e}:e}function PE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ic&&t.documentElement.namespaceURI===ic?t.createElement(e):t.createElementNS(n,e)}}function UE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sp(e){var t=vs(e);return(t.local?UE:PE)(t)}function BE(){}function ac(e){return e==null?BE:function(){return this.querySelector(e)}}function HE(e){typeof e!="function"&&(e=ac(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=new Array(s),l,c,u=0;u<s;++u)(l=a[u])&&(c=e.call(l,l.__data__,u,a))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Ce(r,this._parents)}function VE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FE(){return[]}function op(e){return e==null?FE:function(){return this.querySelectorAll(e)}}function GE(e){return function(){return VE(e.apply(this,arguments))}}function jE(e){typeof e=="function"?e=GE(e):e=op(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var s=t[a],o=s.length,l,c=0;c<o;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),i.push(l));return new Ce(r,i)}function lp(e){return function(){return this.matches(e)}}function cp(e){return function(t){return t.matches(e)}}var zE=Array.prototype.find;function WE(e){return function(){return zE.call(this.children,e)}}function qE(){return this.firstElementChild}function YE(e){return this.select(e==null?qE:WE(typeof e=="function"?e:cp(e)))}var ZE=Array.prototype.filter;function XE(){return Array.from(this.children)}function KE(e){return function(){return ZE.call(this.children,e)}}function QE(e){return this.selectAll(e==null?XE:KE(typeof e=="function"?e:cp(e)))}function JE(e){typeof e!="function"&&(e=lp(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&o.push(l);return new Ce(r,this._parents)}function up(e){return new Array(e.length)}function tO(){return new Ce(this._enter||this._groups.map(up),this._parents)}function ys(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ys.prototype={constructor:ys,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function eO(e){return function(){return e}}function nO(e,t,n,r,i,a){for(var s=0,o,l=t.length,c=a.length;s<c;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new ys(e,a[s]);for(;s<l;++s)(o=t[s])&&(i[s]=o)}function rO(e,t,n,r,i,a,s){var o,l,c=new Map,u=t.length,d=a.length,h=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<d;++o)p=s.call(e,a[o],o,a)+"",(l=c.get(p))?(r[o]=l,l.__data__=a[o],c.delete(p)):n[o]=new ys(e,a[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function iO(e){return e.__data__}function aO(e,t){if(!arguments.length)return Array.from(this,iO);var n=t?rO:nO,r=this._parents,i=this._groups;typeof e!="function"&&(e=eO(e));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],d=i[c],h=d.length,p=sO(e.call(u,u&&u.__data__,c,r)),f=p.length,v=o[c]=new Array(f),m=s[c]=new Array(f),y=l[c]=new Array(h);n(u,d,v,m,y,p,t);for(var g=0,x=0,O,E;g<f;++g)if(O=v[g]){for(g>=x&&(x=g+1);!(E=m[x])&&++x<f;);O._next=E||null}}return s=new Ce(s,r),s._enter=o,s._exit=l,s}function sO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oO(){return new Ce(this._exit||this._groups.map(up),this._parents)}function lO(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function cO(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||u[f])&&(h[f]=p);for(;l<i;++l)o[l]=n[l];return new Ce(o,this._parents)}function uO(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function hO(e){e||(e=dO);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),a=0;a<r;++a){for(var s=n[a],o=s.length,l=i[a]=new Array(o),c,u=0;u<o;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new Ce(i,this._parents).order()}function dO(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pO(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fO(){return Array.from(this)}function mO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function gO(){let e=0;for(const t of this)++e;return e}function vO(){return!this.node()}function yO(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function bO(e){return function(){this.removeAttribute(e)}}function xO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _O(e,t){return function(){this.setAttribute(e,t)}}function EO(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function OO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function wO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function SO(e,t){var n=vs(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?xO:bO:typeof t=="function"?n.local?wO:OO:n.local?EO:_O)(n,t))}function hp(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function TO(e){return function(){this.style.removeProperty(e)}}function $O(e,t,n){return function(){this.style.setProperty(e,t,n)}}function MO(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function CO(e,t,n){return arguments.length>1?this.each((t==null?TO:typeof t=="function"?MO:$O)(e,t,n??"")):qr(this.node(),e)}function qr(e,t){return e.style.getPropertyValue(t)||hp(e).getComputedStyle(e,null).getPropertyValue(t)}function AO(e){return function(){delete this[e]}}function kO(e,t){return function(){this[e]=t}}function LO(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function DO(e,t){return arguments.length>1?this.each((t==null?AO:typeof t=="function"?LO:kO)(e,t)):this.node()[e]}function dp(e){return e.trim().split(/^|\s+/)}function sc(e){return e.classList||new pp(e)}function pp(e){this._node=e,this._names=dp(e.getAttribute("class")||"")}pp.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 fp(e,t){for(var n=sc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function mp(e,t){for(var n=sc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function RO(e){return function(){fp(this,e)}}function IO(e){return function(){mp(this,e)}}function NO(e,t){return function(){(t.apply(this,arguments)?fp:mp)(this,e)}}function PO(e,t){var n=dp(e+"");if(arguments.length<2){for(var r=sc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?NO:t?RO:IO)(n,t))}function UO(){this.textContent=""}function BO(e){return function(){this.textContent=e}}function HO(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function VO(e){return arguments.length?this.each(e==null?UO:(typeof e=="function"?HO:BO)(e)):this.node().textContent}function FO(){this.innerHTML=""}function GO(e){return function(){this.innerHTML=e}}function jO(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function zO(e){return arguments.length?this.each(e==null?FO:(typeof e=="function"?jO:GO)(e)):this.node().innerHTML}function WO(){this.nextSibling&&this.parentNode.appendChild(this)}function qO(){return this.each(WO)}function YO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ZO(){return this.each(YO)}function XO(e){var t=typeof e=="function"?e:sp(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function KO(){return null}function QO(e,t){var n=typeof e=="function"?e:sp(e),r=t==null?KO:typeof t=="function"?t:ac(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function JO(){var e=this.parentNode;e&&e.removeChild(this)}function tw(){return this.each(JO)}function ew(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nw(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rw(e){return this.select(e?nw:ew)}function iw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function aw(e){return function(t){e.call(this,t,this.__data__)}}function sw(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ow(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function lw(e,t,n){return function(){var r=this.__on,i,a=aw(t);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function cw(e,t,n){var r=sw(e+""),i,a=r.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<a;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(o=t?lw:ow,i=0;i<a;++i)this.each(o(r[i],t,n));return this}function gp(e,t,n){var r=hp(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function uw(e,t){return function(){return gp(this,e,t)}}function hw(e,t){return function(){return gp(this,e,t.apply(this,arguments))}}function dw(e,t){return this.each((typeof t=="function"?hw:uw)(e,t))}function*pw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var vp=[null];function Ce(e,t){this._groups=e,this._parents=t}function Zi(){return new Ce([[document.documentElement]],vp)}function fw(){return this}Ce.prototype=Zi.prototype={constructor:Ce,select:HE,selectAll:jE,selectChild:YE,selectChildren:QE,filter:JE,data:aO,enter:tO,exit:oO,join:lO,merge:cO,selection:fw,order:uO,sort:hO,call:pO,nodes:fO,node:mO,size:gO,empty:vO,each:yO,attr:SO,style:CO,property:DO,classed:PO,text:VO,html:zO,raise:qO,lower:ZO,append:XO,insert:QO,remove:tw,clone:rw,datum:iw,on:cw,dispatch:dw,[Symbol.iterator]:pw};function mw(e){let t;for(;t=e.sourceEvent;)e=t;return e}function mr(e,t){if(e=mw(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function oc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yp(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xi(){}var Ki=.7,bs=1/Ki,Yr="\\s*([+-]?\\d+)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gw=/^#([0-9a-f]{3,8})$/,vw=new RegExp(`^rgb\\(${Yr},${Yr},${Yr}\\)$`),yw=new RegExp(`^rgb\\(${dn},${dn},${dn}\\)$`),bw=new RegExp(`^rgba\\(${Yr},${Yr},${Yr},${Qi}\\)$`),xw=new RegExp(`^rgba\\(${dn},${dn},${dn},${Qi}\\)$`),_w=new RegExp(`^hsl\\(${Qi},${dn},${dn}\\)$`),Ew=new RegExp(`^hsla\\(${Qi},${dn},${dn},${Qi}\\)$`),bp={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};oc(Xi,Sn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xp,formatHex:xp,formatHex8:Ow,formatHsl:ww,formatRgb:_p,toString:_p});function xp(){return this.rgb().formatHex()}function Ow(){return this.rgb().formatHex8()}function ww(){return Tp(this).formatHsl()}function _p(){return this.rgb().formatRgb()}function Sn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ep(t):n===3?new _e(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xs(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=vw.exec(e))?new _e(t[1],t[2],t[3],1):(t=yw.exec(e))?new _e(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bw.exec(e))?xs(t[1],t[2],t[3],t[4]):(t=xw.exec(e))?xs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_w.exec(e))?Sp(t[1],t[2]/100,t[3]/100,1):(t=Ew.exec(e))?Sp(t[1],t[2]/100,t[3]/100,t[4]):bp.hasOwnProperty(e)?Ep(bp[e]):e==="transparent"?new _e(NaN,NaN,NaN,0):null}function Ep(e){return new _e(e>>16&255,e>>8&255,e&255,1)}function xs(e,t,n,r){return r<=0&&(e=t=n=NaN),new _e(e,t,n,r)}function Sw(e){return e instanceof Xi||(e=Sn(e)),e?(e=e.rgb(),new _e(e.r,e.g,e.b,e.opacity)):new _e}function lc(e,t,n,r){return arguments.length===1?Sw(e):new _e(e,t,n,r??1)}function _e(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}oc(_e,lc,yp(Xi,{brighter(e){return e=e==null?bs:Math.pow(bs,e),new _e(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new _e(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _e(gr(this.r),gr(this.g),gr(this.b),_s(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:Op,formatHex:Op,formatHex8:Tw,formatRgb:wp,toString:wp}));function Op(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function Tw(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}${vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function wp(){const e=_s(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function _s(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function Sp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qe(e,t,n,r)}function Tp(e){if(e instanceof Qe)return new Qe(e.h,e.s,e.l,e.opacity);if(e instanceof Xi||(e=Sn(e)),!e)return new Qe;if(e instanceof Qe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new Qe(s,o,l,e.opacity)}function cc(e,t,n,r){return arguments.length===1?Tp(e):new Qe(e,t,n,r??1)}function Qe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}oc(Qe,cc,yp(Xi,{brighter(e){return e=e==null?bs:Math.pow(bs,e),new Qe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new Qe(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 _e(uc(e>=240?e-240:e+120,i,r),uc(e,i,r),uc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qe($p(this.h),Es(this.s),Es(this.l),_s(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=_s(this.opacity);return`${e===1?"hsl(":"hsla("}${$p(this.h)}, ${Es(this.s)*100}%, ${Es(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $p(e){return e=(e||0)%360,e<0?e+360:e}function Es(e){return Math.max(0,Math.min(1,e||0))}function uc(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 hc=e=>()=>e;function $w(e,t){return function(n){return e+n*t}}function Mw(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 Cw(e){return(e=+e)==1?Mp:function(t,n){return n-t?Mw(t,n,e):hc(isNaN(t)?n:t)}}function Mp(e,t){var n=t-e;return n?$w(e,n):hc(isNaN(e)?t:e)}const Os=function e(t){var n=Cw(t);function r(i,a){var s=n((i=lc(i)).r,(a=lc(a)).r),o=n(i.g,a.g),l=n(i.b,a.b),c=Mp(i.opacity,a.opacity);return function(u){return i.r=s(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function Aw(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function kw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Lw(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Ji(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function Dw(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ae(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Rw(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ji(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var dc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pc=new RegExp(dc.source,"g");function Iw(e){return function(){return e}}function Nw(e){return function(t){return e(t)+""}}function Cp(e,t){var n=dc.lastIndex=pc.lastIndex=0,r,i,a,s=-1,o=[],l=[];for(e=e+"",t=t+"";(r=dc.exec(e))&&(i=pc.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Ae(r,i)})),n=pc.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?Nw(l[0].x):Iw(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Ji(e,t){var n=typeof t,r;return t==null||n==="boolean"?hc(t):(n==="number"?Ae:n==="string"?(r=Sn(t))?(t=r,Os):Cp:t instanceof Sn?Os:t instanceof Date?Dw:kw(t)?Aw:Array.isArray(t)?Lw:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Rw:Ae)(e,t)}function Ap(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var kp=180/Math.PI,Lp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Dp(e,t,n,r,i,a){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*kp,skewX:Math.atan(l)*kp,scaleX:s,scaleY:o}}var ws;function Pw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Lp:Dp(t.a,t.b,t.c,t.d,t.e,t.f)}function Uw(e){return e==null||(ws||(ws=document.createElementNS("http://www.w3.org/2000/svg","g")),ws.setAttribute("transform",e),!(e=ws.transform.baseVal.consolidate()))?Lp:(e=e.matrix,Dp(e.a,e.b,e.c,e.d,e.e,e.f))}function Rp(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function a(c,u,d,h,p,f){if(c!==d||u!==h){var v=p.push("translate(",null,t,null,n);f.push({i:v-4,x:Ae(c,d)},{i:v-2,x:Ae(u,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function s(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ae(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:Ae(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var v=p.push(i(p)+"scale(",null,",",null,")");f.push({i:v-4,x:Ae(c,d)},{i:v-2,x:Ae(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),a(c.translateX,c.translateY,u.translateX,u.translateY,d,h),s(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,v=h.length,m;++f<v;)d[(m=h[f]).i]=m.x(p);return d.join("")}}}var Bw=Rp(Pw,"px, ","px)","deg)"),Hw=Rp(Uw,", ",")",")"),Zr=0,ta=0,ea=0,Ip=1e3,Ss,na,Ts=0,yr=0,$s=0,ra=typeof performance=="object"&&performance.now?performance:Date,Np=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function fc(){return yr||(Np(Vw),yr=ra.now()+$s)}function Vw(){yr=0}function Ms(){this._call=this._time=this._next=null}Ms.prototype=Pp.prototype={constructor:Ms,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?fc():+n)+(t==null?0:+t),!this._next&&na!==this&&(na?na._next=this:Ss=this,na=this),this._call=e,this._time=n,mc()},stop:function(){this._call&&(this._call=null,this._time=1/0,mc())}};function Pp(e,t,n){var r=new Ms;return r.restart(e,t,n),r}function Fw(){fc(),++Zr;for(var e=Ss,t;e;)(t=yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zr}function Up(){yr=(Ts=ra.now())+$s,Zr=ta=0;try{Fw()}finally{Zr=0,jw(),yr=0}}function Gw(){var e=ra.now(),t=e-Ts;t>Ip&&($s-=t,Ts=e)}function jw(){for(var e,t=Ss,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:Ss=n);na=e,mc(r)}function mc(e){if(!Zr){ta&&(ta=clearTimeout(ta));var t=e-yr;t>24?(e<1/0&&(ta=setTimeout(Up,e-ra.now()-$s)),ea&&(ea=clearInterval(ea))):(ea||(Ts=ra.now(),ea=setInterval(Gw,Ip)),Zr=1,Np(Up))}}function Bp(e,t,n){var r=new Ms;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var zw=rc("start","end","cancel","interrupt"),Ww=[],Hp=0,Vp=1,gc=2,Cs=3,Fp=4,vc=5,As=6;function ks(e,t,n,r,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;qw(e,n,{name:t,index:r,group:i,on:zw,tween:Ww,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Hp})}function yc(e,t){var n=Je(e,t);if(n.state>Hp)throw new Error("too late; already scheduled");return n}function pn(e,t){var n=Je(e,t);if(n.state>Cs)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function qw(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Pp(a,0,n.time);function a(c){n.state=Vp,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,h,p;if(n.state!==Vp)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===Cs)return Bp(s);p.state===Fp?(p.state=As,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=As,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Bp(function(){n.state===Cs&&(n.state=Fp,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=gc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===gc){for(n.state=Cs,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=vc,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===vc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=As,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function bc(e,t){var n=e.__transition,r,i,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}i=r.state>gc&&r.state<vc,r.state=As,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function Yw(e){return this.each(function(){bc(this,e)})}function Zw(e,t){var n,r;return function(){var i=pn(this,e),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Xw(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=pn(this,e),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}a.tween=i}}function Kw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Je(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?Zw:Xw)(n,e,t))}function xc(e,t,n){var r=e._id;return e.each(function(){var i=pn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Je(i,r).value[t]}}function Gp(e,t){var n;return(typeof t=="number"?Ae:t instanceof Sn?Os:(n=Sn(t))?(t=n,Os):Cp)(e,t)}function Qw(e){return function(){this.removeAttribute(e)}}function Jw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tS(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===r?a:a=t(r=s,n)}}function eS(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?a:a=t(r=s,n)}}function nS(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function rS(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function iS(e,t){var n=vs(e),r=n==="transform"?Hw:Gp;return this.attrTween(e,typeof t=="function"?(n.local?rS:nS)(n,r,xc(this,"attr."+e,t)):t==null?(n.local?Jw:Qw)(n):(n.local?eS:tS)(n,r,t))}function aS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function sS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function oS(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&sS(e,a)),n}return i._value=t,i}function lS(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&aS(e,a)),n}return i._value=t,i}function cS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=vs(e);return this.tween(n,(r.local?oS:lS)(r,t))}function uS(e,t){return function(){yc(this,e).delay=+t.apply(this,arguments)}}function hS(e,t){return t=+t,function(){yc(this,e).delay=t}}function dS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uS:hS)(t,e)):Je(this.node(),t).delay}function pS(e,t){return function(){pn(this,e).duration=+t.apply(this,arguments)}}function fS(e,t){return t=+t,function(){pn(this,e).duration=t}}function mS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pS:fS)(t,e)):Je(this.node(),t).duration}function gS(e,t){if(typeof t!="function")throw new Error;return function(){pn(this,e).ease=t}}function vS(e){var t=this._id;return arguments.length?this.each(gS(t,e)):Je(this.node(),t).ease}function yS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pn(this,e).ease=n}}function bS(e){if(typeof e!="function")throw new Error;return this.each(yS(this._id,e))}function xS(e){typeof e!="function"&&(e=lp(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&o.push(l);return new Tn(r,this._parents,this._name,this._id)}function _S(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var l=t[o],c=n[o],u=l.length,d=s[o]=new Array(u),h,p=0;p<u;++p)(h=l[p]||c[p])&&(d[p]=h);for(;o<r;++o)s[o]=t[o];return new Tn(s,this._parents,this._name,this._id)}function ES(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function OS(e,t,n){var r,i,a=ES(t)?yc:pn;return function(){var s=a(this,e),o=s.on;o!==r&&(i=(r=o).copy()).on(t,n),s.on=i}}function wS(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(OS(n,e,t))}function SS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function TS(){return this.on("end.remove",SS(this._id))}function $S(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ac(e));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],l=o.length,c=a[s]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,ks(c[h],t,n,h,c,Je(u,n)));return new Tn(a,this._parents,t,n)}function MS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=op(e));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),p,f=Je(u,n),v=0,m=h.length;v<m;++v)(p=h[v])&&ks(p,t,n,v,h,f);a.push(h),s.push(u)}return new Tn(a,s,t,n)}var CS=Zi.prototype.constructor;function AS(){return new CS(this._groups,this._parents)}function kS(e,t){var n,r,i;return function(){var a=qr(this,e),s=(this.style.removeProperty(e),qr(this,e));return a===s?null:a===n&&s===r?i:i=t(n=a,r=s)}}function jp(e){return function(){this.style.removeProperty(e)}}function LS(e,t,n){var r,i=n+"",a;return function(){var s=qr(this,e);return s===i?null:s===r?a:a=t(r=s,n)}}function DS(e,t,n){var r,i,a;return function(){var s=qr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),qr(this,e))),s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o))}}function RS(e,t){var n,r,i,a="style."+t,s="end."+a,o;return function(){var l=pn(this,e),c=l.on,u=l.value[a]==null?o||(o=jp(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(s,i=u),l.on=r}}function IS(e,t,n){var r=(e+="")=="transform"?Bw:Gp;return t==null?this.styleTween(e,kS(e,r)).on("end.style."+e,jp(e)):typeof t=="function"?this.styleTween(e,DS(e,r,xc(this,"style."+e,t))).each(RS(this._id,e)):this.styleTween(e,LS(e,r,t),n).on("end.style."+e,null)}function NS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function PS(e,t,n){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&NS(e,s,n)),r}return a._value=t,a}function US(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,PS(e,t,n??""))}function BS(e){return function(){this.textContent=e}}function HS(e){return function(){var t=e(this);this.textContent=t??""}}function VS(e){return this.tween("text",typeof e=="function"?HS(xc(this,"text",e)):BS(e==null?"":e+""))}function FS(e){return function(t){this.textContent=e.call(this,t)}}function GS(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&FS(i)),t}return r._value=e,r}function jS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,GS(e))}function zS(){for(var e=this._name,t=this._id,n=zp(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,c=0;c<o;++c)if(l=s[c]){var u=Je(l,t);ks(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Tn(r,this._parents,e,n)}function WS(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};n.each(function(){var c=pn(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&a()})}var qS=0;function Tn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function zp(){return++qS}var $n=Zi.prototype;Tn.prototype={constructor:Tn,select:$S,selectAll:MS,selectChild:$n.selectChild,selectChildren:$n.selectChildren,filter:xS,merge:_S,selection:AS,transition:zS,call:$n.call,nodes:$n.nodes,node:$n.node,size:$n.size,empty:$n.empty,each:$n.each,on:wS,attr:iS,attrTween:cS,style:IS,styleTween:US,text:VS,textTween:jS,remove:TS,tween:Kw,delay:dS,duration:mS,ease:vS,easeVarying:bS,end:WS,[Symbol.iterator]:$n[Symbol.iterator]};function Wp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var YS={time:null,delay:0,duration:250,ease:Wp};function ZS(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function XS(e){var t,n;e instanceof Tn?(t=e._id,e=e._name):(t=zp(),(n=YS).time=fc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,c=0;c<o;++c)(l=s[c])&&ks(l,e,t,c,s,n||ZS(l,t));return new Tn(r,this._parents,e,t)}Zi.prototype.interrupt=Yw,Zi.prototype.transition=XS;function KS(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ls(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 Xr(e){return e=Ls(Math.abs(e)),e?e[1]:NaN}function QS(e,t){return function(n,r){for(var i=n.length,a=[],s=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),a.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function JS(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var tT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ia(e){if(!(t=tT.exec(e)))throw new Error("invalid format: "+e);var t;return new _c({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]})}ia.prototype=_c.prototype;function _c(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+""}_c.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 eT(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var qp;function nT(e,t){var n=Ls(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(qp=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ls(e,Math.max(0,t+a-1))[0]}function Yp(e,t){var n=Ls(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 Zp={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:KS,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)=>Yp(e*100,t),r:Yp,s:nT,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Xp(e){return e}var Kp=Array.prototype.map,Qp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function rT(e){var t=e.grouping===void 0||e.thousands===void 0?Xp:QS(Kp.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+"",a=e.numerals===void 0?Xp:JS(Kp.call(e.numerals,String)),s=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=ia(d);var h=d.fill,p=d.align,f=d.sign,v=d.symbol,m=d.zero,y=d.width,g=d.comma,x=d.precision,O=d.trim,E=d.type;E==="n"?(g=!0,E="g"):Zp[E]||(x===void 0&&(x=12),O=!0,E="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=v==="$"?n:v==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",A=v==="$"?r:/[%p]/.test(E)?s:"",I=Zp[E],L=/[defgprs%]/.test(E);x=x===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function D($){var F=w,P=A,H,_,C;if(E==="c")P=I($)+P,$="";else{$=+$;var k=$<0||1/$<0;if($=isNaN($)?l:I(Math.abs($),x),O&&($=eT($)),k&&+$==0&&f!=="+"&&(k=!1),F=(k?f==="("?f:o:f==="-"||f==="("?"":f)+F,P=(E==="s"?Qp[8+qp/3]:"")+P+(k&&f==="("?")":""),L){for(H=-1,_=$.length;++H<_;)if(C=$.charCodeAt(H),48>C||C>57){P=(C===46?i+$.slice(H+1):$.slice(H))+P,$=$.slice(0,H);break}}}g&&!m&&($=t($,1/0));var U=F.length+$.length+P.length,B=U<y?new Array(y-U+1).join(h):"";switch(g&&m&&($=t(B+$,B.length?y-P.length:1/0),B=""),p){case"<":$=F+$+P+B;break;case"=":$=F+B+$+P;break;case"^":$=B.slice(0,U=B.length>>1)+F+$+P+B.slice(U);break;default:$=B+F+$+P;break}return a($)}return D.toString=function(){return d+""},D}function u(d,h){var p=c((d=ia(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Xr(h)/3)))*3,v=Math.pow(10,-f),m=Qp[8+f/3];return function(y){return p(v*y)+m}}return{format:c,formatPrefix:u}}var Ds,Ec,Jp;iT({thousands:",",grouping:[3],currency:["$",""]});function iT(e){return Ds=rT(e),Ec=Ds.format,Jp=Ds.formatPrefix,Ds}function aT(e){return Math.max(0,-Xr(Math.abs(e)))}function sT(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xr(t)/3)))*3-Xr(Math.abs(e)))}function oT(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xr(t)-Xr(e))+1}function Kr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const tf=Symbol("implicit");function Rs(){var e=new np,t=[],n=[],r=tf;function i(a){let s=e.get(a);if(s===void 0){if(r!==tf)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new np;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Rs(t,n).unknown(r)},Kr.apply(i,arguments),i}function lT(e){return function(){return e}}function cT(e){return+e}var ef=[0,1];function Qr(e){return e}function Oc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:lT(isNaN(t)?NaN:.5)}function uT(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function hT(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Oc(i,r),a=n(s,a)):(r=Oc(r,i),a=n(a,s)),function(o){return a(r(o))}}function dT(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Oc(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var l=ec(e,o,1,r)-1;return a[l](i[l](o))}}function wc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function nf(){var e=ef,t=ef,n=Ji,r,i,a,s=Qr,o,l,c;function u(){var h=Math.min(e.length,t.length);return s!==Qr&&(s=uT(e[0],e[h-1])),o=h>2?dT:hT,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?a:(l||(l=o(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((c||(c=o(t,e.map(r),Ae)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,cT),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=Ap,u()},d.clamp=function(h){return arguments.length?(s=h?!0:Qr,u()):s!==Qr},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,p){return r=h,i=p,u()}}function rf(){return nf()(Qr,Qr)}function pT(e,t,n,r){var i=nc(e,t,n),a;switch(r=ia(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=sT(i,s))&&(r.precision=a),Jp(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=oT(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=aT(i))&&(r.precision=a-(r.type==="%")*2);break}}return Ec(r)}function af(e){var t=e.domain;return e.ticks=function(n){var r=t();return ms(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return pT(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],o=r[a],l,c,u=10;for(o<s&&(c=s,s=o,o=c,c=i,i=a,a=c);u-- >0;){if(c=Wr(s,o,n),c===l)return r[i]=s,r[a]=o,t(r);if(c>0)s=Math.floor(s/c)*c,o=Math.ceil(o/c)*c;else if(c<0)s=Math.ceil(s*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function tn(){var e=rf();return e.copy=function(){return wc(e,tn())},Kr.apply(e,arguments),af(e)}function Sc(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(l){return l!=null&&l<=l?i[ec(r,l,0,n)]:a}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return s}return s.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},s.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},s.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(a=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return Sc().domain([e,t]).range(i).unknown(a)},Kr.apply(af(s),arguments)}function aa(e,t,n){this.k=e,this.x=t,this.y=n}aa.prototype={constructor:aa,scale:function(e){return e===1?this:new aa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new aa(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+")"}},aa.prototype;const Ee="cds",Mn={opacity:{unselected:.05,selected:.4}},qn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Jr={duration:1e3,ease:Wp,zoomLevel:3},ti={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},sf={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Fe={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},fT={defaultBins:10},Yt={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}},Cn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},se={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Vt={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}},br={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},en={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},of={minCellDividerDimension:16,chartPadding:.5},lf={default:{size:24}},cf={defaultOffset:4,horizontalOffset:10},uf={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}},ke={height:{[qe.GRAPH_VIEW]:32,[qe.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},mT=[{type:ne.RADIUS,name:"Radius"},{type:ne.AREA,name:"Poor area"},{type:ne.AREA,name:"Satisfactory area"},{type:ne.AREA,name:"Great area"},{type:ne.QUARTILE,name:"Quartiles"}],ei={type:Ue.END_LINE,threshold:16,numCharacter:14},gT={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"}}},vT={enabled:!0,position:Ur.BOTTOM,clickable:!0,truncation:ei,alignment:te.LEFT,order:null,additionalItems:[]},yT={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},bT={enabled:!0},hf={enabled:!0,showTotal:!0,truncation:ei,groupLabel:"Group"},df={top:{visible:!0,includeZero:!0,truncation:ei},bottom:{visible:!0,includeZero:!0,truncation:ei},left:{visible:!0,includeZero:!0,truncation:ei},right:{visible:!0,includeZero:!0,truncation:ei}},Is={addSpaceOnEdges:1,showDayName:!1,localeObject:Wh,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 pf=!1;try{pf=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const ue={width:null,height:null,resizable:!0,theme:$l.WHITE,tooltip:hf,legend:vT,locale:gT,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:Tt.SHOW_AS_DATATABLE},...pf?[{type:Tt.MAKE_FULLSCREEN}]:[],{type:Tt.EXPORT_CSV},{type:Tt.EXPORT_PNG},{type:Tt.EXPORT_JPG}]}},ff=ct({},ue,{thematic:{projection:un.geoNaturalEarth1}}),sa=ct({},ue,{axes:df,timeScale:Is,grid:yT,ruler:bT,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:qe.GRAPH_VIEW}}}),xr=ct({},sa,{bars:{maxWidth:16,spacingFactor:.25},timeScale:ct(Is,{addSpaceOnEdges:1})}),xT=ct({},xr,{}),_T=ct({},xr,{}),ET=ct({},xr,{bars:ct({},xr.bars,{dividerSize:1.5})}),OT=ct({},xr,{}),Tc=ct({},sa,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),wT=Tc,mf=ct({},Tc,{points:{radius:3,filled:!1,enabled:!0}}),gf=ct({},mf,{timeScale:ct(Is,{addSpaceOnEdges:0})}),ST=gf,TT=ct({},sa,{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:ne.RADIUS,name:"Radius"}]}}),$T=ct({},sa,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:ne.AREA,name:"Poor area"},{type:ne.AREA,name:"Satisfactory area"},{type:ne.AREA,name:"Great area"},{type:ne.QUARTILE,name:"Quartiles"}]}}),MT=ct({},xr,{bars:{dividerSize:1.5},timeScale:ct(Is,{addSpaceOnEdges:0})}),CT=ct({},ue,{tooltip:ct({},hf,{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"}}),vf=ct({},ue,{pie:{labels:{formatter:null,enabled:!0},alignment:te.LEFT,sortFunction:null,valueMapsTo:"value"}}),AT=ct({},ue,{legend:{enabled:!1},gauge:{type:or.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:te.LEFT}}),kT=ct({},vf,{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:te.LEFT}}),yf=ct({},ue,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),LT=ct({},yf,{legend:{enabled:!0}}),DT=ct({},ue,{radar:{axes:{angle:"key",value:"value"},alignment:te.LEFT},tooltip:{gridline:{enabled:!0}}}),RT=ct({},xr,{comboChartTypes:[]}),IT=ct({tree:{type:Ka.TREE}},ue,{}),NT=ct({},ue,{data:ct(ue.data,{groupMapsTo:"name"})}),PT=ct({},ue,ti,{data:ct(ue.data,{groupMapsTo:"name"})}),UT=ct({},ue,{alluvial:{data:ct(ue.data,{groupMapsTo:"source"}),nodeAlignment:te.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),BT=ct({},ue,{axes:df,heatmap:{divider:{state:Hr.AUTO},colorLegend:{type:"linear"}}}),HT=ct({},ff,{choropleth:{colorLegend:{type:"linear"}}}),Pt={alluvialChart:UT,areaChart:gf,axisChart:sa,boxplotChart:OT,bubbleChart:TT,bulletChart:$T,chart:ue,circlePackChart:PT,choroplethChart:HT,comboChart:RT,donutChart:kT,gaugeChart:AT,groupedBarChart:_T,heatmapChart:BT,histogramChart:MT,lineChart:mf,lollipopChart:wT,meterChart:yf,pieChart:vf,proportionalMeterChart:LT,radarChart:DT,scatterChart:Tc,simpleBarChart:xT,stackedAreaChart:ST,stackedBarChart:ET,thematicChart:ff,treeChart:IT,treemapChart:NT,wordCloudChart:CT};function VT(e,t,n){let r=null;return function(...i){const a=this;a.mousePosition=mr(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(a,i)},t)}}function zt(e,t){var n;const r=wn(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 a in r.axes)if(i.includes(a)){const s=t.axes[a];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),s.mapsTo==null){const l=s.scaleType;l==null?s.mapsTo="value":l===tt.TIME?s.mapsTo="date":l===tt.LABELS&&(s.mapsTo="key")}}else delete r.axes[a];return Mc(r,t),ct(r,t)}function An(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 oa(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 $c(e,t,n="value",r=!1){const i=e/t.reduce((a,s)=>a+s[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function la(e,t,n){if(n>e.length)return e;if(t===Ue.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ue.FRONT_LINE)return"..."+e.substr(-n);if(t===Ue.END_LINE)return e.substr(0,n)+"..."}function Mc(e,t){const n=b(e,"legend","additionalItems"),r=b(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),a=n.map(o=>o.type),s=mT.filter(o=>a.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=s,t.legend.additionalItems=EE(s,r,"name")}}const b=(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},bf=(e,t)=>t===Jt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,me=(e,t)=>{const{x0:n,x1:r,y0:i,y1:a}=bf(e,t);return`M${n},${i}L${n},${a}L${r},${a}L${r},${i}L${n},${i}`};function kn(e,t,n){return n===Jt.VERTICAL?[e,t]:[t,e]}const xf=6048e5,FT=864e5,_f=6e4,Ef=36e5;function Of(e){const t=wt(e);return t.setHours(0,0,0,0),t}function wf(e){const t=wt(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 Sf(e,t){const n=Of(e),r=Of(t),i=+n-wf(n),a=+r-wf(r);return Math.round((i-a)/FT)}function nn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function GT(e){const t=wt(e),n=nn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function jT(e){const t=wt(e);return Sf(t,GT(t))+1}function Ns(e){return Ni(e,{weekStartsOn:1})}function Tf(e){const t=wt(e),n=t.getFullYear(),r=nn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Ns(r),a=nn(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=Ns(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function zT(e){const t=Tf(e),n=nn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ns(n)}function WT(e){const t=wt(e),n=+Ns(t)-+zT(t);return Math.round(n/xf)+1}function $f(e,t){var n,r,i,a;const s=wt(e),o=s.getFullYear(),l=ts(),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??((a=(i=l.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,u=nn(e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=Ni(u,t),h=nn(e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=Ni(h,t);return s.getTime()>=d.getTime()?o+1:s.getTime()>=p.getTime()?o:o-1}function qT(e,t){var n,r,i,a;const s=ts(),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)??s.firstWeekContainsDate??((a=(i=s.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,l=$f(e,t),c=nn(e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),Ni(c,t)}function YT(e,t){const n=wt(e),r=+Ni(n,t)-+qT(n,t);return Math.round(r/xf)+1}function kt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Yn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return kt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):kt(n+1,2)},d(e,t){return kt(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 kt(e.getHours()%12||12,t.length)},H(e,t){return kt(e.getHours(),t.length)},m(e,t){return kt(e.getMinutes(),t.length)},s(e,t){return kt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return kt(i,t.length)}},ni={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Mf={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 Yn.y(e,t)},Y:function(e,t,n,r){const i=$f(e,r),a=i>0?i:1-i;if(t==="YY"){const s=a%100;return kt(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):kt(a,t.length)},R:function(e,t){const n=Tf(e);return kt(n,t.length)},u:function(e,t){const n=e.getFullYear();return kt(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 kt(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 kt(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 Yn.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 kt(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=YT(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):kt(i,t.length)},I:function(e,t,n){const r=WT(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):kt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Yn.d(e,t)},D:function(e,t,n){const r=jT(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):kt(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(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return kt(a,2);case"eo":return n.ordinalNumber(a,{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(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return kt(a,t.length);case"co":return n.ordinalNumber(a,{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 kt(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=ni.noon:r===0?i=ni.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=ni.evening:r>=12?i=ni.afternoon:r>=4?i=ni.morning:i=ni.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 Yn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Yn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):kt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Yn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Yn.s(e,t)},S:function(e,t){return Yn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Af(r);case"XXXX":case"XX":return _r(r);case"XXXXX":case"XXX":default:return _r(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Af(r);case"xxxx":case"xx":return _r(r);case"xxxxx":case"xxx":default:return _r(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Cf(r,":");case"OOOO":default:return"GMT"+_r(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Cf(r,":");case"zzzz":default:return"GMT"+_r(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return kt(r,t.length)},T:function(e,t,n){const r=e.getTime();return kt(r,t.length)}};function Cf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+kt(a,2)}function Af(e,t){return e%60===0?(e>0?"-":"+")+kt(Math.abs(e)/60,2):_r(e,t)}function _r(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=kt(Math.trunc(r/60),2),a=kt(r%60,2);return n+i+t+a}const kf=(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"})}},Lf=(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"})}},ZT=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return kf(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",kf(r,t)).replace("{{time}}",Lf(i,t))},XT={p:Lf,P:ZT},KT=/^D+$/,QT=/^Y+$/,JT=["D","DD","YY","YYYY"];function t$(e){return KT.test(e)}function e$(e){return QT.test(e)}function n$(e,t,n){const r=r$(e,t,n);if(console.warn(r),JT.includes(e))throw new RangeError(r)}function r$(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 i$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function a$(e){if(!i$(e)&&typeof e!="number")return!1;const t=wt(e);return!isNaN(Number(t))}const s$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,o$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,l$=/^'([^]*?)'?$/,c$=/''/g,u$=/[a-zA-Z]/;function Cc(e,t,n){var r,i,a,s,o,l,c,u;const d=ts(),h=(n==null?void 0:n.locale)??d.locale??Wh,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??((s=(a=d.locale)==null?void 0:a.options)==null?void 0:s.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,v=wt(e);if(!a$(v))throw new RangeError("Invalid time value");let m=t.match(o$).map(g=>{const x=g[0];if(x==="p"||x==="P"){const O=XT[x];return O(g,h.formatLong)}return g}).join("").match(s$).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const x=g[0];if(x==="'")return{isToken:!1,value:h$(g)};if(Mf[x])return{isToken:!0,value:g};if(x.match(u$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:g}});h.localize.preprocessor&&(m=h.localize.preprocessor(v,m));const y={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(g=>{if(!g.isToken)return g.value;const x=g.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&e$(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&t$(x))&&n$(x,t,String(e));const O=Mf[x[0]];return O(v,x,h.localize,y)}).join("")}function h$(e){const t=e.match(l$);return t?t[1].replace(c$,"'"):e}const Ac=[["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 Df(e,t,n,r,i){const a=t===0,s=Number(Cc(new Date(e),"c"))===2,o=Number(Cc(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return a||Us(e)||ca(e,l)||Zn(e);case"minute":return a||Us(e)||ca(e,l)||Zn(e);case"30minutes":return a||Us(e)||ca(e,l)||Zn(e);case"hourly":return a||Us(e)||ca(e,l)||Zn(e);case"daily":return i?a||s||Zn(e):a||ca(e,l)||Zn(e);case"weekly":return a||s||Zn(e);case"monthly":return a||Zn(e);case"quarterly":return a||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function kc(e,t,n,r,i,a){const s=i.showDayName,o=r==="daily"&&s?"weekly":r,l=new Date(e),c=b(i,"timeIntervalFormats")[o],u=b(c,"primary"),d=b(c,"secondary"),h=Df(e,t,n,r,s);let p=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(p=p.replace("pp","h:mm:ss.SSS a"));const f=i.localeObject,{code:v,optionsObject:m}=a,y=m[r].type,g=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!g){const x=Cc(l,p,{locale:f}).split("").map(O=>{const E=Number(O);return O!==" "&&!Number.isNaN(E)?E.toLocaleString(v):O});return a[y](l,v,{},x.join(""))}else return a[y](l,v,g)}function Ps(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function d$(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function p$(e){const t=Ac.reduce((n,[,r],i)=>{const a=Ac[n][1],s=Math.abs(a-e),o=Math.abs(r-e);return s<o?n:i},0);return Ac[t][0]}function Lc(e,t){if(zh[t])return t;if(e.length===1)return"15seconds";const n=d$(e),r=Wn(n);return p$(r)}function Us(e){const{s:t,m:n,H:r}=Ps(e);return r===0&&n===0&&t===0}function ca(e,t){const n=Ps(e).M,r=Ps(t).M;return n!==r}function Zn(e){const{M:t,d:n,s:r,m:i,H:a}=Ps(e);return t===1&&n===1&&a===0&&i===0&&r===0}function Rf(e){return e===void 0?"":e.toISOString()}function If(e){const t=Ke(e,r=>r.value),n=tn().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 Nf(e,t){const n=b(t,"gradient","colors"),r=!Xe(n);let i=b(t,"pairing","option");const a=If(e),s=a[0]<0&&a[1]>0?"diverge":"mono";(i<1&&i>4&&s==="mono"||i<1&&i>2&&s==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=s==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${s}-${i}-${c}`)}return Sc().domain(a).range(o)}var pt=(e=>(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))(pt||{});function f$(e,t){return e&&Qd(e,t,Hi)}function m$(e,t){return function(n,r){if(n==null)return n;if(!hr(n))return e(n,r);for(var i=n.length,a=-1,s=Object(n);++a<i&&r(s[a],a,s)!==!1;);return n}}var Dc=m$(f$);function ft(e){return function(){return e}}var g$=Array.prototype.slice;function Bs(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function v$(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var s=e[i];t(r,s,n(s),e)}return r}function y$(e,t,n,r){return Dc(e,function(i,a,s){t(r,i,n(i),s)}),r}function b$(e,t){return function(n,r){var i=ae(n)?v$:y$,a={};return i(n,e,ps(r),a)}}function x$(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var _$=Object.prototype,E$=_$.hasOwnProperty,O$=b$(function(e,t,n){E$.call(e,n)?e[n].push(t):rs(e,n,[t])});function w$(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function S$(e){return e}function T$(e=pr){if(e===pr)return Pf;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 Pf(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var $$=Array.prototype,M$=$$.slice;function Rc(e){return()=>e}function C$(e,t,n){let r;for(;;){const i=Wr(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 A$(e){return Math.max(1,Math.ceil(Math.log(w$(e))/Math.LN2)+1)}function k$(){var e=S$,t=Ke,n=A$;function r(i){Array.isArray(i)||(i=Array.from(i));var a,s=i.length,o,l,c=new Array(s);for(a=0;a<s;++a)c[a]=e(i[a],a,i);var u=t(c),d=u[0],h=u[1],p=n(c,d,h);if(!Array.isArray(p)){const x=h,O=+p;if(t===Ke&&([d,h]=C$(d,h,O)),p=ms(d,h,O),p[0]<=d&&(l=Wr(d,h,O)),p[p.length-1]>=h)if(x>=h&&t===Ke){const E=Wr(d,h,O);isFinite(E)&&(E>0?h=(Math.floor(h/E)+1)*E:E<0&&(h=(Math.ceil(h*-E)+1)/-E))}else p.pop()}for(var f=p.length,v=0,m=f;p[v]<=d;)++v;for(;p[m-1]>h;)--m;(v||m<f)&&(p=p.slice(v,m),f=m-v);var y=new Array(f+1),g;for(a=0;a<=f;++a)g=y[a]=[],g.x0=a>0?p[a-1]:d,g.x1=a<f?p[a]:h;if(isFinite(l)){if(l>0)for(a=0;a<s;++a)(o=c[a])!=null&&d<=o&&o<=h&&y[Math.min(f,Math.floor((o-d)/l))].push(i[a]);else if(l<0){for(a=0;a<s;++a)if((o=c[a])!=null&&d<=o&&o<=h){const x=Math.floor((d-o)*l);y[Math.min(f,x+(p[x]<=o))].push(i[a])}}}else for(a=0;a<s;++a)(o=c[a])!=null&&d<=o&&o<=h&&y[ec(p,o,0,f)].push(i[a]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Rc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Rc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Rc(Array.isArray(i)?M$.call(i):i),r):n},r}function Uf(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Pf:T$(i);r>n;){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));Uf(e,t,p,f,i)}const a=e[t];let s=n,o=r;for(ua(e,n,t),i(e[r],a)>0&&ua(e,n,r);s<o;){for(ua(e,s,o),++s,--o;i(e[s],a)<0;)++s;for(;i(e[o],a)>0;)--o}i(e[n],a)===0?ua(e,n,o):(++o,ua(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ua(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ic(e,t,n){if(e=Float64Array.from(TE(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Wn(e);if(t>=1)return fr(e);var r,i=(r-1)*t,a=Math.floor(i),s=fr(Uf(e,a).subarray(0,a+1)),o=Wn(e.subarray(a+1));return s+(o-s)*(i-a)}}function Bf(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Hf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function L$(e,t){return e[t]}function D$(e){const t=[];return t.key=e,t}function Nc(){var e=ft([]),t=Hf,n=Bf,r=L$;function i(a){var s=Array.from(e.apply(this,arguments),D$),o,l=s.length,c=-1,u;for(const d of a)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(d,s[o].key,c,a)]).data=d;for(o=0,u=Bs(t(s));o<l;++o)s[u[o]].index=o;return n(s,u),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ft(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ft(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Hf:typeof a=="function"?a:ft(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Bf,i):n},i}function R$(e,t){if((l=e.length)>0)for(var n,r=0,i,a,s,o,l,c=e[t[0]].length;r<c;++r)for(s=o=0,n=0;n<l;++n)(a=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=s,i[1]=s+=a):a<0?(i[1]=o,i[0]=o+=a):(i[0]=0,i[1]=a)}function I$(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class fn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:a,number:s}=b(r,"locale"),o=b(r,"tabularRepModal","tableHeadingFormatter"),l=b(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===tt.TIME&&(d=h=>a(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]=s(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:a}=b(n,"data"),s=b(n,"axes");return t&&(r=r.filter(o=>t.includes(o[a]))),s&&Object.keys(s).forEach(o=>{const l=s[o].mapsTo,c=s[o].scaleType;if((c===tt.LINEAR||c===tt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&s[o].domain)if(c===tt.LABELS)r=r.filter(u=>s[o].domain.includes(u[l]));else{const[u,d]=s[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[a]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Yt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>r.find(s=>s.name===a[i]&&s.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(wn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Yt.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 O$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),a=n.axes[r],{groupMapsTo:s}=n.data,{bins:o=fT.defaultBins}=a,l=Array.isArray(o),c=k$().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[s]))),h=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,v=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:v[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(),a=this.getDataValuesGroupedByKeys({bins:i});return Nc().keys(r)(a).map((s,o)=>Object.keys(s).filter(l=>!isNaN(l)).map(l=>{const c=s[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(a=>{const s=a[i];r[s]!==null&&r[s]!==void 0?r[s].push(a):r[s]=[a]}),Object.keys(r).map(a=>({name:a,data:r[a]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let a;t?a=t.map(l=>`${l.x0}:${l.x1}`):a=Yi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Rf(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const s=this.services.cartesianScales.domainAxisPosition,o=r.axes[s].scaleType;return o===tt.TIME?a.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===tt.LOG||o===tt.LINEAR)&&a.sort((l,c)=>l-c),a}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.getDisplayData(n),s=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 s.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return s.forEach(u=>{const d=a.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Rf(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:a}=i.data,s=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=x$(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{s.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{s.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Nc().offset(R$):Nc()).keys(s)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[a]=s[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();Mc(n,t),this.set({options:ct(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(S.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Yt.items.status,i=this.getDataGroups(),a=i.some(c=>c.status===r),s=i.filter(c=>c.status===n);if(a)if(s.length===1&&s[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(S.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const a=this.getOptions();return a.getIsFilled?a.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),a=b(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,a):a}getStrokeColor(t,n,r){const i=this.getOptions(),a=b(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,a):a}isUserProvidedColorScaleValid(){const t=b(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(a=>{a.data.forEach((s,o)=>{let l;const c=b(a,"label");if(c===null){const d=b(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(s)?(u.value=s.value,u.date=s.date):u.value=s,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(a=>a.map(s=>`"${(s==="&ndash;"?"–":s).split(/[,;'"`]/).map(o=>I$(o)).join("")}"`)).map(a=>a.join(",")).join(`
2
+ `),n=this.getOptions();let r="myChart";const i=b(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}=Yt.items.status,a=this.getOptions(),s=Yi(t.map(l=>l[n]));a.data.selectedGroups.length&&(a.data.selectedGroups.every(l=>s.includes(l))||(a.data.selectedGroups=[]));const o=l=>!a.data.selectedGroups.length||a.data.selectedGroups.includes(l)?r:i;return s.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=b(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=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=b(t,"option");const i=sf.pairingOptions,a=n>5?14:n,s=`${a}-color`;r=r<=i[s]?r:1;const o=this.allDataGroups.map((l,c)=>`${a}-${r}-${c%14+1}`);this.colorClassNames=Rs().range(o).domain(this.allDataGroups)}}class Er extends fn{constructor(t){super(t),this.axisFlavor=Di.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(a=>{const s=i[a];t.scales[s]?i[a]={position:s,label:t.getScaleLabel(s),identifier:b(n,"axes",s,"mapsTo")}:i[a]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:a,secondaryDomain:s,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=b(this.getOptions(),"locale"),u=["Group",i.label,a.label,...s?[s.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"&ndash;":l(h[a.identifier],c),...s?[h[s.identifier]===null?"&ndash;":h[s.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",G.TOP,"enabled"))){const r=b(this.getOptions(),"zoomBar",G.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(wn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const a=i.getDomainIdentifier(),s=i.getRangeIdentifier();let o=n.map(l=>l[a].getTime());o=Yi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[a].getTime()===l&&(c+=d[s])}),u[a]=new Date(l),u[s]=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(G).forEach(i=>{const a=G[i],s=n.axes[a];if(s&&s.scaleType===tt.TIME){const o=s.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(a=>{b(i,a,"getTime")===null&&(i[a]=new Date(i[a]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}class N$ extends Er{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale");t.sort((s,o)=>s.source.localeCompare(o.source));const i=["Source","Target","Value"],a=[...t.map(s=>[s.source,s.target,s.value===null?"&ndash;":n(s.value,r)])];return super.formatTable({headers:i,cells:a})}}class P$ extends Er{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Ic(t,.25),q_50:Ic(t,.5),q_75:Ic(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:a,data:s}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=s.map(x=>x[o]).sort(pr),c={[n]:a,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,v=[],m=[];for(const x of l)x<p||x>f?v.push(x):m.push(x);c.outliers=v;const y=Wn(m),g=fr(m);c.whiskers={min:y||Wn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:g||fr([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:a}=b(t,"locale"),s=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=b(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],b(l,"whiskers","min")!==null?i(b(l,"whiskers","min"),a):"&ndash;",b(l,"quartiles","q_25")!==null?i(b(l,"quartiles","q_25"),a):"&ndash;",b(l,"quartiles","q_50")!==null?i(b(l,"quartiles","q_50"),a):"&ndash;",b(l,"quartiles","q_75")!==null?i(b(l,"quartiles","q_75"),a):"&ndash;",b(l,"whiskers","max")!==null?i(b(l,"whiskers","max"),a):"&ndash;",b(l,"quartiles","q_75")!==null&&b(l,"quartiles","q_25")!==null?(i(b(l,"quartiles","q_75")-b(l,"quartiles","q_25")),a):"&ndash;",c.map(u=>i(u,a)).join(",")]})];return super.formatTable({headers:s,cells:o})}setColorClassNames(){const t=b(this.getOptions(),"color","pairing");let n=b(t,"option");const r=sf.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Rs().range(i).domain(this.allDataGroups)}}class U$ extends Er{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:a,code:s}=b(n,"locale"),o=b(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":a(u.value,s),b(u,"marker")===null?"&ndash;":a(u.marker,s),b(u,"marker")===null?"&ndash;":`${a(Math.floor(u[i]/u.marker*100),s)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}}let B$=class extends fn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Xe(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Xe(n)&&!Xe(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}=b(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],a=[...t.map(s=>[s.id===null?"&ndash;":s.id,s.name,s.value===null?"&ndash;":n(s.value,r)])];return super.formatTable({headers:i,cells:a})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=Nf(this.getDisplayData(),t)}},H$=class extends fn{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=ct({},t,this.getZoomOptions(t));Mc(n,r);const i=this.getHierarchyLevel(),a=b(n,"circlePack","depth");this.set({options:ct(n,r),depth:a&&a<4?a:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&b(n,0,"children")?b(n,0,"children"):n;let a=this.getHierarchyLevel();return i.some(s=>{if(s.children&&s.children.some(o=>o.children))return a=3,!1}),b(r,"canvasZoom","enabled")===!0&&a>2?{legend:{additionalItems:[{type:ne.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(a=>{const s=a[r];return this.setChildrenDataGroup(a,s)});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}=b(this.getOptions(),"locale"),i=["Child","Parent","Value"],a=[];return t.forEach(s=>{let o=s.value?s.value:0;s.children&&(o+=this.getChildrenDatums(s.children,s.name,a,0)),a.push(["&ndash;",s.name,n(o,r)])}),super.formatTable({headers:i,cells:a})}getChildrenDatums(t,n,r=[],i=0){const a=n,{number:s,code:o}=b(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,a,s(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,a,s(d,o)])}}),i}},V$=class extends fn{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:a,code:s}=b(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":a(c[i],s)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}};class F$ extends fn{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:a}=b(this.getOptions(),"locale"),s=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,a)])];return super.formatTable({headers:s,cells:o})}}class G$ extends Er{constructor(t){super(t),this.axisFlavor=Di.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==tt.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==tt.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==tt.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==tt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ke(this.getDisplayData(),r=>r.value),n=tn().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(Xe(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),a=n.getCustomDomainValuesByposition(i);if(a)return a;this._domains=Array.from(new Set(t.map(s=>s[r])))}return this._domains}getUniqueRanges(){if(Xe(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),a=n.getCustomDomainValuesByposition(i);if(a)return a;this._ranges=Array.from(new Set(t.map(s=>s[r])))}return this._ranges}getMatrix(){if(Xe(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),a={};n.forEach(s=>{a[s]={value:null,index:-1}}),t.forEach(s=>{this._matrix[s]=wn(a)}),this.getDisplayData().forEach((s,o)=>{this._matrix[s[r]][s[i]]={value:s.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(wn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Xe(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),a=[];return t.forEach(s=>{n.forEach(o=>{const l={value:this._matrix[s][o].value,index:this._matrix[s][o].index};l[r]=s,l[i]=o,a.push(l)})}),a}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:a}=b(this.getOptions(),"locale"),s=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,a)])];return super.formatTable({headers:s,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),r=!Xe(n);let i=b(t,"color","pairing","option");const a=this.getValueDomain(),s=a[0]<0&&a[1]>0?"diverge":"mono";(i<1&&i>4&&s==="mono"||i<1&&i>2&&s==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=s==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${s}-${i}-${u}`)}this._colorScale=Sc().domain(a).range(o);const l=b(this.getOptions(),"color");this._colorScale=Nf(this.getDisplayData(),l)}}let j$=class extends Er{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=b(this.getOptions(),"locale"),a=this.getBinnedStackedData(),s=[Et(t,"bins.rangeLabel")||"Range",...a.map(l=>Et(l,`0.${n}`))],o=[...Et(a,0).map((l,c)=>[`${r(Number(Et(l,"data.x0")),i)} – ${r(Number(Et(l,"data.x1")),i)}`,...a.map(u=>r(Et(u[c],`data.${Et(u[c],n)}`),i))])];return super.formatTable({headers:s,cells:o})}};class z$ extends fn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=b(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),r=(n==null?void 0:n.reduce((s,o)=>s+o.value,0))??0,i=b(t,"meter","proportional")?r:r>100?100:r,a=b(t,"meter","status","ranges");if(a){const s=a.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(s.length>0)return s[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),a=b(n,"meter","proportional"),{number:s,code:o}=b(this.getOptions(),"locale");let l=[],c=[],u;if(a===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":s(d.value,o),...i?[i]:[]]]}else u=b(a,"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?"&ndash;":s(p,o),s(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}class W$ extends Er{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=b(t,"radar","axes"),{number:a,code:s}=b(t,"locale"),o=b(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>b(u,"data",h,i)!==null?a(b(u,"data",h,i),s):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}let q$=class extends fn{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,"&ndash;"])}),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 Y$ extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Child","Group","Value"],a=[];return t.forEach(s=>{Array.isArray(s.children)?s.children.forEach(o=>{a.push([o.name,s.name,o.value===null?"&ndash;":n(o.value,r)])}):b(s.name)!==null&&b(s.value)&&a.push(["–",s.name,n(s.value,r)])}),super.formatTable({headers:i,cells:a})}}let Z$=class extends fn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:a}=n.data,{code:s,number:o}=b(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[a],o(u[r],s)])];return super.formatTable({headers:l,cells:c})}};var X$=/\s/;function K$(e){for(var t=e.length;t--&&X$.test(e.charAt(t)););return t}var Q$=/^\s+/;function J$(e){return e&&e.slice(0,K$(e)+1).replace(Q$,"")}var Vf=NaN,tM=/^[-+]0x[0-9a-f]+$/i,eM=/^0b[01]+$/i,nM=/^0o[0-7]+$/i,rM=parseInt;function ri(e){if(typeof e=="number")return e;if(es(e))return Vf;if(He(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=He(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=J$(e);var n=eM.test(e);return n||nM.test(e)?rM(e.slice(2),n?2:8):tM.test(e)?Vf:+e}var Pc=function(){return Ye.Date.now()},iM="Expected a function",aM=Math.max,sM=Math.min;function Hs(e,t,n){var r,i,a,s,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(iM);t=ri(t)||0,He(n)&&(u=!!n.leading,d="maxWait"in n,a=d?aM(ri(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(w){var A=r,I=i;return r=i=void 0,c=w,s=e.apply(I,A),s}function f(w){return c=w,o=setTimeout(y,t),u?p(w):s}function v(w){var A=w-l,I=w-c,L=t-A;return d?sM(L,a-I):L}function m(w){var A=w-l,I=w-c;return l===void 0||A>=t||A<0||d&&I>=a}function y(){var w=Pc();if(m(w))return g(w);o=setTimeout(y,v(w))}function g(w){return o=void 0,h&&r?p(w):(r=i=void 0,s)}function x(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function O(){return o===void 0?s:g(Pc())}function E(){var w=Pc(),A=m(w);if(r=arguments,i=this,l=w,A){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(y,t),p(l)}return o===void 0&&(o=setTimeout(y,t)),s}return E.cancel=x,E.flush=O,E}function oM(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,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function R(e){return typeof e=="string"?new Ce([[document.querySelector(e)]],[document.documentElement]):new Ce([[e]],vp)}function ha(){var e=Rs().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,p=i<r,f=p?i:r,v=p?r:i;a=(v-f)/Math.max(1,h-l+c*2),o&&(a=Math.floor(a)),f+=(v-f-a*(h-l))*u,s=a*(1-l),o&&(f=Math.round(f),s=Math.round(s));var m=oM(h).map(function(y){return f+a*y});return n(p?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return ha(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Kr.apply(d(),arguments)}function Ff(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}const Uc=new Date,Bc=new Date;function re(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let c;do l.push(c=new Date(+a)),t(a,o),e(a);while(c<a&&a<s);return l},i.filter=a=>re(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(Uc.setTime(+a),Bc.setTime(+s),e(Uc),e(Bc),Math.floor(n(Uc,Bc))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Vs=re(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Vs.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?re(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Vs),Vs.range;const Ln=1e3,Ge=Ln*60,Dn=Ge*60,Rn=Dn*24,Hc=Rn*7,Gf=Rn*30,Vc=Rn*365,ii=re(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getUTCSeconds());ii.range;const Fc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ln)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getMinutes());Fc.range,re(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getUTCMinutes()).range;const Gc=re(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ln-e.getMinutes()*Ge)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getHours());Gc.range,re(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getUTCHours()).range;const da=re(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ge)/Rn,e=>e.getDate()-1);da.range;const jc=re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Rn,e=>e.getUTCDate()-1);jc.range,re(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Rn,e=>Math.floor(e/Rn)).range;function Or(e){return re(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())*Ge)/Hc)}const Fs=Or(0),Gs=Or(1),lM=Or(2),cM=Or(3),ai=Or(4),uM=Or(5),hM=Or(6);Fs.range,Gs.range,lM.range,cM.range,ai.range,uM.range,hM.range;function wr(e){return re(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)/Hc)}const jf=wr(0),js=wr(1),dM=wr(2),pM=wr(3),si=wr(4),fM=wr(5),mM=wr(6);jf.range,js.range,dM.range,pM.range,si.range,fM.range,mM.range;const zc=re(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());zc.range,re(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 In=re(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());In.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)}),In.range;const Sr=re(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());Sr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:re(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)}),Sr.range;function gM(e,t,n,r,i,a){const s=[[ii,1,Ln],[ii,5,5*Ln],[ii,15,15*Ln],[ii,30,30*Ln],[a,1,Ge],[a,5,5*Ge],[a,15,15*Ge],[a,30,30*Ge],[i,1,Dn],[i,3,3*Dn],[i,6,6*Dn],[i,12,12*Dn],[r,1,Rn],[r,2,2*Rn],[n,1,Hc],[t,1,Gf],[t,3,3*Gf],[e,1,Vc]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const p=d&&typeof d.range=="function"?d:l(c,u,d),f=p?p.range(c,+u+1):[];return h?f.reverse():f}function l(c,u,d){const h=Math.abs(u-c)/d,p=tc(([,,m])=>m).right(s,h);if(p===s.length)return e.every(nc(c/Vc,u/Vc,d));if(p===0)return Vs.every(Math.max(nc(c,u,d),1));const[f,v]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return f.every(v)}return[o,l]}const[vM,yM]=gM(In,zc,Fs,da,Gc,Fc);function Wc(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function qc(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function pa(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function bM(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,c=fa(i),u=ma(i),d=fa(a),h=ma(a),p=fa(s),f=ma(s),v=fa(o),m=ma(o),y=fa(l),g=ma(l),x={a:k,A:U,b:B,B:X,c:null,d:Xf,e:Xf,f:FM,g:QM,G:tC,H:BM,I:HM,j:VM,L:Kf,m:GM,M:jM,p:Y,q:ot,Q:rm,s:im,S:zM,u:WM,U:qM,V:YM,w:ZM,W:XM,x:null,X:null,y:KM,Y:JM,Z:eC,"%":nm},O={a:it,A:xt,b:at,B:K,c:null,d:Jf,e:Jf,f:aC,g:mC,G:vC,H:nC,I:rC,j:iC,L:tm,m:sC,M:oC,p:et,q:mt,Q:rm,s:im,S:lC,u:cC,U:uC,V:hC,w:dC,W:pC,x:null,X:null,y:fC,Y:gC,Z:yC,"%":nm},E={a:D,A:$,b:F,B:P,c:H,d:Yf,e:Yf,f:IM,g:qf,G:Wf,H:Zf,I:Zf,j:kM,L:RM,m:AM,M:LM,p:L,q:CM,Q:PM,s:UM,S:DM,u:wM,U:SM,V:TM,w:OM,W:$M,x:_,X:C,y:qf,Y:Wf,Z:MM,"%":NM};x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),O.x=w(n,O),O.X=w(r,O),O.c=w(t,O);function w(q,J){return function(dt){var j=[],It=-1,gt=0,qt=q.length,jt,nt,Mt;for(dt instanceof Date||(dt=new Date(+dt));++It<qt;)q.charCodeAt(It)===37&&(j.push(q.slice(gt,It)),(nt=zf[jt=q.charAt(++It)])!=null?jt=q.charAt(++It):nt=jt==="e"?" ":"0",(Mt=J[jt])&&(jt=Mt(dt,nt)),j.push(jt),gt=It+1);return j.push(q.slice(gt,It)),j.join("")}}function A(q,J){return function(dt){var j=pa(1900,void 0,1),It=I(j,q,dt+="",0),gt,qt;if(It!=dt.length)return null;if("Q"in j)return new Date(j.Q);if("s"in j)return new Date(j.s*1e3+("L"in j?j.L:0));if(J&&!("Z"in j)&&(j.Z=0),"p"in j&&(j.H=j.H%12+j.p*12),j.m===void 0&&(j.m="q"in j?j.q:0),"V"in j){if(j.V<1||j.V>53)return null;"w"in j||(j.w=1),"Z"in j?(gt=qc(pa(j.y,0,1)),qt=gt.getUTCDay(),gt=qt>4||qt===0?js.ceil(gt):js(gt),gt=jc.offset(gt,(j.V-1)*7),j.y=gt.getUTCFullYear(),j.m=gt.getUTCMonth(),j.d=gt.getUTCDate()+(j.w+6)%7):(gt=Wc(pa(j.y,0,1)),qt=gt.getDay(),gt=qt>4||qt===0?Gs.ceil(gt):Gs(gt),gt=da.offset(gt,(j.V-1)*7),j.y=gt.getFullYear(),j.m=gt.getMonth(),j.d=gt.getDate()+(j.w+6)%7)}else("W"in j||"U"in j)&&("w"in j||(j.w="u"in j?j.u%7:"W"in j?1:0),qt="Z"in j?qc(pa(j.y,0,1)).getUTCDay():Wc(pa(j.y,0,1)).getDay(),j.m=0,j.d="W"in j?(j.w+6)%7+j.W*7-(qt+5)%7:j.w+j.U*7-(qt+6)%7);return"Z"in j?(j.H+=j.Z/100|0,j.M+=j.Z%100,qc(j)):Wc(j)}}function I(q,J,dt,j){for(var It=0,gt=J.length,qt=dt.length,jt,nt;It<gt;){if(j>=qt)return-1;if(jt=J.charCodeAt(It++),jt===37){if(jt=J.charAt(It++),nt=E[jt in zf?J.charAt(It++):jt],!nt||(j=nt(q,dt,j))<0)return-1}else if(jt!=dt.charCodeAt(j++))return-1}return j}function L(q,J,dt){var j=c.exec(J.slice(dt));return j?(q.p=u.get(j[0].toLowerCase()),dt+j[0].length):-1}function D(q,J,dt){var j=p.exec(J.slice(dt));return j?(q.w=f.get(j[0].toLowerCase()),dt+j[0].length):-1}function $(q,J,dt){var j=d.exec(J.slice(dt));return j?(q.w=h.get(j[0].toLowerCase()),dt+j[0].length):-1}function F(q,J,dt){var j=y.exec(J.slice(dt));return j?(q.m=g.get(j[0].toLowerCase()),dt+j[0].length):-1}function P(q,J,dt){var j=v.exec(J.slice(dt));return j?(q.m=m.get(j[0].toLowerCase()),dt+j[0].length):-1}function H(q,J,dt){return I(q,t,J,dt)}function _(q,J,dt){return I(q,n,J,dt)}function C(q,J,dt){return I(q,r,J,dt)}function k(q){return s[q.getDay()]}function U(q){return a[q.getDay()]}function B(q){return l[q.getMonth()]}function X(q){return o[q.getMonth()]}function Y(q){return i[+(q.getHours()>=12)]}function ot(q){return 1+~~(q.getMonth()/3)}function it(q){return s[q.getUTCDay()]}function xt(q){return a[q.getUTCDay()]}function at(q){return l[q.getUTCMonth()]}function K(q){return o[q.getUTCMonth()]}function et(q){return i[+(q.getUTCHours()>=12)]}function mt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var J=w(q+="",x);return J.toString=function(){return q},J},parse:function(q){var J=A(q+="",!1);return J.toString=function(){return q},J},utcFormat:function(q){var J=w(q+="",O);return J.toString=function(){return q},J},utcParse:function(q){var J=A(q+="",!0);return J.toString=function(){return q},J}}}var zf={"-":"",_:" ",0:"0"},ie=/^\s*\d+/,xM=/^%/,_M=/[\\^$*+?|[\]().{}]/g;function St(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function EM(e){return e.replace(_M,"\\$&")}function fa(e){return new RegExp("^(?:"+e.map(EM).join("|")+")","i")}function ma(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function OM(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wM(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function SM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function TM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function $M(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Wf(e,t,n){var r=ie.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qf(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function MM(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 CM(e,t,n){var r=ie.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function AM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Yf(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function kM(e,t,n){var r=ie.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Zf(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function LM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function DM(e,t,n){var r=ie.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function RM(e,t,n){var r=ie.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function IM(e,t,n){var r=ie.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function NM(e,t,n){var r=xM.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function PM(e,t,n){var r=ie.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function UM(e,t,n){var r=ie.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Xf(e,t){return St(e.getDate(),t,2)}function BM(e,t){return St(e.getHours(),t,2)}function HM(e,t){return St(e.getHours()%12||12,t,2)}function VM(e,t){return St(1+da.count(In(e),e),t,3)}function Kf(e,t){return St(e.getMilliseconds(),t,3)}function FM(e,t){return Kf(e,t)+"000"}function GM(e,t){return St(e.getMonth()+1,t,2)}function jM(e,t){return St(e.getMinutes(),t,2)}function zM(e,t){return St(e.getSeconds(),t,2)}function WM(e){var t=e.getDay();return t===0?7:t}function qM(e,t){return St(Fs.count(In(e)-1,e),t,2)}function Qf(e){var t=e.getDay();return t>=4||t===0?ai(e):ai.ceil(e)}function YM(e,t){return e=Qf(e),St(ai.count(In(e),e)+(In(e).getDay()===4),t,2)}function ZM(e){return e.getDay()}function XM(e,t){return St(Gs.count(In(e)-1,e),t,2)}function KM(e,t){return St(e.getFullYear()%100,t,2)}function QM(e,t){return e=Qf(e),St(e.getFullYear()%100,t,2)}function JM(e,t){return St(e.getFullYear()%1e4,t,4)}function tC(e,t){var n=e.getDay();return e=n>=4||n===0?ai(e):ai.ceil(e),St(e.getFullYear()%1e4,t,4)}function eC(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+St(t/60|0,"0",2)+St(t%60,"0",2)}function Jf(e,t){return St(e.getUTCDate(),t,2)}function nC(e,t){return St(e.getUTCHours(),t,2)}function rC(e,t){return St(e.getUTCHours()%12||12,t,2)}function iC(e,t){return St(1+jc.count(Sr(e),e),t,3)}function tm(e,t){return St(e.getUTCMilliseconds(),t,3)}function aC(e,t){return tm(e,t)+"000"}function sC(e,t){return St(e.getUTCMonth()+1,t,2)}function oC(e,t){return St(e.getUTCMinutes(),t,2)}function lC(e,t){return St(e.getUTCSeconds(),t,2)}function cC(e){var t=e.getUTCDay();return t===0?7:t}function uC(e,t){return St(jf.count(Sr(e)-1,e),t,2)}function em(e){var t=e.getUTCDay();return t>=4||t===0?si(e):si.ceil(e)}function hC(e,t){return e=em(e),St(si.count(Sr(e),e)+(Sr(e).getUTCDay()===4),t,2)}function dC(e){return e.getUTCDay()}function pC(e,t){return St(js.count(Sr(e)-1,e),t,2)}function fC(e,t){return St(e.getUTCFullYear()%100,t,2)}function mC(e,t){return e=em(e),St(e.getUTCFullYear()%100,t,2)}function gC(e,t){return St(e.getUTCFullYear()%1e4,t,4)}function vC(e,t){var n=e.getUTCDay();return e=n>=4||n===0?si(e):si.ceil(e),St(e.getUTCFullYear()%1e4,t,4)}function yC(){return"+0000"}function nm(){return"%"}function rm(e){return+e}function im(e){return Math.floor(+e/1e3)}var oi,am;bC({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 bC(e){return oi=bM(e),am=oi.format,oi.parse,oi.utcFormat,oi.utcParse,oi}function xC(e){return new Date(e)}function _C(e){return e instanceof Date?+e:+new Date(+e)}function sm(e,t,n,r,i,a,s,o,l,c){var u=rf(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),v=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),g=c("%b %d"),x=c("%B"),O=c("%Y");function E(w){return(l(w)<w?p:o(w)<w?f:s(w)<w?v:a(w)<w?m:r(w)<w?i(w)<w?y:g:n(w)<w?x:O)(w)}return u.invert=function(w){return new Date(d(w))},u.domain=function(w){return arguments.length?h(Array.from(w,_C)):h().map(xC)},u.ticks=function(w){var A=h();return e(A[0],A[A.length-1],w??10)},u.tickFormat=function(w,A){return A==null?E:c(A)},u.nice=function(w){var A=h();return(!w||typeof w.range!="function")&&(w=t(A[0],A[A.length-1],w??10)),w?h(Ff(A,w)):u},u.copy=function(){return wc(u,sm(e,t,n,r,i,a,s,o,l,c))},u}function om(){return Kr.apply(sm(vM,yM,In,zc,Fs,da,Gc,Fc,ii,am).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const lm=Math.abs,he=Math.atan2,Tr=Math.cos,EC=Math.max,Yc=Math.min,mn=Math.sin,li=Math.sqrt,de=1e-12,ga=Math.PI,zs=ga/2,Ws=2*ga;function OC(e){return e>1?0:e<-1?ga:Math.acos(e)}function cm(e){return e>=1?zs:e<=-1?-zs:Math.asin(e)}function um(e){this._context=e}um.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 qs(e){return new um(e)}function Xn(){}function hm(e){this._context=e}hm.prototype={areaStart:Xn,areaEnd:Xn,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 dm(e){return new hm(e)}function wC(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 SC=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Nn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ys(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function TC(e){const t=Ys(e,"border-left-width"),n=Ys(e,"border-right-width");return e.clientWidth+t+n}function $C(e){const t=Ys(e,"border-top-width"),n=Ys(e,"border-bottom-width");return e.clientHeight+t+n}function pm(e,t={}){const n=t.width||TC(e),r=t.height||$C(e);return{width:n,height:r}}function MC(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Le=16384;function CC(e){(e.width>Le||e.height>Le)&&(e.width>Le&&e.height>Le?e.width>e.height?(e.height*=Le/e.width,e.width=Le):(e.width*=Le/e.height,e.height=Le):e.width>Le?(e.height*=Le/e.width,e.width=Le):(e.width*=Le/e.height,e.height=Le))}function Zs(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function AC(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function kC(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),AC(i)}const Oe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Oe(n,t)};function LC(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function DC(e){return Nn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function RC(e,t,n){const r=`.${e}:${t}`,i=n.cssText?LC(n):DC(n);return document.createTextNode(`${r}{${i}}`)}function fm(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const a=SC();try{t.className=`${t.className} ${a}`}catch{return}const s=document.createElement("style");s.appendChild(RC(a,n,r)),t.appendChild(s)}function IC(e,t){fm(e,t,":before"),fm(e,t,":after")}const mm="application/font-woff",gm="image/jpeg",NC={woff:mm,woff2:mm,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:gm,jpeg:gm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function PC(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Zc(e){const t=PC(e).toLowerCase();return NC[t]||""}function UC(e){return e.split(/,/)[1]}function Xc(e){return e.search(/^(data:)/)!==-1}function BC(e,t){return`data:${t};base64,${e}`}async function vm(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((a,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{a(n({res:r,result:o.result}))}catch(l){s(l)}},o.readAsDataURL(i)})}const Kc={};function HC(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 Qc(e,t,n){const r=HC(e,t,n.includeQueryParams);if(Kc[r]!=null)return Kc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await vm(e,n.fetchRequestInit,({res:s,result:o})=>(t||(t=s.headers.get("Content-Type")||""),UC(o)));i=BC(a,t)}catch(a){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${e}`;a&&(s=typeof a=="string"?a:a.message),s&&console.warn(s)}return Kc[r]=i,i}async function VC(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Zs(t)}async function FC(e,t){if(e.currentSrc){const a=document.createElement("canvas"),s=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,s==null||s.drawImage(e,0,0,a.width,a.height);const o=a.toDataURL();return Zs(o)}const n=e.poster,r=Zc(n),i=await Qc(n,r,t);return Zs(i)}async function GC(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await Xs(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function jC(e,t){return Oe(e,HTMLCanvasElement)?VC(e):Oe(e,HTMLVideoElement)?FC(e,t):Oe(e,HTMLIFrameElement)?GC(e):e.cloneNode(!1)}const zC=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function WC(e,t,n){var r,i;let a=[];return zC(e)&&e.assignedNodes?a=Nn(e.assignedNodes()):Oe(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?a=Nn(e.contentDocument.body.childNodes):a=Nn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Oe(e,HTMLVideoElement)||await a.reduce((s,o)=>s.then(()=>Xs(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function qC(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Nn(r).forEach(i=>{let a=r.getPropertyValue(i);i==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Oe(e,HTMLIFrameElement)&&i==="display"&&a==="inline"&&(a="block"),i==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),n.setProperty(i,a,r.getPropertyPriority(i))})}function YC(e,t){Oe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Oe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function ZC(e,t){if(Oe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function XC(e,t){return Oe(t,Element)&&(qC(e,t),IC(e,t),YC(e,t),ZC(e,t)),t}async function KC(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const s=n[a].getAttribute("xlink:href");if(s){const o=e.querySelector(s),l=document.querySelector(s);!o&&l&&!r[s]&&(r[s]=await Xs(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",s=document.createElementNS(a,"svg");s.setAttribute("xmlns",a),s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.overflow="hidden",s.style.display="none";const o=document.createElementNS(a,"defs");s.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(s)}return e}async function Xs(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>jC(r,t)).then(r=>WC(e,r,t)).then(r=>XC(e,r)).then(r=>KC(r,t))}const ym=/url\((['"]?)([^'"]+?)\1\)/g,QC=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,JC=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function t2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function e2(e){const t=[];return e.replace(ym,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Xc(n))}async function n2(e,t,n,r,i){try{const a=n?wC(t,n):t,s=Zc(t);let o;return i||(o=await Qc(a,s,r)),e.replace(t2(t),`$1${o}$3`)}catch{}return e}function r2(e,{preferredFontFormat:t}){return t?e.replace(JC,n=>{for(;;){const[r,,i]=QC.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function bm(e){return e.search(ym)!==-1}async function xm(e,t,n){if(!bm(e))return e;const r=r2(e,n);return e2(r).reduce((i,a)=>i.then(s=>n2(s,a,t,n)),Promise.resolve(r))}async function Ks(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await xm(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function i2(e,t){await Ks("background",e,t)||await Ks("background-image",e,t),await Ks("mask",e,t)||await Ks("mask-image",e,t)}async function a2(e,t){const n=Oe(e,HTMLImageElement);if(!(n&&!Xc(e.src))&&!(Oe(e,SVGImageElement)&&!Xc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Qc(r,Zc(r),t);await new Promise((a,s)=>{e.onload=a,e.onerror=s;const o=e;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function s2(e,t){const n=Nn(e.childNodes).map(r=>_m(r,t));await Promise.all(n).then(()=>e)}async function _m(e,t){Oe(e,Element)&&(await i2(e,t),await a2(e,t),await s2(e,t))}function o2(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 Em={};async function Om(e){let t=Em[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Em[e]=t,t}async function wm(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(r,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),vm(s,t.fetchRequestInit,({result:o})=>(n=n.replace(a,`url(${o})`),[a,o]))});return Promise.all(i).then(()=>n)}function Sm(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 a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let l=a.exec(r);if(l===null){if(l=o.exec(r),l===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;t.push(l[0])}return t}async function l2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Nn(i.cssRules||[]).forEach((a,s)=>{if(a.type===CSSRule.IMPORT_RULE){let o=s+1;const l=a.href,c=Om(l).then(u=>wm(u,t)).then(u=>Sm(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(a){const s=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Om(i.href).then(o=>wm(o,t)).then(o=>Sm(o).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Nn(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function c2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>bm(t.style.getPropertyValue("src")))}async function u2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Nn(e.ownerDocument.styleSheets),r=await l2(n,t);return c2(r)}async function h2(e,t){const n=await u2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return xm(r.cssText,i,t)}))).join(`
3
+ `)}async function d2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await h2(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 p2(e,t={}){const{width:n,height:r}=pm(e,t),i=await Xs(e,t,!0);return await d2(i,t),await _m(i,t),o2(i,t),await kC(i,n,r)}async function Tm(e,t={}){const{width:n,height:r}=pm(e,t),i=await p2(e,t),a=await Zs(i),s=document.createElement("canvas"),o=s.getContext("2d"),l=t.pixelRatio||MC(),c=t.canvasWidth||n,u=t.canvasHeight||r;return s.width=c*l,s.height=u*l,t.skipAutoScale||CC(s),s.style.width=`${c}`,s.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(a,0,0,s.width,s.height),s}async function f2(e,t={}){return(await Tm(e,t)).toDataURL()}async function m2(e,t={}){return(await Tm(e,t)).toDataURL("image/jpeg",t.quality||1)}let Pn=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const g2="DONT_STYLE_ME_css_styles_verifier";let N=class Uh extends Pn{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=R(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],v=parseFloat(f);f&&v>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=v)}})},a={width:t.attr("width"),height:t.attr("height")},s=t.node();let o,l,c,u;try{typeof s.getBBox=="function"&&(o=s.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(s==null?void 0:s.getBoundingClientRect)=="function"&&(c=s.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(s instanceof SVGSVGElement&&(d={width:s.clientWidth,height:s.clientHeight}),n){if(n.useAttrs&&(i(a),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:b(t.node(),"width","baseVal","value"),height:b(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(a)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),a,s;return i.length===2?(a=i[0],i=i[1].split("."),s=i[0]):(i=n.split("."),a=i[0]),t.append(a).attr("id",s).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(),a=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-a.left,r.top=i.top-a.top}catch(s){console.error(s)}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=b(t,"style","prefix"),r=R(this.getHolder()).append("div").classed(`${Ee}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",g2),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),R(this.getHolder()).classed(`${Ee}--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=R(r);i.classed("filled",!0),m2(this.getMainContainer(),{quality:1,filter:a=>!(a.classList&&a.classList.contains("cds--cc--toolbar"))}).then(function(a){var s;let o="myChart";const l=b(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(s=t.services.files)==null||s.downloadImage(a,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=R(r);i.classed("filled",!0),f2(this.getMainContainer(),{quality:1,filter:a=>!(a.classList&&a.classList.contains("cds--cc--toolbar"))}).then(function(a){var s;let o="myChart";const l=b(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(s=t.services.files)==null||s.downloadImage(a,`${o}.png`),i.classed("filled",!1)}).catch(function(a){console.error("oops, something went wrong!",a)})}isFullScreenMode(){return R(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();R(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=R(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Uh.getSVGElementSize(R(this.mainContainer),{useBBox:!0}),n=R(this.mainContainer).attr("class"),r=R(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(a){i+=Number(Uh.getSVGElementSize(R(a),{useBBox:!0}).height)}),i<=t?R(this.mainContainer).attr("height",i):R(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&R(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(S.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(S.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Hs(()=>{var a;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(a=this.services.events)==null||a.dispatchEvent(S.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},Jc=class z0 extends Pn{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:z0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function $m(e){const t=v2(Mm(e),360);return Kn(t,[0,10])||Kn(t,[350,0])?{textAnchor:ln.START,dominantBaseline:cn.MIDDLE}:Kn(t,[10,80])?{textAnchor:ln.START,dominantBaseline:cn.HANGING}:Kn(t,[80,100])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.HANGING}:Kn(t,[100,170])?{textAnchor:ln.END,dominantBaseline:cn.HANGING}:Kn(t,[170,190])?{textAnchor:ln.END,dominantBaseline:cn.MIDDLE}:Kn(t,[190,260])?{textAnchor:ln.END,dominantBaseline:cn.BASELINE}:Kn(t,[260,280])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.BASELINE}:{textAnchor:ln.START,dominantBaseline:cn.BASELINE}}function v2(e,t){return(e%t+t)%t}function Kn(e,[t,n]){return e>=t&&e<=n}function Mm(e){return e*(180/Math.PI)}function Zt(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 y2(e,t){return t*Math.sin(e-Math.PI/2)}function b2(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;)n=t(n,e[i],i,e);return n}function x2(e){return function(t){return e==null?void 0:e[t]}}var _2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},E2=x2(_2),O2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,w2="\\u0300-\\u036f",S2="\\ufe20-\\ufe2f",T2="\\u20d0-\\u20ff",$2=w2+S2+T2,M2="["+$2+"]",C2=RegExp(M2,"g");function A2(e){return e=ji(e),e&&e.replace(O2,E2).replace(C2,"")}var k2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function L2(e){return e.match(k2)||[]}var D2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function R2(e){return D2.test(e)}var Cm="\\ud800-\\udfff",I2="\\u0300-\\u036f",N2="\\ufe20-\\ufe2f",P2="\\u20d0-\\u20ff",U2=I2+N2+P2,Am="\\u2700-\\u27bf",km="a-z\\xdf-\\xf6\\xf8-\\xff",B2="\\xac\\xb1\\xd7\\xf7",H2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",V2="\\u2000-\\u206f",F2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lm="A-Z\\xc0-\\xd6\\xd8-\\xde",G2="\\ufe0e\\ufe0f",Dm=B2+H2+V2+F2,Rm="['’]",Im="["+Dm+"]",j2="["+U2+"]",Nm="\\d+",z2="["+Am+"]",Pm="["+km+"]",Um="[^"+Cm+Dm+Nm+Am+km+Lm+"]",W2="\\ud83c[\\udffb-\\udfff]",q2="(?:"+j2+"|"+W2+")",Y2="[^"+Cm+"]",Bm="(?:\\ud83c[\\udde6-\\uddff]){2}",Hm="[\\ud800-\\udbff][\\udc00-\\udfff]",ci="["+Lm+"]",Z2="\\u200d",Vm="(?:"+Pm+"|"+Um+")",X2="(?:"+ci+"|"+Um+")",Fm="(?:"+Rm+"(?:d|ll|m|re|s|t|ve))?",Gm="(?:"+Rm+"(?:D|LL|M|RE|S|T|VE))?",jm=q2+"?",zm="["+G2+"]?",K2="(?:"+Z2+"(?:"+[Y2,Bm,Hm].join("|")+")"+zm+jm+")*",Q2="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",J2="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tA=zm+jm+K2,eA="(?:"+[z2,Bm,Hm].join("|")+")"+tA,nA=RegExp([ci+"?"+Pm+"+"+Fm+"(?="+[Im,ci,"$"].join("|")+")",X2+"+"+Gm+"(?="+[Im,ci+Vm,"$"].join("|")+")",ci+"?"+Vm+"+"+Fm,ci+"+"+Gm,J2,Q2,Nm,eA].join("|"),"g");function rA(e){return e.match(nA)||[]}function iA(e,t,n){return e=ji(e),t=t,t===void 0?R2(e)?rA(e):L2(e):e.match(t)||[]}var aA="['’]",sA=RegExp(aA,"g");function Wm(e){return function(t){return b2(iA(A2(t).replace(sA,"")),e,"")}}function oA(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function qm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=ri(n),n=n===n?n:0),t!==void 0&&(t=ri(t),t=t===t?t:0),oA(ri(e),t,n)}var lA="Expected a function";function cA(e,t,n){if(typeof e!="function")throw new TypeError(lA);return setTimeout(function(){e.apply(void 0,n)},t)}var uA=Il(function(e,t,n){return cA(e,ri(t)||0,n)});function hA(e,t){var n=-1,r=hr(e)?Array(e.length):[];return Dc(e,function(i,a,s){r[++n]=t(i,a,s)}),r}function dA(e,t){var n=ae(e)?Cl:hA;return n(e,ps(t))}var pA=1/0;function fA(e,t){return cs(dA(e,t),pA)}function Ym(e,t){return ds(e,t)}var ui=Wm(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function mA(e,t){var n;return Dc(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}function gA(e,t,n){var r=ae(e)?Gd:mA;return r(e,ps(t))}class $r{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const a=n[i],s=t+a,o=Math.abs(t)<Math.abs(a)?t-(s-a):a-(s-t);o&&(n[r++]=o),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,a,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,a=i-(s-r),!a););n>0&&(a<0&&t[n-1]<0||a>0&&t[n-1]>0)&&(i=a*2,r=s+i,i==r-s&&(s=r))}return s}}function*vA(e){for(const t of e)yield*t}function Zm(e){return Array.from(vA(e))}function yA(e){return e}var Qs=1,Js=2,tu=3,va=4,Xm=1e-6;function bA(e){return"translate("+e+",0)"}function xA(e){return"translate(0,"+e+")"}function _A(e){return t=>+e(t)}function EA(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function OA(){return!this.__axis}function to(e,t){var n=[],r=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Qs||e===va?-1:1,u=e===va||e===Js?"x":"y",d=e===Qs||e===tu?bA:xA;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),v=i??(t.tickFormat?t.tickFormat.apply(t,n):yA),m=Math.max(a,0)+o,y=t.range(),g=+y[0]+l,x=+y[y.length-1]+l,O=(t.bandwidth?EA:_A)(t.copy(),l),E=p.selection?p.selection():p,w=E.selectAll(".domain").data([null]),A=E.selectAll(".tick").data(f,t).order(),I=A.exit(),L=A.enter().append("g").attr("class","tick"),D=A.select("line"),$=A.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(L),D=D.merge(L.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),$=$.merge(L.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Qs?"0em":e===tu?"0.71em":"0.32em")),p!==E&&(w=w.transition(p),A=A.transition(p),D=D.transition(p),$=$.transition(p),I=I.transition(p).attr("opacity",Xm).attr("transform",function(F){return isFinite(F=O(F))?d(F+l):this.getAttribute("transform")}),L.attr("opacity",Xm).attr("transform",function(F){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(F))?P:O(F))+l)})),I.remove(),w.attr("d",e===va||e===Js?s?"M"+c*s+","+g+"H"+l+"V"+x+"H"+c*s:"M"+l+","+g+"V"+x:s?"M"+g+","+c*s+"V"+l+"H"+x+"V"+c*s:"M"+g+","+l+"H"+x),A.attr("opacity",1).attr("transform",function(F){return d(O(F)+l)}),D.attr(u+"2",c*a),$.attr(u,c*m).text(v),E.filter(OA).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Js?"start":e===va?"end":"middle"),E.each(function(){this.__axis=O})}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?(a=s=+p,h):a},h.tickSizeInner=function(p){return arguments.length?(a=+p,h):a},h.tickSizeOuter=function(p){return arguments.length?(s=+p,h):s},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function wA(e){return to(Qs,e)}function SA(e){return to(Js,e)}function eu(e){return to(tu,e)}function Km(e){return to(va,e)}const nu={capture:!0,passive:!1};function ru(e){e.preventDefault(),e.stopImmediatePropagation()}function TA(e){var t=e.document.documentElement,n=R(e).on("dragstart.drag",ru,nu);"onselectstart"in t?n.on("selectstart.drag",ru,nu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $A(e,t){var n=e.document.documentElement,r=R(e).on("dragstart.drag",null);t&&(r.on("click.drag",ru,nu),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 MA(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const CA=e=>+e,iu=e=>()=>e;function AA(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:a}){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:a}})}function kA(e){e.stopImmediatePropagation()}function au(e){e.preventDefault(),e.stopImmediatePropagation()}var Qm={name:"drag"},su={name:"space"},hi={name:"handle"},di={name:"center"};const{abs:Jm,max:pe,min:fe}=Math;function tg(e){return[+e[0],+e[1]]}function eg(e){return[tg(e[0]),tg(e[1])]}var eo={name:"x",handles:["w","e"].map(no),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]]}},ou={name:"y",handles:["n","s"].map(no),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Un={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"},ng={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},rg={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},LA={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},DA={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function no(e){return{type:e}}function RA(e){return!e.ctrlKey&&!e.button}function IA(){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 NA(){return navigator.maxTouchPoints||"ontouchstart"in this}function lu(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function PA(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function ig(){return UA(eo)}function UA(e){var t=IA,n=RA,r=NA,i=!0,a=rc("start","brush","end"),s=6,o;function l(m){var y=m.property("__brush",v).selectAll(".overlay").data([no("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Un.overlay).merge(y).each(function(){var x=lu(this).extent;R(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([no("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Un.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var g=m.selectAll(".handle").data(e.handles,function(x){return x.type});g.exit().remove(),g.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return Un[x.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,y,g){m.tween?m.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,O=x.__brush,E=u(x,arguments),w=O.selection,A=e.input(typeof y=="function"?y.apply(this,arguments):y,O.extent),I=Ji(w,A);function L(D){O.selection=D===1&&A===null?null:I(D),c.call(x),E.brush()}return w!==null&&A!==null?L:L(1)}):m.each(function(){var x=this,O=arguments,E=x.__brush,w=e.input(typeof y=="function"?y.apply(x,O):y,E.extent),A=u(x,O).beforestart();bc(x),E.selection=w===null?null:w,c.call(x),A.start(g).brush(g).end(g)})},l.clear=function(m,y){l.move(m,null,y)};function c(){var m=R(this),y=lu(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(g){return g.type[g.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(g){return g.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(g){return g.type==="n"||g.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(g){return g.type==="e"||g.type==="w"?y[1][1]-y[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,y,g){var x=m.__brush.emitter;return x&&(!g||!x.clean)?x:new d(m,y,g)}function d(m,y,g){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=g}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,g){var x=R(this.that).datum();a.call(m,this.that,new AA(m,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:g,dispatch:a}),x)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var y=this,g=m.target.__data__.type,x=(i&&m.metaKey?g="overlay":g)==="selection"?Qm:i&&m.altKey?di:hi,O=e===ou?null:LA[g],E=e===eo?null:DA[g],w=lu(y),A=w.extent,I=w.selection,L=A[0][0],D,$,F=A[0][1],P,H,_=A[1][0],C,k,U=A[1][1],B,X,Y=0,ot=0,it,xt=O&&E&&i&&m.shiftKey,at,K,et=Array.from(m.touches||[m],nt=>{const Mt=nt.identifier;return nt=mr(nt,y),nt.point0=nt.slice(),nt.identifier=Mt,nt});bc(y);var mt=u(y,arguments,!0).beforestart();if(g==="overlay"){I&&(it=!0);const nt=[et[0],et[1]||et[0]];w.selection=I=[[D=e===ou?L:fe(nt[0][0],nt[1][0]),P=e===eo?F:fe(nt[0][1],nt[1][1])],[C=e===ou?_:pe(nt[0][0],nt[1][0]),B=e===eo?U:pe(nt[0][1],nt[1][1])]],et.length>1&&It(m)}else D=I[0][0],P=I[0][1],C=I[1][0],B=I[1][1];$=D,H=P,k=C,X=B;var q=R(y).attr("pointer-events","none"),J=q.selectAll(".overlay").attr("cursor",Un[g]);if(m.touches)mt.moved=j,mt.ended=gt;else{var dt=R(m.view).on("mousemove.brush",j,!0).on("mouseup.brush",gt,!0);i&&dt.on("keydown.brush",qt,!0).on("keyup.brush",jt,!0),TA(m.view)}c.call(y),mt.start(m,x.name);function j(nt){for(const Mt of nt.changedTouches||[nt])for(const xe of et)xe.identifier===Mt.identifier&&(xe.cur=mr(Mt,y));if(xt&&!at&&!K&&et.length===1){const Mt=et[0];Jm(Mt.cur[0]-Mt[0])>Jm(Mt.cur[1]-Mt[1])?K=!0:at=!0}for(const Mt of et)Mt.cur&&(Mt[0]=Mt.cur[0],Mt[1]=Mt.cur[1]);it=!0,au(nt),It(nt)}function It(nt){const Mt=et[0],xe=Mt.point0;var Pe;switch(Y=Mt[0]-xe[0],ot=Mt[1]-xe[1],x){case su:case Qm:{O&&(Y=pe(L-D,fe(_-C,Y)),$=D+Y,k=C+Y),E&&(ot=pe(F-P,fe(U-B,ot)),H=P+ot,X=B+ot);break}case hi:{et[1]?(O&&($=pe(L,fe(_,et[0][0])),k=pe(L,fe(_,et[1][0])),O=1),E&&(H=pe(F,fe(U,et[0][1])),X=pe(F,fe(U,et[1][1])),E=1)):(O<0?(Y=pe(L-D,fe(_-D,Y)),$=D+Y,k=C):O>0&&(Y=pe(L-C,fe(_-C,Y)),$=D,k=C+Y),E<0?(ot=pe(F-P,fe(U-P,ot)),H=P+ot,X=B):E>0&&(ot=pe(F-B,fe(U-B,ot)),H=P,X=B+ot));break}case di:{O&&($=pe(L,fe(_,D-Y*O)),k=pe(L,fe(_,C+Y*O))),E&&(H=pe(F,fe(U,P-ot*E)),X=pe(F,fe(U,B+ot*E)));break}}k<$&&(O*=-1,Pe=D,D=C,C=Pe,Pe=$,$=k,k=Pe,g in ng&&J.attr("cursor",Un[g=ng[g]])),X<H&&(E*=-1,Pe=P,P=B,B=Pe,Pe=H,H=X,X=Pe,g in rg&&J.attr("cursor",Un[g=rg[g]])),w.selection&&(I=w.selection),at&&($=I[0][0],k=I[1][0]),K&&(H=I[0][1],X=I[1][1]),(I[0][0]!==$||I[0][1]!==H||I[1][0]!==k||I[1][1]!==X)&&(w.selection=[[$,H],[k,X]],c.call(y),mt.brush(nt,x.name))}function gt(nt){if(kA(nt),nt.touches){if(nt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else $A(nt.view,it),dt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),J.attr("cursor",Un.overlay),w.selection&&(I=w.selection),PA(I)&&(w.selection=null,c.call(y)),mt.end(nt,x.name)}function qt(nt){switch(nt.keyCode){case 16:{xt=O&&E;break}case 18:{x===hi&&(O&&(C=k-Y*O,D=$+Y*O),E&&(B=X-ot*E,P=H+ot*E),x=di,It(nt));break}case 32:{(x===hi||x===di)&&(O<0?C=k-Y:O>0&&(D=$-Y),E<0?B=X-ot:E>0&&(P=H-ot),x=su,J.attr("cursor",Un.selection),It(nt));break}default:return}au(nt)}function jt(nt){switch(nt.keyCode){case 16:{xt&&(at=K=xt=!1,It(nt));break}case 18:{x===di&&(O<0?C=k:O>0&&(D=$),E<0?B=X:E>0&&(P=H),x=hi,It(nt));break}case 32:{x===su&&(nt.altKey?(O&&(C=k-Y*O,D=$+Y*O),E&&(B=X-ot*E,P=H+ot*E),x=di):(O<0?C=k:O>0&&(D=$),E<0?B=X:E>0&&(P=H),x=hi),J.attr("cursor",Un[g]),It(nt));break}default:return}au(nt)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function v(){var m=this.__brush||{selection:null};return m.extent=eg(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:iu(eg(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:iu(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:iu(!!m),l):r},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=a.on.apply(a,arguments);return m===a?l:m},l}const cu=Math.PI,uu=2*cu,Mr=1e-6,BA=uu-Mr;function ag(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function HA(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ag;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let hu=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?ag:HA(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw new Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,o=n-e,l=r-t,c=a-e,u=s-t,d=c*c+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Mr)if(!(Math.abs(u*o-l*c)>Mr)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let h=n-a,p=r-s,f=o*o+l*l,v=h*h+p*p,m=Math.sqrt(f),y=Math.sqrt(d),g=i*Math.tan((cu-Math.acos((f+d-v)/(2*m*y)))/2),x=g/y,O=g/m;Math.abs(x-1)>Mr&&this._append`L${e+x*c},${t+x*u}`,this._append`A${i},${i},0,0,${+(u*h>c*p)},${this._x1=e+O*o},${this._y1=t+O*l}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),o=n*Math.sin(r),l=e+s,c=t+o,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Mr||Math.abs(this._y1-c)>Mr)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%uu+uu),d>BA?this._append`A${n},${n},0,1,${u},${e-s},${t-o}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>Mr&&this._append`A${n},${n},0,${+(d>=cu)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function sg(){return new hu}sg.prototype=hu.prototype;var Lt=1e-6,og=1e-12,vt=Math.PI,we=vt/2,lg=vt/4,De=vt*2,ge=180/vt,Xt=vt/180,Dt=Math.abs,cg=Math.atan,Cr=Math.atan2,Rt=Math.cos,VA=Math.exp,FA=Math.log,$t=Math.sin,Qn=Math.sign||function(e){return e>0?1:e<0?-1:0},rn=Math.sqrt,GA=Math.tan;function jA(e){return e>1?0:e<-1?vt:Math.acos(e)}function Bn(e){return e>1?we:e<-1?-we:Math.asin(e)}function je(){}function ro(e,t){e&&hg.hasOwnProperty(e.type)&&hg[e.type](e,t)}var ug={Feature:function(e,t){ro(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ro(n[r].geometry,t)}},hg={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){du(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)du(n[r],t,0)},Polygon:function(e,t){dg(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)dg(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ro(n[r],t)}};function du(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function dg(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)du(e[n],t,1);t.polygonEnd()}function pi(e,t){e&&ug.hasOwnProperty(e.type)?ug[e.type](e,t):ro(e,t)}function pu(e){return[Cr(e[1],e[0]),Bn(e[2])]}function fi(e){var t=e[0],n=e[1],r=Rt(n);return[r*Rt(t),r*$t(t),$t(n)]}function io(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ao(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function fu(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function so(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function mu(e){var t=rn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function gu(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function vu(e,t){return Dt(e)>vt&&(e-=Math.round(e/De)*De),[e,t]}vu.invert=vu;function pg(e,t,n){return(e%=De)?t||n?gu(mg(e),gg(t,n)):mg(e):t||n?gg(t,n):vu}function fg(e){return function(t,n){return t+=e,Dt(t)>vt&&(t-=Math.round(t/De)*De),[t,n]}}function mg(e){var t=fg(e);return t.invert=fg(-e),t}function gg(e,t){var n=Rt(e),r=$t(e),i=Rt(t),a=$t(t);function s(o,l){var c=Rt(l),u=Rt(o)*c,d=$t(o)*c,h=$t(l),p=h*n+u*r;return[Cr(d*i-p*a,u*n-h*r),Bn(p*i+d*a)]}return s.invert=function(o,l){var c=Rt(l),u=Rt(o)*c,d=$t(o)*c,h=$t(l),p=h*i-d*a;return[Cr(d*i+h*a,u*n+p*r),Bn(p*n-u*r)]},s}function zA(e){e=pg(e[0]*Xt,e[1]*Xt,e.length>2?e[2]*Xt:0);function t(n){return n=e(n[0]*Xt,n[1]*Xt),n[0]*=ge,n[1]*=ge,n}return t.invert=function(n){return n=e.invert(n[0]*Xt,n[1]*Xt),n[0]*=ge,n[1]*=ge,n},t}function WA(e,t,n,r,i,a){if(n){var s=Rt(t),o=$t(t),l=r*n;i==null?(i=t+r*De,a=t-l/2):(i=vg(s,i),a=vg(s,a),(r>0?i<a:i>a)&&(i+=r*De));for(var c,u=i;r>0?u>a:u<a;u-=l)c=pu([s,-o*Rt(u),-o*$t(u)]),e.point(c[0],c[1])}}function vg(e,t){t=fi(t),t[0]-=e,mu(t);var n=jA(-t[1]);return((-t[2]<0?-n:n)+De-Lt)%De}function yg(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:je,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function oo(e,t){return Dt(e[0]-t[0])<Lt&&Dt(e[1]-t[1])<Lt}function lo(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function bg(e,t,n,r,i){var a=[],s=[],o,l;if(e.forEach(function(f){if(!((v=f.length-1)<=0)){var v,m=f[0],y=f[v],g;if(oo(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),o=0;o<v;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}y[0]+=2*Lt}a.push(g=new lo(m,f,null,!0)),s.push(g.o=new lo(m,null,g,!1)),a.push(g=new lo(y,f,null,!1)),s.push(g.o=new lo(y,null,g,!0))}}),!!a.length){for(s.sort(t),xg(a),xg(s),o=0,l=s.length;o<l;++o)s[o].e=n=!n;for(var c=a[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(u=h.p.z,o=u.length-1;o>=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 xg(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function yu(e){return Dt(e[0])<=vt?e[0]:Qn(e[0])*((Dt(e[0])+vt)%De-vt)}function qA(e,t){var n=yu(t),r=t[1],i=$t(r),a=[$t(n),-Rt(n),0],s=0,o=0,l=new $r;i===1?r=we+Lt:i===-1&&(r=-we-Lt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],f=yu(p),v=p[1]/2+lg,m=$t(v),y=Rt(v),g=0;g<h;++g,f=O,m=w,y=A,p=x){var x=d[g],O=yu(x),E=x[1]/2+lg,w=$t(E),A=Rt(E),I=O-f,L=I>=0?1:-1,D=L*I,$=D>vt,F=m*w;if(l.add(Cr(F*L*$t(D),y*A+F*Rt(D))),s+=$?I+L*De:I,$^f>=n^O>=n){var P=ao(fi(p),fi(x));mu(P);var H=ao(a,P);mu(H);var _=($^I>=0?-1:1)*Bn(H[2]);(r>_||r===_&&(P[0]||P[1]))&&(o+=$^I>=0?1:-1)}}return(s<-Lt||s<Lt&&l<-og)^o&1}function _g(e,t,n,r){return function(i){var a=t(i),s=yg(),o=t(s),l=!1,c,u,d,h={point:p,lineStart:v,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=g,h.lineEnd=x,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=v,h.lineEnd=m,u=Zm(u);var O=qA(c,r);u.length?(l||(i.polygonStart(),l=!0),bg(u,ZA,O,n,i)):O&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(O,E){e(O,E)&&i.point(O,E)}function f(O,E){a.point(O,E)}function v(){h.point=f,a.lineStart()}function m(){h.point=p,a.lineEnd()}function y(O,E){d.push([O,E]),o.point(O,E)}function g(){o.lineStart(),d=[]}function x(){y(d[0][0],d[0][1]),o.lineEnd();var O=o.clean(),E=s.result(),w,A=E.length,I,L,D;if(d.pop(),c.push(d),d=null,!!A){if(O&1){if(L=E[0],(I=L.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),w=0;w<I;++w)i.point((D=L[w])[0],D[1]);i.lineEnd()}return}A>1&&O&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(YA))}}return h}}function YA(e){return e.length>1}function ZA(e,t){return((e=e.x)[0]<0?e[1]-we-Lt:we-e[1])-((t=t.x)[0]<0?t[1]-we-Lt:we-t[1])}const Eg=_g(function(){return!0},XA,QA,[-vt,-we]);function XA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,s){var o=a>0?vt:-vt,l=Dt(a-t);Dt(l-vt)<Lt?(e.point(t,n=(n+s)/2>0?we:-we),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(a,n),i=0):r!==o&&l>=vt&&(Dt(t-r)<Lt&&(t-=r*Lt),Dt(a-o)<Lt&&(a-=o*Lt),n=KA(t,n,a,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=a,n=s),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function KA(e,t,n,r){var i,a,s=$t(e-n);return Dt(s)>Lt?cg(($t(t)*(a=Rt(r))*$t(n)-$t(r)*(i=Rt(t))*$t(e))/(i*a*s)):(t+r)/2}function QA(e,t,n,r){var i;if(e==null)i=n*we,r.point(-vt,i),r.point(0,i),r.point(vt,i),r.point(vt,0),r.point(vt,-i),r.point(0,-i),r.point(-vt,-i),r.point(-vt,0),r.point(-vt,i);else if(Dt(e[0]-t[0])>Lt){var a=e[0]<t[0]?vt:-vt;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(t[0],t[1])}function JA(e){var t=Rt(e),n=2*Xt,r=t>0,i=Dt(t)>Lt;function a(u,d,h,p){WA(p,e,n,h,u,d)}function s(u,d){return Rt(u)*Rt(d)>t}function o(u){var d,h,p,f,v;return{lineStart:function(){f=p=!1,v=1},point:function(m,y){var g=[m,y],x,O=s(m,y),E=r?O?0:c(m,y):O?c(m+(m<0?vt:-vt),y):0;if(!d&&(f=p=O)&&u.lineStart(),O!==p&&(x=l(d,g),(!x||oo(d,x)||oo(g,x))&&(g[2]=1)),O!==p)v=0,O?(u.lineStart(),x=l(g,d),u.point(x[0],x[1])):(x=l(d,g),u.point(x[0],x[1],2),u.lineEnd()),d=x;else if(i&&d&&r^O){var w;!(E&h)&&(w=l(g,d,!0))&&(v=0,r?(u.lineStart(),u.point(w[0][0],w[0][1]),u.point(w[1][0],w[1][1]),u.lineEnd()):(u.point(w[1][0],w[1][1]),u.lineEnd(),u.lineStart(),u.point(w[0][0],w[0][1],3)))}O&&(!d||!oo(d,g))&&u.point(g[0],g[1]),d=g,p=O,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return v|(f&&p)<<1}}}function l(u,d,h){var p=fi(u),f=fi(d),v=[1,0,0],m=ao(p,f),y=io(m,m),g=m[0],x=y-g*g;if(!x)return!h&&u;var O=t*y/x,E=-t*g/x,w=ao(v,m),A=so(v,O),I=so(m,E);fu(A,I);var L=w,D=io(A,L),$=io(L,L),F=D*D-$*(io(A,A)-1);if(!(F<0)){var P=rn(F),H=so(L,(-D-P)/$);if(fu(H,A),H=pu(H),!h)return H;var _=u[0],C=d[0],k=u[1],U=d[1],B;C<_&&(B=_,_=C,C=B);var X=C-_,Y=Dt(X-vt)<Lt,ot=Y||X<Lt;if(!Y&&U<k&&(B=k,k=U,U=B),ot?Y?k+U>0^H[1]<(Dt(H[0]-_)<Lt?k:U):k<=H[1]&&H[1]<=U:X>vt^(_<=H[0]&&H[0]<=C)){var it=so(L,(-D+P)/$);return fu(it,A),[H,pu(it)]}}}function c(u,d){var h=r?e:vt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return _g(s,o,a,r?[0,-e]:[-vt,e-vt])}function tk(e,t,n,r,i,a){var s=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-s,p=c-o,f;if(f=n-s,!(!h&&f>0)){if(f/=h,h<0){if(f<u)return;f<d&&(d=f)}else if(h>0){if(f>d)return;f>u&&(u=f)}if(f=i-s,!(!h&&f<0)){if(f/=h,h<0){if(f>d)return;f>u&&(u=f)}else if(h>0){if(f<u)return;f<d&&(d=f)}if(f=r-o,!(!p&&f>0)){if(f/=p,p<0){if(f<u)return;f<d&&(d=f)}else if(p>0){if(f>d)return;f>u&&(u=f)}if(f=a-o,!(!p&&f<0)){if(f/=p,p<0){if(f>d)return;f>u&&(u=f)}else if(p>0){if(f<u)return;f<d&&(d=f)}return u>0&&(e[0]=s+u*h,e[1]=o+u*p),d<1&&(t[0]=s+d*h,t[1]=o+d*p),!0}}}}}var ya=1e9,co=-ya;function ek(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function a(c,u,d,h){var p=0,f=0;if(c==null||(p=s(c,d))!==(f=s(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 s(c,u){return Dt(c[0]-e)<Lt?u>0?0:3:Dt(c[0]-n)<Lt?u>0?2:1:Dt(c[1]-t)<Lt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),h=s(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=yg(),h,p,f,v,m,y,g,x,O,E,w,A={point:I,lineStart:F,lineEnd:P,polygonStart:D,polygonEnd:$};function I(_,C){i(_,C)&&u.point(_,C)}function L(){for(var _=0,C=0,k=p.length;C<k;++C)for(var U=p[C],B=1,X=U.length,Y=U[0],ot,it,xt=Y[0],at=Y[1];B<X;++B)ot=xt,it=at,Y=U[B],xt=Y[0],at=Y[1],it<=r?at>r&&(xt-ot)*(r-it)>(at-it)*(e-ot)&&++_:at<=r&&(xt-ot)*(r-it)<(at-it)*(e-ot)&&--_;return _}function D(){u=d,h=[],p=[],w=!0}function $(){var _=L(),C=w&&_,k=(h=Zm(h)).length;(C||k)&&(c.polygonStart(),C&&(c.lineStart(),a(null,null,1,c),c.lineEnd()),k&&bg(h,o,_,a,c),c.polygonEnd()),u=c,h=p=f=null}function F(){A.point=H,p&&p.push(f=[]),E=!0,O=!1,g=x=NaN}function P(){h&&(H(v,m),y&&O&&d.rejoin(),h.push(d.result())),A.point=I,O&&u.lineEnd()}function H(_,C){var k=i(_,C);if(p&&f.push([_,C]),E)v=_,m=C,y=k,E=!1,k&&(u.lineStart(),u.point(_,C));else if(k&&O)u.point(_,C);else{var U=[g=Math.max(co,Math.min(ya,g)),x=Math.max(co,Math.min(ya,x))],B=[_=Math.max(co,Math.min(ya,_)),C=Math.max(co,Math.min(ya,C))];tk(U,B,e,t,n,r)?(O||(u.lineStart(),u.point(U[0],U[1])),u.point(B[0],B[1]),k||u.lineEnd(),w=!1):k&&(u.lineStart(),u.point(_,C),w=!1)}g=_,x=C,O=k}return A}}const bu=e=>e;var xu=new $r,_u=new $r,Og,wg,Eu,Ou,Hn={point:je,lineStart:je,lineEnd:je,polygonStart:function(){Hn.lineStart=nk,Hn.lineEnd=ik},polygonEnd:function(){Hn.lineStart=Hn.lineEnd=Hn.point=je,xu.add(Dt(_u)),_u=new $r},result:function(){var e=xu/2;return xu=new $r,e}};function nk(){Hn.point=rk}function rk(e,t){Hn.point=Sg,Og=Eu=e,wg=Ou=t}function Sg(e,t){_u.add(Ou*e-Eu*t),Eu=e,Ou=t}function ik(){Sg(Og,wg)}var mi=1/0,uo=mi,ba=-mi,ho=ba,po={point:ak,lineStart:je,lineEnd:je,polygonStart:je,polygonEnd:je,result:function(){var e=[[mi,uo],[ba,ho]];return ba=ho=-(uo=mi=1/0),e}};function ak(e,t){e<mi&&(mi=e),e>ba&&(ba=e),t<uo&&(uo=t),t>ho&&(ho=t)}var wu=0,Su=0,xa=0,fo=0,mo=0,gi=0,Tu=0,$u=0,_a=0,Tg,$g,gn,vn,ze={point:Ar,lineStart:Mg,lineEnd:Cg,polygonStart:function(){ze.lineStart=lk,ze.lineEnd=ck},polygonEnd:function(){ze.point=Ar,ze.lineStart=Mg,ze.lineEnd=Cg},result:function(){var e=_a?[Tu/_a,$u/_a]:gi?[fo/gi,mo/gi]:xa?[wu/xa,Su/xa]:[NaN,NaN];return wu=Su=xa=fo=mo=gi=Tu=$u=_a=0,e}};function Ar(e,t){wu+=e,Su+=t,++xa}function Mg(){ze.point=sk}function sk(e,t){ze.point=ok,Ar(gn=e,vn=t)}function ok(e,t){var n=e-gn,r=t-vn,i=rn(n*n+r*r);fo+=i*(gn+e)/2,mo+=i*(vn+t)/2,gi+=i,Ar(gn=e,vn=t)}function Cg(){ze.point=Ar}function lk(){ze.point=uk}function ck(){Ag(Tg,$g)}function uk(e,t){ze.point=Ag,Ar(Tg=gn=e,$g=vn=t)}function Ag(e,t){var n=e-gn,r=t-vn,i=rn(n*n+r*r);fo+=i*(gn+e)/2,mo+=i*(vn+t)/2,gi+=i,i=vn*e-gn*t,Tu+=i*(gn+e),$u+=i*(vn+t),_a+=i*3,Ar(gn=e,vn=t)}function kg(e){this._context=e}kg.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,De);break}}},result:je};var Mu=new $r,Cu,Lg,Dg,Ea,Oa,wa={point:je,lineStart:function(){wa.point=hk},lineEnd:function(){Cu&&Rg(Lg,Dg),wa.point=je},polygonStart:function(){Cu=!0},polygonEnd:function(){Cu=null},result:function(){var e=+Mu;return Mu=new $r,e}};function hk(e,t){wa.point=Rg,Lg=Ea=e,Dg=Oa=t}function Rg(e,t){Ea-=e,Oa-=t,Mu.add(rn(Ea*Ea+Oa*Oa)),Ea=e,Oa=t}let Ig,go,Ng,Pg;class Ug{constructor(t){this._append=t==null?Bg:dk(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!==Ng||this._append!==go){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`,Ng=r,go=this._append,Pg=this._,this._=i}this._+=Pg;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Bg(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function dk(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Bg;if(t!==Ig){const n=10**t;Ig=t,go=function(r){let i=1;this._+=r[0];for(const a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return go}function pk(e,t){let n=3,r=4.5,i,a;function s(o){return o&&(typeof r=="function"&&a.pointRadius(+r.apply(this,arguments)),pi(o,i(a))),a.result()}return s.area=function(o){return pi(o,i(Hn)),Hn.result()},s.measure=function(o){return pi(o,i(wa)),wa.result()},s.bounds=function(o){return pi(o,i(po)),po.result()},s.centroid=function(o){return pi(o,i(ze)),ze.result()},s.projection=function(o){return arguments.length?(i=o==null?(e=null,bu):(e=o).stream,s):e},s.context=function(o){return arguments.length?(a=o==null?(t=null,new Ug(n)):new kg(t=o),typeof r!="function"&&a.pointRadius(r),s):t},s.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(a.pointRadius(+o),+o),s):r},s.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(a=new Ug(n)),s},s.projection(e).digits(n).context(t)}function Au(e){return function(t){var n=new ku;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ku(){}ku.prototype={constructor:ku,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 Lu(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),pi(n,e.stream(po)),t(po.result()),r!=null&&e.clipExtent(r),e}function Hg(e,t,n){return Lu(e,function(r){var i=t[1][0]-t[0][0],a=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(a-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([o,l])},n)}function fk(e,t,n){return Hg(e,[[0,0],t],n)}function mk(e,t,n){return Lu(e,function(r){var i=+t,a=i/(r[1][0]-r[0][0]),s=(i-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];e.scale(150*a).translate([s,o])},n)}function gk(e,t,n){return Lu(e,function(r){var i=+t,a=i/(r[1][1]-r[0][1]),s=-a*r[0][0],o=(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,o])},n)}var Vg=16,vk=Rt(30*Xt);function Fg(e,t){return+t?bk(e,t):yk(e)}function yk(e){return Au({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function bk(e,t){function n(r,i,a,s,o,l,c,u,d,h,p,f,v,m){var y=c-r,g=u-i,x=y*y+g*g;if(x>4*t&&v--){var O=s+h,E=o+p,w=l+f,A=rn(O*O+E*E+w*w),I=Bn(w/=A),L=Dt(Dt(w)-1)<Lt||Dt(a-d)<Lt?(a+d)/2:Cr(E,O),D=e(L,I),$=D[0],F=D[1],P=$-r,H=F-i,_=g*P-y*H;(_*_/x>t||Dt((y*P+g*H)/x-.5)>.3||s*h+o*p+l*f<vk)&&(n(r,i,a,s,o,l,$,F,L,O/=A,E/=A,w,v,m),m.point($,F),n($,F,L,O,E,w,c,u,d,h,p,f,v,m))}}return function(r){var i,a,s,o,l,c,u,d,h,p,f,v,m={point:y,lineStart:g,lineEnd:O,polygonStart:function(){r.polygonStart(),m.lineStart=E},polygonEnd:function(){r.polygonEnd(),m.lineStart=g}};function y(I,L){I=e(I,L),r.point(I[0],I[1])}function g(){d=NaN,m.point=x,r.lineStart()}function x(I,L){var D=fi([I,L]),$=e(I,L);n(d,h,u,p,f,v,d=$[0],h=$[1],u=I,p=D[0],f=D[1],v=D[2],Vg,r),r.point(d,h)}function O(){m.point=y,r.lineEnd()}function E(){g(),m.point=w,m.lineEnd=A}function w(I,L){x(i=I,L),a=d,s=h,o=p,l=f,c=v,m.point=x}function A(){n(d,h,u,p,f,v,a,s,i,o,l,c,Vg,r),m.lineEnd=O,O()}return m}}var xk=Au({point:function(e,t){this.stream.point(e*Xt,t*Xt)}});function _k(e){return Au({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Ek(e,t,n,r,i){function a(s,o){return s*=r,o*=i,[t+e*s,n-e*o]}return a.invert=function(s,o){return[(s-t)/e*r,(n-o)/e*i]},a}function Gg(e,t,n,r,i,a){if(!a)return Ek(e,t,n,r,i);var s=Rt(a),o=$t(a),l=s*e,c=o*e,u=s/e,d=o/e,h=(o*n-s*t)/e,p=(o*t+s*n)/e;function f(v,m){return v*=r,m*=i,[l*v-c*m+t,n-c*v-l*m]}return f.invert=function(v,m){return[r*(u*v-d*m+h),i*(p-d*v-u*m)]},f}function vo(e){return jg(function(){return e})()}function jg(e){var t,n=150,r=480,i=250,a=0,s=0,o=0,l=0,c=0,u,d=0,h=1,p=1,f=null,v=Eg,m=null,y,g,x,O=bu,E=.5,w,A,I,L,D;function $(_){return I(_[0]*Xt,_[1]*Xt)}function F(_){return _=I.invert(_[0],_[1]),_&&[_[0]*ge,_[1]*ge]}$.stream=function(_){return L&&D===_?L:L=xk(_k(u)(v(w(O(D=_)))))},$.preclip=function(_){return arguments.length?(v=_,f=void 0,H()):v},$.postclip=function(_){return arguments.length?(O=_,m=y=g=x=null,H()):O},$.clipAngle=function(_){return arguments.length?(v=+_?JA(f=_*Xt):(f=null,Eg),H()):f*ge},$.clipExtent=function(_){return arguments.length?(O=_==null?(m=y=g=x=null,bu):ek(m=+_[0][0],y=+_[0][1],g=+_[1][0],x=+_[1][1]),H()):m==null?null:[[m,y],[g,x]]},$.scale=function(_){return arguments.length?(n=+_,P()):n},$.translate=function(_){return arguments.length?(r=+_[0],i=+_[1],P()):[r,i]},$.center=function(_){return arguments.length?(a=_[0]%360*Xt,s=_[1]%360*Xt,P()):[a*ge,s*ge]},$.rotate=function(_){return arguments.length?(o=_[0]%360*Xt,l=_[1]%360*Xt,c=_.length>2?_[2]%360*Xt:0,P()):[o*ge,l*ge,c*ge]},$.angle=function(_){return arguments.length?(d=_%360*Xt,P()):d*ge},$.reflectX=function(_){return arguments.length?(h=_?-1:1,P()):h<0},$.reflectY=function(_){return arguments.length?(p=_?-1:1,P()):p<0},$.precision=function(_){return arguments.length?(w=Fg(A,E=_*_),H()):rn(E)},$.fitExtent=function(_,C){return Hg($,_,C)},$.fitSize=function(_,C){return fk($,_,C)},$.fitWidth=function(_,C){return mk($,_,C)},$.fitHeight=function(_,C){return gk($,_,C)};function P(){var _=Gg(n,0,0,h,p,d).apply(null,t(a,s)),C=Gg(n,r-_[0],i-_[1],h,p,d);return u=pg(o,l,c),A=gu(t,C),I=gu(u,A),w=Fg(A,E),H()}function H(){return L=D=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&F,P()}}function zg(e){var t=0,n=vt/3,r=jg(e),i=r(t,n);return i.parallels=function(a){return arguments.length?r(t=a[0]*Xt,n=a[1]*Xt):[t*ge,n*ge]},i}function Ok(e){var t=Rt(e);function n(r,i){return[r*t,$t(i)/t]}return n.invert=function(r,i){return[r/t,Bn(i*t)]},n}function wk(e,t){var n=$t(e),r=(n+$t(t))/2;if(Dt(r)<Lt)return Ok(e);var i=1+n*(2*r-n),a=rn(i)/r;function s(o,l){var c=rn(i-2*r*$t(l))/r;return[c*$t(o*=r),a-c*Rt(o)]}return s.invert=function(o,l){var c=a-l,u=Cr(o,Dt(c))*Qn(c);return c*r<0&&(u-=vt*Qn(o)*Qn(c)),[u/r,Bn((i-(o*o+c*c)*r*r)/(2*r))]},s}function Wg(){return zg(wk).scale(155.424).center([0,33.6442])}function Sk(){return Wg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Du(e,t){return[e,FA(GA((we+t)/2))]}Du.invert=function(e,t){return[e,2*cg(VA(t))-we]};function Tk(){return $k(Du).scale(961/De)}function $k(e){var t=vo(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,s=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=o=l=c=null:(s=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,o],[l,c]]};function u(){var d=vt*r(),h=t(zA(t.rotate()).invert([0,0]));return a(s==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Du?[[Math.max(h[0]-d,s),o],[Math.min(h[0]+d,l),c]]:[[s,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function yo(e,t){return[e,t]}yo.invert=yo;function Mk(){return vo(yo).scale(152.63)}function Ck(e,t){var n=Rt(e),r=e===t?$t(e):(n-Rt(t))/(t-e),i=n/r+e;if(Dt(r)<Lt)return yo;function a(s,o){var l=i-o,c=r*s;return[l*$t(c),i-l*Rt(c)]}return a.invert=function(s,o){var l=i-o,c=Cr(s,Dt(l))*Qn(l);return l*r<0&&(c-=vt*Qn(s)*Qn(l)),[c/r,i-Qn(r)*rn(s*s+l*l)]},a}function Ak(){return zg(Ck).scale(131.154).center([0,13.9389])}var Sa=1.340264,Ta=-.081106,$a=893e-6,Ma=.003796,bo=rn(3)/2,kk=12;function qg(e,t){var n=Bn(bo*$t(t)),r=n*n,i=r*r*r;return[e*Rt(n)/(bo*(Sa+3*Ta*r+i*(7*$a+9*Ma*r))),n*(Sa+Ta*r+i*($a+Ma*r))]}qg.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,s,o,l;a<kk&&(o=n*(Sa+Ta*r+i*($a+Ma*r))-t,l=Sa+3*Ta*r+i*(7*$a+9*Ma*r),n-=s=o/l,r=n*n,i=r*r*r,!(Dt(s)<og));++a);return[bo*e*(Sa+3*Ta*r+i*(7*$a+9*Ma*r))/Rt(n),Bn($t(n)/bo)]};function Lk(){return vo(qg).scale(177.158)}function Yg(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Yg.invert=function(e,t){var n=t,r=25,i;do{var a=n*n,s=a*a;n-=i=(n*(1.007226+a*(.015085+s*(-.044475+.028874*a-.005916*s)))-t)/(1.007226+a*(.015085*3+s*(-.044475*7+.028874*9*a-.005916*11*s)))}while(Dt(i)>Lt&&--r>0);return[e/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]};function Dk(){return vo(Yg).scale(175.295)}function Rk(e,t){return e.parent===t.parent?1:2}function Ik(e){return e.reduce(Nk,0)/e.length}function Nk(e,t){return e+t.x}function Pk(e){return 1+e.reduce(Uk,0)}function Uk(e,t){return Math.max(e,t.y)}function Bk(e){for(var t;t=e.children;)e=t[0];return e}function Hk(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Vk(){var e=Rk,t=1,n=1,r=!1;function i(a){var s,o=0;a.eachAfter(function(h){var p=h.children;p?(h.x=Ik(p),h.y=Pk(p)):(h.x=s?o+=e(h,s):0,h.y=0,s=h)});var l=Bk(a),c=Hk(a),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return a.eachAfter(r?function(h){h.x=(h.x-a.x)*t,h.y=(a.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(a.y?h.y/a.y:1))*n})}return i.separation=function(a){return arguments.length?(e=a,i):e},i.size=function(a){return arguments.length?(r=!1,t=+a[0],n=+a[1],i):r?null:[t,n]},i.nodeSize=function(a){return arguments.length?(r=!0,t=+a[0],n=+a[1],i):r?[t,n]:null},i}function Fk(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 Gk(){return this.eachAfter(Fk)}function jk(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function zk(e,t){for(var n=this,r=[n],i,a,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function Wk(e,t){for(var n=this,r=[n],i=[],a,s,o,l=-1;n=r.pop();)if(i.push(n),a=n.children)for(s=0,o=a.length;s<o;++s)r.push(a[s]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function qk(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Yk(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Zk(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Xk(e){for(var t=this,n=Kk(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 Kk(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 Qk(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Jk(){return Array.from(this)}function tL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function eL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*nL(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function Ca(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=aL)):t===void 0&&(t=iL);for(var n=new Aa(e),r,i=[n],a,s,o,l;r=i.pop();)if((s=t(r.data))&&(l=(s=Array.from(s)).length))for(r.children=s,o=l-1;o>=0;--o)i.push(a=s[o]=new Aa(s[o])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(oL)}function rL(){return Ca(this).eachBefore(sL)}function iL(e){return e.children}function aL(e){return Array.isArray(e)?e[1]:null}function sL(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function oL(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Aa(e){this.data=e,this.depth=this.height=0,this.parent=null}Aa.prototype=Ca.prototype={constructor:Aa,count:Gk,each:jk,eachAfter:Wk,eachBefore:zk,find:qk,sum:Yk,sort:Zk,path:Xk,ancestors:Qk,descendants:Jk,leaves:tL,links:eL,copy:rL,[Symbol.iterator]:nL};function lL(e){return e==null?null:Zg(e)}function Zg(e){if(typeof e!="function")throw new Error;return e}function kr(){return 0}function vi(e){return function(){return e}}const cL=1664525,uL=1013904223,Xg=4294967296;function hL(){let e=1;return()=>(e=(cL*e+uL)%Xg)/Xg}function dL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pL(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 fL(e,t){for(var n=0,r=(e=pL(Array.from(e),t)).length,i=[],a,s;n<r;)a=e[n],s&&Kg(s,a)?++n:(s=gL(i=mL(i,a)),n=0);return s}function mL(e,t){var n,r;if(Ru(t,e))return[t];for(n=0;n<e.length;++n)if(xo(t,e[n])&&Ru(ka(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(xo(ka(e[n],e[r]),t)&&xo(ka(e[n],t),e[r])&&xo(ka(e[r],t),e[n])&&Ru(Qg(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function xo(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Kg(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Ru(e,t){for(var n=0;n<t.length;++n)if(!Kg(e,t[n]))return!1;return!0}function gL(e){switch(e.length){case 1:return vL(e[0]);case 2:return ka(e[0],e[1]);case 3:return Qg(e[0],e[1],e[2])}}function vL(e){return{x:e.x,y:e.y,r:e.r}}function ka(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,s=t.y,o=t.r,l=a-n,c=s-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+a+l/d*u)/2,y:(r+s+c/d*u)/2,r:(d+i+o)/2}}function Qg(e,t,n){var r=e.x,i=e.y,a=e.r,s=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-s,p=r-c,f=i-o,v=i-u,m=l-a,y=d-a,g=r*r+i*i-a*a,x=g-s*s-o*o+l*l,O=g-c*c-u*u+d*d,E=p*f-h*v,w=(f*O-v*x)/(E*2)-r,A=(v*m-f*y)/E,I=(p*x-h*O)/(E*2)-i,L=(h*y-p*m)/E,D=A*A+L*L-1,$=2*(a+w*A+I*L),F=w*w+I*I-a*a,P=-(Math.abs(D)>1e-6?($+Math.sqrt($*$-4*D*F))/(2*D):F/$);return{x:r+w+A*P,y:i+I+L*P,r:P}}function Jg(e,t,n){var r=e.x-t.x,i,a,s=e.y-t.y,o,l,c=r*r+s*s;c?(a=t.r+n.r,a*=a,l=e.r+n.r,l*=l,a>l?(i=(c+l-a)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*s,n.y=e.y-i*s+o*r):(i=(c+a-l)/(2*c),o=Math.sqrt(Math.max(0,a/c-i*i)),n.x=t.x+i*r-o*s,n.y=t.y+i*s+o*r)):(n.x=t.x+n.r,n.y=t.y)}function tv(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 ev(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function _o(e){this._=e,this.next=null,this.previous=null}function yL(e,t){if(!(a=(e=dL(e)).length))return 0;var n,r,i,a,s,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(a>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;Jg(r,n,i=e[2]),n=new _o(n),r=new _o(r),i=new _o(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<a;++l){Jg(n._,r._,i=e[l]),i=new _o(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(tv(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(tv(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,s=ev(n);(i=i.next)!==r;)(o=ev(i))<s&&(n=i,s=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=fL(n,t),l=0;l<a;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function bL(e){return Math.sqrt(e.value)}function xL(){var e=null,t=1,n=1,r=kr;function i(a){const s=hL();return a.x=t/2,a.y=n/2,e?a.eachBefore(nv(e)).eachAfter(Iu(r,.5,s)).eachBefore(rv(1)):a.eachBefore(nv(bL)).eachAfter(Iu(kr,1,s)).eachAfter(Iu(r,a.r/Math.min(t,n),s)).eachBefore(rv(Math.min(t,n)/(2*a.r))),a}return i.radius=function(a){return arguments.length?(e=lL(a),i):e},i.size=function(a){return arguments.length?(t=+a[0],n=+a[1],i):[t,n]},i.padding=function(a){return arguments.length?(r=typeof a=="function"?a:vi(+a),i):r},i}function nv(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Iu(e,t,n){return function(r){if(i=r.children){var i,a,s=i.length,o=e(r)*t||0,l;if(o)for(a=0;a<s;++a)i[a].r+=o;if(l=yL(i,n),o)for(a=0;a<s;++a)i[a].r-=o;r.r=l+o}}}function rv(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function _L(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function EL(e,t,n,r,i){for(var a=e.children,s,o=-1,l=a.length,c=e.value&&(r-t)/e.value;++o<l;)s=a[o],s.y0=n,s.y1=i,s.x0=t,s.x1=t+=s.value*c}function OL(e,t){return e.parent===t.parent?1:2}function Nu(e){var t=e.children;return t?t[0]:e.t}function Pu(e){var t=e.children;return t?t[t.length-1]:e.t}function wL(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function SL(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function TL(e,t,n){return e.a.parent===t.parent?e.a:n}function Eo(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}Eo.prototype=Object.create(Aa.prototype);function $L(e){for(var t=new Eo(e,0),n,r=[t],i,a,s,o;n=r.pop();)if(a=n._.children)for(n.children=new Array(o=a.length),s=o-1;s>=0;--s)r.push(i=n.children[s]=new Eo(a[s],s)),i.parent=n;return(t.parent=new Eo(null,0)).children=[t],t}function ML(){var e=OL,t=1,n=1,r=null;function i(c){var u=$L(c);if(u.eachAfter(a),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(g){g.x<d.x&&(d=g),g.x>h.x&&(h=g),g.depth>p.depth&&(p=g)});var f=d===h?1:e(d,h)/2,v=f-d.x,m=t/(h.x+f+v),y=n/(p.depth||1);c.eachBefore(function(g){g.x=(g.x+v)*m,g.y=g.depth*y})}return c}function a(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){SL(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 s(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,v=h.parent.children[0],m=h.m,y=p.m,g=f.m,x=v.m,O;f=Pu(f),h=Nu(h),f&&h;)v=Nu(v),p=Pu(p),p.a=c,O=f.z+g-h.z-m+e(f._,h._),O>0&&(wL(TL(f,c,d),c,O),m+=O,y+=O),g+=f.m,m+=h.m,x+=v.m,y+=p.m;f&&!Pu(p)&&(p.t=f,p.m+=g-y),h&&!Nu(v)&&(v.t=h,v.m+=m-x,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 CL(e,t,n,r,i){for(var a=e.children,s,o=-1,l=a.length,c=e.value&&(i-n)/e.value;++o<l;)s=a[o],s.x0=t,s.x1=r,s.y0=n,s.y1=n+=s.value*c}var AL=(1+Math.sqrt(5))/2;function kL(e,t,n,r,i,a){for(var s=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,v=t.value,m,y,g,x,O,E,w;u<h;){p=i-n,f=a-r;do m=o[d++].value;while(!m&&d<h);for(y=g=m,E=Math.max(f/p,p/f)/(v*e),w=m*m*E,O=Math.max(g/w,w/y);d<h;++d){if(m+=c=o[d].value,c<y&&(y=c),c>g&&(g=c),w=m*m*E,x=Math.max(g/w,w/y),x>O){m-=c;break}O=x}s.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?EL(l,n,r,i,v?r+=f*m/v:a):CL(l,n,r,v?n+=p*m/v:i,a),v-=m,u=d}return s}const LL=function e(t){function n(r,i,a,s,o){kL(t,r,i,a,s,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(AL);function DL(){var e=LL,t=!1,n=1,r=1,i=[0],a=kr,s=kr,o=kr,l=kr,c=kr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(_L),h}function d(h){var p=i[h.depth],f=h.x0+p,v=h.y0+p,m=h.x1-p,y=h.y1-p;m<f&&(f=m=(f+m)/2),y<v&&(v=y=(v+y)/2),h.x0=f,h.y0=v,h.x1=m,h.y1=y,h.children&&(p=i[h.depth+1]=a(h)/2,f+=c(h)-p,v+=s(h)-p,m-=o(h)-p,y-=l(h)-p,m<f&&(f=m=(f+m)/2),y<v&&(v=y=(v+y)/2),e(h,f,v,m,y))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Zg(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(a=typeof h=="function"?h:vi(+h),u):a},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(s=typeof h=="function"?h:vi(+h),u):s},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:vi(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:vi(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:vi(+h),u):c},u}function Oo(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new hu(t)}function RL(e){return e.innerRadius}function IL(e){return e.outerRadius}function NL(e){return e.startAngle}function PL(e){return e.endAngle}function UL(e){return e&&e.padAngle}function BL(e,t,n,r,i,a,s,o){var l=n-e,c=r-t,u=s-i,d=o-a,h=d*l-u*c;if(!(h*h<de))return h=(u*(t-a)-d*(e-i))/h,[e+h*l,t+h*c]}function wo(e,t,n,r,i,a,s){var o=e-n,l=t-r,c=(s?a:-a)/li(o*o+l*l),u=c*l,d=-c*o,h=e+u,p=t+d,f=n+u,v=r+d,m=(h+f)/2,y=(p+v)/2,g=f-h,x=v-p,O=g*g+x*x,E=i-a,w=h*v-f*p,A=(x<0?-1:1)*li(EC(0,E*E*O-w*w)),I=(w*x-g*A)/O,L=(-w*g-x*A)/O,D=(w*x+g*A)/O,$=(-w*g+x*A)/O,F=I-m,P=L-y,H=D-m,_=$-y;return F*F+P*P>H*H+_*_&&(I=D,L=$),{cx:I,cy:L,x01:-u,y01:-d,x11:I*(i/E-1),y11:L*(i/E-1)}}function La(){var e=RL,t=IL,n=ft(0),r=null,i=NL,a=PL,s=UL,o=null,l=Oo(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-zs,v=a.apply(this,arguments)-zs,m=lm(v-f),y=v>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>de))o.moveTo(0,0);else if(m>Ws-de)o.moveTo(p*Tr(f),p*mn(f)),o.arc(0,0,p,f,v,!y),h>de&&(o.moveTo(h*Tr(v),h*mn(v)),o.arc(0,0,h,v,f,y));else{var g=f,x=v,O=f,E=v,w=m,A=m,I=s.apply(this,arguments)/2,L=I>de&&(r?+r.apply(this,arguments):li(h*h+p*p)),D=Yc(lm(p-h)/2,+n.apply(this,arguments)),$=D,F=D,P,H;if(L>de){var _=cm(L/h*mn(I)),C=cm(L/p*mn(I));(w-=_*2)>de?(_*=y?1:-1,O+=_,E-=_):(w=0,O=E=(f+v)/2),(A-=C*2)>de?(C*=y?1:-1,g+=C,x-=C):(A=0,g=x=(f+v)/2)}var k=p*Tr(g),U=p*mn(g),B=h*Tr(E),X=h*mn(E);if(D>de){var Y=p*Tr(x),ot=p*mn(x),it=h*Tr(O),xt=h*mn(O),at;if(m<ga)if(at=BL(k,U,it,xt,Y,ot,B,X)){var K=k-at[0],et=U-at[1],mt=Y-at[0],q=ot-at[1],J=1/mn(OC((K*mt+et*q)/(li(K*K+et*et)*li(mt*mt+q*q)))/2),dt=li(at[0]*at[0]+at[1]*at[1]);$=Yc(D,(h-dt)/(J-1)),F=Yc(D,(p-dt)/(J+1))}else $=F=0}A>de?F>de?(P=wo(it,xt,k,U,p,F,y),H=wo(Y,ot,B,X,p,F,y),o.moveTo(P.cx+P.x01,P.cy+P.y01),F<D?o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,F,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,p,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),!y),o.arc(H.cx,H.cy,F,he(H.y11,H.x11),he(H.y01,H.x01),!y))):(o.moveTo(k,U),o.arc(0,0,p,g,x,!y)):o.moveTo(k,U),!(h>de)||!(w>de)?o.lineTo(B,X):$>de?(P=wo(B,X,Y,ot,h,-$,y),H=wo(k,U,it,xt,h,-$,y),o.lineTo(P.cx+P.x01,P.cy+P.y01),$<D?o.arc(P.cx,P.cy,$,he(P.y01,P.x01),he(H.y01,H.x01),!y):(o.arc(P.cx,P.cy,$,he(P.y01,P.x01),he(P.y11,P.x11),!y),o.arc(0,0,h,he(P.cy+P.y11,P.cx+P.x11),he(H.cy+H.y11,H.cx+H.x11),y),o.arc(H.cx,H.cy,$,he(H.y11,H.x11),he(H.y01,H.x01),!y))):o.arc(0,0,h,E,O,y)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-ga/2;return[Tr(d)*u,mn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ft(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ft(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ft(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ft(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ft(+u),c):i},c.endAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ft(+u),c):a},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ft(+u),c):s},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function Uu(e){return e[0]}function Bu(e){return e[1]}function Da(e,t){var n=ft(!0),r=null,i=qs,a=null,s=Oo(o);e=typeof e=="function"?e:e===void 0?Uu:ft(e),t=typeof t=="function"?t:t===void 0?Bu:ft(t);function o(l){var c,u=(l=Bs(l)).length,d,h=!1,p;for(r==null&&(a=i(p=s())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(d,c,l),+t(d,c,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ft(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ft(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ft(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),o):r},o}function Hu(e,t,n){var r=null,i=ft(!0),a=null,s=qs,o=null,l=Oo(c);e=typeof e=="function"?e:e===void 0?Uu:ft(+e),t=typeof t=="function"?t:ft(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Bu:ft(+n);function c(d){var h,p,f,v=(d=Bs(d)).length,m,y=!1,g,x=new Array(v),O=new Array(v);for(a==null&&(o=s(g=l())),h=0;h<=v;++h){if(!(h<v&&i(m=d[h],h,d))===y)if(y=!y)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(x[f],O[f]);o.lineEnd(),o.areaEnd()}y&&(x[h]=+e(m,h,d),O[h]=+t(m,h,d),o.point(r?+r(m,h,d):x[h],n?+n(m,h,d):O[h]))}if(g)return o=null,g+""||null}function u(){return Da().defined(i).curve(s).context(a)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ft(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:ft(+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:ft(!!d),c):i},c.curve=function(d){return arguments.length?(s=d,a!=null&&(o=s(a)),c):s},c.context=function(d){return arguments.length?(d==null?a=o=null:o=s(a=d),c):a},c}function HL(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function VL(e){return e}function FL(){var e=VL,t=HL,n=null,r=ft(0),i=ft(Ws),a=ft(0);function s(o){var l,c=(o=Bs(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),v=+r.apply(this,arguments),m=Math.min(Ws,Math.max(-Ws,i.apply(this,arguments)-v)),y,g=Math.min(Math.abs(m)/c,a.apply(this,arguments)),x=g*(m<0?-1:1),O;for(l=0;l<c;++l)(O=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=O);for(t!=null?p.sort(function(E,w){return t(f[E],f[w])}):n!=null&&p.sort(function(E,w){return n(o[E],o[w])}),l=0,d=h?(m-c*x)/h:0;l<c;++l,v=y)u=p[l],O=f[u],y=v+(O>0?O*d:0)+x,f[u]={data:o[u],index:l,value:O,startAngle:v,endAngle:y,padAngle:g};return f}return s.value=function(o){return arguments.length?(e=typeof o=="function"?o:ft(+o),s):e},s.sortValues=function(o){return arguments.length?(t=o,n=null,s):t},s.sort=function(o){return arguments.length?(n=o,t=null,s):n},s.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:ft(+o),s):r},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ft(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:ft(+o),s):a},s}var GL=av(qs);function iv(e){this._curve=e}iv.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 av(e){function t(n){return new iv(e(n))}return t._curve=e,t}function jL(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(av(n)):t()._curve},e}function zL(){return jL(Da().curve(GL))}class WL{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 qL(e){return new WL(e,!0)}function YL(e){return e.source}function ZL(e){return e.target}function XL(e){let t=YL,n=ZL,r=Uu,i=Bu,a=null,s=null,o=Oo(l);function l(){let c;const u=g$.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(a==null&&(s=e(c=o())),s.lineStart(),u[0]=d,s.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,s.point(+r.apply(this,u),+i.apply(this,u)),s.lineEnd(),c)return s=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:ft(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ft(+c),l):i},l.context=function(c){return arguments.length?(c==null?a=s=null:s=e(a=c),l):a},l}function KL(){return XL(qL)}let yt=class{constructor(t,n,r){if(this.type="",this.renderType=rt.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=b(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(R(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=b(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Ee}--${i}--${this.type}`,!0),r&&r.classed(`${Ee}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=b(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${Ee}--${n}--${this.type}`);if(t.withinChartClip){const a=this.model.get("chartClipId");if(a){const s=R(`#${a}`).select("rect");s.size()!==0&&parseFloat(s.attr("height"))>0&&i.attr("clip-path",`url(#${a})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ct({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:sv,setPrototypeOf:ov,isFrozen:QL,getPrototypeOf:JL,getOwnPropertyDescriptor:tD}=Object;let{freeze:ve,seal:We,create:lv}=Object,{apply:Vu,construct:Fu}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e}),We||(We=function(e){return e}),Vu||(Vu=function(e,t,n){return e.apply(t,n)}),Fu||(Fu=function(e,t){return new e(...t)});const So=Re(Array.prototype.forEach),cv=Re(Array.prototype.pop),Ra=Re(Array.prototype.push),To=Re(String.prototype.toLowerCase),Gu=Re(String.prototype.toString),uv=Re(String.prototype.match),Ia=Re(String.prototype.replace),eD=Re(String.prototype.indexOf),nD=Re(String.prototype.trim),an=Re(Object.prototype.hasOwnProperty),ye=Re(RegExp.prototype.test),Na=rD(TypeError);function Re(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Vu(e,t,r)}}function rD(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fu(e,n)}}function bt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:To;ov&&ov(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(QL(t)||(t[r]=a),i=a)}e[i]=!0}return e}function iD(e){for(let t=0;t<e.length;t++)an(e,t)||(e[t]=null);return e}function Lr(e){const t=lv(null);for(const[n,r]of sv(e))an(e,n)&&(Array.isArray(r)?t[n]=iD(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Lr(r):t[n]=r);return t}function Pa(e,t){for(;e!==null;){const r=tD(e,t);if(r){if(r.get)return Re(r.get);if(typeof r.value=="function")return Re(r.value)}e=JL(e)}function n(){return null}return n}const hv=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ju=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),zu=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),aD=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Wu=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sD=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dv=ve(["#text"]),pv=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qu=ve(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fv=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),$o=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),oD=We(/\{\{[\w\W]*|[\w\W]*\}\}/gm),lD=We(/<%[\w\W]*|[\w\W]*%>/gm),cD=We(/\${[\w\W]*}/gm),uD=We(/^data-[\-\w.\u00B7-\uFFFF]/),hD=We(/^aria-[\-\w]+$/),mv=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dD=We(/^(?:\w+script|data):/i),pD=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gv=We(/^html$/i),fD=We(/^[a-z][.\w]*(-[.\w]+)+$/i);var vv=Object.freeze({__proto__:null,MUSTACHE_EXPR:oD,ERB_EXPR:lD,TMPLIT_EXPR:cD,DATA_ATTR:uD,ARIA_ATTR:hD,IS_ALLOWED_URI:mv,IS_SCRIPT_OR_DATA:dD,ATTR_WHITESPACE:pD,DOCTYPE_NAME:gv,CUSTOM_ELEMENT:fD});const Ua={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mD=function(){return typeof window>"u"?null:window},gD=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(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function yv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mD();const t=T=>yv(T);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Ua.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,v=Pa(f,"cloneNode"),m=Pa(f,"remove"),y=Pa(f,"nextSibling"),g=Pa(f,"childNodes"),x=Pa(f,"parentNode");if(typeof s=="function"){const T=n.createElement("template");T.content&&T.content.ownerDocument&&(n=T.content.ownerDocument)}let O,E="";const{implementation:w,createNodeIterator:A,createDocumentFragment:I,getElementsByTagName:L}=n,{importNode:D}=r;let $={};t.isSupported=typeof sv=="function"&&typeof x=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:P,TMPLIT_EXPR:H,DATA_ATTR:_,ARIA_ATTR:C,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:B}=vv;let{IS_ALLOWED_URI:X}=vv,Y=null;const ot=bt({},[...hv,...ju,...zu,...Wu,...dv]);let it=null;const xt=bt({},[...pv,...qu,...fv,...$o]);let at=Object.seal(lv(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}})),K=null,et=null,mt=!0,q=!0,J=!1,dt=!0,j=!1,It=!0,gt=!1,qt=!1,jt=!1,nt=!1,Mt=!1,xe=!1,Pe=!0,Yo=!1;const za="user-content-";let Wa=!0,Ir=!1,Fn={},Gn=null;const rr=bt({},["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 Zo=null;const qa=bt({},["audio","video","img","source","image","track"]);let Oi=null;const wi=bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Si="http://www.w3.org/1998/Math/MathML",Ti="http://www.w3.org/2000/svg",on="http://www.w3.org/1999/xhtml";let ir=on,Ya=!1,Za=null;const Nh=bt({},[Si,Ti,on],Gu);let jn=null;const Xo=["application/xhtml+xml","text/html"],ar="text/html";let Kt=null,xn=null;const Ko=n.createElement("form"),Qo=function(T){return T instanceof RegExp||T instanceof Function},$i=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xn&&xn===T)){if((!T||typeof T!="object")&&(T={}),T=Lr(T),jn=Xo.indexOf(T.PARSER_MEDIA_TYPE)===-1?ar:T.PARSER_MEDIA_TYPE,Kt=jn==="application/xhtml+xml"?Gu:To,Y=an(T,"ALLOWED_TAGS")?bt({},T.ALLOWED_TAGS,Kt):ot,it=an(T,"ALLOWED_ATTR")?bt({},T.ALLOWED_ATTR,Kt):xt,Za=an(T,"ALLOWED_NAMESPACES")?bt({},T.ALLOWED_NAMESPACES,Gu):Nh,Oi=an(T,"ADD_URI_SAFE_ATTR")?bt(Lr(wi),T.ADD_URI_SAFE_ATTR,Kt):wi,Zo=an(T,"ADD_DATA_URI_TAGS")?bt(Lr(qa),T.ADD_DATA_URI_TAGS,Kt):qa,Gn=an(T,"FORBID_CONTENTS")?bt({},T.FORBID_CONTENTS,Kt):rr,K=an(T,"FORBID_TAGS")?bt({},T.FORBID_TAGS,Kt):{},et=an(T,"FORBID_ATTR")?bt({},T.FORBID_ATTR,Kt):{},Fn=an(T,"USE_PROFILES")?T.USE_PROFILES:!1,mt=T.ALLOW_ARIA_ATTR!==!1,q=T.ALLOW_DATA_ATTR!==!1,J=T.ALLOW_UNKNOWN_PROTOCOLS||!1,dt=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,j=T.SAFE_FOR_TEMPLATES||!1,It=T.SAFE_FOR_XML!==!1,gt=T.WHOLE_DOCUMENT||!1,nt=T.RETURN_DOM||!1,Mt=T.RETURN_DOM_FRAGMENT||!1,xe=T.RETURN_TRUSTED_TYPE||!1,jt=T.FORCE_BODY||!1,Pe=T.SANITIZE_DOM!==!1,Yo=T.SANITIZE_NAMED_PROPS||!1,Wa=T.KEEP_CONTENT!==!1,Ir=T.IN_PLACE||!1,X=T.ALLOWED_URI_REGEXP||mv,ir=T.NAMESPACE||on,at=T.CUSTOM_ELEMENT_HANDLING||{},T.CUSTOM_ELEMENT_HANDLING&&Qo(T.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(at.tagNameCheck=T.CUSTOM_ELEMENT_HANDLING.tagNameCheck),T.CUSTOM_ELEMENT_HANDLING&&Qo(T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(at.attributeNameCheck=T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(at.allowCustomizedBuiltInElements=T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),j&&(q=!1),Mt&&(nt=!0),Fn&&(Y=bt({},dv),it=[],Fn.html===!0&&(bt(Y,hv),bt(it,pv)),Fn.svg===!0&&(bt(Y,ju),bt(it,qu),bt(it,$o)),Fn.svgFilters===!0&&(bt(Y,zu),bt(it,qu),bt(it,$o)),Fn.mathMl===!0&&(bt(Y,Wu),bt(it,fv),bt(it,$o))),T.ADD_TAGS&&(Y===ot&&(Y=Lr(Y)),bt(Y,T.ADD_TAGS,Kt)),T.ADD_ATTR&&(it===xt&&(it=Lr(it)),bt(it,T.ADD_ATTR,Kt)),T.ADD_URI_SAFE_ATTR&&bt(Oi,T.ADD_URI_SAFE_ATTR,Kt),T.FORBID_CONTENTS&&(Gn===rr&&(Gn=Lr(Gn)),bt(Gn,T.FORBID_CONTENTS,Kt)),Wa&&(Y["#text"]=!0),gt&&bt(Y,["html","head","body"]),Y.table&&(bt(Y,["tbody"]),delete K.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Na('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Na('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=T.TRUSTED_TYPES_POLICY,E=O.createHTML("")}else O===void 0&&(O=gD(p,i)),O!==null&&typeof E=="string"&&(E=O.createHTML(""));ve&&ve(T),xn=T}},Jo=bt({},["mi","mo","mn","ms","mtext"]),Xa=bt({},["foreignobject","annotation-xml"]),tl=bt({},["title","style","font","a","script"]),el=bt({},[...ju,...zu,...aD]),nl=bt({},[...Wu,...sD]),rl=function(T){let Z=x(T);(!Z||!Z.tagName)&&(Z={namespaceURI:ir,tagName:"template"});const W=To(T.tagName),lt=To(Z.tagName);return Za[T.namespaceURI]?T.namespaceURI===Ti?Z.namespaceURI===on?W==="svg":Z.namespaceURI===Si?W==="svg"&&(lt==="annotation-xml"||Jo[lt]):!!el[W]:T.namespaceURI===Si?Z.namespaceURI===on?W==="math":Z.namespaceURI===Ti?W==="math"&&Xa[lt]:!!nl[W]:T.namespaceURI===on?Z.namespaceURI===Ti&&!Xa[lt]||Z.namespaceURI===Si&&!Jo[lt]?!1:!nl[W]&&(tl[W]||!el[W]):!!(jn==="application/xhtml+xml"&&Za[T.namespaceURI]):!1},_n=function(T){Ra(t.removed,{element:T});try{x(T).removeChild(T)}catch{m(T)}},Mi=function(T,Z){try{Ra(t.removed,{attribute:Z.getAttributeNode(T),from:Z})}catch{Ra(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(T),T==="is"&&!it[T])if(nt||Mt)try{_n(Z)}catch{}else try{Z.setAttribute(T,"")}catch{}},il=function(T){let Z=null,W=null;if(jt)T="<remove></remove>"+T;else{const Ut=uv(T,/^[\r\n\t ]+/);W=Ut&&Ut[0]}jn==="application/xhtml+xml"&&ir===on&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const lt=O?O.createHTML(T):T;if(ir===on)try{Z=new h().parseFromString(lt,jn)}catch{}if(!Z||!Z.documentElement){Z=w.createDocument(ir,"template",null);try{Z.documentElement.innerHTML=Ya?E:lt}catch{}}const At=Z.body||Z.documentElement;return T&&W&&At.insertBefore(n.createTextNode(W),At.childNodes[0]||null),ir===on?L.call(Z,gt?"html":"body")[0]:gt?Z.documentElement:At},al=function(T){return A.call(T.ownerDocument||T,T,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},sl=function(T){return T instanceof d&&(typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||!(T.attributes instanceof u)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function")},M=function(T){return typeof o=="function"&&T instanceof o},z=function(T,Z,W){$[T]&&So($[T],lt=>{lt.call(t,Z,W,xn)})},Q=function(T){let Z=null;if(z("beforeSanitizeElements",T,null),sl(T))return _n(T),!0;const W=Kt(T.nodeName);if(z("uponSanitizeElement",T,{tagName:W,allowedTags:Y}),T.hasChildNodes()&&!M(T.firstElementChild)&&ye(/<[/\w]/g,T.innerHTML)&&ye(/<[/\w]/g,T.textContent)||T.nodeType===Ua.progressingInstruction||It&&T.nodeType===Ua.comment&&ye(/<[/\w]/g,T.data))return _n(T),!0;if(!Y[W]||K[W]){if(!K[W]&&Ot(W)&&(at.tagNameCheck instanceof RegExp&&ye(at.tagNameCheck,W)||at.tagNameCheck instanceof Function&&at.tagNameCheck(W)))return!1;if(Wa&&!Gn[W]){const lt=x(T)||T.parentNode,At=g(T)||T.childNodes;if(At&&lt){const Ut=At.length;for(let oe=Ut-1;oe>=0;--oe){const Bt=v(At[oe],!0);Bt.__removalCount=(T.__removalCount||0)+1,lt.insertBefore(Bt,y(T))}}}return _n(T),!0}return T instanceof l&&!rl(T)||(W==="noscript"||W==="noembed"||W==="noframes")&&ye(/<\/no(script|embed|frames)/i,T.innerHTML)?(_n(T),!0):(j&&T.nodeType===Ua.text&&(Z=T.textContent,So([F,P,H],lt=>{Z=Ia(Z,lt," ")}),T.textContent!==Z&&(Ra(t.removed,{element:T.cloneNode()}),T.textContent=Z)),z("afterSanitizeElements",T,null),!1)},ut=function(T,Z,W){if(Pe&&(Z==="id"||Z==="name")&&(W in n||W in Ko))return!1;if(!(q&&!et[Z]&&ye(_,Z))&&!(mt&&ye(C,Z))){if(!it[Z]||et[Z]){if(!(Ot(T)&&(at.tagNameCheck instanceof RegExp&&ye(at.tagNameCheck,T)||at.tagNameCheck instanceof Function&&at.tagNameCheck(T))&&(at.attributeNameCheck instanceof RegExp&&ye(at.attributeNameCheck,Z)||at.attributeNameCheck instanceof Function&&at.attributeNameCheck(Z))||Z==="is"&&at.allowCustomizedBuiltInElements&&(at.tagNameCheck instanceof RegExp&&ye(at.tagNameCheck,W)||at.tagNameCheck instanceof Function&&at.tagNameCheck(W))))return!1}else if(!Oi[Z]&&!ye(X,Ia(W,U,""))&&!((Z==="src"||Z==="xlink:href"||Z==="href")&&T!=="script"&&eD(W,"data:")===0&&Zo[T])&&!(J&&!ye(k,Ia(W,U,"")))&&W)return!1}return!0},Ot=function(T){return T!=="annotation-xml"&&uv(T,B)},Ct=function(T){z("beforeSanitizeAttributes",T,null);const{attributes:Z}=T;if(!Z)return;const W={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:it};let lt=Z.length;for(;lt--;){const At=Z[lt],{name:Ut,namespaceURI:oe,value:Bt}=At,$e=Kt(Ut);let le=Ut==="value"?Bt:nD(Bt);if(W.attrName=$e,W.attrValue=le,W.keepAttr=!0,W.forceKeepAttr=void 0,z("uponSanitizeAttribute",T,W),le=W.attrValue,It&&ye(/((--!?|])>)|<\/(style|title)/i,le)){Mi(Ut,T);continue}if(W.forceKeepAttr||(Mi(Ut,T),!W.keepAttr))continue;if(!dt&&ye(/\/>/i,le)){Mi(Ut,T);continue}j&&So([F,P,H],x5=>{le=Ia(le,x5," ")});const ol=Kt(T.nodeName);if(ut(ol,$e,le)){if(Yo&&($e==="id"||$e==="name")&&(Mi(Ut,T),le=za+le),O&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!oe)switch(p.getAttributeType(ol,$e)){case"TrustedHTML":{le=O.createHTML(le);break}case"TrustedScriptURL":{le=O.createScriptURL(le);break}}try{oe?T.setAttributeNS(oe,Ut,le):T.setAttribute(Ut,le),sl(T)?_n(T):cv(t.removed)}catch{}}}z("afterSanitizeAttributes",T,null)},_t=function T(Z){let W=null;const lt=al(Z);for(z("beforeSanitizeShadowDOM",Z,null);W=lt.nextNode();)z("uponSanitizeShadowNode",W,null),!Q(W)&&(W.content instanceof a&&T(W.content),Ct(W));z("afterSanitizeShadowDOM",Z,null)};return t.sanitize=function(T){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,lt=null,At=null,Ut=null;if(Ya=!T,Ya&&(T="<!-->"),typeof T!="string"&&!M(T))if(typeof T.toString=="function"){if(T=T.toString(),typeof T!="string")throw Na("dirty is not a string, aborting")}else throw Na("toString is not a function");if(!t.isSupported)return T;if(qt||$i(Z),t.removed=[],typeof T=="string"&&(Ir=!1),Ir){if(T.nodeName){const $e=Kt(T.nodeName);if(!Y[$e]||K[$e])throw Na("root node is forbidden and cannot be sanitized in-place")}}else if(T instanceof o)W=il("<!---->"),lt=W.ownerDocument.importNode(T,!0),lt.nodeType===Ua.element&&lt.nodeName==="BODY"||lt.nodeName==="HTML"?W=lt:W.appendChild(lt);else{if(!nt&&!j&&!gt&&T.indexOf("<")===-1)return O&&xe?O.createHTML(T):T;if(W=il(T),!W)return nt?null:xe?E:""}W&&jt&&_n(W.firstChild);const oe=al(Ir?T:W);for(;At=oe.nextNode();)Q(At)||(At.content instanceof a&&_t(At.content),Ct(At));if(Ir)return T;if(nt){if(Mt)for(Ut=I.call(W.ownerDocument);W.firstChild;)Ut.appendChild(W.firstChild);else Ut=W;return(it.shadowroot||it.shadowrootmode)&&(Ut=D.call(r,Ut,!0)),Ut}let Bt=gt?W.outerHTML:W.innerHTML;return gt&&Y["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&ye(gv,W.ownerDocument.doctype.name)&&(Bt="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
4
+ `+Bt),j&&So([F,P,H],$e=>{Bt=Ia(Bt,$e," ")}),O&&xe?O.createHTML(Bt):Bt},t.setConfig=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$i(T),qt=!0},t.clearConfig=function(){xn=null,qt=!1},t.isValidAttribute=function(T,Z,W){xn||$i({});const lt=Kt(T),At=Kt(Z);return ut(lt,At,W)},t.addHook=function(T,Z){typeof Z=="function"&&($[T]=$[T]||[],Ra($[T],Z))},t.removeHook=function(T){if($[T])return cv($[T])},t.removeHooks=function(T){$[T]&&($[T]=[])},t.removeAllHooks=function(){$={}},t}var Yu=yv();const Mo=e=>Yu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),vD=e=>Yu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),yn=e=>Yu.sanitize(e,{ALLOWED_TAGS:[]}),bv=class W0 extends yt{constructor(){super(...arguments),this.type="toolbar",this.renderType=rt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(S.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(S.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar");if(b(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("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const a=n.selectAll("div.toolbar-control").data(r,l=>l.id);a.exit().remove();const s=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;s.merge(a).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
5
5
  <button
6
6
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
7
7
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${yn(l.id)}`)}" aria-label="${yn(l.title)}">
8
8
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
9
- ${vL(l.iconSVG.content)}
9
+ ${vD(l.iconSVG.content)}
10
10
  </svg>
11
- </button>`).each(function(l,c){D(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"),D(this).select("button").on("mouseover focus",function(u){const d=D(this);d.classed("hovered",!0),o.services.events.dispatchEvent(S.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(S.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=>b(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),D(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(S.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(S.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<n.length){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`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<n.length){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`#${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 a=D(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(r,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",s=>{s&&s.key==="Enter"?n.triggerFunctionAndEvent(r,t,a.node()):s&&s.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):s&&s.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):s&&s.key==="Escape"&&n.updateOverflowMenu(!1),s.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(S.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=b(this.getOptions(),"toolbar","numberOfIcons")-1,n=b(this.getOptions(),"toolbar","controls"),r=[],i=[],a=[];return n.forEach(s=>{let o=null;if(s.type===Tt.CUSTOM)b(s,"id")===null&&(s.id=`toolbar-button-${W0.buttonID++}`),b(s,"shouldBeDisabled")===null&&(s.shouldBeDisabled=()=>!1),o=s;else{const l=this.services.domUtils.isFullScreenMode();s.type===Tt.MAKE_FULLSCREEN&&l?s.type=Tt.EXIT_FULLSCREEN:s.type===Tt.EXIT_FULLSCREEN&&!l&&(s.type=Tt.MAKE_FULLSCREEN),o=this.getControlConfigByType(s.type)}o&&(o.text=s.text?s.text:s.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?b(o,"iconSVG","content")===null?a.push(o):i.push(o):a.push(o))}),a.push(...r),a.length?{buttonList:i,overflowMenuItemList:a}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=b(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
11
+ </button>`).each(function(l,c){R(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"),R(this).select("button").on("mouseover focus",function(u){const d=R(this);d.classed("hovered",!0),o.services.events.dispatchEvent(S.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(S.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=>b(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),R(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(S.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(S.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<n.length){const i=R(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=R(`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<n.length){const i=R(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=R(`#${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 a=R(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(r,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",s=>{s&&s.key==="Enter"?n.triggerFunctionAndEvent(r,t,a.node()):s&&s.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):s&&s.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):s&&s.key==="Escape"&&n.updateOverflowMenu(!1),s.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(S.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=b(this.getOptions(),"toolbar","numberOfIcons")-1,n=b(this.getOptions(),"toolbar","controls"),r=[],i=[],a=[];return n.forEach(s=>{let o=null;if(s.type===Tt.CUSTOM)b(s,"id")===null&&(s.id=`toolbar-button-${W0.buttonID++}`),b(s,"shouldBeDisabled")===null&&(s.shouldBeDisabled=()=>!1),o=s;else{const l=this.services.domUtils.isFullScreenMode();s.type===Tt.MAKE_FULLSCREEN&&l?s.type=Tt.EXIT_FULLSCREEN:s.type===Tt.EXIT_FULLSCREEN&&!l&&(s.type=Tt.MAKE_FULLSCREEN),o=this.getControlConfigByType(s.type)}o&&(o.text=s.text?s.text:s.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?b(o,"iconSVG","content")===null?a.push(o):i.push(o):a.push(o))}),a.push(...r),a.length?{buttonList:i,overflowMenuItemList:a}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=b(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
12
  <circle cx="16" cy="16" r="2"></circle>
13
13
  <circle cx="16" cy="24" r="2"></circle>`},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:a,exportAsJPG:s,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:p}=b(i,"locale","translations","toolbar");let f;switch(t){case Tt.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 Tt.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 Tt.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 Tt.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 Tt.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 Tt.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(S.Modal.SHOW)};break;case Tt.EXPORT_CSV:f={id:"toolbar-export-CSV",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Tt.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Tt.EXPORT_JPG:f={id:"toolbar-export-JPG",title:s,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 Tt.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
14
  <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Tt.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
15
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Tt.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case Tt.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case Tt.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case Tt.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};bv.buttonID=0;let Co=bv;const xv=class q0 extends yt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=q0.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=b(r,"growth");return i===ht.PREFERRED||i===ht.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>b(t,"growth")===ht.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=N.getHTMLElementSize(n.node()),a=this.configs.direction===Nt.ROW||this.configs.direction===Nt.ROW_REVERSE,s=b(this.model.getOptions(),"style","prefix"),o=n.classed(`${Ee}--${s}--layout-row`,this.configs.direction===Nt.ROW).classed(`${Ee}--${s}--layout-row-reverse`,this.configs.direction===Nt.ROW_REVERSE).classed(`${Ee}--${s}--layout-column`,this.configs.direction===Nt.COLUMN).classed(`${Ee}--${s}--layout-column-reverse`,this.configs.direction===Nt.COLUMN_REVERSE).classed(`${Ee}--${s}--layout-alignitems-center`,this.configs.alignItems===sr.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",c=>`layout-child layout-child-${this._instanceID} ${c.id}`).each(function(c){c.components.forEach(u=>{const d=D(this),h=b(c,"renderType")===rt.SVG;u.setParent(h?N.appendOrSelect(d,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):d);const p=b(c,"growth");(p===ht.PREFERRED||p===ht.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(c){const u=b(c,"growth"),d=b(c,"renderType")===rt.SVG?N.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):N.getHTMLElementSize(this);if(u===ht.PREFERRED){const h=a?d.width:d.height,p=a?r:i;c.size=h/p*100}}),o.exit().remove(),this.children.filter(c=>b(c,"growth")===ht.STRETCH).forEach(c=>{c.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);a?l.style("width",c=>`${c.size/100*r}px`).style("height","100%"):l.style("height",c=>`${c.size/100*i}px`).style("width","100%"),l.each(function(c){c.components.forEach(u=>{b(c,"growth")===ht.STRETCH&&u.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())})}};xv.instanceID=Math.floor(Math.random()*99999999999);let Ie=xv;class Vn extends yt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||lf.default.size}px`).style("height",`${this.configs.size||lf.default.size}px`).attr("opacity",0)}}var yL={prefix:"bx",selectorTabbable:`
15
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Tt.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case Tt.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case Tt.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case Tt.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};bv.buttonID=0;let Co=bv;const xv=class q0 extends yt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=q0.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=b(r,"growth");return i===ht.PREFERRED||i===ht.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>b(t,"growth")===ht.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=N.getHTMLElementSize(n.node()),a=this.configs.direction===Nt.ROW||this.configs.direction===Nt.ROW_REVERSE,s=b(this.model.getOptions(),"style","prefix"),o=n.classed(`${Ee}--${s}--layout-row`,this.configs.direction===Nt.ROW).classed(`${Ee}--${s}--layout-row-reverse`,this.configs.direction===Nt.ROW_REVERSE).classed(`${Ee}--${s}--layout-column`,this.configs.direction===Nt.COLUMN).classed(`${Ee}--${s}--layout-column-reverse`,this.configs.direction===Nt.COLUMN_REVERSE).classed(`${Ee}--${s}--layout-alignitems-center`,this.configs.alignItems===sr.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",c=>`layout-child layout-child-${this._instanceID} ${c.id}`).each(function(c){c.components.forEach(u=>{const d=R(this),h=b(c,"renderType")===rt.SVG;u.setParent(h?N.appendOrSelect(d,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):d);const p=b(c,"growth");(p===ht.PREFERRED||p===ht.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(c){const u=b(c,"growth"),d=b(c,"renderType")===rt.SVG?N.getSVGElementSize(R(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):N.getHTMLElementSize(this);if(u===ht.PREFERRED){const h=a?d.width:d.height,p=a?r:i;c.size=h/p*100}}),o.exit().remove(),this.children.filter(c=>b(c,"growth")===ht.STRETCH).forEach(c=>{c.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);a?l.style("width",c=>`${c.size/100*r}px`).style("height","100%"):l.style("height",c=>`${c.size/100*i}px`).style("width","100%"),l.each(function(c){c.components.forEach(u=>{b(c,"growth")===ht.STRETCH&&u.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())})}};xv.instanceID=Math.floor(Math.random()*99999999999);let Ie=xv;class Vn extends yt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||lf.default.size}px`).style("height",`${this.configs.size||lf.default.size}px`).attr("opacity",0)}}var yD={prefix:"bx",selectorTabbable:`
16
16
  a[href], area[href], input:not([disabled]):not([tabindex='-1']),
17
17
  button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),
18
18
  textarea:not([disabled]):not([tabindex='-1']),
@@ -22,9 +22,9 @@
22
22
  button:not([disabled]),select:not([disabled]),
23
23
  textarea:not([disabled]),
24
24
  iframe, object, embed, *[tabindex], *[contenteditable=true]
25
- `},Zu=yL;function bL(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function xL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _L(e){return SL(e)||wL(e)||OL(e)||EL()}function EL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OL(e,t){if(e){if(typeof e=="string")return Xu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xu(e,t)}}function wL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SL(e){if(Array.isArray(e))return Xu(e)}function Xu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _v(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,_L(_v(n))):t.push(n),t},[])}function TL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _v(t).reduce(function(r,i){return i(r)},function(){function r(){xL(this,r)}return bL(r)}())}function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function $L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ev(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ML(e,t,n){return t&&Ev(e.prototype,t),n&&Ev(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function CL(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qu(e,t)}function Qu(e,t){return Qu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Qu(e,t)}function AL(e){var t=RL();return function(){var n=Ao(e),r;if(t){var i=Ao(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kL(this,r)}}function kL(e,t){if(t&&(Ku(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ov(e)}function Ov(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RL(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ao(e){return Ao=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ao(e)}function LL(e){var t=function(n){CL(i,n);var r=AL(i);function i(a){var s,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if($L(this,i),s=r.call(this,a,o),s.children=[],!a||a.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return s.element=a,s.options=Object.assign(Object.create(s.constructor.options),o),s.constructor.components.set(s.element,Ov(s)),s}return ML(i,[{key:"release",value:function(){for(var a=this.children.pop();a;a=this.children.pop())a.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(a,s){return this.components.get(a)||new this(a,s)}}]),i}(e);return t}function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}function DL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function NL(e,t,n){return t&&IL(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ko(){return typeof Reflect<"u"&&Reflect.get?ko=Reflect.get:ko=function(e,t,n){var r=PL(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ko.apply(this,arguments)}function PL(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=yi(e),e!==null););return e}function UL(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&th(e,t)}function th(e,t){return th=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},th(e,t)}function BL(e){var t=FL();return function(){var n=yi(e),r;if(t){var i=yi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return HL(this,r)}}function HL(e,t){if(t&&(Ju(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VL(e)}function VL(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FL(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yi(e){return yi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},yi(e)}function GL(e){var t=function(n){UL(i,n);var r=BL(i);function i(){var a;DL(this,i);for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];return a=r.call.apply(r,[this].concat(o)),a.handles=new Set,a}return NL(i,[{key:"manage",value:function(a){return this.handles.add(a),a}},{key:"unmanage",value:function(a){return this.handles.delete(a),a}},{key:"release",value:function(){var a=this;return this.handles.forEach(function(s){s.release(),a.handles.delete(s)}),ko(yi(i.prototype),"release",this).call(this)}}]),i}(e);return t}function Ba(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}function jL(e){return YL(e)||qL(e)||WL(e)||zL()}function zL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WL(e,t){if(e){if(typeof e=="string")return nh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nh(e,t)}}function qL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YL(e){if(Array.isArray(e))return nh(e)}function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function KL(e,t,n){return t&&XL(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QL(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rh(e,t)}function rh(e,t){return rh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},rh(e,t)}function JL(e){var t=nD();return function(){var n=Ro(e),r;if(t){var i=Ro(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return tD(this,r)}}function tD(e,t){if(t&&(eh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eD(e)}function eD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ro(e){return Ro=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ro(e)}function rD(e){var t=function(n){QL(i,n);var r=JL(i);function i(){return ZL(this,i),r.apply(this,arguments)}return KL(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var a=this,s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];var c=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,d=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(c,u)){d&&d(null,!0);return}var h={group:u&&u.group,state:c},p=[h.group,c].filter(Boolean).join("-").split("-").map(function(x){return x[0].toUpperCase()+x.substr(1)}).join(""),f=new CustomEvent(this.options["eventBefore".concat(p)],{bubbles:!0,cancelable:!0,detail:u}),v=u&&u.delegatorNode||this.element,m=!v.dispatchEvent(f);if(m){if(d){var y=new Error("Changing state (".concat(JSON.stringify(h),") has been canceled."));y.canceled=!0,d(y)}}else{var g=[c,u].filter(Boolean);this._changeState.apply(this,jL(g).concat([function(){v.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:u})),d&&d()}]))}}}]),i}(e);return t}function ih(e,t){var n=e.target,r=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var i=n.closest(t);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function wv(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function ah(e){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ah(e)}function iD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sD(e,t,n){return t&&aD(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sh(e,t)}function sh(e,t){return sh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},sh(e,t)}function lD(e){var t=hD();return function(){var n=Lo(e),r;if(t){var i=Lo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cD(this,r)}}function cD(e,t){if(t&&(ah(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uD(e)}function uD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lo(e){return Lo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Lo(e)}function dD(e){var t=function(n){oD(i,n);var r=lD(i);function i(){return iD(this,i),r.apply(this,arguments)}return sD(i,[{key:"show",value:function(a,s){(!a||typeof a=="function")&&(s=a),this.changeState("shown",wv(a),s)}},{key:"hide",value:function(a,s){(!a||typeof a=="function")&&(s=a),this.changeState("hidden",wv(a),s)}}]),i}(e);return t}var pD=[rD,dD];function Sv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fD(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 Tv=function(){};process.env.NODE_ENV!=="production"&&(Tv=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var a=0,s="Warning: "+t.replace(/%s/g,function(){return n[a++]});typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}});var mD=Tv;const gD=Sv(mD);function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function vD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bD(e,t,n){return n&&yD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lh(e,t)}function lh(e,t){return lh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},lh(e,t)}function _D(e){var t=wD();return function(){var n=Do(e),r;if(t){var i=Do(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ED(this,r)}}function ED(e,t){if(t&&(oh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OD(e)}function OD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Do(e){return Do=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Do(e)}function SD(e){var t=function(n){xD(i,n);var r=_D(i);function i(){return vD(this,i),r.apply(this,arguments)}return bD(i,null,[{key:"init",value:function(){var a=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=Object.assign(Object.create(this.options),o);if(!s||s.nodeType!==Node.ELEMENT_NODE&&s.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(s.nodeType===Node.ELEMENT_NODE&&s.matches(l.selectorInit))this.create(s,o);else{var c=l.initEventNames.map(function(u){return Ba(s,u,function(d){var h=ih(d,"[".concat(l.attribInitTarget,"]"));if(h){d.delegateTarget=h;var p=h.ownerDocument.querySelectorAll(h.getAttribute(l.attribInitTarget));if(p.length>1)throw new Error("Target widget must be unique.");if(p.length===1){h.tagName==="A"&&d.preventDefault();var f=a.create(p[0],o);typeof f.createdByLauncher=="function"&&f.createdByLauncher(d)}}})});return{release:function(){for(var u=c.pop();u;u=c.pop())u.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(e)}function TD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $D(e,t,n){return t&&$v(e.prototype,t),n&&$v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function MD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uh(e,t)}function uh(e,t){return uh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},uh(e,t)}function CD(e){var t=RD();return function(){var n=Io(e),r;if(t){var i=Io(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return AD(this,r)}}function AD(e,t){if(t&&(ch(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kD(e)}function kD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Io(e){return Io=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Io(e)}var LD=function(e){MD(n,e);var t=CD(n);function n(r,i){var a;return TD(this,n),a=t.call(this,r,i),a._handleFocusinListener=void 0,a._handleKeydownListener=void 0,a._handleFocusin=function(s){var o=a.element.querySelector(a.options.selectorModalContainer)||a.element;a.element.classList.contains(a.options.classVisible)&&!o.contains(s.target)&&a.options.selectorsFloatingMenus.every(function(l){return!ih(s,l)})&&a.element.querySelector(Zu.selectorTabbable).focus()},a._hookCloseActions(),a}return $D(n,[{key:"createdByLauncher",value:function(r){this.show(r)}},{key:"shouldStateBeChanged",value:function(r){return r==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(r,i,a){var s=this,o,l=function(){if(o&&(o=s.unmanage(o).release()),r==="shown"&&s.element.offsetWidth>0&&s.element.offsetHeight>0){s.previouslyFocusedNode=s.element.ownerDocument.activeElement;var d=s.element.querySelector(s.options.selectorPrimaryFocus)||s.element.querySelector(Zu.selectorTabbable);d.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&gD(d,"Modals need to contain a focusable element by either using "+"`".concat(s.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}a()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),r==="shown"){var c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(Ba(this.element.ownerDocument,u,this._handleFocusin,!c))}r==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):r==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Ba(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage(Ba(this.element,"click",function(i){var a=ih(i,r.options.selectorModalClose);a&&(i.delegateTarget=a),(a||i.target===r.element)&&r.hide(i)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ba(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=Zu.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(r,"--overflow-menu-options"),".".concat(r,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(r,"--modal-container"),classVisible:"is-visible",classBody:"".concat(r,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(TL(LL,SD,pD,GL));class No extends yt{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),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),LD.create(this.modal.node()).show(),document.addEventListener("modal-hidden",this.handleHideModal)},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null),document.removeEventListener("modal-hidden",this.handleHideModal)},this.init()}addEventListeners(){this.services.events.addEventListener(S.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(S.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=b(n,"locale","translations","tabularRep"),a=b(n,"style","prefix"),s=this.model.getTabularDataArray();return`
25
+ `},Zu=yD;function bD(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function xD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _D(e){return SD(e)||wD(e)||OD(e)||ED()}function ED(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OD(e,t){if(e){if(typeof e=="string")return Xu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xu(e,t)}}function wD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SD(e){if(Array.isArray(e))return Xu(e)}function Xu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _v(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,_D(_v(n))):t.push(n),t},[])}function TD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _v(t).reduce(function(r,i){return i(r)},function(){function r(){xD(this,r)}return bD(r)}())}function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function $D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ev(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function MD(e,t,n){return t&&Ev(e.prototype,t),n&&Ev(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function CD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qu(e,t)}function Qu(e,t){return Qu=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Qu(e,t)}function AD(e){var t=LD();return function(){var n=Ao(e),r;if(t){var i=Ao(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kD(this,r)}}function kD(e,t){if(t&&(Ku(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ov(e)}function Ov(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ao(e){return Ao=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ao(e)}function DD(e){var t=function(n){CD(i,n);var r=AD(i);function i(a){var s,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if($D(this,i),s=r.call(this,a,o),s.children=[],!a||a.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return s.element=a,s.options=Object.assign(Object.create(s.constructor.options),o),s.constructor.components.set(s.element,Ov(s)),s}return MD(i,[{key:"release",value:function(){for(var a=this.children.pop();a;a=this.children.pop())a.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(a,s){return this.components.get(a)||new this(a,s)}}]),i}(e);return t}function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}function RD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ID(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ND(e,t,n){return t&&ID(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ko(){return typeof Reflect<"u"&&Reflect.get?ko=Reflect.get:ko=function(e,t,n){var r=PD(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ko.apply(this,arguments)}function PD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=yi(e),e!==null););return e}function UD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&th(e,t)}function th(e,t){return th=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},th(e,t)}function BD(e){var t=FD();return function(){var n=yi(e),r;if(t){var i=yi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return HD(this,r)}}function HD(e,t){if(t&&(Ju(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VD(e)}function VD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yi(e){return yi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},yi(e)}function GD(e){var t=function(n){UD(i,n);var r=BD(i);function i(){var a;RD(this,i);for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];return a=r.call.apply(r,[this].concat(o)),a.handles=new Set,a}return ND(i,[{key:"manage",value:function(a){return this.handles.add(a),a}},{key:"unmanage",value:function(a){return this.handles.delete(a),a}},{key:"release",value:function(){var a=this;return this.handles.forEach(function(s){s.release(),a.handles.delete(s)}),ko(yi(i.prototype),"release",this).call(this)}}]),i}(e);return t}function Ba(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}function jD(e){return YD(e)||qD(e)||WD(e)||zD()}function zD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WD(e,t){if(e){if(typeof e=="string")return nh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nh(e,t)}}function qD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YD(e){if(Array.isArray(e))return nh(e)}function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function KD(e,t,n){return t&&XD(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rh(e,t)}function rh(e,t){return rh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},rh(e,t)}function JD(e){var t=nR();return function(){var n=Lo(e),r;if(t){var i=Lo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return tR(this,r)}}function tR(e,t){if(t&&(eh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eR(e)}function eR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lo(e){return Lo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Lo(e)}function rR(e){var t=function(n){QD(i,n);var r=JD(i);function i(){return ZD(this,i),r.apply(this,arguments)}return KD(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var a=this,s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];var c=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,d=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(c,u)){d&&d(null,!0);return}var h={group:u&&u.group,state:c},p=[h.group,c].filter(Boolean).join("-").split("-").map(function(x){return x[0].toUpperCase()+x.substr(1)}).join(""),f=new CustomEvent(this.options["eventBefore".concat(p)],{bubbles:!0,cancelable:!0,detail:u}),v=u&&u.delegatorNode||this.element,m=!v.dispatchEvent(f);if(m){if(d){var y=new Error("Changing state (".concat(JSON.stringify(h),") has been canceled."));y.canceled=!0,d(y)}}else{var g=[c,u].filter(Boolean);this._changeState.apply(this,jD(g).concat([function(){v.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:u})),d&&d()}]))}}}]),i}(e);return t}function ih(e,t){var n=e.target,r=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var i=n.closest(t);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function wv(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function ah(e){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ah(e)}function iR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sR(e,t,n){return t&&aR(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sh(e,t)}function sh(e,t){return sh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},sh(e,t)}function lR(e){var t=hR();return function(){var n=Do(e),r;if(t){var i=Do(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cR(this,r)}}function cR(e,t){if(t&&(ah(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uR(e)}function uR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Do(e){return Do=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Do(e)}function dR(e){var t=function(n){oR(i,n);var r=lR(i);function i(){return iR(this,i),r.apply(this,arguments)}return sR(i,[{key:"show",value:function(a,s){(!a||typeof a=="function")&&(s=a),this.changeState("shown",wv(a),s)}},{key:"hide",value:function(a,s){(!a||typeof a=="function")&&(s=a),this.changeState("hidden",wv(a),s)}}]),i}(e);return t}var pR=[rR,dR];function Sv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fR(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 Tv=function(){};process.env.NODE_ENV!=="production"&&(Tv=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var a=0,s="Warning: "+t.replace(/%s/g,function(){return n[a++]});typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}});var mR=Tv;const gR=Sv(mR);function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function vR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bR(e,t,n){return n&&yR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lh(e,t)}function lh(e,t){return lh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},lh(e,t)}function _R(e){var t=wR();return function(){var n=Ro(e),r;if(t){var i=Ro(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ER(this,r)}}function ER(e,t){if(t&&(oh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OR(e)}function OR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ro(e){return Ro=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ro(e)}function SR(e){var t=function(n){xR(i,n);var r=_R(i);function i(){return vR(this,i),r.apply(this,arguments)}return bR(i,null,[{key:"init",value:function(){var a=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=Object.assign(Object.create(this.options),o);if(!s||s.nodeType!==Node.ELEMENT_NODE&&s.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(s.nodeType===Node.ELEMENT_NODE&&s.matches(l.selectorInit))this.create(s,o);else{var c=l.initEventNames.map(function(u){return Ba(s,u,function(d){var h=ih(d,"[".concat(l.attribInitTarget,"]"));if(h){d.delegateTarget=h;var p=h.ownerDocument.querySelectorAll(h.getAttribute(l.attribInitTarget));if(p.length>1)throw new Error("Target widget must be unique.");if(p.length===1){h.tagName==="A"&&d.preventDefault();var f=a.create(p[0],o);typeof f.createdByLauncher=="function"&&f.createdByLauncher(d)}}})});return{release:function(){for(var u=c.pop();u;u=c.pop())u.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(e)}function TR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $R(e,t,n){return t&&$v(e.prototype,t),n&&$v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function MR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uh(e,t)}function uh(e,t){return uh=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},uh(e,t)}function CR(e){var t=LR();return function(){var n=Io(e),r;if(t){var i=Io(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return AR(this,r)}}function AR(e,t){if(t&&(ch(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kR(e)}function kR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Io(e){return Io=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Io(e)}var DR=function(e){MR(n,e);var t=CR(n);function n(r,i){var a;return TR(this,n),a=t.call(this,r,i),a._handleFocusinListener=void 0,a._handleKeydownListener=void 0,a._handleFocusin=function(s){var o=a.element.querySelector(a.options.selectorModalContainer)||a.element;a.element.classList.contains(a.options.classVisible)&&!o.contains(s.target)&&a.options.selectorsFloatingMenus.every(function(l){return!ih(s,l)})&&a.element.querySelector(Zu.selectorTabbable).focus()},a._hookCloseActions(),a}return $R(n,[{key:"createdByLauncher",value:function(r){this.show(r)}},{key:"shouldStateBeChanged",value:function(r){return r==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(r,i,a){var s=this,o,l=function(){if(o&&(o=s.unmanage(o).release()),r==="shown"&&s.element.offsetWidth>0&&s.element.offsetHeight>0){s.previouslyFocusedNode=s.element.ownerDocument.activeElement;var d=s.element.querySelector(s.options.selectorPrimaryFocus)||s.element.querySelector(Zu.selectorTabbable);d.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&gR(d,"Modals need to contain a focusable element by either using "+"`".concat(s.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}a()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),r==="shown"){var c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(Ba(this.element.ownerDocument,u,this._handleFocusin,!c))}r==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):r==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Ba(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage(Ba(this.element,"click",function(i){var a=ih(i,r.options.selectorModalClose);a&&(i.delegateTarget=a),(a||i.target===r.element)&&r.hide(i)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ba(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=Zu.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(r,"--overflow-menu-options"),".".concat(r,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(r,"--modal-container"),classVisible:"is-visible",classBody:"".concat(r,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(TD(DD,SR,pR,GD));class No extends yt{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),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),DR.create(this.modal.node()).show(),document.addEventListener("modal-hidden",this.handleHideModal)},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null),document.removeEventListener("modal-hidden",this.handleHideModal)},this.init()}addEventListeners(){this.services.events.addEventListener(S.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(S.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=b(n,"locale","translations","tabularRep"),a=b(n,"style","prefix"),s=this.model.getTabularDataArray();return`
28
28
  <div class="cds--modal-container">
29
29
  <div class="cds--modal-header">
30
30
 
@@ -61,7 +61,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
61
61
  <div class="${Ee}--${a}-modal-footer-spacer"></div>
62
62
  <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>
63
63
  </div>
64
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=D(this.services.domUtils.getHolder()),i=b(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${Ee}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ha extends yt{constructor(){super(...arguments),this.type="title",this.renderType=rt.HTML}render(t=!1){const n=this.getComponentContainer(),r=b(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(a=>yn(a)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const a=this;i.on("mouseover",function(s){a.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:i,content:i.text()})}).on("mousemove",function(s){a.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("mouseout",function(){a.services.events.dispatchEvent(S.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),a=t.text(),s=this.getSubstringIndex(t.node(),0,a.length-1,n-i);t.html(a.substring(0,s-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(S.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(S.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(S.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const a=Math.floor((r+n)/2);return t.getSubStringLength(0,a)>i?this.getSubstringIndex(t,n,a,i):t.getSubStringLength(0,a)<i?t.getSubStringLength(0,a+1)>i?a:this.getSubstringIndex(t,a,r,i):a}}class hh extends yt{constructor(){super(...arguments),this.type="legend",this.renderType=rt.HTML}render(t=!1){const n=this.getOptions(),r=b(n,"legend"),i=b(r,"alignment"),a=b(n,"legend","orientation");let s=this.model.getDataGroups();const{DISABLED:o}=Yt.items.status,l=s.some(g=>g.status===o),c=b(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===te.CENTER).classed("right-aligned",i===te.RIGHT).classed(a,!0).classed("has-deactivated-items",l).attr("role",pt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(s=this.sortDataGroups(s,c));const d=u.selectAll("div.legend-item").data(s,g=>g.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});const p=b(this.getOptions(),"legend","clickable");u.classed("clickable",p&&s.length>1);const f=Yt.checkbox.radius,v=h.append("div").classed("checkbox",!0),m=v.merge(d.select("div.checkbox")).attr("role",pt.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(g,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:g})=>g===Yt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",g=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:g.name,originalClassName:"checkbox"})).style("background",g=>g.status===Yt.items.status.ACTIVE?this.model.getFillColor(g.name)||this.model.getStrokeColor(g.name):null).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});v.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 y=b(n,"legend","additionalItems");if(y&&s.length){const g=this,x=u.selectAll("div.additional-item").data(y);x.exit().remove();const O=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(A,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+I}-title`));O.selectAll("*").remove();let E,w=1;O.append("svg").classed("icon",!0).each(function(A){const I=D(this);!E||E!=A.type?(E=A.type,w=1):w++,g.addAdditionalItem(I,A,w)}),O.append("p").merge(O.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.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:a}=Yt.area;if(n.type===ne.RADIUS?t.style("width",`${a}px`).style("height",`${a}px`):t.style("width",`${i}px`).style("height",`${a}px`),n.type===ne.RADIUS){const{iconData:s,fill:o,stroke:l}=Yt.radius;t.attr("fill","none").selectAll("circle").data(s).enter().append("circle").classed("radius",!0).attr("role",pt.IMG).attr("aria-label","radius").attr("cx",c=>c.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===ne.LINE){const s=Yt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",pt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",s.yPosition).attr("x2",i).attr("y2",s.yPosition).style("stroke",n.stroke?n.stroke:s.stroke).style("stroke-width",s.strokeWidth)}else if(n.type===ne.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",pt.IMG).attr("aria-label","area").attr("width",i).attr("height",a).style("fill",r>3&&!n.fill?Yt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===ne.SIZE){const{iconData:s,fill:o,stroke:l}=Yt.size;t.attr("fill","none").attr("role",pt.IMG).attr("aria-label","size").selectAll("rect").data(s).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===ne.QUARTILE){const{iconData:s}=Yt.quartile;t.selectAll("rect").attr("role",pt.IMG).attr("aria-label","quartile").data(s).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===ne.ZOOM){const{iconData:s,color:o}=b(Yt,"zoom"),l=t.attr("role",pt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(s).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=b(this.getOptions(),"legend","truncation"),r=b(n,"type"),i=b(n,"threshold"),a=b(n,"numCharacter"),s=t.selectAll("div.legend-item p");s.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==Ue.NONE?s.html(function(o){const l=yn(o.name);return l.length>i&&l.length!==a?la(l,r,a):l}):s.html(o=>yn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=b(r,"legend"),a=b(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(s){t.services.events.dispatchEvent(S.Legend.ITEM_HOVER,{hoveredElement:D(this)});const o=D(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>a.threshold&&a.numCharacter<l.name.length&&a.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,content:l.name})}).on("mousemove",function(s){D(this).datum().name.length>a.threshold&&a.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(){t.services.events.dispatchEvent(S.Legend.ITEM_CLICK,{clickedElement:D(this)});const s=D(this).datum();t.model.toggleDataLabel(s.name)}).on("mouseout",function(){const s=D(this);s.select("div.checkbox").classed("hovered",!1),s.datum().name.length>a.threshold&&a.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.HIDE),t.services.events.dispatchEvent(S.Legend.ITEM_MOUSEOUT,{hoveredElement:s})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(s){s.key&&s.key==="Tab"&&t.services.events.dispatchEvent(S.Legend.ITEM_HOVER,{hoveredElement:D(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(s,o){s.key&&s.key===" "?(s.preventDefault(),t.model.toggleDataLabel(o.name)):s.key&&s.key==="Tab"&&t.services.events.dispatchEvent(S.Legend.ITEM_MOUSEOUT,{hoveredElement:D(this)})}),n.selectAll("g.additional-item").on("mouseover",function(s){const o=D(this),l=o.datum();l.name.length>a.threshold&&t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,content:l.name})})}}class Mv extends yt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=rt.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(),[a,s]=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}`);s-a>0&&c.attr("x",a).attr("y",l).attr("width",s-a).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class DD extends Mv{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 bi,Qt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Qt||(Qt={}));var Cv=(bi={},bi[Qt.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)}},bi[Qt.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)}},bi[Qt.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)}},bi[Qt.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)}},bi),Av=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Po=function(){function e(t){t===void 0&&(t={}),this.positions=Cv,this.positions=Object.assign({},Cv,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 a=t.getBoundingClientRect(),s=document.body.getBoundingClientRect();return{top:a.top-s.top+r.top,left:a.left-s.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),a=t.getBoundingClientRect();return this.calculatePosition(i,a,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),a=t.getBoundingClientRect();return this.calculatePosition(i,a,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var a=i(t),s=t.getBoundingClientRect();return this.calculatePosition(a,s,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,a){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),a===void 0&&(a=this.findPosition.bind(this));var o=r.map(function(l){var c=a(t,n,l),u=s.getPlacementBox(n,c),d=0,h=0,p=i();u.top<p.top?d=p.top-u.top:u.bottom>p.height&&(d=u.bottom-p.height),u.left<p.left?h=p.left-u.left:u.right>p.width&&(h=u.right-p.width),d&&!h?h=1:h&&!d&&(d=1);var f=n.offsetHeight*n.offsetWidth,v=d*h,m=f-v,y=m/f;return{placement:l,weight:y}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var s=function(o,l,c){return a.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,s)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Av.innerHeight,width:Av.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 Po;class dh extends yt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new Po,this.handleShowTooltip=i=>{const a=i.detail.data||i.detail.items;let s;const o=this.formatItems(this.getItems(i));i.detail.content?s=`<div class="title-tooltip"><p>${Mo(i.detail.content)}</p></div>`:s=Mo(this.getTooltipHTML(o));const l=N.appendOrSelect(this.tooltip,"div.content-box");if(b(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${Mo(i.detail.content)}</p></div>`;l.html(c)}else l.html(`<div class="title-tooltip"><p>${Mo(this.model.getOptions().tooltip.customHTML(a,s))}</p></div>`);else l.html(s);l.selectAll(".datapoint-tooltip").each(function(c,u){const d=o[u];o[u]&&o[u].color&&D(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",d.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(S.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==S.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(S.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(S.Tooltip.MOVE,null),this.services.events.removeEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(S.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=b(n,"tooltip","truncation","type"),i=b(n,"tooltip","truncation","threshold"),a=b(n,"tooltip","truncation","numCharacter");return r!==Ue.NONE?t.map(s=>{const o=s.labelIcon?12:0;return s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s.label&&s.label.length+o>i&&(s.label=la(s.label,r,a)),s.value&&s.value.length>i&&(s.value=la(s.value,r,a)),s}):t.map(s=>(s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
64
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=R(this.services.domUtils.getHolder()),i=b(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${Ee}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ha extends yt{constructor(){super(...arguments),this.type="title",this.renderType=rt.HTML}render(t=!1){const n=this.getComponentContainer(),r=b(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(a=>yn(a)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const a=this;i.on("mouseover",function(s){a.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:i,content:i.text()})}).on("mousemove",function(s){a.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("mouseout",function(){a.services.events.dispatchEvent(S.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),a=t.text(),s=this.getSubstringIndex(t.node(),0,a.length-1,n-i);t.html(a.substring(0,s-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(S.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(S.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(S.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const a=Math.floor((r+n)/2);return t.getSubStringLength(0,a)>i?this.getSubstringIndex(t,n,a,i):t.getSubStringLength(0,a)<i?t.getSubStringLength(0,a+1)>i?a:this.getSubstringIndex(t,a,r,i):a}}class hh extends yt{constructor(){super(...arguments),this.type="legend",this.renderType=rt.HTML}render(t=!1){const n=this.getOptions(),r=b(n,"legend"),i=b(r,"alignment"),a=b(n,"legend","orientation");let s=this.model.getDataGroups();const{DISABLED:o}=Yt.items.status,l=s.some(g=>g.status===o),c=b(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===te.CENTER).classed("right-aligned",i===te.RIGHT).classed(a,!0).classed("has-deactivated-items",l).attr("role",pt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(s=this.sortDataGroups(s,c));const d=u.selectAll("div.legend-item").data(s,g=>g.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});const p=b(this.getOptions(),"legend","clickable");u.classed("clickable",p&&s.length>1);const f=Yt.checkbox.radius,v=h.append("div").classed("checkbox",!0),m=v.merge(d.select("div.checkbox")).attr("role",pt.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(g,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:g})=>g===Yt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",g=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:g.name,originalClassName:"checkbox"})).style("background",g=>g.status===Yt.items.status.ACTIVE?this.model.getFillColor(g.name)||this.model.getStrokeColor(g.name):null).classed("active",function(g){return g.status===Yt.items.status.ACTIVE});v.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 y=b(n,"legend","additionalItems");if(y&&s.length){const g=this,x=u.selectAll("div.additional-item").data(y);x.exit().remove();const O=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(A,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+I}-title`));O.selectAll("*").remove();let E,w=1;O.append("svg").classed("icon",!0).each(function(A){const I=R(this);!E||E!=A.type?(E=A.type,w=1):w++,g.addAdditionalItem(I,A,w)}),O.append("p").merge(O.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.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:a}=Yt.area;if(n.type===ne.RADIUS?t.style("width",`${a}px`).style("height",`${a}px`):t.style("width",`${i}px`).style("height",`${a}px`),n.type===ne.RADIUS){const{iconData:s,fill:o,stroke:l}=Yt.radius;t.attr("fill","none").selectAll("circle").data(s).enter().append("circle").classed("radius",!0).attr("role",pt.IMG).attr("aria-label","radius").attr("cx",c=>c.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===ne.LINE){const s=Yt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",pt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",s.yPosition).attr("x2",i).attr("y2",s.yPosition).style("stroke",n.stroke?n.stroke:s.stroke).style("stroke-width",s.strokeWidth)}else if(n.type===ne.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",pt.IMG).attr("aria-label","area").attr("width",i).attr("height",a).style("fill",r>3&&!n.fill?Yt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===ne.SIZE){const{iconData:s,fill:o,stroke:l}=Yt.size;t.attr("fill","none").attr("role",pt.IMG).attr("aria-label","size").selectAll("rect").data(s).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===ne.QUARTILE){const{iconData:s}=Yt.quartile;t.selectAll("rect").attr("role",pt.IMG).attr("aria-label","quartile").data(s).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===ne.ZOOM){const{iconData:s,color:o}=b(Yt,"zoom"),l=t.attr("role",pt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(s).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=b(this.getOptions(),"legend","truncation"),r=b(n,"type"),i=b(n,"threshold"),a=b(n,"numCharacter"),s=t.selectAll("div.legend-item p");s.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==Ue.NONE?s.html(function(o){const l=yn(o.name);return l.length>i&&l.length!==a?la(l,r,a):l}):s.html(o=>yn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=b(r,"legend"),a=b(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(s){t.services.events.dispatchEvent(S.Legend.ITEM_HOVER,{hoveredElement:R(this)});const o=R(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>a.threshold&&a.numCharacter<l.name.length&&a.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,content:l.name})}).on("mousemove",function(s){R(this).datum().name.length>a.threshold&&a.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(){t.services.events.dispatchEvent(S.Legend.ITEM_CLICK,{clickedElement:R(this)});const s=R(this).datum();t.model.toggleDataLabel(s.name)}).on("mouseout",function(){const s=R(this);s.select("div.checkbox").classed("hovered",!1),s.datum().name.length>a.threshold&&a.type!==Ue.NONE&&t.services.events.dispatchEvent(S.Tooltip.HIDE),t.services.events.dispatchEvent(S.Legend.ITEM_MOUSEOUT,{hoveredElement:s})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(s){s.key&&s.key==="Tab"&&t.services.events.dispatchEvent(S.Legend.ITEM_HOVER,{hoveredElement:R(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(s,o){s.key&&s.key===" "?(s.preventDefault(),t.model.toggleDataLabel(o.name)):s.key&&s.key==="Tab"&&t.services.events.dispatchEvent(S.Legend.ITEM_MOUSEOUT,{hoveredElement:R(this)})}),n.selectAll("g.additional-item").on("mouseover",function(s){const o=R(this),l=o.datum();l.name.length>a.threshold&&t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,content:l.name})})}}class Mv extends yt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=rt.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(),[a,s]=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}`);s-a>0&&c.attr("x",a).attr("y",l).attr("width",s-a).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class RR extends Mv{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 bi,Qt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Qt||(Qt={}));var Cv=(bi={},bi[Qt.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)}},bi[Qt.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)}},bi[Qt.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)}},bi[Qt.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)}},bi),Av=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Po=function(){function e(t){t===void 0&&(t={}),this.positions=Cv,this.positions=Object.assign({},Cv,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 a=t.getBoundingClientRect(),s=document.body.getBoundingClientRect();return{top:a.top-s.top+r.top,left:a.left-s.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),a=t.getBoundingClientRect();return this.calculatePosition(i,a,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),a=t.getBoundingClientRect();return this.calculatePosition(i,a,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var a=i(t),s=t.getBoundingClientRect();return this.calculatePosition(a,s,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,a){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),a===void 0&&(a=this.findPosition.bind(this));var o=r.map(function(l){var c=a(t,n,l),u=s.getPlacementBox(n,c),d=0,h=0,p=i();u.top<p.top?d=p.top-u.top:u.bottom>p.height&&(d=u.bottom-p.height),u.left<p.left?h=p.left-u.left:u.right>p.width&&(h=u.right-p.width),d&&!h?h=1:h&&!d&&(d=1);var f=n.offsetHeight*n.offsetWidth,v=d*h,m=f-v,y=m/f;return{placement:l,weight:y}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var s=function(o,l,c){return a.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,s)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Av.innerHeight,width:Av.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 Po;class dh extends yt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new Po,this.handleShowTooltip=i=>{const a=i.detail.data||i.detail.items,s=R(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${Mo(i.detail.content)}</p></div>`:o=Mo(this.getTooltipHTML(l));const c=N.appendOrSelect(this.tooltip,"div.content-box");if(b(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${Mo(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${Mo(this.model.getOptions().tooltip.customHTML(a,o,s))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&R(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(S.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==S.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(S.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(S.Tooltip.MOVE,null),this.services.events.removeEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(S.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=b(n,"tooltip","truncation","type"),i=b(n,"tooltip","truncation","threshold"),a=b(n,"tooltip","truncation","numCharacter");return r!==Ue.NONE?t.map(s=>{const o=s.labelIcon?12:0;return s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s.label&&s.label.length+o>i&&(s.label=la(s.label,r,a)),s.value&&s.value.length>i&&(s.value=la(s.value,r,a)),s}):t.map(s=>(s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
65
65
  <div class="datapoint-tooltip${n.bold?" bold":""}">
66
66
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
67
67
  <div class="label">
@@ -70,19 +70,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
70
70
  </div>
71
71
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
72
72
  </div>
73
- </li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=b(r,"tooltip","valueFormatter"),{code:a,number:s,date:o}=b(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,a,{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,a,{month:"short",day:"numeric",year:"numeric"})}}catch{}return s(t,a)}render(t=!1){const n=this.getOptions(),r=b(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),a=b(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${Ee}--${a}--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==Qt.LEFT?i.left-=r:n==Qt.RIGHT?i.left+=r:n==Qt.TOP?i.top-=r:n==Qt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,a=this.tooltip.node(),s=this.getOptions(),o=b(s,"zoomBar","top","enabled"),l=!!b(t,"detail","noWrap"),c=Array.isArray(b(t,"detail","placements")),u=c?b(t,"detail","placements"):[Qt.RIGHT,Qt.LEFT,Qt.TOP,Qt.BOTTOM];let d,{horizontalOffset:h}=cf;const{defaultOffset:p}=cf;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=b(t,"detail","event","target"),y=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(y,a,u,()=>({top:0,left:0,width:r,height:i}));let g=this.positionService.findPosition(m,a,d,()=>this.services.domUtils.getElementOffset(m));g=this.addOffsetByPlacement(g,d,p),this.positionService.setElement(a,g);return}let f=b(t,"detail","mousePosition");if(!f)f=mr(b(t,"detail","event"),n);else{const m=b(s,"zoomBar","top","type"),y=ke.height[m];o&&(f[1]+=y+ke.spacerHeight)}f[0]/r>.9?d=Qt.LEFT:f[0]/r<.1?d=Qt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},a,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Qt.LEFT&&(h*=-1);const v=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},a,d);this.positionService.setElement(a,v)}}const kv=class ll extends yt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=rt.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),a=N.appendOrSelect(i,`g.${this.type}`),s=N.appendOrSelect(a,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===tt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const v=E=>{const w=E[1]-E[0];let A="0,"+w.toString();const I=Math.floor(l/ll.DASH_LENGTH),R=I*ll.DASH_LENGTH;for(let L=0;L<I;L++)A+=","+ll.DASH_LENGTH;A+=","+(l-R),I%2===1&&(A+=",0"),A+=","+w.toString(),A+=","+l.toString(),p.attr("stroke-dasharray",A)},m=E=>{const w=E.selection;w===null||w[0]===w[1]||(p.attr("x",parseFloat(s.attr("x"))+parseFloat(i.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),v(w))},y=(E,w)=>{const A=om().range([0,o]).domain(f);let I=[A.invert(E),A.invert(w)];I[0].valueOf()===I[1].valueOf()&&(I=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==I[0].valueOf()||f[1].valueOf()!==I[1].valueOf())&&this.services.zoom.handleDomainChange(I)};let g;const x=E=>{const w=E.selection;w!==null&&(y(w[0],w[1]),a.call(g.move,null),p.style("display","none"))};l!=0&&o!=0&&(g=ig().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",x),a.call(g));const O=this.services.zoom.getZoomRatio();i.on("click",function(E){if(E.shiftKey){const w=this.services.domUtils.getHolder(),A=mr(a.node(),w)[0];let I=A-o*O/2;I<0&&(I=0);let R=A+o*O/2;R>o&&(R=o),y(I,R)}})}}};kv.DASH_LENGTH=4;let ID=kv;class ND extends yt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=rt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=ig(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(S.ZoomBar.UPDATE,this.render.bind(this));const t=b(this.getOptions(),"zoomBar",G.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(G.TOP),i=this.services.zoom.isZoomBarLocked(G.TOP),a=b(this.getOptions(),"zoomBar",G.TOP,"type"),s=b(this.getOptions(),"axes",G.BOTTOM,"highlights"),o=ke.height[a],{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",ke.spacerHeight).attr("opacity",1).attr("fill","none"),a===qe.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):a===qe.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(),v=h.getMainXScaleType();if(p&&v===tt.TIME){let m=this.services.zoom.getZoomBarData();if(Xe(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const y=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,y);const g=this.model.get("initialZoomDomain"),x=b(this.getOptions(),"zoomBar",G.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(g&&g[0].valueOf()===x[0].valueOf()&&g[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:ct([],x),zoomDomain:x?ct([],x):y},{skipUpdate:!0}):x===null&&g!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],y)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ke(m,w=>w.value));const O=this.model.get("zoomDomain");if(a===qe.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),s)){const w=s.highlightStartMapsTo,A=s.highlightEndMapsTo,I=s.color,R=s.labelMapsTo;s.data.forEach((L,$)=>{N.appendOrSelect(d,`rect.highlight-${$}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[w])).attr("width",this.xScale(L[A])-this.xScale(L[w])).style("fill",I&&I.scale[L[R]]?I.scale[L[R]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[L[R]]?I.scale[L[R]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(O,c,l);const E=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(O!==void 0)if(O[0].valueOf()===O[1].valueOf())E.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const w=O.map(A=>this.xScale(A));w[1]-w[0]<this.MIN_SELECTION_DIFF||(E.call(this.brush.move,w),this.updateBrushHandle(this.getComponentContainer(),w))}i&&(this.brush.filter(()=>!1),E.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)},a=b(this.getOptions(),"zoomBar",G.TOP,"type"),s=ke.height[a];this.brush.extent([[n,0],[r,s]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const a=[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]!==a[0]||n[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let s;t.type==="start"?s=S.ZoomBar.SELECTION_START:t.type==="brush"?s=S.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(s=S.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(s,{selection:i,newDomain:a})}}updateBrushHandle(t,n){const r=this,i=ke.handleWidth,a=b(this.getOptions(),"zoomBar",G.TOP,"type"),s=ke.height[a],o=-i/2,l=ke.handleBarWidth,c=a===qe.GRAPH_VIEW?ke.handleBarHeight:6,u=-l/2,d=(s-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",s).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"),a===qe.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],s)}updateSliderSelectedArea(t){const n=b(this.getOptions(),"zoomBar",G.TOP,"type"),r=ke.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:a}=this.services,s=a.getMainXAxisPosition(),o=a.getMainYAxisPosition(),l=a.getMainXScaleType(),c=a.getMainYScaleType(),u=(y,g,x)=>O=>a.getValueFromScale(y,g,x,O),d=u(this.xScale,l,s),h=u(this.yScale,c,o),p=b(this.getOptions(),"zoomBar",G.TOP,"type"),f=ke.height[p],v=Hu().x(y=>d(y)).y0(f).y1(y=>f-h(y)),m=N.appendOrSelect(t,n).datum(r).attr("d",v);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,a,s){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",a).attr("height",s)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=wn(t),i=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const s={};s[i]=n[0],s[a]=0,r.unshift(s)}if(Number(n[1])>Number(r[r.length-1][i])){const s={};s[i]=n[1],s[a]=0,r.push(s)}return r}renderZoomBarBaseline(t,n,r,i=!1){const a=b(this.model.getOptions(),"zoomBar",G.TOP,"type"),s=ke.height[a],o=La()([[n,s],[r,s]]);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),b(this.getOptions(),"zoomBar",G.TOP,"type")===qe.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(S.ZoomBar.UPDATE,this.render.bind(this))}}class PD extends yt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new Po}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const a=i.enter().append("g").merge(i);a.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const s=a.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(s).attr("class","threshold-group");const l=this;a.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===G.LEFT||c===G.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===tt.LABELS,[v,m]=h.range(),[y,g]=p.range(),{cartesianScales:x}=l.services,O=x.getOrientation(),E=L=>x.getDomainValue(L),w=L=>x.getRangeValue(L),[A,I]=kn(E,w,O),R=D(this);c===G.TOP||c===G.BOTTOM?(R.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",g).attr("y2",y).attr("x1",({datum:L})=>A(L)+(f?u.step()/2:0)).attr("x2",({datum:L})=>A(L)+(f?u.step()/2:0)).style("stroke",({fillColor:L})=>L),R.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-A(L)).attr("width",Math.abs(y-g)).classed("rotate",!0)):(R.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("x1",v).attr("x2",m).attr("y1",({datum:L})=>I(L)+(f?u.step()/2:0)).attr("y2",({datum:L})=>I(L)+(f?u.step()/2:0)).style("stroke",({fillColor:L})=>L),R.selectAll("rect.threshold-hoverable-area").attr("x",v).attr("y",({datum:L})=>I(L)).attr("width",Math.abs(m-v)).classed("rotate",!1))}),this.services.events.addEventListener(S.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(S.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),a=this.services.cartesianScales.getScaleTypeByPosition(r),{code:s,number:o}=b(i,"locale");if(a===tt.TIME){const l=[G.LEFT,G.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=b(i,"timeScale"),p=Rc(d.ticks(),b(h,"timeInterval"));return kc(n,0,d.ticks(),p,h,i.locale)}return o(n,s)}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${Ee}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=mr(t,r),a=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(yn(`${n.label||"Threshold"}: ${a}`)).style("background-color",n.fillColor);const s=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Qt.RIGHT,Qt.LEFT,Qt.TOP,Qt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},s,o);this.positionService.setElement(s,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=b(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){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(S.Threshold.SHOW,{event:n,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(S.Threshold.HIDE,{event:n,hoveredElement:D(this),datum:D(this).datum()})})}}class UD extends yt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new Po,this.highlightStrokeWidth=1}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const a=i.enter().append("g").merge(i);a.attr("class",c=>`axis-highlight ${c.axisPosition}`);const s=a.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)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(s).attr("class","highlight-group");const l=this;a.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,v]=d.range(),{cartesianScales:m}=l.services,y=m.getOrientation(),g=A=>m.getDomainValue(A),x=A=>m.getRangeValue(A),[O,E]=kn(g,x,y),w=D(this);c===G.TOP||c===G.BOTTOM?w.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("y",Math.max(v+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:A,...I})=>O(I[A])).attr("width",({highlightStartMapsTo:A,highlightEndMapsTo:I,...R})=>Math.max(O(R[I])-O(R[A]),0)).style("stroke",({color:A,labelMapsTo:I,...R})=>A&&A.scale[R[I]]?A.scale[R[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:I,...R})=>A&&A.scale[R[I]]?A.scale[R[I]]:null):w.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:A,...I})=>E(I[A])).attr("height",({highlightStartMapsTo:A,highlightEndMapsTo:I,...R})=>Math.max(E(R[A])-E(R[I]),0)).style("stroke",({color:A,labelMapsTo:I,...R})=>A&&A.scale[R[I]]?A.scale[R[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:I,...R})=>A&&A.scale[R[I]]?A.scale[R[I]]:null)})}}class Rv extends dh{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,a=i.getDomainIdentifier(),s=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][a];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(s){const v=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(v)}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(v=>d.push({label:v.label,value:v.value})),d.push({label:Et(r,"locale.translations.group")||Et(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)),!s&&b(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function Lv(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 BD(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 ph(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 HD(e){return e.depth}function VD(e,t){return t-1-e.height}function Dv(e,t){return e.sourceLinks.length?e.depth:t-1}function Uo(e){return function(){return e}}function Iv(e,t){return Bo(e.source,t.source)||e.index-t.index}function Nv(e,t){return Bo(e.target,t.target)||e.index-t.index}function Bo(e,t){return e.y0-t.y0}function fh(e){return e.value}function FD(e){return e.index}function GD(e){return e.nodes}function jD(e){return e.links}function Pv(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Uv({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 zD(){let e=0,t=0,n=1,r=1,i=24,a=8,s,o=FD,l=Dv,c,u,d=GD,h=jD,p=6;function f(){const _={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return v(_),m(_),y(_),g(_),E(_),Uv(_),_}f.update=function(_){return Uv(_),_},f.nodeId=function(_){return arguments.length?(o=typeof _=="function"?_:Uo(_),f):o},f.nodeAlign=function(_){return arguments.length?(l=typeof _=="function"?_:Uo(_),f):l},f.nodeSort=function(_){return arguments.length?(c=_,f):c},f.nodeWidth=function(_){return arguments.length?(i=+_,f):i},f.nodePadding=function(_){return arguments.length?(a=s=+_,f):a},f.nodes=function(_){return arguments.length?(d=typeof _=="function"?_:Uo(_),f):d},f.links=function(_){return arguments.length?(h=typeof _=="function"?_:Uo(_),f):h},f.linkSort=function(_){return arguments.length?(u=_,f):u},f.size=function(_){return arguments.length?(e=t=0,n=+_[0],r=+_[1],f):[n-e,r-t]},f.extent=function(_){return arguments.length?(e=+_[0][0],n=+_[1][0],t=+_[0][1],r=+_[1][1],f):[[e,t],[n,r]]},f.iterations=function(_){return arguments.length?(p=+_,f):p};function v({nodes:_,links:C}){for(const[U,B]of _.entries())B.index=U,B.sourceLinks=[],B.targetLinks=[];const k=new Map(_.map((U,B)=>[o(U,B,_),U]));for(const[U,B]of C.entries()){B.index=U;let{source:X,target:Y}=B;typeof X!="object"&&(X=B.source=Pv(k,X)),typeof Y!="object"&&(Y=B.target=Pv(k,Y)),X.sourceLinks.push(B),Y.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:U,targetLinks:B}of _)U.sort(u),B.sort(u)}function m({nodes:_}){for(const C of _)C.value=C.fixedValue===void 0?Math.max(ph(C.sourceLinks,fh),ph(C.targetLinks,fh)):C.fixedValue}function y({nodes:_}){const C=_.length;let k=new Set(_),U=new Set,B=0;for(;k.size;){for(const X of k){X.depth=B;for(const{target:Y}of X.sourceLinks)U.add(Y)}if(++B>C)throw new Error("circular link");k=U,U=new Set}}function g({nodes:_}){const C=_.length;let k=new Set(_),U=new Set,B=0;for(;k.size;){for(const X of k){X.height=B;for(const{source:Y}of X.targetLinks)U.add(Y)}if(++B>C)throw new Error("circular link");k=U,U=new Set}}function x({nodes:_}){const C=Lv(_,B=>B.depth)+1,k=(n-e-i)/(C-1),U=new Array(C);for(const B of _){const X=Math.max(0,Math.min(C-1,Math.floor(l.call(null,B,C))));B.layer=X,B.x0=e+X*k,B.x1=B.x0+i,U[X]?U[X].push(B):U[X]=[B]}if(c)for(const B of U)B.sort(c);return U}function O(_){const C=BD(_,k=>(r-t-(k.length-1)*s)/ph(k,fh));for(const k of _){let U=t;for(const B of k){B.y0=U,B.y1=U+B.value*C,U=B.y1+s;for(const X of B.sourceLinks)X.width=X.value*C}U=(r-U+s)/(k.length+1);for(let B=0;B<k.length;++B){const X=k[B];X.y0+=U*(B+1),X.y1+=U*(B+1)}F(k)}}function E(_){const C=x(_);s=Math.min(a,(r-t)/(Lv(C,k=>k.length)-1)),O(C);for(let k=0;k<p;++k){const U=Math.pow(.99,k),B=Math.max(1-U,(k+1)/p);A(C,U,B),w(C,U,B)}}function w(_,C,k){for(let U=1,B=_.length;U<B;++U){const X=_[U];for(const Y of X){let ot=0,it=0;for(const{source:at,value:K}of Y.targetLinks){let et=K*(Y.layer-at.layer);ot+=P(at,Y)*et,it+=et}if(!(it>0))continue;let xt=(ot/it-Y.y0)*C;Y.y0+=xt,Y.y1+=xt,$(Y)}c===void 0&&X.sort(Bo),I(X,k)}}function A(_,C,k){for(let U=_.length,B=U-2;B>=0;--B){const X=_[B];for(const Y of X){let ot=0,it=0;for(const{target:at,value:K}of Y.sourceLinks){let et=K*(at.layer-Y.layer);ot+=H(Y,at)*et,it+=et}if(!(it>0))continue;let xt=(ot/it-Y.y0)*C;Y.y0+=xt,Y.y1+=xt,$(Y)}c===void 0&&X.sort(Bo),I(X,k)}}function I(_,C){const k=_.length>>1,U=_[k];L(_,U.y0-s,k-1,C),R(_,U.y1+s,k+1,C),L(_,r,_.length-1,C),R(_,t,0,C)}function R(_,C,k,U){for(;k<_.length;++k){const B=_[k],X=(C-B.y0)*U;X>1e-6&&(B.y0+=X,B.y1+=X),C=B.y1+s}}function L(_,C,k,U){for(;k>=0;--k){const B=_[k],X=(B.y1-C)*U;X>1e-6&&(B.y0-=X,B.y1-=X),C=B.y0-s}}function $({sourceLinks:_,targetLinks:C}){if(u===void 0){for(const{source:{sourceLinks:k}}of C)k.sort(Nv);for(const{target:{targetLinks:k}}of _)k.sort(Iv)}}function F(_){if(u===void 0)for(const{sourceLinks:C,targetLinks:k}of _)C.sort(Nv),k.sort(Iv)}function P(_,C){let k=_.y0-(_.sourceLinks.length-1)*s/2;for(const{target:U,width:B}of _.sourceLinks){if(U===C)break;k+=B+s}for(const{source:U,width:B}of C.targetLinks){if(U===_)break;k-=B}return k}function H(_,C){let k=C.y0-(C.targetLinks.length-1)*s/2;for(const{source:U,width:B}of C.targetLinks){if(U===_)break;k+=B+s}for(const{target:U,width:B}of _.sourceLinks){if(U===C)break;k-=B}return k}return f}var mh=Math.PI,gh=2*mh,Lr=1e-6,WD=gh-Lr;function vh(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Bv(){return new vh}vh.prototype=Bv.prototype={constructor:vh,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,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,s=this._y1,o=n-e,l=r-t,c=a-e,u=s-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>Lr)if(!(Math.abs(u*o-l*c)>Lr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-a,p=r-s,f=o*o+l*l,v=h*h+p*p,m=Math.sqrt(f),y=Math.sqrt(d),g=i*Math.tan((mh-Math.acos((f+d-v)/(2*m*y)))/2),x=g/y,O=g/m;Math.abs(x-1)>Lr&&(this._+="L"+(e+x*c)+","+(t+x*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+O*o)+","+(this._y1=t+O*l)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var s=n*Math.cos(r),o=n*Math.sin(r),l=e+s,c=t+o,u=1^a,d=a?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)>Lr||Math.abs(this._y1-c)>Lr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%gh+gh),d>WD?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>Lr&&(this._+="A"+n+","+n+",0,"+ +(d>=mh)+","+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 Hv(e){return function(){return e}}function qD(e){return e[0]}function YD(e){return e[1]}var ZD=Array.prototype.slice;function XD(e){return e.source}function KD(e){return e.target}function QD(e){var t=XD,n=KD,r=qD,i=YD,a=null;function s(){var o,l=ZD.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(a||(a=o=Bv()),e(a,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(t=o,s):t},s.target=function(o){return arguments.length?(n=o,s):n},s.x=function(o){return arguments.length?(r=typeof o=="function"?o:Hv(+o),s):r},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Hv(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function JD(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function tI(){return QD(JD)}function eI(e){return[e.source.x1,e.y0]}function nI(e){return[e.target.x0,e.y1]}function rI(){return tI().source(eI).target(nI)}class iI extends yt{constructor(){super(...arguments),this.type="alluvial",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const a=this.model.getOptions(),s=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=en.minNodePadding;a.alluvial.nodePadding>en.minNodePadding&&(l=a.alluvial.nodePadding);const c=b(a,"alluvial","nodeAlignment");let u=Dv;c===te.LEFT?u=HD:c===te.RIGHT&&(u=VD);const d=zD().nodeId(g=>g.name).nodeWidth(en.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:a.alluvial.nodes.map(g=>Object.assign({},g)),links:s.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const h={};this.graph.nodes.forEach(g=>{const x=g.x0;g.category&&(h[x]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,x)=>this.services.domUtils.generateElementIDString(`alluvial-category-${x}`)).style("font-size","14px").text(g=>h[g]?h[g]:"").attr("y",20).attr("x",(g,x)=>{const O=this.services.domUtils.generateElementIDString(`alluvial-category-${x}`),{width:E}=N.getSVGElementSize(D(`text#${O}`),{useBBox:!0});let w=0;return g+w>=E&&(w=-E+4),w});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const g=b(this.getOptions(),"color","scale");g&&p.enter().append("linearGradient").attr("id",x=>`${this.gradient_id}-link-${x.index}`).attr("gradientUnits","userSpaceOnUse").call(x=>x.append("stop").attr("offset","0%").attr("stop-color",O=>g[O.source.name])).call(x=>x.append("stop").attr("offset","100%").attr("stop-color",O=>g[O.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",rI()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name,null,{...g,source:g.source.name,target:g.target.name})).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",en.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);f.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const v=f.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`)),{code:m,number:y}=b(a,"locale");v.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${y(g.value,m)})`).attr("aria-label",g=>`${g.name} (${g.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(g,x)=>{const O=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:E}=N.getSVGElementSize(D(`text#${O}`),{useBBox:!0});return E+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(g,x)=>{const O=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:E}=N.getSVGElementSize(D(`text#${O}`),{useBBox:!0}),w=(g.y1-g.y0)/2-9;let A=g.x1-g.x0;return g.x1>=E?A=A-(E+16):A+=4,`translate(${A}, ${w})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=b(this.getOptions(),"locale"),a=Hs((s,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"?(D(s).lower(),l.style("stroke-opacity",en.opacity.default)):l.style("stroke-opacity",function(){return s===this?(D(this).raise(),en.opacity.selected):en.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(s,o){const l=D(this);a(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOVER,{event:s,element:l,datum:o}),n.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,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(s,o){n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEMOVE,{event:s,element:D(this),datum:o}),n.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,o){n.services.events.dispatchEvent(S.Alluvial.LINE_CLICK,{event:s,element:D(this),datum:o})}).on("mouseout",function(s,o){const l=D(this);a(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOUT,{event:s,element:l,datum:o}),n.services.events.dispatchEvent(S.Tooltip.HIDE,{event:s,hoveredElement:l})})}addNodeEventListener(){const t=this,n=Hs((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,a=>a.index).order().style("stroke-opacity",en.opacity.default);return}t.parent.selectAll("path.link").transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(a){return r.some(s=>s===a.index)?(D(this).classed("link-hovered",!0).raise(),en.opacity.selected):en.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const a=D(this),s=[];if(t.traverse({link:"sourceLinks",node:"target"},i,s),t.traverse({link:"targetLinks",node:"source"},i,s),s.length){const o=oa(a.attr("transform"));if(a.attr("transform",`translate(${o.x-2}, ${o.y})`),a.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=oa(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(s,"mouseover"),t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEOVER,{event:r,element:a,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const a=D(this),s=oa(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${s.x+2}, ${s.y})`).select("rect.node").attr("width",en.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=oa(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(S.Alluvial.NODE_MOUSEOUT,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}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`
73
+ </li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=b(r,"tooltip","valueFormatter"),{code:a,number:s,date:o}=b(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,a,{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,a,{month:"short",day:"numeric",year:"numeric"})}}catch{}return s(t,a)}render(t=!1){const n=this.getOptions(),r=b(n,"tooltip","enabled");if(r){const i=R(this.services.domUtils.getHolder()),a=b(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${Ee}--${a}--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==Qt.LEFT?i.left-=r:n==Qt.RIGHT?i.left+=r:n==Qt.TOP?i.top-=r:n==Qt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,a=this.tooltip.node(),s=this.getOptions(),o=b(s,"zoomBar","top","enabled"),l=!!b(t,"detail","noWrap"),c=Array.isArray(b(t,"detail","placements")),u=c?b(t,"detail","placements"):[Qt.RIGHT,Qt.LEFT,Qt.TOP,Qt.BOTTOM];let d,{horizontalOffset:h}=cf;const{defaultOffset:p}=cf;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=b(t,"detail","event","target"),y=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(y,a,u,()=>({top:0,left:0,width:r,height:i}));let g=this.positionService.findPosition(m,a,d,()=>this.services.domUtils.getElementOffset(m));g=this.addOffsetByPlacement(g,d,p),this.positionService.setElement(a,g);return}let f=b(t,"detail","mousePosition");if(!f)f=mr(b(t,"detail","event"),n);else{const m=b(s,"zoomBar","top","type"),y=ke.height[m];o&&(f[1]+=y+ke.spacerHeight)}f[0]/r>.9?d=Qt.LEFT:f[0]/r<.1?d=Qt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},a,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Qt.LEFT&&(h*=-1);const v=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},a,d);this.positionService.setElement(a,v)}}const kv=class ll extends yt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=rt.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),a=N.appendOrSelect(i,`g.${this.type}`),s=N.appendOrSelect(a,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===tt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const v=E=>{const w=E[1]-E[0];let A="0,"+w.toString();const I=Math.floor(l/ll.DASH_LENGTH),L=I*ll.DASH_LENGTH;for(let D=0;D<I;D++)A+=","+ll.DASH_LENGTH;A+=","+(l-L),I%2===1&&(A+=",0"),A+=","+w.toString(),A+=","+l.toString(),p.attr("stroke-dasharray",A)},m=E=>{const w=E.selection;w===null||w[0]===w[1]||(p.attr("x",parseFloat(s.attr("x"))+parseFloat(i.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),v(w))},y=(E,w)=>{const A=om().range([0,o]).domain(f);let I=[A.invert(E),A.invert(w)];I[0].valueOf()===I[1].valueOf()&&(I=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==I[0].valueOf()||f[1].valueOf()!==I[1].valueOf())&&this.services.zoom.handleDomainChange(I)};let g;const x=E=>{const w=E.selection;w!==null&&(y(w[0],w[1]),a.call(g.move,null),p.style("display","none"))};l!=0&&o!=0&&(g=ig().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",x),a.call(g));const O=this.services.zoom.getZoomRatio();i.on("click",function(E){if(E.shiftKey){const w=this.services.domUtils.getHolder(),A=mr(a.node(),w)[0];let I=A-o*O/2;I<0&&(I=0);let L=A+o*O/2;L>o&&(L=o),y(I,L)}})}}};kv.DASH_LENGTH=4;let IR=kv;class NR extends yt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=rt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=ig(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(S.ZoomBar.UPDATE,this.render.bind(this));const t=b(this.getOptions(),"zoomBar",G.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(G.TOP),i=this.services.zoom.isZoomBarLocked(G.TOP),a=b(this.getOptions(),"zoomBar",G.TOP,"type"),s=b(this.getOptions(),"axes",G.BOTTOM,"highlights"),o=ke.height[a],{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",ke.spacerHeight).attr("opacity",1).attr("fill","none"),a===qe.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):a===qe.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(),v=h.getMainXScaleType();if(p&&v===tt.TIME){let m=this.services.zoom.getZoomBarData();if(Xe(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const y=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,y);const g=this.model.get("initialZoomDomain"),x=b(this.getOptions(),"zoomBar",G.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(g&&g[0].valueOf()===x[0].valueOf()&&g[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:ct([],x),zoomDomain:x?ct([],x):y},{skipUpdate:!0}):x===null&&g!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],y)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ke(m,w=>w.value));const O=this.model.get("zoomDomain");if(a===qe.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),s)){const w=s.highlightStartMapsTo,A=s.highlightEndMapsTo,I=s.color,L=s.labelMapsTo;s.data.forEach((D,$)=>{N.appendOrSelect(d,`rect.highlight-${$}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(D[w])).attr("width",this.xScale(D[A])-this.xScale(D[w])).style("fill",I&&I.scale[D[L]]?I.scale[D[L]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[D[L]]?I.scale[D[L]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(O,c,l);const E=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(O!==void 0)if(O[0].valueOf()===O[1].valueOf())E.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const w=O.map(A=>this.xScale(A));w[1]-w[0]<this.MIN_SELECTION_DIFF||(E.call(this.brush.move,w),this.updateBrushHandle(this.getComponentContainer(),w))}i&&(this.brush.filter(()=>!1),E.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)},a=b(this.getOptions(),"zoomBar",G.TOP,"type"),s=ke.height[a];this.brush.extent([[n,0],[r,s]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const a=[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]!==a[0]||n[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let s;t.type==="start"?s=S.ZoomBar.SELECTION_START:t.type==="brush"?s=S.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(s=S.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(s,{selection:i,newDomain:a})}}updateBrushHandle(t,n){const r=this,i=ke.handleWidth,a=b(this.getOptions(),"zoomBar",G.TOP,"type"),s=ke.height[a],o=-i/2,l=ke.handleBarWidth,c=a===qe.GRAPH_VIEW?ke.handleBarHeight:6,u=-l/2,d=(s-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",s).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"),a===qe.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],s)}updateSliderSelectedArea(t){const n=b(this.getOptions(),"zoomBar",G.TOP,"type"),r=ke.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:a}=this.services,s=a.getMainXAxisPosition(),o=a.getMainYAxisPosition(),l=a.getMainXScaleType(),c=a.getMainYScaleType(),u=(y,g,x)=>O=>a.getValueFromScale(y,g,x,O),d=u(this.xScale,l,s),h=u(this.yScale,c,o),p=b(this.getOptions(),"zoomBar",G.TOP,"type"),f=ke.height[p],v=Hu().x(y=>d(y)).y0(f).y1(y=>f-h(y)),m=N.appendOrSelect(t,n).datum(r).attr("d",v);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,a,s){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",a).attr("height",s)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=wn(t),i=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const s={};s[i]=n[0],s[a]=0,r.unshift(s)}if(Number(n[1])>Number(r[r.length-1][i])){const s={};s[i]=n[1],s[a]=0,r.push(s)}return r}renderZoomBarBaseline(t,n,r,i=!1){const a=b(this.model.getOptions(),"zoomBar",G.TOP,"type"),s=ke.height[a],o=Da()([[n,s],[r,s]]);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),b(this.getOptions(),"zoomBar",G.TOP,"type")===qe.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(S.ZoomBar.UPDATE,this.render.bind(this))}}class PR extends yt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new Po}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const a=i.enter().append("g").merge(i);a.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const s=a.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(s).attr("class","threshold-group");const l=this;a.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===G.LEFT||c===G.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===tt.LABELS,[v,m]=h.range(),[y,g]=p.range(),{cartesianScales:x}=l.services,O=x.getOrientation(),E=D=>x.getDomainValue(D),w=D=>x.getRangeValue(D),[A,I]=kn(E,w,O),L=R(this);c===G.TOP||c===G.BOTTOM?(L.selectAll("line.threshold-line").transition().call(D=>l.services.transitions.setupTransition({transition:D,name:"threshold-line-update",animate:t})).attr("y1",g).attr("y2",y).attr("x1",({datum:D})=>A(D)+(f?u.step()/2:0)).attr("x2",({datum:D})=>A(D)+(f?u.step()/2:0)).style("stroke",({fillColor:D})=>D),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:D})=>-A(D)).attr("width",Math.abs(y-g)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(D=>l.services.transitions.setupTransition({transition:D,name:"threshold-line-update",animate:t})).attr("x1",v).attr("x2",m).attr("y1",({datum:D})=>I(D)+(f?u.step()/2:0)).attr("y2",({datum:D})=>I(D)+(f?u.step()/2:0)).style("stroke",({fillColor:D})=>D),L.selectAll("rect.threshold-hoverable-area").attr("x",v).attr("y",({datum:D})=>I(D)).attr("width",Math.abs(m-v)).classed("rotate",!1))}),this.services.events.addEventListener(S.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(S.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),a=this.services.cartesianScales.getScaleTypeByPosition(r),{code:s,number:o}=b(i,"locale");if(a===tt.TIME){const l=[G.LEFT,G.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=b(i,"timeScale"),p=Lc(d.ticks(),b(h,"timeInterval"));return kc(n,0,d.ticks(),p,h,i.locale)}return o(n,s)}appendThresholdLabel(){const t=R(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${Ee}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=mr(t,r),a=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(yn(`${n.label||"Threshold"}: ${a}`)).style("background-color",n.fillColor);const s=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Qt.RIGHT,Qt.LEFT,Qt.TOP,Qt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},s,o);this.positionService.setElement(s,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=b(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){R(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(S.Threshold.SHOW,{event:n,hoveredElement:R(this),datum:R(this).datum()})}).on("mouseout",function(n){R(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(S.Threshold.HIDE,{event:n,hoveredElement:R(this),datum:R(this).datum()})})}}class UR extends yt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new Po,this.highlightStrokeWidth=1}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).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({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const a=i.enter().append("g").merge(i);a.attr("class",c=>`axis-highlight ${c.axisPosition}`);const s=a.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)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(s).attr("class","highlight-group");const l=this;a.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,v]=d.range(),{cartesianScales:m}=l.services,y=m.getOrientation(),g=A=>m.getDomainValue(A),x=A=>m.getRangeValue(A),[O,E]=kn(g,x,y),w=R(this);c===G.TOP||c===G.BOTTOM?w.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("y",Math.max(v+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:A,...I})=>O(I[A])).attr("width",({highlightStartMapsTo:A,highlightEndMapsTo:I,...L})=>Math.max(O(L[I])-O(L[A]),0)).style("stroke",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null):w.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:A,...I})=>E(I[A])).attr("height",({highlightStartMapsTo:A,highlightEndMapsTo:I,...L})=>Math.max(E(L[A])-E(L[I]),0)).style("stroke",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:I,...L})=>A&&A.scale[L[I]]?A.scale[L[I]]:null)})}}class Lv extends dh{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,a=i.getDomainIdentifier(),s=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][a];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(s){const v=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(v)}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(v=>d.push({label:v.label,value:v.value})),d.push({label:Et(r,"locale.translations.group")||Et(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)),!s&&b(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function Dv(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 BR(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 ph(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 HR(e){return e.depth}function VR(e,t){return t-1-e.height}function Rv(e,t){return e.sourceLinks.length?e.depth:t-1}function Uo(e){return function(){return e}}function Iv(e,t){return Bo(e.source,t.source)||e.index-t.index}function Nv(e,t){return Bo(e.target,t.target)||e.index-t.index}function Bo(e,t){return e.y0-t.y0}function fh(e){return e.value}function FR(e){return e.index}function GR(e){return e.nodes}function jR(e){return e.links}function Pv(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Uv({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 zR(){let e=0,t=0,n=1,r=1,i=24,a=8,s,o=FR,l=Rv,c,u,d=GR,h=jR,p=6;function f(){const _={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return v(_),m(_),y(_),g(_),E(_),Uv(_),_}f.update=function(_){return Uv(_),_},f.nodeId=function(_){return arguments.length?(o=typeof _=="function"?_:Uo(_),f):o},f.nodeAlign=function(_){return arguments.length?(l=typeof _=="function"?_:Uo(_),f):l},f.nodeSort=function(_){return arguments.length?(c=_,f):c},f.nodeWidth=function(_){return arguments.length?(i=+_,f):i},f.nodePadding=function(_){return arguments.length?(a=s=+_,f):a},f.nodes=function(_){return arguments.length?(d=typeof _=="function"?_:Uo(_),f):d},f.links=function(_){return arguments.length?(h=typeof _=="function"?_:Uo(_),f):h},f.linkSort=function(_){return arguments.length?(u=_,f):u},f.size=function(_){return arguments.length?(e=t=0,n=+_[0],r=+_[1],f):[n-e,r-t]},f.extent=function(_){return arguments.length?(e=+_[0][0],n=+_[1][0],t=+_[0][1],r=+_[1][1],f):[[e,t],[n,r]]},f.iterations=function(_){return arguments.length?(p=+_,f):p};function v({nodes:_,links:C}){for(const[U,B]of _.entries())B.index=U,B.sourceLinks=[],B.targetLinks=[];const k=new Map(_.map((U,B)=>[o(U,B,_),U]));for(const[U,B]of C.entries()){B.index=U;let{source:X,target:Y}=B;typeof X!="object"&&(X=B.source=Pv(k,X)),typeof Y!="object"&&(Y=B.target=Pv(k,Y)),X.sourceLinks.push(B),Y.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:U,targetLinks:B}of _)U.sort(u),B.sort(u)}function m({nodes:_}){for(const C of _)C.value=C.fixedValue===void 0?Math.max(ph(C.sourceLinks,fh),ph(C.targetLinks,fh)):C.fixedValue}function y({nodes:_}){const C=_.length;let k=new Set(_),U=new Set,B=0;for(;k.size;){for(const X of k){X.depth=B;for(const{target:Y}of X.sourceLinks)U.add(Y)}if(++B>C)throw new Error("circular link");k=U,U=new Set}}function g({nodes:_}){const C=_.length;let k=new Set(_),U=new Set,B=0;for(;k.size;){for(const X of k){X.height=B;for(const{source:Y}of X.targetLinks)U.add(Y)}if(++B>C)throw new Error("circular link");k=U,U=new Set}}function x({nodes:_}){const C=Dv(_,B=>B.depth)+1,k=(n-e-i)/(C-1),U=new Array(C);for(const B of _){const X=Math.max(0,Math.min(C-1,Math.floor(l.call(null,B,C))));B.layer=X,B.x0=e+X*k,B.x1=B.x0+i,U[X]?U[X].push(B):U[X]=[B]}if(c)for(const B of U)B.sort(c);return U}function O(_){const C=BR(_,k=>(r-t-(k.length-1)*s)/ph(k,fh));for(const k of _){let U=t;for(const B of k){B.y0=U,B.y1=U+B.value*C,U=B.y1+s;for(const X of B.sourceLinks)X.width=X.value*C}U=(r-U+s)/(k.length+1);for(let B=0;B<k.length;++B){const X=k[B];X.y0+=U*(B+1),X.y1+=U*(B+1)}F(k)}}function E(_){const C=x(_);s=Math.min(a,(r-t)/(Dv(C,k=>k.length)-1)),O(C);for(let k=0;k<p;++k){const U=Math.pow(.99,k),B=Math.max(1-U,(k+1)/p);A(C,U,B),w(C,U,B)}}function w(_,C,k){for(let U=1,B=_.length;U<B;++U){const X=_[U];for(const Y of X){let ot=0,it=0;for(const{source:at,value:K}of Y.targetLinks){let et=K*(Y.layer-at.layer);ot+=P(at,Y)*et,it+=et}if(!(it>0))continue;let xt=(ot/it-Y.y0)*C;Y.y0+=xt,Y.y1+=xt,$(Y)}c===void 0&&X.sort(Bo),I(X,k)}}function A(_,C,k){for(let U=_.length,B=U-2;B>=0;--B){const X=_[B];for(const Y of X){let ot=0,it=0;for(const{target:at,value:K}of Y.sourceLinks){let et=K*(at.layer-Y.layer);ot+=H(Y,at)*et,it+=et}if(!(it>0))continue;let xt=(ot/it-Y.y0)*C;Y.y0+=xt,Y.y1+=xt,$(Y)}c===void 0&&X.sort(Bo),I(X,k)}}function I(_,C){const k=_.length>>1,U=_[k];D(_,U.y0-s,k-1,C),L(_,U.y1+s,k+1,C),D(_,r,_.length-1,C),L(_,t,0,C)}function L(_,C,k,U){for(;k<_.length;++k){const B=_[k],X=(C-B.y0)*U;X>1e-6&&(B.y0+=X,B.y1+=X),C=B.y1+s}}function D(_,C,k,U){for(;k>=0;--k){const B=_[k],X=(B.y1-C)*U;X>1e-6&&(B.y0-=X,B.y1-=X),C=B.y0-s}}function $({sourceLinks:_,targetLinks:C}){if(u===void 0){for(const{source:{sourceLinks:k}}of C)k.sort(Nv);for(const{target:{targetLinks:k}}of _)k.sort(Iv)}}function F(_){if(u===void 0)for(const{sourceLinks:C,targetLinks:k}of _)C.sort(Nv),k.sort(Iv)}function P(_,C){let k=_.y0-(_.sourceLinks.length-1)*s/2;for(const{target:U,width:B}of _.sourceLinks){if(U===C)break;k+=B+s}for(const{source:U,width:B}of C.targetLinks){if(U===_)break;k-=B}return k}function H(_,C){let k=C.y0-(C.targetLinks.length-1)*s/2;for(const{source:U,width:B}of C.targetLinks){if(U===_)break;k+=B+s}for(const{target:U,width:B}of _.sourceLinks){if(U===C)break;k-=B}return k}return f}var mh=Math.PI,gh=2*mh,Dr=1e-6,WR=gh-Dr;function vh(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Bv(){return new vh}vh.prototype=Bv.prototype={constructor:vh,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,a){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,s=this._y1,o=n-e,l=r-t,c=a-e,u=s-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>Dr)if(!(Math.abs(u*o-l*c)>Dr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-a,p=r-s,f=o*o+l*l,v=h*h+p*p,m=Math.sqrt(f),y=Math.sqrt(d),g=i*Math.tan((mh-Math.acos((f+d-v)/(2*m*y)))/2),x=g/y,O=g/m;Math.abs(x-1)>Dr&&(this._+="L"+(e+x*c)+","+(t+x*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+O*o)+","+(this._y1=t+O*l)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var s=n*Math.cos(r),o=n*Math.sin(r),l=e+s,c=t+o,u=1^a,d=a?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)>Dr||Math.abs(this._y1-c)>Dr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%gh+gh),d>WR?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>Dr&&(this._+="A"+n+","+n+",0,"+ +(d>=mh)+","+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 Hv(e){return function(){return e}}function qR(e){return e[0]}function YR(e){return e[1]}var ZR=Array.prototype.slice;function XR(e){return e.source}function KR(e){return e.target}function QR(e){var t=XR,n=KR,r=qR,i=YR,a=null;function s(){var o,l=ZR.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(a||(a=o=Bv()),e(a,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(t=o,s):t},s.target=function(o){return arguments.length?(n=o,s):n},s.x=function(o){return arguments.length?(r=typeof o=="function"?o:Hv(+o),s):r},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Hv(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function JR(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function tI(){return QR(JR)}function eI(e){return[e.source.x1,e.y0]}function nI(e){return[e.target.x0,e.y1]}function rI(){return tI().source(eI).target(nI)}class iI extends yt{constructor(){super(...arguments),this.type="alluvial",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const a=this.model.getOptions(),s=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=en.minNodePadding;a.alluvial.nodePadding>en.minNodePadding&&(l=a.alluvial.nodePadding);const c=b(a,"alluvial","nodeAlignment");let u=Rv;c===te.LEFT?u=HR:c===te.RIGHT&&(u=VR);const d=zR().nodeId(g=>g.name).nodeWidth(en.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:a.alluvial.nodes.map(g=>Object.assign({},g)),links:s.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const h={};this.graph.nodes.forEach(g=>{const x=g.x0;g.category&&(h[x]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,x)=>this.services.domUtils.generateElementIDString(`alluvial-category-${x}`)).style("font-size","14px").text(g=>h[g]?h[g]:"").attr("y",20).attr("x",(g,x)=>{const O=this.services.domUtils.generateElementIDString(`alluvial-category-${x}`),{width:E}=N.getSVGElementSize(R(`text#${O}`),{useBBox:!0});let w=0;return g+w>=E&&(w=-E+4),w});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const g=b(this.getOptions(),"color","scale");g&&p.enter().append("linearGradient").attr("id",x=>`${this.gradient_id}-link-${x.index}`).attr("gradientUnits","userSpaceOnUse").call(x=>x.append("stop").attr("offset","0%").attr("stop-color",O=>g[O.source.name])).call(x=>x.append("stop").attr("offset","100%").attr("stop-color",O=>g[O.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",rI()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name,null,{...g,source:g.source.name,target:g.target.name})).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",en.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);f.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const v=f.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`)),{code:m,number:y}=b(a,"locale");v.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${y(g.value,m)})`).attr("aria-label",g=>`${g.name} (${g.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(g,x)=>{const O=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:E}=N.getSVGElementSize(R(`text#${O}`),{useBBox:!0});return E+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(g,x)=>{const O=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:E}=N.getSVGElementSize(R(`text#${O}`),{useBBox:!0}),w=(g.y1-g.y0)/2-9;let A=g.x1-g.x0;return g.x1>=E?A=A-(E+16):A+=4,`translate(${A}, ${w})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=b(this.getOptions(),"locale"),a=Hs((s,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"?(R(s).lower(),l.style("stroke-opacity",en.opacity.default)):l.style("stroke-opacity",function(){return s===this?(R(this).raise(),en.opacity.selected):en.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(s,o){const l=R(this);a(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOVER,{event:s,element:l,datum:o}),n.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,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(s,o){n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEMOVE,{event:s,element:R(this),datum:o}),n.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,o){n.services.events.dispatchEvent(S.Alluvial.LINE_CLICK,{event:s,element:R(this),datum:o})}).on("mouseout",function(s,o){const l=R(this);a(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOUT,{event:s,element:l,datum:o}),n.services.events.dispatchEvent(S.Tooltip.HIDE,{event:s,hoveredElement:l})})}addNodeEventListener(){const t=this,n=Hs((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,a=>a.index).order().style("stroke-opacity",en.opacity.default);return}t.parent.selectAll("path.link").transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(a){return r.some(s=>s===a.index)?(R(this).classed("link-hovered",!0).raise(),en.opacity.selected):en.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const a=R(this),s=[];if(t.traverse({link:"sourceLinks",node:"target"},i,s),t.traverse({link:"targetLinks",node:"source"},i,s),s.length){const o=oa(a.attr("transform"));if(a.attr("transform",`translate(${o.x-2}, ${o.y})`),a.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=oa(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(s,"mouseover"),t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEOVER,{event:r,element:a,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEMOVE,{event:r,element:R(this),datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_CLICK,{event:r,element:R(this),datum:i})}).on("mouseout",function(r,i){const a=R(this),s=oa(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${s.x+2}, ${s.y})`).select("rect.node").attr("width",en.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=oa(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(S.Alluvial.NODE_MOUSEOUT,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}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`
74
74
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
75
75
  <polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
76
76
  <rect width="32" height="32"/>
77
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ne extends yt{constructor(){super(...arguments),this.type="grid",this.renderType=rt.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),r=b(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(),a=eu(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&a.tickValues(l)}else{const o=b(this.getOptions(),"grid","x","numberOfTicks");a.ticks(o)}const s=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(a):s.call(a),this.cleanGrid(s)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),a=Km(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&a.tickValues(l)}else{const o=b(this.getOptions(),"grid","y","numberOfTicks");a.ticks(o)}const s=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(a):s.call(a),this.cleanGrid(s)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(An(u).tx)-Number(An(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+An(u).tx&&i++});const a=i+1<r.length?i+1:r.length,s=r[i],o=r[a];let l;if(!s)l=+An(o).tx;else if(o)l=+An(o).tx-+An(s).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+An(s).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=An(this),a={min:Number(i.tx)-r,max:Number(i.tx)+r};return a.min<=t[0]&&t[0]<=a.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),a=this.services.cartesianScales.getMainYScale(),[s,o]=i.range(),[l,c]=a.range();this.backdrop=N.appendOrSelect(r,"svg.chart-grid-backdrop");const u=N.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",s).attr("y",c).attr("width",Math.abs(o-s)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Vv extends yt{constructor(){super(...arguments),this.type="area",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{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?Mn.opacity.unselected:Mn.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",Mn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:a}=this.services,s=a.getOrientation(),o=Hu().curve(this.services.curves.getD3Curve()).defined(E=>{const w=a.getRangeIdentifier();return E[w]!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(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=(E,w)=>{b(r,"axes",E,"includeZero")===!1&&w[0]>0&&w[1]>0&&(d=w[0])},p=E=>u?a.getBoundedScaledValues(E)[0]:a.getRangeValue(d),f=E=>u?a.getBoundedScaledValues(E)[1]:a.getRangeValue(E);s===Jt.VERTICAL?(i=a.getMainYScale().domain(),h(a.getMainYAxisPosition(),i),o.x(E=>a.getDomainValue(E)).y0(E=>p(E)).y1(E=>f(E))):(i=a.getMainXScale().domain(),h(a.getMainXAxisPosition(),i),o.x0(E=>p(E)).x1(E=>f(E)).y(E=>a.getDomainValue(E)));const v=b(r,"color","gradient","enabled"),m=l&&l.length===1&&v;l.length>1&&v&&console.error("Gradients can only be enabled when having 1 single dataset");const y=n.selectAll("path.area").data(l,E=>E.name),g=D(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!l.length)return;if(m){const E=g.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let w;if(E)w=getComputedStyle(E,null).getPropertyValue("stroke");else{const A=b(this.model.getOptions(),"color","scale");if(A!==null){const I=Object.keys(A);w=A[I[0]]}}Jc.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:Jc.getStops(i,w)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,O=y.enter().append("path");m?O.merge(y).style("fill",E=>`url(#${this.services.domUtils.generateElementIDString(`${E.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:E.name,originalClassName:"area"})).attr("d",E=>{const{data:w}=E;return o(w)}):(O.attr("opacity",0).merge(y).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:E.name,originalClassName:"area"})).style("fill",E=>x.model.getFillColor(E.name,null,E.data)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"area-update-enter",animate:t})).attr("opacity",u?1:Mn.opacity.selected).attr("d",E=>{const{data:w}=E;return o(w)}),u&&O.attr("fill-opacity",Mn.opacity.selected).style("stroke",E=>x.model.getStrokeColor(E.name,null,E.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xi extends yt{constructor(){super(...arguments),this.type="line",this.renderType=rt.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?Cn.opacity.unselected:Cn.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",Cn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,a=p=>r.getDomainValue(p),s=p=>r.getRangeValue(p),[o,l]=kn(a,s,r.getOrientation()),c=this.getOptions(),u=La().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(v=>c.axes[v].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const m=this.services.cartesianScales.getDomainIdentifier(v),y=this.services.cartesianScales.getRangeIdentifier(v);return{name:b(v,0,f),data:v.map(g=>({[m]:g.data.sharedStackKey,[f]:g[f],[y]:g[1]})),hidden:!gA(v,g=>g[0]!==g[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",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(v=>{const m=this.services.cartesianScales.getRangeIdentifier(v);return v[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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Fv=5;function aI(e,t){return e>t-Fv&&e<t+Fv}class Jn extends yt{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,a=this.services.cartesianScales.getOrientation(),s=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=a===Jt.HORIZONTAL?r:n,d=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=N.appendOrSelect(d,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=s.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>aI(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(S.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const v=this.pointsWithinLine.reduce((m,y)=>{if(m.length===0)return m.push(y),m;const g=m[0].domainValue,x=Math.abs(u-y.domainValue),O=Math.abs(u-g);return x>O||(x<O?m=[y]:m.push(y)),m},[]);if(v.length>0){const m=v.map(O=>O.originalData).filter(O=>{const E=this.services.cartesianScales.getRangeIdentifier(O);return O[E]!=null}),y=v.map(O=>O.domainValue),g=p.filter(O=>{const E=this.services.cartesianScales.getDomainValue(O);return y.includes(E)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Ym(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g,this.services.events.dispatchEvent(S.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const x=v[0];a==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",x.domainValue).attr("y2",x.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",x.domainValue).attr("x2",x.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(S.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(a){const s=mr(a,t.parent.node());t.showRuler(a,s)};if(r.length>100){const a=r.length%50*12.5;i=VT(function(s){const{mousePosition:o}=this;t.showRuler(s,o)},a,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")}}class bn extends yt{constructor(){super(...arguments),this.type="scatter",this.renderType=rt.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 a;return(a=this.services.transitions)==null?void 0:a.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(S.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(a=>a[r].getTime()>=i[0].getTime()&&a[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(a=>t.axes[a].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(a=>{const s=i.getRangeIdentifier(a);return a[s]!==void 0&&a[s]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(b(this.getOptions(),"points","enabled")||b(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const s=a.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[s]}`);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(),[a,s]=kn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=kn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return s&&a?u<=s.scaleValue&&c>=a.scaleValue:s?u<=s.scaleValue:a?c>=a.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:a}=r.points,{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>s.getDomainValue(p),c=p=>s.getRangeValue(p),[u,d]=kn(l,c,s.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=s.getDomainIdentifier(p),v=this.model.getIsFilled(p[o],p[f],p,i)?[st.FILL,st.STROKE]:[st.STROKE];return this.model.getColorClassName({classNameTypes:v,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=s.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=s.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=s.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=s.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?a:1).attr("opacity",h?0:1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=s.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 a,s;const o=D(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),(a=t.services.events)==null||a.dispatchEvent(S.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(s=t.services.events)==null||s.dispatchEvent(S.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var a,s;const o=D(this);(a=t.services.events)==null||a.dispatchEvent(S.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(s=t.services.events)==null||s.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var a;(a=t.services.events)==null||a.dispatchEvent(S.Scatter.SCATTER_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){var a,s,o;const l=D(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.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)}(s=t.services.events)==null||s.dispatchEvent(S.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(S.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Gv extends yt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.SVG,this.truncation={[G.LEFT]:!1,[G.RIGHT]:!1,[G.TOP]:!1,[G.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=b(r,"axes",n,"visible"),a=this.getComponentContainer(),{width:s,height:o}=N.getSVGElementSize(a,{useAttrs:!0}),l=N.appendOrSelect(a,`g.axis.${n}`);let c,u;if(n===G.BOTTOM||n===G.TOP?(c=this.configs.axes[G.LEFT]?this.margins.left:0,u=this.configs.axes[G.RIGHT]?s-this.margins.right:s):(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===tt.LABELS||this.scaleType===tt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case G.LEFT:h=Km;break;case G.BOTTOM:h=eu;break;case G.RIGHT:h=SA;break;case G.TOP:h=wA;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",`${pt.GRAPHICS_OBJECT} ${pt.GROUP}`),f.attr("aria-label",`${n} ticks`));const v=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=b(r,"axes",n),y=this.scaleType===tt.TIME||m.scaleType===tt.TIME,g=n===G.LEFT||n===G.RIGHT,x=this.model.get("zoomDomain");if(x&&y&&!g&&d.domain(x),!i){f.attr("aria-hidden",!0);return}const O=b(m,"scaleType"),E=b(r,"data","loading"),w=b(m,"ticks","number"),A=b(m,"ticks","values"),I=b(m,"truncation","type"),R=b(m,"truncation","threshold"),L=b(m,"truncation","numCharacter"),$=w!==null,F=b(r,"timeScale"),P=N.appendOrSelect(v,"g.tick"),H=N.appendOrSelect(P,"text").text("0"),_=N.getSVGElementSize(H.node(),{useBBox:!0}).height;P.remove();const C=this.scaleType||m.scaleType||tt.LINEAR,k=h(d).tickSizeOuter(0);if(d.ticks){let K;if($?K=w:(K=qn.ticks.number,g&&(K=this.getNumberOfFittingTicks(o,_,qn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),k.ticks(K),y)if(!d.ticks(K).length)k.tickValues([]);else{const et=b(r,"timeScale","addSpaceOnEdges"),mt=b(r,"axes",n,"domain"),q=d.copy();et&&!mt&&q.nice(K);const J=q.ticks(K);et&&J.length>2&&!mt&&(J.splice(J.length-1,1),J.splice(0,1)),k.tickValues(J)}}let U;const B=b(m,"ticks","formatter"),{code:X,number:Y}=b(r,"locale");if(y){const K=Rc(k.tickValues(),b(r,"timeScale","timeInterval"));B===null?U=(et,mt)=>kc(et,mt,k.tickValues(),K,F,r.locale):U=(et,mt)=>{const q=kc(et,mt,k.tickValues(),K,F,r.locale);return B(et,mt,q)}}else B===null?C===tt.LINEAR&&(U=K=>Y(K,X)):U=B;k.tickFormat(U);const[ot,it]=this.services.cartesianScales.getScaleByPosition(n).domain();let xt;if(A){if(y)A.forEach((K,et)=>{K.getTime===void 0&&(A[et]=new Date(K))}),xt=A.filter(K=>{const et=K.getTime();return et>=new Date(ot).getTime()&&et<=new Date(it).getTime()});else if(O===tt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();xt=A.filter(et=>K.includes(et))}else xt=A.filter(K=>K>=ot&&K<=it);k.tickValues(xt)}switch(n){case G.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case G.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case G.RIGHT:f.attr("transform",`translate(${s-this.margins.right}, 0)`);break;case G.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const at=this.model.isDataEmpty();if(m.title){const K=N.appendOrSelect(l,"text.axis-title").html(at||E?"":yn(m.title)),et=b(m,"titleOrientation");let mt;switch(n){case G.LEFT:et===Ja.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case G.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case G.RIGHT:et===Ja.LEFT?K.attr("transform","rotate(-90)").attr("y",s).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-s).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case G.TOP:mt=N.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${mt/2})`).style("text-anchor","middle");break}}if(y){const K=Rc(k.tickValues(),b(r,"timeScale","timeInterval")),et=F.showDayName,mt=f;t&&(f=f.transition().call(q=>this.services.transitions.setupTransition({transition:q,name:"axis-update",animate:t}))),f=f.call(k),mt.selectAll(".tick").data(k.tickValues(),d).order().select("text").style("font-weight",(q,J)=>Lf(q,J,k.tickValues(),K,et)?"bold":"normal")}else!t||!p?f=f.call(k):f=f.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(k);if(v.call(k),n===G.BOTTOM||n===G.TOP){let K=!1;const et=b(m,"ticks","rotation");if(et===ki.ALWAYS)K=!0;else if(et===ki.NEVER)K=!1;else if(!et||et===ki.AUTO)if(d.step)K=v.selectAll("g.tick text").nodes().some(mt=>N.getSVGElementSize(mt,{useBBox:!0}).width>=d.step());else{K=!1;const mt=v.append("text").text("A"),q=N.getSVGElementSize(mt.node(),{useBBox:!0}).width;let J;v.selectAll("g.tick").each(function(){const dt=D(this),j=parseFloat(b(An(this),"tx"));j!==null&&J+dt.text().length*q*.8>=j&&(K=!0),J=j}),mt.remove()}K?($||(k.ticks(this.getNumberOfFittingTicks(s,_,qn.ticks.horizontalSpaceRatio)),v.call(k),f.call(k)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===G.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(E?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",K=>K),v.selectAll("g.tick").attr("aria-label",K=>K),I!==Ue.NONE&&O===tt.LABELS&&!A){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const et=a.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const mt=this;l.selectAll("g.tick text").data(K).text(function(q){return q.length>R?(mt.truncation[n]=!0,la(q,I,L)):q}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(q){return q.length>R?la(q,I,L):q}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),a=b(i,"axes",n),s=b(a,"scaleType"),o=b(a,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),s===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),s===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),s===tt.LABELS&&l.services.events.dispatchEvent(S.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 qm(i,2,qn.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 sI extends Gv{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer(),i=N.appendOrSelect(r,`g.axis.${n}`),a=this;i.selectAll("g.tick").each(function(s,o){const l=D(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 G.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case G.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case G.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,a.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case G.BOTTOM:p=-(u/2),f=d/2-2,a.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-qn.hover.rectanglePadding).attr("y",f).attr("width",u+qn.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(),a=b(i,"axes",n),s=b(a,"scaleType"),o=b(a,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),s===tt.LABELS&&d.length>o&&l.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),s===tt.LABELS&&l.services.events.dispatchEvent(S.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(S.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(S.Tooltip.HIDE),l.services.events.dispatchEvent(S.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===G.LEFT||n===G.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 Se extends yt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=rt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(G),i=b(this.getOptions(),"axes");r.forEach(s=>{i[G[s]]&&(n[G[s]]=!0)}),this.configs.axes=n,r.forEach(s=>{const o=G[s];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Li.DEFAULT?new Gv(this.model,this.services,l):new sI(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(s=>{this.children[s].render(t)});const a={};Object.keys(this.children).forEach(s=>{const o=this.children[s],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===G.LEFT||l===G.RIGHT)&&(h+=5)),l){case G.TOP:a.top=d+h;break;case G.BOTTOM:a.bottom=d+h;break;case G.LEFT:a.left=u+h;break;case G.RIGHT:a.right=u+h;break}}),this.services.events.dispatchEvent(S.Axis.RENDER_COMPLETE),Object.keys(a).some(s=>this.margins[s]!==a[s])&&(this.margins=Object.assign(this.margins,a),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(S.ZoomBar.UPDATE),Object.keys(this.children).forEach(s=>{const o=this.children[s];o.margins=this.margins}),this.render(!0))}}class be extends yt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===ee.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===ee.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===ee.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===ee.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===Jt.VERTICAL&&this.drawYGrid(t),n===Jt.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=tn().domain([0,1]).range(t),this.yScale=tn().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 a=N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");a.attr("width","100%").attr("height","100%");const[s]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(a).attr("x",s).attr("y",o),a.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=b(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),a=N.appendOrSelect(this.backdrop,"g.x.skeleton"),s=a.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),a.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=b(this.getOptions(),"grid","y","numberOfTicks"),a=this.xScale.ticks(i).map(l=>l*n),s=N.appendOrSelect(this.backdrop,"g.y.skeleton"),o=s.selectAll("line").data(a);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),s.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:a,height:s}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",a).attr("height",s),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",a).attr("height",s).attr("fill","none");const u=Ra().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Vt.radiusOffset),h=t+(Math.min(a,s)-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+Vt.xOffset;c===te.CENTER?f=a/2:c===te.RIGHT&&(f=a-t-Vt.xOffset);const v=t+Vt.yOffset;p.attr("transform",`translate(${f}, ${v})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Vt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:a}=N.getSVGElementSize(this.parent,{useAttrs:!0}),s=0,o=a,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",s-3*.2*a).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
77
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ne extends yt{constructor(){super(...arguments),this.type="grid",this.renderType=rt.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),r=b(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(),a=eu(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&a.tickValues(l)}else{const o=b(this.getOptions(),"grid","x","numberOfTicks");a.ticks(o)}const s=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(a):s.call(a),this.cleanGrid(s)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),a=Km(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&a.tickValues(l)}else{const o=b(this.getOptions(),"grid","y","numberOfTicks");a.ticks(o)}const s=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(a):s.call(a),this.cleanGrid(s)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(An(u).tx)-Number(An(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+An(u).tx&&i++});const a=i+1<r.length?i+1:r.length,s=r[i],o=r[a];let l;if(!s)l=+An(o).tx;else if(o)l=+An(o).tx-+An(s).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+An(s).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=An(this),a={min:Number(i.tx)-r,max:Number(i.tx)+r};return a.min<=t[0]&&t[0]<=a.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),a=this.services.cartesianScales.getMainYScale(),[s,o]=i.range(),[l,c]=a.range();this.backdrop=N.appendOrSelect(r,"svg.chart-grid-backdrop");const u=N.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",s).attr("y",c).attr("width",Math.abs(o-s)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Vv extends yt{constructor(){super(...arguments),this.type="area",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{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?Mn.opacity.unselected:Mn.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",Mn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:a}=this.services,s=a.getOrientation(),o=Hu().curve(this.services.curves.getD3Curve()).defined(E=>{const w=a.getRangeIdentifier();return E[w]!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(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=(E,w)=>{b(r,"axes",E,"includeZero")===!1&&w[0]>0&&w[1]>0&&(d=w[0])},p=E=>u?a.getBoundedScaledValues(E)[0]:a.getRangeValue(d),f=E=>u?a.getBoundedScaledValues(E)[1]:a.getRangeValue(E);s===Jt.VERTICAL?(i=a.getMainYScale().domain(),h(a.getMainYAxisPosition(),i),o.x(E=>a.getDomainValue(E)).y0(E=>p(E)).y1(E=>f(E))):(i=a.getMainXScale().domain(),h(a.getMainXAxisPosition(),i),o.x0(E=>p(E)).x1(E=>f(E)).y(E=>a.getDomainValue(E)));const v=b(r,"color","gradient","enabled"),m=l&&l.length===1&&v;l.length>1&&v&&console.error("Gradients can only be enabled when having 1 single dataset");const y=n.selectAll("path.area").data(l,E=>E.name),g=R(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!l.length)return;if(m){const E=g.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let w;if(E)w=getComputedStyle(E,null).getPropertyValue("stroke");else{const A=b(this.model.getOptions(),"color","scale");if(A!==null){const I=Object.keys(A);w=A[I[0]]}}Jc.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:Jc.getStops(i,w)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,O=y.enter().append("path");m?O.merge(y).style("fill",E=>`url(#${this.services.domUtils.generateElementIDString(`${E.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:E.name,originalClassName:"area"})).attr("d",E=>{const{data:w}=E;return o(w)}):(O.attr("opacity",0).merge(y).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:E.name,originalClassName:"area"})).style("fill",E=>x.model.getFillColor(E.name,null,E.data)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"area-update-enter",animate:t})).attr("opacity",u?1:Mn.opacity.selected).attr("d",E=>{const{data:w}=E;return o(w)}),u&&O.attr("fill-opacity",Mn.opacity.selected).style("stroke",E=>x.model.getStrokeColor(E.name,null,E.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xi extends yt{constructor(){super(...arguments),this.type="line",this.renderType=rt.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?Cn.opacity.unselected:Cn.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",Cn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,a=p=>r.getDomainValue(p),s=p=>r.getRangeValue(p),[o,l]=kn(a,s,r.getOrientation()),c=this.getOptions(),u=Da().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(v=>c.axes[v].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const m=this.services.cartesianScales.getDomainIdentifier(v),y=this.services.cartesianScales.getRangeIdentifier(v);return{name:b(v,0,f),data:v.map(g=>({[m]:g.data.sharedStackKey,[f]:g[f],[y]:g[1]})),hidden:!gA(v,g=>g[0]!==g[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",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(v=>{const m=this.services.cartesianScales.getRangeIdentifier(v);return v[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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Fv=5;function aI(e,t){return e>t-Fv&&e<t+Fv}class Jn extends yt{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,a=this.services.cartesianScales.getOrientation(),s=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=a===Jt.HORIZONTAL?r:n,d=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=N.appendOrSelect(d,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=s.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>aI(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(S.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const v=this.pointsWithinLine.reduce((m,y)=>{if(m.length===0)return m.push(y),m;const g=m[0].domainValue,x=Math.abs(u-y.domainValue),O=Math.abs(u-g);return x>O||(x<O?m=[y]:m.push(y)),m},[]);if(v.length>0){const m=v.map(O=>O.originalData).filter(O=>{const E=this.services.cartesianScales.getRangeIdentifier(O);return O[E]!=null}),y=v.map(O=>O.domainValue),g=p.filter(O=>{const E=this.services.cartesianScales.getDomainValue(O);return y.includes(E)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Ym(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g,this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const x=v[0];a==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",x.domainValue).attr("y2",x.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",x.domainValue).attr("x2",x.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(S.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(a){const s=mr(a,t.parent.node());t.showRuler(a,s)};if(r.length>100){const a=r.length%50*12.5;i=VT(function(s){const{mousePosition:o}=this;t.showRuler(s,o)},a,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")}}class bn extends yt{constructor(){super(...arguments),this.type="scatter",this.renderType=rt.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 a;return(a=this.services.transitions)==null?void 0:a.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(S.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(a=>a[r].getTime()>=i[0].getTime()&&a[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(a=>t.axes[a].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(a=>{const s=i.getRangeIdentifier(a);return a[s]!==void 0&&a[s]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(b(this.getOptions(),"points","enabled")||b(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const s=a.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[s]}`);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(),[a,s]=kn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=kn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return s&&a?u<=s.scaleValue&&c>=a.scaleValue:s?u<=s.scaleValue:a?c>=a.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:a}=r.points,{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>s.getDomainValue(p),c=p=>s.getRangeValue(p),[u,d]=kn(l,c,s.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=s.getDomainIdentifier(p),v=this.model.getIsFilled(p[o],p[f],p,i)?[st.FILL,st.STROKE]:[st.STROKE];return this.model.getColorClassName({classNameTypes:v,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=s.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=s.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=s.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=s.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?a:1).attr("opacity",h?0:1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=s.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 a,s;const o=R(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),(a=t.services.events)==null||a.dispatchEvent(S.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(s=t.services.events)==null||s.dispatchEvent(S.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var a,s;const o=R(this);(a=t.services.events)==null||a.dispatchEvent(S.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(s=t.services.events)==null||s.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var a;(a=t.services.events)==null||a.dispatchEvent(S.Scatter.SCATTER_CLICK,{event:r,element:R(this),datum:i})}).on("mouseout",function(r,i){var a,s,o;const l=R(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.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)}(s=t.services.events)==null||s.dispatchEvent(S.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(S.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Gv extends yt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.SVG,this.truncation={[G.LEFT]:!1,[G.RIGHT]:!1,[G.TOP]:!1,[G.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=b(r,"axes",n,"visible"),a=this.getComponentContainer(),{width:s,height:o}=N.getSVGElementSize(a,{useAttrs:!0}),l=N.appendOrSelect(a,`g.axis.${n}`);let c,u;if(n===G.BOTTOM||n===G.TOP?(c=this.configs.axes[G.LEFT]?this.margins.left:0,u=this.configs.axes[G.RIGHT]?s-this.margins.right:s):(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===tt.LABELS||this.scaleType===tt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case G.LEFT:h=Km;break;case G.BOTTOM:h=eu;break;case G.RIGHT:h=SA;break;case G.TOP:h=wA;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",`${pt.GRAPHICS_OBJECT} ${pt.GROUP}`),f.attr("aria-label",`${n} ticks`));const v=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=b(r,"axes",n),y=this.scaleType===tt.TIME||m.scaleType===tt.TIME,g=n===G.LEFT||n===G.RIGHT,x=this.model.get("zoomDomain");if(x&&y&&!g&&d.domain(x),!i){f.attr("aria-hidden",!0);return}const O=b(m,"scaleType"),E=b(r,"data","loading"),w=b(m,"ticks","number"),A=b(m,"ticks","values"),I=b(m,"truncation","type"),L=b(m,"truncation","threshold"),D=b(m,"truncation","numCharacter"),$=w!==null,F=b(r,"timeScale"),P=N.appendOrSelect(v,"g.tick"),H=N.appendOrSelect(P,"text").text("0"),_=N.getSVGElementSize(H.node(),{useBBox:!0}).height;P.remove();const C=this.scaleType||m.scaleType||tt.LINEAR,k=h(d).tickSizeOuter(0);if(d.ticks){let K;if($?K=w:(K=qn.ticks.number,g&&(K=this.getNumberOfFittingTicks(o,_,qn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),k.ticks(K),y)if(!d.ticks(K).length)k.tickValues([]);else{const et=b(r,"timeScale","addSpaceOnEdges"),mt=b(r,"axes",n,"domain"),q=d.copy();et&&!mt&&q.nice(K);const J=q.ticks(K);et&&J.length>2&&!mt&&(J.splice(J.length-1,1),J.splice(0,1)),k.tickValues(J)}}let U;const B=b(m,"ticks","formatter"),{code:X,number:Y}=b(r,"locale");if(y){const K=Lc(k.tickValues(),b(r,"timeScale","timeInterval"));B===null?U=(et,mt)=>kc(et,mt,k.tickValues(),K,F,r.locale):U=(et,mt)=>{const q=kc(et,mt,k.tickValues(),K,F,r.locale);return B(et,mt,q)}}else B===null?C===tt.LINEAR&&(U=K=>Y(K,X)):U=B;k.tickFormat(U);const[ot,it]=this.services.cartesianScales.getScaleByPosition(n).domain();let xt;if(A){if(y)A.forEach((K,et)=>{K.getTime===void 0&&(A[et]=new Date(K))}),xt=A.filter(K=>{const et=K.getTime();return et>=new Date(ot).getTime()&&et<=new Date(it).getTime()});else if(O===tt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();xt=A.filter(et=>K.includes(et))}else xt=A.filter(K=>K>=ot&&K<=it);k.tickValues(xt)}switch(n){case G.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case G.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case G.RIGHT:f.attr("transform",`translate(${s-this.margins.right}, 0)`);break;case G.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const at=this.model.isDataEmpty();if(m.title){const K=N.appendOrSelect(l,"text.axis-title").html(at||E?"":yn(m.title)),et=b(m,"titleOrientation");let mt;switch(n){case G.LEFT:et===Ja.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case G.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case G.RIGHT:et===Ja.LEFT?K.attr("transform","rotate(-90)").attr("y",s).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-s).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case G.TOP:mt=N.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${mt/2})`).style("text-anchor","middle");break}}if(y){const K=Lc(k.tickValues(),b(r,"timeScale","timeInterval")),et=F.showDayName,mt=f;t&&(f=f.transition().call(q=>this.services.transitions.setupTransition({transition:q,name:"axis-update",animate:t}))),f=f.call(k),mt.selectAll(".tick").data(k.tickValues(),d).order().select("text").style("font-weight",(q,J)=>Df(q,J,k.tickValues(),K,et)?"bold":"normal")}else!t||!p?f=f.call(k):f=f.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(k);if(v.call(k),n===G.BOTTOM||n===G.TOP){let K=!1;const et=b(m,"ticks","rotation");if(et===ki.ALWAYS)K=!0;else if(et===ki.NEVER)K=!1;else if(!et||et===ki.AUTO)if(d.step)K=v.selectAll("g.tick text").nodes().some(mt=>N.getSVGElementSize(mt,{useBBox:!0}).width>=d.step());else{K=!1;const mt=v.append("text").text("A"),q=N.getSVGElementSize(mt.node(),{useBBox:!0}).width;let J;v.selectAll("g.tick").each(function(){const dt=R(this),j=parseFloat(b(An(this),"tx"));j!==null&&J+dt.text().length*q*.8>=j&&(K=!0),J=j}),mt.remove()}K?($||(k.ticks(this.getNumberOfFittingTicks(s,_,qn.ticks.horizontalSpaceRatio)),v.call(k),f.call(k)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===G.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(E?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",K=>K),v.selectAll("g.tick").attr("aria-label",K=>K),I!==Ue.NONE&&O===tt.LABELS&&!A){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const et=a.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const mt=this;l.selectAll("g.tick text").data(K).text(function(q){return q.length>L?(mt.truncation[n]=!0,la(q,I,D)):q}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(q){return q.length>L?la(q,I,D):q}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),a=b(i,"axes",n),s=b(a,"scaleType"),o=b(a,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOVER,{event:c,element:R(this),datum:u}),s===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,hoveredElement:R(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEMOVE,{event:c,element:R(this),datum:u}),s===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:R(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:R(this),datum:u}),s===tt.LABELS&&l.services.events.dispatchEvent(S.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 qm(i,2,qn.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 sI extends Gv{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer(),i=N.appendOrSelect(r,`g.axis.${n}`),a=this;i.selectAll("g.tick").each(function(s,o){const l=R(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 G.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case G.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case G.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,a.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case G.BOTTOM:p=-(u/2),f=d/2-2,a.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-qn.hover.rectanglePadding).attr("y",f).attr("width",u+qn.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(),a=b(i,"axes",n),s=b(a,"scaleType"),o=b(a,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=R(this).select("text"),d=u.datum();l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),s===tt.LABELS&&d.length>o&&l.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=R(this).select("text"),d=u.datum();l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:R(this).select("text"),datum:R(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:R(this).select("text"),datum:R(this).select("text").datum()}),s===tt.LABELS&&l.services.events.dispatchEvent(S.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(S.Axis.LABEL_FOCUS,{event:{...c,...u},element:R(this),datum:R(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_BLUR,{event:c,element:R(this),datum:R(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(S.Tooltip.HIDE),l.services.events.dispatchEvent(S.Axis.LABEL_BLUR,{event:c,element:R(this),datum:R(this).select("text").datum()})),n===G.LEFT||n===G.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 Se extends yt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=rt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(G),i=b(this.getOptions(),"axes");r.forEach(s=>{i[G[s]]&&(n[G[s]]=!0)}),this.configs.axes=n,r.forEach(s=>{const o=G[s];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Di.DEFAULT?new Gv(this.model,this.services,l):new sI(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(s=>{this.children[s].render(t)});const a={};Object.keys(this.children).forEach(s=>{const o=this.children[s],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===G.LEFT||l===G.RIGHT)&&(h+=5)),l){case G.TOP:a.top=d+h;break;case G.BOTTOM:a.bottom=d+h;break;case G.LEFT:a.left=u+h;break;case G.RIGHT:a.right=u+h;break}}),this.services.events.dispatchEvent(S.Axis.RENDER_COMPLETE),Object.keys(a).some(s=>this.margins[s]!==a[s])&&(this.margins=Object.assign(this.margins,a),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(S.ZoomBar.UPDATE),Object.keys(this.children).forEach(s=>{const o=this.children[s];o.margins=this.margins}),this.render(!0))}}class be extends yt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===ee.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===ee.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===ee.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===ee.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===Jt.VERTICAL&&this.drawYGrid(t),n===Jt.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=tn().domain([0,1]).range(t),this.yScale=tn().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 a=N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");a.attr("width","100%").attr("height","100%");const[s]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(a).attr("x",s).attr("y",o),a.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=b(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),a=N.appendOrSelect(this.backdrop,"g.x.skeleton"),s=a.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),a.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=b(this.getOptions(),"grid","y","numberOfTicks"),a=this.xScale.ticks(i).map(l=>l*n),s=N.appendOrSelect(this.backdrop,"g.y.skeleton"),o=s.selectAll("line").data(a);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),s.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:a,height:s}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",a).attr("height",s),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",a).attr("height",s).attr("fill","none");const u=La().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Vt.radiusOffset),h=t+(Math.min(a,s)-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+Vt.xOffset;c===te.CENTER?f=a/2:c===te.RIGHT&&(f=a-t-Vt.xOffset);const v=t+Vt.yOffset;p.attr("transform",`translate(${f}, ${v})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Vt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:a}=N.getSVGElementSize(this.parent,{useAttrs:!0}),s=0,o=a,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",s-3*.2*a).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
78
78
  <stop class="${n}" offset="${s}"></stop>
79
79
  <stop class="${r}" offset="${s+.2}"></stop>
80
80
  <stop class="${n}" offset="${s+2*.2}"></stop>
81
- `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${s-3*.2*a}, 0)`).transition().duration(2e3).delay(1e3).ease(CA).attr("gradientTransform",`translate(${o+3*.2*a}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class oI extends yt{constructor(){super(...arguments),this.type="boxplot",this.renderType=rt.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.model.getDataGroupNames(),s=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=s.range(),[u,d]=o.range(),h=c-l,p=u-d;if(h===0)return;const{cartesianScales:f}=this.services,v=f.getOrientation(),m=v===Jt.VERTICAL,[y,g]=kn($=>this.services.cartesianScales.getDomainValue($),$=>this.services.cartesianScales.getRangeValue($),v),x=Math.floor((m?h:p)/a.length),O=Math.min(x/2,16),E=this.model.getBoxplotData(),w=n.selectAll(".box-group").data(E);w.exit().remove();const A=w.enter().append("g").attr("class","box-group"),I=w.merge(A);A.append("path").merge(w.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Fe.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalstartline",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i]),P=F,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.quartiles.q_25);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Fe.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalendline",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i]),P=F,H=f.getRangeValue($.whiskers.max),_=f.getRangeValue($.quartiles.q_75);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"box"})).attr("fill-opacity",Fe.box.opacity.default).attr("stroke-width",Fe.strokeWidth.default).attr("role",pt.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 F=f.getDomainValue($[i])-O/2,P=F+O,H=f.getRangeValue(Math[m?"max":"min"]($.quartiles.q_75,$.quartiles.q_25)),_=H+Math.abs(f.getRangeValue($.quartiles.q_75)-f.getRangeValue($.quartiles.q_25));return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",$=>{const F=f.getDomainValue($[i])-O/2,P=F+O,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.whiskers.max);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Fe.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-startingwhisker",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i])-O/4,P=F+O/2,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.whiskers.min);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.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 F=f.getDomainValue($[i])-O/2,P=F+O,H=f.getRangeValue($.quartiles.q_50);return me({x0:F,x1:P,y0:H,y1:H},v)}),A.append("path").merge(w.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Fe.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-endingwhisker",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i])-O/4,P=F+O/2,H=f.getRangeValue($.whiskers.max),_=f.getRangeValue($.whiskers.max);return me({x0:F,x1:P,y0:H,y1:_},v)});const R=I.selectAll("circle.outlier").data($=>$.outliers.map(F=>({min:$.whiskers.min,max:$.whiskers.max,[i]:$[i],value:F})));R.exit().remove();const L=R.enter().append("circle");R.merge(L).attr("r",Fe.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Fe.circle.opacity.default).attr("cx",y).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-circles",animate:t})).attr("cy",g),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,a){const s=D(this);D(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Fe.box.opacity.hovered),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:s,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Minimum",value:a.whiskers.min},{label:"Q1",value:a.quartiles.q_25},{label:"Median",value:a.quartiles.q_50},{label:"Q3",value:a.quartiles.q_75},{label:"Maximum",value:a.whiskers.max},{label:"IQR",value:a.quartiles.q_75-a.quartiles.q_25}]}),t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEOVER,{event:i,element:s,datum:a})}).on("mousemove",function(i,a){const s=D(this);t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEMOVE,{event:i,element:s,datum:a}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,a){t.services.events.dispatchEvent(S.Boxplot.BOX_CLICK,{event:i,element:D(this),datum:a})}).on("mouseout",function(i,a){const s=D(this);D(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Fe.box.opacity.default),t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEOUT,{event:i,element:s,datum:a}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:s})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(a,s){const o=D(this);o.classed("hovered",!0).attr("fill-opacity",Fe.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Outlier",value:s[i]}]}),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOVER,{event:a,element:o,datum:s})}).on("mousemove",function(a,s){const o=D(this);t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEMOVE,{event:a,element:o,datum:s}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,s){t.services.events.dispatchEvent(S.Boxplot.OUTLIER_CLICK,{event:a,element:D(this),datum:s})}).on("mouseout",function(a,s){const o=D(this);o.classed("hovered",!1).attr("fill-opacity",Fe.circle.opacity.default),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOUT,{event:a,element:o,datum:s}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class _i extends yt{constructor(){super(...arguments),this.type="zero-line",this.renderType=rt.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,a]=r.domain(),s=i>0&&a<0||i<0&&a>0,o=this.getComponentContainer();if(!s){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=bf({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 lI extends bn{constructor(){super(...arguments),this.type="bubble",this.renderType=rt.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),a=i.map(c=>c[r]).filter(c=>c),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=a.length>0,l=o?Ke(a):[1,1];return tn().domain(l).range(o?n.bubble.radiusRange(s,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,a=this.getRadiusScale(t),{groupMapsTo:s}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=kn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",pt.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=>a(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:h[s],originalClassName:"dot"})).style("fill",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[s],h[p],h)}).style("stroke",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[s],h[p],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class cI extends yt{constructor(){super(...arguments),this.type="bullet",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=s.range(),[,u]=s.domain(),d=()=>{const v=[];a.forEach(y=>{y.ranges?y.ranges.forEach((g,x)=>{g!=null&&g<u&&v.push({datum:y,value:g,order:x+1})}):v.push({datum:y,order:1})});const m=N.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(v,y=>`${y[r]}-${y.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let g,x,O,E;return y.order===1?(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,x=g+16,O=c-2,E=l+1):(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,x=g+16,O=this.services.cartesianScales.getRangeValue(y.value),E=c),me({x0:g,x1:x,y0:O,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const v=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(a,m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).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 y=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[y],m)}).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-4,g=y+8,x=this.services.cartesianScales.getRangeValue(0)+1,O=this.services.cartesianScales.getRangeValue(m);return me({x0:y,x1:g,y0:x,y1:O},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const v=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(a.filter(m=>b(m,"marker")!==null),m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-12,g=y+24,x=this.services.cartesianScales.getRangeValue(m.marker);return me({x0:y,x1:g,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let v=[];a.filter(y=>b(y,"marker")!==null).forEach(y=>{const g=y.marker,x=y[o];v=v.concat([{datum:y,value:g*.25,barValue:x},{datum:y,value:g*.5,barValue:x},{datum:y,value:g*.75,barValue:x}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(v,y=>y[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:g})=>{let x=4;y.ranges&&y.ranges.indexOf(g)!==-1&&(x=8);const O=this.services.cartesianScales.getDomainValue(y)-x/2,E=O+x,w=this.services.cartesianScales.getRangeValue(g);return me({x0:O,x1:E,y0:w,y1:w},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:a,number:s}=b(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=D(this);c.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=b(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:b(n,"locale","translations","group")||b(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:`${s(Math.floor(l[i]/l.marker*100),a)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:o,element:D(this),datum:l}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:o,element:D(this),datum:l})}).on("mouseout",function(o,l){const c=D(this);c.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function uI(e){return e}function hI(e){if(e==null)return uI;var t,n,r=e.scale[0],i=e.scale[1],a=e.translate[0],s=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+a,d[1]=(n+=o[1])*i+s;c<u;)d[c]=o[c],++c;return d}}function dI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function pI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return jv(e,n)})}:jv(e,t)}function jv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=yh(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:a}:r==null?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function yh(e,t){var n=hI(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,f=h.length;p<f;++p)d.push(n(h[p],p));u<0&&dI(d,f)}function a(u){return n(u)}function s(u){for(var d=[],h=0,p=u.length;h<p;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=a(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(a);break;case"LineString":h=s(u.arcs);break;case"MultiLineString":h=u.arcs.map(s);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function fI(e,t){var n={},r={},i={},a=[],s=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++s],t[s]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],p,f;if(p=i[d])if(delete i[p.end],p.push(c),p.end=h,f=r[h]){delete r[f.start];var v=f===p?p:p.concat(f);r[v.start=p.start]=i[v.end=f.end]=v}else r[p.start]=i[p.end]=p;else if(p=r[h])if(delete r[p.start],p.unshift(c),p.start=d,f=i[d]){delete i[f.end];var m=f===p?p:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[p.start]=i[p.end]=p;else p=[c],r[p.start=d]=i[p.end=h]=p});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(p){h[0]+=p[0],h[1]+=p[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(p){n[p<0?~p:p]=1}),a.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||a.push([c])}),a}function mI(e){for(var t=-1,n=e.length,r,i=e[n-1],a=0;++t<n;)r=i,i=e[t],a+=r[0]*i[1]-r[1]*i[0];return Math.abs(a)}function gI(e){return yh(e,vI.apply(this,arguments))}function vI(e,t){var n={},r=[],i=[];t.forEach(a);function a(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(a);break;case"Polygon":s(l.arcs);break;case"MultiPolygon":l.arcs.forEach(s);break}}function s(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return mI(yh(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(p){p._||(p._=1,u.push(p))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(v){v.forEach(function(m){m.forEach(function(y){n[y<0?~y:y].length<2&&c.push(y)})})}),c=fI(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),p,f;d<u;++d)(p=o(c[d]))>h&&(f=c[0],c[0]=c[d],c[d]=f,h=p);return c}).filter(function(l){return l.length>0})}}class yI extends Jn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=rt.SVG}showRuler(t,[n,r]){const i=this.parent,a=this.model.getOptions(),{cartesianScales:s}=this.services,o=s.getOrientation(),l=s.getRangeScale(),[c,u]=l.range(),d=s.getDomainScale(),h=d.invert(o===Jt.VERTICAL?n:r),p=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=N.appendOrSelect(p,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(Et(m,"data.x0"))<=h&&parseFloat(Et(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Ym(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),y=parseFloat(Et(m,"data.x0")),g=parseFloat(Et(m,"data.x1")),x=this.model.getActiveDataGroupNames(),O=x.reverse().map(E=>({label:E,value:Et(m,`data.${E}`),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:E})})).filter(E=>E.value!==0);if(O.length>0){this.services.events.dispatchEvent(S.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:f,items:[{label:Et(a,"bins.rangeLabel")||"Range",value:`${y} – ${g}`},...O,...b(a,"tooltip","showTotal")===!0?[{label:Et(a,"locale.translations.total")||Et(a,"tooltip.totalLabel")||"Total",value:x.reduce((w,A)=>w+parseFloat(Et(m,`data.${A}`)),0)}]:[]]}),p.attr("opacity",1);const E=d((y+g)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",E).attr("y2",E):f.attr("y1",u).attr("y2",c).attr("x1",E).attr("x2",E)}else this.hideRuler()}else this.hideRuler()}}class Ho extends Jn{formatTooltipData(t){return t.reverse()}}const bI=(e,t)=>{const n=e.x,r=e.y,i=t.x,a=t.y,s=sg();return s.moveTo(n,r),s.lineTo(i,a),s.toString()},xI={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},_I={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},EI={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},OI={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},wI={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},SI={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class zv extends hh{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=rt.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:a}=N.getSVGElementSize(i,{useAttrs:!0}),s=b(this.getOptions(),"data","loading");if(a>Yt.color.barWidth&&!s){const o=b(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(S.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=N.getSVGElementSize(r,{useAttrs:!0}),a=b(n,"color","gradient","colors"),s=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){r.html("");return}const c=!Xe(a),u=If(this.model.getDisplayData()),d=!(i<=Yt.color.barWidth),h=d?Yt.color.barWidth:i,p=N.appendOrSelect(r,"g.legend"),f=N.appendOrSelect(p,"g.legend-axis");if(l){const R=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(R,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const v=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&v==="mono"||o<1&&o>2&&v==="diverge")&&(o=1);let m=[];const y=v==="diverge"?17:11;if(c)m=a;else for(let R=1;R<y+1;R++)m.push(s===Ri.LINEAR?`stop-color-${v}-${o}-${R}`:`fill-${v}-${o}-${R}`);const g=Ae(u[0],u[1]),x=MA(g,3),O=tn().domain(u).range([0,h]),E=eu(O).tickSize(0).tickValues(x),{code:w,number:A}=b(n,"locale");E.tickFormat(R=>A(R,w));let I;switch(s){case Ri.LINEAR:this.drawLinear(m,p,h);break;case Ri.QUANTIZE:I=this.drawQuantize(m,v,c,p,h),O.range([I,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${Yt.color.axisYTranslation})`).call(E),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",(a,s)=>`${s*i}%`).attr("class",(a,s)=>t[s]).attr("stop-color",a=>a),N.appendOrSelect(n,"rect").attr("width",r).attr("height",Yt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,a){!r&&n==="diverge"&&t.splice(t.length/2,1);const s=ha().domain(t).range([0,a]);return N.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(s.domain()).join("rect").attr("x",o=>s(o)).attr("y",0).attr("width",Math.max(0,s.bandwidth()-1)).attr("height",Yt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?s.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(S.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class TI extends Ha{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:a}=r.data,s=r.locale.translations.meter.title;if(b(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(s?[s]:[n[a]]);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=b(n,"meter","proportional","total"),a=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let s;if(r===i)s=null;else{const u=i!==null?i-r:r,d=b(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=b(n,"locale");s=d!==null?d({datasetsTotal:r,total:i}):`${p(r,h)} ${a} used (${p(u,h)} ${a} available)`}const o=t.selectAll("text.proportional-meter-title").data([s]);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=b(n,"meter","proportional","total"),i=r?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),a=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",s=b(n,"meter","proportional","totalFormatter"),{code:o,number:l}=b(n,"locale"),c=s!==null?s(i):`${l(r,o)} ${a} 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-se.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(),a=se.status.indicatorSize/2,s=N.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-a}, 0)`),o=i?[i]:[],l=s.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const c=s.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),{code:n,number:r}=b(this.getOptions(),"locale"),i=this.getComponentContainer(),a=N.appendOrSelect(i,"text.meter-title"),s=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(s),l=se.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+a.attr("x")+a.node().getComputedTextLength()+l).attr("y",a.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=N.appendOrSelect(this.parent,"tspan"),i=se.statusBar.paddingRight,a=Math.ceil(r.node().getComputedTextLength());N.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+a+i)}getMaxTitleWidth(){const t=b(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-se.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=se.statusBar.paddingRight,a=r.node().getComputedTextLength(),s=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(s,{useBBox:!0}).width+se.status.paddingLeft;return n-a-i-o}}getStatusIconPathString(t){switch(t){case Ai.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 Ai.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ai.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 bh extends yt{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 a=b(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*a/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 t<i(r[0])||n>i(r[1])}return!1}}class $I extends yt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=rt.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:ti.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({withinChartClip:!0}),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let a=this.model.getDisplayData();const s=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=b(l,"canvasZoom","enabled");s&&b(a,0,"children")&&(a=b(a,0,"children"));const u=Ca({children:a}).sum(f=>f.value).sort((f,v)=>v.value-f.value),d=xR().size([r,i]).padding(f=>f.depth>=1?ti.padding.children+3:ti.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 v=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${v}`:`node node-leaf ${v}`})}).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",ti.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Jr),this.setBackgroundListeners()),s||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",ti.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){D(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=D(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,Jr)})}getZoomIcon(){return`
81
+ `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${s-3*.2*a}, 0)`).transition().duration(2e3).delay(1e3).ease(CA).attr("gradientTransform",`translate(${o+3*.2*a}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class oI extends yt{constructor(){super(...arguments),this.type="boxplot",this.renderType=rt.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.model.getDataGroupNames(),s=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=s.range(),[u,d]=o.range(),h=c-l,p=u-d;if(h===0)return;const{cartesianScales:f}=this.services,v=f.getOrientation(),m=v===Jt.VERTICAL,[y,g]=kn($=>this.services.cartesianScales.getDomainValue($),$=>this.services.cartesianScales.getRangeValue($),v),x=Math.floor((m?h:p)/a.length),O=Math.min(x/2,16),E=this.model.getBoxplotData(),w=n.selectAll(".box-group").data(E);w.exit().remove();const A=w.enter().append("g").attr("class","box-group"),I=w.merge(A);A.append("path").merge(w.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Fe.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalstartline",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i]),P=F,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.quartiles.q_25);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Fe.strokeWidth.default).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-verticalendline",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i]),P=F,H=f.getRangeValue($.whiskers.max),_=f.getRangeValue($.quartiles.q_75);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"box"})).attr("fill-opacity",Fe.box.opacity.default).attr("stroke-width",Fe.strokeWidth.default).attr("role",pt.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 F=f.getDomainValue($[i])-O/2,P=F+O,H=f.getRangeValue(Math[m?"max":"min"]($.quartiles.q_75,$.quartiles.q_25)),_=H+Math.abs(f.getRangeValue($.quartiles.q_75)-f.getRangeValue($.quartiles.q_25));return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",$=>{const F=f.getDomainValue($[i])-O/2,P=F+O,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.whiskers.max);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Fe.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-startingwhisker",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i])-O/4,P=F+O/2,H=f.getRangeValue($.whiskers.min),_=f.getRangeValue($.whiskers.min);return me({x0:F,x1:P,y0:H,y1:_},v)}),A.append("path").merge(w.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 F=f.getDomainValue($[i])-O/2,P=F+O,H=f.getRangeValue($.quartiles.q_50);return me({x0:F,x1:P,y0:H,y1:H},v)}),A.append("path").merge(w.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Fe.strokeWidth.thicker).attr("fill","none").transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-endingwhisker",animate:t})).attr("d",$=>{const F=f.getDomainValue($[i])-O/4,P=F+O/2,H=f.getRangeValue($.whiskers.max),_=f.getRangeValue($.whiskers.max);return me({x0:F,x1:P,y0:H,y1:_},v)});const L=I.selectAll("circle.outlier").data($=>$.outliers.map(F=>({min:$.whiskers.min,max:$.whiskers.max,[i]:$[i],value:F})));L.exit().remove();const D=L.enter().append("circle");L.merge(D).attr("r",Fe.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Fe.circle.opacity.default).attr("cx",y).transition().call($=>this.services.transitions.setupTransition({transition:$,name:"boxplot-update-circles",animate:t})).attr("cy",g),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,a){const s=R(this);R(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Fe.box.opacity.hovered),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:s,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Minimum",value:a.whiskers.min},{label:"Q1",value:a.quartiles.q_25},{label:"Median",value:a.quartiles.q_50},{label:"Q3",value:a.quartiles.q_75},{label:"Maximum",value:a.whiskers.max},{label:"IQR",value:a.quartiles.q_75-a.quartiles.q_25}]}),t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEOVER,{event:i,element:s,datum:a})}).on("mousemove",function(i,a){const s=R(this);t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEMOVE,{event:i,element:s,datum:a}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,a){t.services.events.dispatchEvent(S.Boxplot.BOX_CLICK,{event:i,element:R(this),datum:a})}).on("mouseout",function(i,a){const s=R(this);R(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Fe.box.opacity.default),t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEOUT,{event:i,element:s,datum:a}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:s})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(a,s){const o=R(this);o.classed("hovered",!0).attr("fill-opacity",Fe.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Outlier",value:s[i]}]}),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOVER,{event:a,element:o,datum:s})}).on("mousemove",function(a,s){const o=R(this);t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEMOVE,{event:a,element:o,datum:s}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,s){t.services.events.dispatchEvent(S.Boxplot.OUTLIER_CLICK,{event:a,element:R(this),datum:s})}).on("mouseout",function(a,s){const o=R(this);o.classed("hovered",!1).attr("fill-opacity",Fe.circle.opacity.default),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOUT,{event:a,element:o,datum:s}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class _i extends yt{constructor(){super(...arguments),this.type="zero-line",this.renderType=rt.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,a]=r.domain(),s=i>0&&a<0||i<0&&a>0,o=this.getComponentContainer();if(!s){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=bf({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 lI extends bn{constructor(){super(...arguments),this.type="bubble",this.renderType=rt.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),a=i.map(c=>c[r]).filter(c=>c),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=a.length>0,l=o?Ke(a):[1,1];return tn().domain(l).range(o?n.bubble.radiusRange(s,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,a=this.getRadiusScale(t),{groupMapsTo:s}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=kn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",pt.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=>a(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:h[s],originalClassName:"dot"})).style("fill",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[s],h[p],h)}).style("stroke",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[s],h[p],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class cI extends yt{constructor(){super(...arguments),this.type="bullet",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=s.range(),[,u]=s.domain(),d=()=>{const v=[];a.forEach(y=>{y.ranges?y.ranges.forEach((g,x)=>{g!=null&&g<u&&v.push({datum:y,value:g,order:x+1})}):v.push({datum:y,order:1})});const m=N.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(v,y=>`${y[r]}-${y.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let g,x,O,E;return y.order===1?(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,x=g+16,O=c-2,E=l+1):(g=this.services.cartesianScales.getDomainValue(y.datum)-16/2,x=g+16,O=this.services.cartesianScales.getRangeValue(y.value),E=c),me({x0:g,x1:x,y0:O,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const v=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(a,m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).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 y=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[y],m)}).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-4,g=y+8,x=this.services.cartesianScales.getRangeValue(0)+1,O=this.services.cartesianScales.getRangeValue(m);return me({x0:y,x1:g,y0:x,y1:O},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const v=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(a.filter(m=>b(m,"marker")!==null),m=>m[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const y=this.services.cartesianScales.getDomainValue(m)-12,g=y+24,x=this.services.cartesianScales.getRangeValue(m.marker);return me({x0:y,x1:g,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let v=[];a.filter(y=>b(y,"marker")!==null).forEach(y=>{const g=y.marker,x=y[o];v=v.concat([{datum:y,value:g*.25,barValue:x},{datum:y,value:g*.5,barValue:x},{datum:y,value:g*.75,barValue:x}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(v,y=>y[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:g})=>{let x=4;y.ranges&&y.ranges.indexOf(g)!==-1&&(x=8);const O=this.services.cartesianScales.getDomainValue(y)-x/2,E=O+x,w=this.services.cartesianScales.getRangeValue(g);return me({x0:O,x1:E,y0:w,y1:w},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:a,number:s}=b(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=R(this);c.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=b(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:b(n,"locale","translations","group")||b(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:`${s(Math.floor(l[i]/l.marker*100),a)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:o,element:R(this),datum:l}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:o,element:R(this),datum:l})}).on("mouseout",function(o,l){const c=R(this);c.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function uI(e){return e}function hI(e){if(e==null)return uI;var t,n,r=e.scale[0],i=e.scale[1],a=e.translate[0],s=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+a,d[1]=(n+=o[1])*i+s;c<u;)d[c]=o[c],++c;return d}}function dI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function pI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return jv(e,n)})}:jv(e,t)}function jv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=yh(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:a}:r==null?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function yh(e,t){var n=hI(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,f=h.length;p<f;++p)d.push(n(h[p],p));u<0&&dI(d,f)}function a(u){return n(u)}function s(u){for(var d=[],h=0,p=u.length;h<p;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=a(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(a);break;case"LineString":h=s(u.arcs);break;case"MultiLineString":h=u.arcs.map(s);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function fI(e,t){var n={},r={},i={},a=[],s=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++s],t[s]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],p,f;if(p=i[d])if(delete i[p.end],p.push(c),p.end=h,f=r[h]){delete r[f.start];var v=f===p?p:p.concat(f);r[v.start=p.start]=i[v.end=f.end]=v}else r[p.start]=i[p.end]=p;else if(p=r[h])if(delete r[p.start],p.unshift(c),p.start=d,f=i[d]){delete i[f.end];var m=f===p?p:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[p.start]=i[p.end]=p;else p=[c],r[p.start=d]=i[p.end=h]=p});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(p){h[0]+=p[0],h[1]+=p[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(p){n[p<0?~p:p]=1}),a.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||a.push([c])}),a}function mI(e){for(var t=-1,n=e.length,r,i=e[n-1],a=0;++t<n;)r=i,i=e[t],a+=r[0]*i[1]-r[1]*i[0];return Math.abs(a)}function gI(e){return yh(e,vI.apply(this,arguments))}function vI(e,t){var n={},r=[],i=[];t.forEach(a);function a(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(a);break;case"Polygon":s(l.arcs);break;case"MultiPolygon":l.arcs.forEach(s);break}}function s(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return mI(yh(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(p){p._||(p._=1,u.push(p))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(v){v.forEach(function(m){m.forEach(function(y){n[y<0?~y:y].length<2&&c.push(y)})})}),c=fI(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),p,f;d<u;++d)(p=o(c[d]))>h&&(f=c[0],c[0]=c[d],c[d]=f,h=p);return c}).filter(function(l){return l.length>0})}}class yI extends Jn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=rt.SVG}showRuler(t,[n,r]){const i=this.parent,a=this.model.getOptions(),{cartesianScales:s}=this.services,o=s.getOrientation(),l=s.getRangeScale(),[c,u]=l.range(),d=s.getDomainScale(),h=d.invert(o===Jt.VERTICAL?n:r),p=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=N.appendOrSelect(p,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(Et(m,"data.x0"))<=h&&parseFloat(Et(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Ym(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=R(v.nodes()[0]).datum(),y=parseFloat(Et(m,"data.x0")),g=parseFloat(Et(m,"data.x1")),x=this.model.getActiveDataGroupNames(),O=x.reverse().map(E=>({label:E,value:Et(m,`data.${E}`),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:E})})).filter(E=>E.value!==0);if(O.length>0){this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:Et(a,"bins.rangeLabel")||"Range",value:`${y} – ${g}`},...O,...b(a,"tooltip","showTotal")===!0?[{label:Et(a,"locale.translations.total")||Et(a,"tooltip.totalLabel")||"Total",value:x.reduce((w,A)=>w+parseFloat(Et(m,`data.${A}`)),0)}]:[]]}),p.attr("opacity",1);const E=d((y+g)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",E).attr("y2",E):f.attr("y1",u).attr("y2",c).attr("x1",E).attr("x2",E)}else this.hideRuler()}else this.hideRuler()}}class Ho extends Jn{formatTooltipData(t){return t.reverse()}}const bI=(e,t)=>{const n=e.x,r=e.y,i=t.x,a=t.y,s=sg();return s.moveTo(n,r),s.lineTo(i,a),s.toString()},xI={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},_I={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},EI={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},OI={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},wI={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},SI={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class zv extends hh{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=rt.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:a}=N.getSVGElementSize(i,{useAttrs:!0}),s=b(this.getOptions(),"data","loading");if(a>Yt.color.barWidth&&!s){const o=b(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(S.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=N.getSVGElementSize(r,{useAttrs:!0}),a=b(n,"color","gradient","colors"),s=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){r.html("");return}const c=!Xe(a),u=If(this.model.getDisplayData()),d=!(i<=Yt.color.barWidth),h=d?Yt.color.barWidth:i,p=N.appendOrSelect(r,"g.legend"),f=N.appendOrSelect(p,"g.legend-axis");if(l){const L=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(L,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const v=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&v==="mono"||o<1&&o>2&&v==="diverge")&&(o=1);let m=[];const y=v==="diverge"?17:11;if(c)m=a;else for(let L=1;L<y+1;L++)m.push(s===Li.LINEAR?`stop-color-${v}-${o}-${L}`:`fill-${v}-${o}-${L}`);const g=Ae(u[0],u[1]),x=MA(g,3),O=tn().domain(u).range([0,h]),E=eu(O).tickSize(0).tickValues(x),{code:w,number:A}=b(n,"locale");E.tickFormat(L=>A(L,w));let I;switch(s){case Li.LINEAR:this.drawLinear(m,p,h);break;case Li.QUANTIZE:I=this.drawQuantize(m,v,c,p,h),O.range([I,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${Yt.color.axisYTranslation})`).call(E),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",(a,s)=>`${s*i}%`).attr("class",(a,s)=>t[s]).attr("stop-color",a=>a),N.appendOrSelect(n,"rect").attr("width",r).attr("height",Yt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,a){!r&&n==="diverge"&&t.splice(t.length/2,1);const s=ha().domain(t).range([0,a]);return N.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(s.domain()).join("rect").attr("x",o=>s(o)).attr("y",0).attr("width",Math.max(0,s.bandwidth()-1)).attr("height",Yt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?s.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(S.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class TI extends Ha{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:a}=r.data,s=r.locale.translations.meter.title;if(b(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(s?[s]:[n[a]]);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=b(n,"meter","proportional","total"),a=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let s;if(r===i)s=null;else{const u=i!==null?i-r:r,d=b(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=b(n,"locale");s=d!==null?d({datasetsTotal:r,total:i}):`${p(r,h)} ${a} used (${p(u,h)} ${a} available)`}const o=t.selectAll("text.proportional-meter-title").data([s]);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=b(n,"meter","proportional","total"),i=r?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),a=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",s=b(n,"meter","proportional","totalFormatter"),{code:o,number:l}=b(n,"locale"),c=s!==null?s(i):`${l(r,o)} ${a} 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-se.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(),a=se.status.indicatorSize/2,s=N.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-a}, 0)`),o=i?[i]:[],l=s.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const c=s.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),{code:n,number:r}=b(this.getOptions(),"locale"),i=this.getComponentContainer(),a=N.appendOrSelect(i,"text.meter-title"),s=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(s),l=se.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+a.attr("x")+a.node().getComputedTextLength()+l).attr("y",a.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=N.appendOrSelect(this.parent,"tspan"),i=se.statusBar.paddingRight,a=Math.ceil(r.node().getComputedTextLength());N.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+a+i)}getMaxTitleWidth(){const t=b(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-se.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=se.statusBar.paddingRight,a=r.node().getComputedTextLength(),s=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(s,{useBBox:!0}).width+se.status.paddingLeft;return n-a-i-o}}getStatusIconPathString(t){switch(t){case Ai.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 Ai.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ai.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 bh extends yt{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 a=b(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*a/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 t<i(r[0])||n>i(r[1])}return!1}}class $I extends yt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=rt.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:ti.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({withinChartClip:!0}),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let a=this.model.getDisplayData();const s=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=b(l,"canvasZoom","enabled");s&&b(a,0,"children")&&(a=b(a,0,"children"));const u=Ca({children:a}).sum(f=>f.value).sort((f,v)=>v.value-f.value),d=xL().size([r,i]).padding(f=>f.depth>=1?ti.padding.children+3:ti.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 v=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${v}`:`node node-leaf ${v}`})}).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",ti.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Jr),this.setBackgroundListeners()),s||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",ti.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){R(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=R(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,Jr)})}getZoomIcon(){return`
82
82
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
83
83
  <polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
84
84
  <path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
85
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0);const a=t.model.getHierarchyLevel(),s=a>2&&!i.classed("focal"),o=b(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!s){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&&a<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:Et(p,"locale.translations.total")||Et(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(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&a<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),a=i.classed("non-focal"),s=b(t.model.getOptions(),"canvasZoom","enabled");if(s&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Jr)}else if(r.depth===2&&r.children&&!a&&s){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Jr),n.stopPropagation()}t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function MI(e,t){const n=Ji(this._current,e);return r=>(this._current=n(r),t(this._current))}class Wv extends yt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Vt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:a}=i.data,{valueMapsTo:s}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(R=>R[s]>0),l=this.computeRadius();this.arc=Ra().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ra().innerRadius(this.getInnerRadius()).outerRadius(l+Vt.hoverArc.outerRadiusOffset);const c=FR().value(R=>R[s]).sort(b(i,"pie","sortFunction")).padAngle(Vt.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",pt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,R=>R.data[a]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",R=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:R.data[a],originalClassName:"slice"})).style("fill",R=>n.model.getFillColor(R.data[a],null,R.data)).attr("d",this.arc).transition().call(R=>this.services.transitions.setupTransition({transition:R,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",R=>`${R[s]}, ${$c(R.data[s],o,s)+"%"}`).attrTween("d",function(R){return MI.bind(this)(R,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=b(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(R=>R.data[s]>0):[],v=N.appendOrSelect(r,"g.labels").attr("role",pt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,R=>R.data[a]);v.exit().attr("opacity",0).remove();const m=v.enter().append("text").classed("pie-label",!0),y=[];m.merge(v).style("text-anchor","middle").text(R=>i.pie.labels.formatter?i.pie.labels.formatter({...R,percentageValue:$c(R.data[s],o,s,!0)}):h($c(R.data[s],o,s),d)+"%").datum(function(R){const L=l+7,$=(R.endAngle-R.startAngle)/2+R.startAngle,F=$/Math.PI*180,P=this.getComputedTextLength();return R.textOffsetX=P/2,R.textOffsetY=F>90&&F<270?10:0,R.xPosition=(R.textOffsetX+L)*Math.sin($),R.yPosition=(R.textOffsetY+L)*-Math.cos($),R}).attr("transform",function(R,L){const $=f.length,F=(R.endAngle-R.startAngle)*(180/Math.PI);if(L>=$-2&&F<Vt.callout.minSliceDegree){let P,H;return R.index===$-1?(P=R.xPosition+Vt.callout.offsetX+Vt.callout.textMargin+R.textOffsetX,H=R.yPosition-Vt.callout.offsetY,R.direction=Ci.RIGHT,y.push(R)):(P=R.xPosition-Vt.callout.offsetX-R.textOffsetX-Vt.callout.textMargin,H=R.yPosition-Vt.callout.offsetY,R.direction=Ci.LEFT,y.push(R)),`translate(${P}, ${H})`}return`translate(${R.xPosition}, ${R.yPosition})`}),this.renderCallouts(y);const g=b(i,"donut")?"donut":"pie",x=b(i,g,"alignment"),{width:O}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),E=p?Vt.xOffset:0,w=p?Vt.yOffset:0;let A=l+E;x===te.CENTER?A=O/2:x===te.RIGHT&&(A=O-l-Vt.xOffset);let I=l+w;y.length>0&&(I+=Vt.yOffsetCallout),r.attr("x",A+7).attr("y",I),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",pt.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",pt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(a){const{xPosition:s,yPosition:o,direction:l}=a;return l===Ci.RIGHT?(a.startPos={x:s,y:o+a.textOffsetY},a.endPos={x:s+Vt.callout.offsetX,y:o-Vt.callout.offsetY+a.textOffsetY},a.intersectPointX=a.endPos.x-Vt.callout.horizontalLineLength):(a.startPos={x:s,y:o+a.textOffsetY},a.endPos={x:s-Vt.callout.offsetX,y:o-Vt.callout.offsetY+a.textOffsetY},a.intersectPointX=a.endPos.x+Vt.callout.horizontalLineLength),a}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",a=>a.startPos.x).attr("y1",a=>a.startPos.y).attr("x2",a=>a.intersectPointX).attr("y2",a=>a.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",a=>a.intersectPointX).attr("y1",a=>a.endPos.y).attr("x2",a=>a.endPos.x).attr("y2",a=>a.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=D(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(S.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:a}=t.getOptions().data,{valueMapsTo:s}=t.getOptions().pie;t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[a],value:r.data[s]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);uA(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>t.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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+Vt.radiusOffset:i}}class CI extends Wv{constructor(){super(...arguments),this.type="donut",this.renderType=rt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),a=this.computeRadius(),s=b(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>s===null||s===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(a)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(D(this))}),s!==null&&s!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(a)).attr("y",i.donut.center.titleYPosition(a)).text(s)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=b(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 a;i%1===0&&r%1===0?a=Ap:a=Ae;const s=a(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(s(o)));else{const{code:c,number:u}=b(n,"locale");t.text(u(Math.floor(s(o)),c))}}}}const qv="4,10 8,6 12,10",Yv="12,6 8,10 4,6";class AI extends yt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return qm(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 b(t,"gauge","type")===or.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(b(n,"gauge","deltaArrow","direction")){case Qa.UP:return qv;case Qa.DOWN:return Yv;default:return t>0?qv:Yv}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),a=this.getValueRatio(),s=this.getArcSize(),o=this.getStartAngle(),l=a*s,c=o+l,u=o+s,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ra().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ra().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",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=b(r,"gauge","alignment"),{width:v}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===te.CENTER?m=v/2:f===te.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=b(n,"gauge","type"),i=this.getValue(),a=this.getDelta(),s=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let d=0;r===or.FULL&&!a?d=l(s):r===or.SEMI&&a&&(d=-(l(s)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(s),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:v,number:m}=b(n,"locale"),y=b(n,"gauge","numberFormatter"),g=f.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${p}px`).attr("text-anchor","middle").text(R=>{let L;return R!=null?L=Number(R.toFixed(2))%1!==0?R.toFixed(2):R.toFixed():L=0,y?y(L):m(Number(L),v)});const{width:x}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),O=p/2,E=u?"%":"",w=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${O}px`).attr("x",x/2).text(E),{width:A,height:I}=N.getSVGElementSize(w,{useBBox:!0});w.attr("y",`-${I/2}px`),f.attr("transform",`translate(-${A/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:a,number:s}=b(r,"locale");if(i){const o=this.computeRadius(),l=i?b(r,"gauge","deltaFontSize"):()=>0,c=i?b(r,"gauge","numberFormatter"):()=>null,u=b(r,"gauge","deltaArrow","size"),d=b(r,"gauge","numberSpacing"),h=b(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),v=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";v.data(i===null?[]:[i]),v.enter().append("text").classed("gauge-delta-number",!0).merge(v).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(O=>{let E;return O!=null?E=Number(O.toFixed(2))%1!==0?O.toFixed(2):O.toFixed():E=0,c?`${c(E)}${m}`:`${s(Number(E),a)}${m}`});const{width:y}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=b(r,"gauge","deltaArrow","enabled"),x=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);x.enter().append("svg").merge(x).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/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 O=D(this);N.appendOrSelect(O,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=b(r,"gauge","status");N.appendOrSelect(O,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").attr("points",t.getArrow(i))}),x.exit().remove(),v.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=b(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(S.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=b(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===or.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Zv extends bh{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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 a=this.getComponentContainer({withinChartClip:!0}),s=Yi(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=a.selectAll("g.bars").data(s,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",pt.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()===Jt.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,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,m),g=this.services.cartesianScales.getRangeValue(u),x=this.services.cartesianScales.getDomainValue(u)-h/2,O=x+h;if(!this.isOutsideZoomedDomain(x,O))return me({x0:p,x1:f,y0:y,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.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=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.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(a=>{var s;return((s=a.data)==null?void 0:s.length)>1});if(i){const a=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][a])-t(i.data[0][a]))}}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=b(t,"bars","width"),r=b(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ha().domain(t).rangeRound([0,this.getGroupWidth()])}}class kI extends yt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.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(),a=this.model.getUniqueDomain(),s=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=s,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const v=this.matrix[r][f].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})):(u=o,a.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const v=this.matrix[f][r].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Wn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Wn(l.range())},${c(r)})`),this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n.event,hoveredElement:D(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/a.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(S.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(S.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(S.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),b(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),a=r.getMainYScale(),s=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=a.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",v=>`heat-${v.index}`).classed("cell",!0).attr("transform",v=>`translate(${i(v[s])}, ${a(v[o])})`).append("rect").attr("class",v=>this.model.getColorClassName({value:v.value,originalClassName:`heat-${v.index}`})).classed("heat",!0).classed("null-state",v=>v.index===-1||v.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",v=>{const m=this.services.cartesianScales.getDomainIdentifier(v);return v.index===-1||v.value===null?`url(#${p})`:this.model.getFillColor(Number(v.value),v[m],v)}).attr("aria-label",v=>v.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=b(this.getOptions(),"heatmap","divider","state");return t!==Hr.OFF&&(t===Hr.AUTO&&of.minCellDividerDimension<=this.xBandwidth&&of.minCellDividerDimension<=this.yBandwidth||t===Hr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",a=n.getDomainIdentifier(),s=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=oa(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(S.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,items:[{label:o,value:u[a]},{label:l,value:u[s]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const d=D(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class RI extends yt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:a}=r.data,s=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(s,u=>Et(u,`0.${a}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",pt.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[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a],null,u)).attr("d",u=>{const d=Et(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,v=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-v)>0&&Math.abs(m-v)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?m+=1:m-=1),me({x0:p,x1:f,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=b(t,"locale"),a=this;this.parent.selectAll("path.bar").on("mouseover",function(s,o){const l=D(this);l.classed("hovered",!0);const c=i(parseFloat(Et(o,"data.x0")),r),u=i(parseFloat(Et(o,"data.x1")),r),d=a.services.cartesianScales.getRangeAxisPosition(),h=a.services.cartesianScales.getScaleLabel(d);a.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:l,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:a.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:o[n]})},{label:h,value:Et(o,`data.${o[n]}`)}]})}).on("mousemove",function(s){a.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("mouseout",function(){D(this).classed("hovered",!1),a.services.events.dispatchEvent(S.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class LI extends bn{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[i]!==n.datum[i]?Cn.weight.unselected:Cn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Cn.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[i]!==n.datum().name?Cn.opacity.unselected:Cn.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",Cn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:a}=this.services,s=a.getMainXScale(),o=a.getMainYScale(),l=a.getDomainIdentifier(),c=m=>a.getDomainValue(m),u=m=>a.getRangeValue(m),d=a.getOrientation(),[h,p]=kn(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const v=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===Jt.HORIZONTAL?v.attr("y1",p).attr("y2",p).attr("x1",s.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.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(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class DI extends yt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.SVG}getStackedBounds(t,n){let r=0;return t.map((i,a)=>a!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-se.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-se.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),a=b(i,"meter","proportional"),s=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;b(i,"meter","proportional")===null?u=100:u=b(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=tn().domain([0,u]).range([0,l]),h=this.getStackedBounds(s,d),p=b(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(a?se.height.proportional:se.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(a?se.height.proportional:se.height.default));const f=r.selectAll("rect.value").data(h),v=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!a?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",x=>x.x).attr("y",0).attr("height",()=>p||(a?se.height.proportional:se.height.default)).attr("class",x=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:x[c],originalClassName:v})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:t})).attr("width",x=>x.value>u?d(u):Math.max(x.width,2)).style("fill",x=>n.model.getFillColor(x[c],null,x)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),f.exit().remove();const m=b(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<s[0].value&&(y=s[0].value>u?u:s[0].value));const g=r.selectAll("line.peak").data(y==null?[]:[y]);g.enter().append("line").classed("peak",!0).merge(g).attr("y1",0).attr("y2",()=>p||(a?se.height.proportional:se.height.default)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:t})).attr("x1",x=>d(x)).attr("x2",x=>d(x)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),g.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=b(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,s){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOVER,{event:a,element:o,datum:s}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:s[n],value:s.value}]}))}).on("mousemove",function(a,s){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEMOVE,{event:a,element:o,datum:s}),i&&r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,s){r.services.events.dispatchEvent(S.Meter.METER_CLICK,{event:a,element:D(this),datum:s})}).on("mouseout",function(a,s){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOUT,{event:a,element:o,datum:s}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class II extends yt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:a}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:a}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),a=b(n,"data","groupMapsTo"),s=fA(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[a]:l,[i]:null}))));return ct(s,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),a=b(n,"data","groupMapsTo");return t.map(({name:s,data:o})=>{const l=this.uniqueKeys.map(c=>({[a]:s,[r]:c,[i]:null}));return{name:s,data:ct(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?br.opacity.unselected:br.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?br.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",br.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),a=this.model.getData(),s=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:d}=b(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:v,xAxisRectHeight:m}=br;this.uniqueKeys=Array.from(new Set(a.map(_=>_[u]))),this.uniqueGroups=Array.from(new Set(a.map(_=>_[l]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(s);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),g=(Math.min(r,i)-y)/2;if(g<=0)return;const x=ha().domain(this.fullDataNormalized.map(_=>_[u])).range([0,2*Math.PI].map(_=>_-Math.PI/2)),O=Wn(this.fullDataNormalized.map(_=>_[d])),E=tn().domain([O>=0?0:O,fr(this.fullDataNormalized.map(_=>_[d]))]).range([v,g]).nice(f),w=E.ticks(f),A=(_,C,k)=>this.model.getFillColor(_,C,k),I=zR().angle(_=>x(_[u])+Math.PI/2).radius(_=>E(_[d])).curve(dm),R=this.uniqueKeys.map(_=>{const C=this.getLabelDimensions(_).width,k=y2(x(_),g);return C+k}),L={x:fr(R)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",pt.GROUP).selectAll("path").data(w,_=>_),F=_=>this.uniqueKeys.map(C=>({[u]:C,[d]:_}));$.join(_=>_.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:t})).attr("d",k=>I(F(k))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",pt.GROUP).selectAll("line").data(this.uniqueKeys,_=>_).join(_=>_.append("line").attr("opacity",0).attr("class",C=>`x-axis-${ui(C)}`).attr("stroke-dasharray","0").attr("x1",C=>Zt(x(C),0,L).x).attr("y1",C=>Zt(x(C),0,L).y).attr("x2",C=>Zt(x(C),0,L).x).attr("y2",C=>Zt(x(C),0,L).y).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",k=>Zt(x(k),E.range()[0],L).x).attr("y1",k=>Zt(x(k),E.range()[0],L).y).attr("x2",k=>Zt(x(k),E.range()[1],L).x).attr("y2",k=>Zt(x(k),E.range()[1],L).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",k=>Zt(x(k),E.range()[0],L).x).attr("y1",k=>Zt(x(k),E.range()[0],L).y).attr("x2",k=>Zt(x(k),E.range()[1],L).x).attr("y2",k=>Zt(x(k),E.range()[1],L).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",pt.GROUP).selectAll("text").data(this.uniqueKeys).join(_=>_.append("text").text(C=>C).attr("opacity",0).attr("x",C=>Zt(x(C),E.range()[1]+h,L).x).attr("y",C=>Zt(x(C),E.range()[1]+h,L).y).style("text-anchor",C=>$m(x(C)).textAnchor).style("dominant-baseline",C=>$m(x(C)).dominantBaseline).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",k=>Zt(x(k),E.range()[1]+h,L).x).attr("y",k=>Zt(x(k),E.range()[1]+h,L).y).end().finally(()=>{const k=b(o,"radar","alignment"),U=this.getAlignmentXOffset(k,n,this.getParent());n.attr("x",U)})),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",pt.GROUP).selectAll("path").data(this.groupedDataNormalized,_=>_.name).join(_=>_.append("path").attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",C=>A(C.name,null,C.data)).style("fill-opacity",br.opacity.selected).style("stroke",C=>A(C.name,null,C.data)).call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_enter",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),k.attr("opacity",1).attr("d",U=>I(U.data))}),_=>(_.attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).style("fill",C=>A(C.name,null,C.data)).style("stroke",C=>A(C.name,null,C.data)),_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",k=>I(k.data))),_),_=>_.call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_exit",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",pt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(_=>b(_,d)!==null)).join(_=>_.append("circle").attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C[c]),_=>_,_=>_.remove()).attr("class",_=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:_[l],originalClassName:ui(_[u])})).attr("cx",_=>Zt(x(_[u]),E(_[d]),L).x).attr("cy",_=>Zt(x(_[u]),E(_[d]),L).y).attr("r",0).attr("opacity",0).style("fill",_=>A(_[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",pt.GROUP).selectAll("rect").data(this.uniqueKeys).join(_=>_.append("rect"),_=>_,_=>_.remove()).attr("x",L.x).attr("y",L.y-m/2).attr("width",E.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",_=>`rotate(${Mm(x(_))}, ${L.x}, ${L.y})`);const{code:P,number:H}=b(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",pt.GROUP).selectAll("text").data(Ke(w)).join(_=>_.append("text").attr("opacity",0).text(C=>H(C,P)).attr("x",C=>Zt(-Math.PI/2,E(C),L).x+p).attr("y",C=>Zt(-Math.PI/2,E(C),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:t})).text(k=>k).attr("opacity",1).attr("x",k=>Zt(-Math.PI/2,E(k),L).x+p).attr("y",k=>Zt(-Math.PI/2,E(k),L).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,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:a}=N.getSVGElementSize(r,{useAttrs:!0});let s=0;return t===te.CENTER?s=Math.floor((a-i.width)/2):t===te.RIGHT&&(s=a-i.width),s}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=b(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const a=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOVER,{event:r,element:a,datum:i});const s=t.parent.select(`.x-axes .x-axis-${ui(i)}`),o=t.parent.selectAll(`.dots circle.${ui(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=b(c,"radar","axes","value");s.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",br.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:r,hoveredElement:a,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 a=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEMOVE,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const a=D(this),s=t.parent.select(`.x-axes .x-axis-${ui(i)}`),o=t.parent.selectAll(`.dots circle.${ui(i)}`);s.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOUT,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE)})}}class Xv extends bh{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(a,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,v;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),v=this.services.cartesianScales.getRangeValue(d[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,y)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-f);if(m!==0&&m<2&&(d>0&&s===Jt.VERTICAL||d<0&&s===Jt.HORIZONTAL?v=f-2:v=f+2),!this.isOutsideZoomedDomain(h,p))return me({x0:h,x1:p,y0:f,y1:v},s)}).attr("opacity",1).attr("role",pt.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=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class NI extends be{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),r=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(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"),a=i.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",0).attr("x2",n).attr("y1",s=>s).attr("y2",s=>s),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 Kv extends yt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>b(a,0,i)!==n.datum().name?Mn.opacity.unselected:Mn.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",Mn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:a}=i.data,s=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:s,groups:this.configs.groups}),l=b(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=>b(p,0,a));this.areaGenerator=Hu().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=>b(p,0,a)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:b(p,0,a),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(b(p,0,a),null,p)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>b(p,0,a)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Mn.opacity.selected).attr("d",this.areaGenerator)}}class Qv extends bh{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),s=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(a,c=>b(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",pt.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 v=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(v-f)>0&&Math.abs(v-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&s.length>1?this.services.cartesianScales.getOrientation()===Jt.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?v+=1:v-=1)}return me({x0:h,x1:p,y0:f,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",pt.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,a){const s=D(this);s.classed("hovered",!0),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:i,element:s,datum:a});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]===a.data[a[n]]&&l[c].toString()===a.data.sharedStackKey&&l[n]===a[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:a.data.sharedStackKey,[c]:a.data[a[n]],[n]:a[n]}}r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:s,data:[o]})}).on("mousemove",function(i,a){const s=D(this);r.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:i,element:s,datum:a}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,a){r.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:i,element:D(this),datum:a})}).on("mouseout",function(i,a){const s=D(this);s.classed("hovered",!1),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:i,element:s,datum:a}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:s})})}getBarWidth(){const t=this.getOptions();if(b(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,a=b(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*a/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Jv extends bn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!b(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=Object.keys(r.axes).some(u=>r.axes[u].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=n.selectAll("g.dots").data(s,u=>b(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",pt.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,a=Object.keys(r.axes).some(l=>r.axes[l].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=[];return s.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const v=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),y=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(v)&&(a&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[y]: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 Ei=6;class PI extends yt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.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();n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const a=this.model.getOptions(),s=this.model.getDisplayData(),o=b(a,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(s),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+Ei:30-Ei},h=Ca({name:o,children:s}),p=10,f=r/6,v=w=>{const A=h.descendants().reverse(),I=h.links();let R=h,L=h;h.eachBefore(U=>{U.x<R.x&&(R=U),U.x>L.x&&(L=U)});const $=L.x-R.x,F=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,R.x,r,$].join(" ")),P=E.selectAll("g").data(A,U=>U.id),H=this,_=P.enter().append("g").attr("transform",()=>`translate(${w.y0},${w.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOVER,{event:U,element:D(this),datum:B})}).on("click",function(U,B){B.depth!==0&&(B.children=B.children?null:B._children,v(B)),H.services.events.dispatchEvent(S.Tree.NODE_CLICK,{event:U,element:D(this),datum:B})}).on("mouseout",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOUT,{event:U,element:D(this),datum:B})});_.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),_.append("text").attr("dy","0.31em").attr("x",U=>U._children?-Ei:Ei).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(_).transition(F).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(F).remove().attr("transform",()=>`translate(${w.y},${w.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const C=O.selectAll("path").data(I,U=>U.target.id),k=C.enter().append("path").attr("d",()=>{const U={x:w.x0,y:w.y0};return x({source:U,target:U})});C.merge(k).transition(F).attr("d",x),C.exit().transition(F).remove().attr("d",()=>{const U={x:w.x,y:w.y};return x({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},m=h.descendants(),y=m[m.length-1].depth,g=b(a,"tree","type")===Ka.DENDROGRAM?Vk().size([i,r-u-y*Ei-l]):MR().nodeSize([p,f]).size([i,r-u-y*Ei-l]),x=KR().x(w=>w.y).y(w=>w.x);h.x0=f/2,h.y0=0,h.descendants().forEach((w,A)=>{w.id=A,w._children=w.children}),g(h),n.attr("viewBox",[-d.left,-d.top,r,p]).style("user-select","none");const O=n.append("g").attr("class","links"),E=n.append("g").attr("class","nodes");v(h)}}var UI="#000000",BI="#ffffff",HI="#fcf4d6",VI="#fddc69",FI="#f1c21b",GI="#d2a106",jI="#b28600",zI="#8e6a00",WI="#684e00",qI="#483700",YI="#302400",ZI="#1c1500",XI={10:HI,20:VI,30:FI,40:GI,50:jI,60:zI,70:WI,80:qI,90:YI,100:ZI},KI="#fff2e8",QI="#ffd9be",JI="#ffb784",tN="#ff832b",eN="#eb6200",nN="#ba4e00",rN="#8a3800",iN="#5e2900",aN="#3e1a00",sN="#231000",oN={10:KI,20:QI,30:JI,40:tN,50:eN,60:nN,70:rN,80:iN,90:aN,100:sN},lN="#fff1f1",cN="#ffd7d9",uN="#ffb3b8",hN="#ff8389",dN="#fa4d56",pN="#da1e28",fN="#a2191f",mN="#750e13",gN="#520408",vN="#2d0709",yN={10:lN,20:cN,30:uN,40:hN,50:dN,60:pN,70:fN,80:mN,90:gN,100:vN},bN="#fff0f7",xN="#ffd6e8",_N="#ffafd2",EN="#ff7eb6",ON="#ee5396",wN="#d02670",SN="#9f1853",TN="#740937",$N="#510224",MN="#2a0a18",CN={10:bN,20:xN,30:_N,40:EN,50:ON,60:wN,70:SN,80:TN,90:$N,100:MN},AN="#f6f2ff",kN="#e8daff",RN="#d4bbff",LN="#be95ff",DN="#a56eff",IN="#8a3ffc",NN="#6929c4",PN="#491d8b",UN="#31135e",BN="#1c0f30",HN={10:AN,20:kN,30:RN,40:LN,50:DN,60:IN,70:NN,80:PN,90:UN,100:BN},VN="#edf5ff",FN="#d0e2ff",GN="#a6c8ff",jN="#78a9ff",zN="#4589ff",WN="#0f62fe",qN="#0043ce",YN="#002d9c",ZN="#001d6c",XN="#001141",KN={10:VN,20:FN,30:GN,40:jN,50:zN,60:WN,70:qN,80:YN,90:ZN,100:XN},QN="#e5f6ff",JN="#bae6ff",tP="#82cfff",eP="#33b1ff",nP="#1192e8",rP="#0072c3",iP="#00539a",aP="#003a6d",sP="#012749",oP="#061727",lP={10:QN,20:JN,30:tP,40:eP,50:nP,60:rP,70:iP,80:aP,90:sP,100:oP},cP="#d9fbfb",uP="#9ef0f0",hP="#3ddbd9",dP="#08bdba",pP="#009d9a",fP="#007d79",mP="#005d5d",gP="#004144",vP="#022b30",yP="#081a1c",bP={10:cP,20:uP,30:hP,40:dP,50:pP,60:fP,70:mP,80:gP,90:vP,100:yP},xP="#defbe6",_P="#a7f0ba",EP="#6fdc8c",OP="#42be65",wP="#24a148",SP="#198038",TP="#0e6027",$P="#044317",MP="#022d0d",CP="#071908",AP={10:xP,20:_P,30:EP,40:OP,50:wP,60:SP,70:TP,80:$P,90:MP,100:CP},kP="#f2f4f8",RP="#dde1e6",LP="#c1c7cd",DP="#a2a9b0",IP="#878d96",NP="#697077",PP="#4d5358",UP="#343a3f",BP="#21272a",HP="#121619",VP={10:kP,20:RP,30:LP,40:DP,50:IP,60:NP,70:PP,80:UP,90:BP,100:HP},FP="#f4f4f4",GP="#e0e0e0",jP="#c6c6c6",zP="#a8a8a8",WP="#8d8d8d",qP="#6f6f6f",YP="#525252",ZP="#393939",XP="#262626",KP="#161616",QP={10:FP,20:GP,30:jP,40:zP,50:WP,60:qP,70:YP,80:ZP,90:XP,100:KP},JP="#f7f3f2",t3="#e5e0df",e3="#cac5c4",n3="#ada8a8",r3="#8f8b8b",i3="#726e6e",a3="#565151",s3="#3c3838",o3="#272525",l3="#171414",c3={10:JP,20:t3,30:e3,40:n3,50:r3,60:i3,70:a3,80:s3,90:o3,100:l3},t0={black:{100:UI},blue:KN,coolGray:VP,cyan:lP,gray:QP,green:AP,magenta:CN,orange:oN,purple:HN,red:yN,teal:bP,warmGray:c3,white:{0:BI},yellow:XI};const u3=e=>{if(!e)return null;for(const t of Object.keys(t0)){const n=t0[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},e0=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Sn(t);let r;if(n&&(r=u3(n?n.hex():null)),r==null){const i=cc(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let h3=0;class d3 extends yt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),a=b(window,"location"),{width:s,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=Ca({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=LR().size([s,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",()=>h3++).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=D(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=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=D(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${f}`;return new URL(`#${v}`,a)+""}),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;const v=cc(this.model.getFillColor(f.data.name));return[{text:p.data.name,color:v.l<.5?"white":"black"}]},p=>p).join(p=>{const f=p.append("text").text(v=>v.text).style("fill",e0).attr("x",7).attr("y",18);return a&&f.attr("clip-path",function(){const v=D(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${m}`,a)+""})`}),f},p=>p.text(f=>f.text).style("fill",e0),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),s=r;for(;s.depth>1;)s=s.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&&(a=l),Sn(a).darker(.7).toString()}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:a,label:s.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1);let a=r;for(;a.depth>1;)a=a.parent;i.transition().call(s=>t.services.transitions.setupTransition({transition:s,name:"graph_element_mouseout_fill_update"})).style("fill",s=>t.model.getFillColor(s.parent.data.name,null,s.data)),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}}var p3={value:function(){}};function n0(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Vo(n)}function Vo(e){this._=e}function f3(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=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}})}Vo.prototype=n0.prototype={constructor:Vo,on:function(e,t){var n=this._,r=f3(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=m3(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=r0(n[i],e.name,t);else if(t==null)for(i in n)n[i]=r0(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Vo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function m3(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function r0(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=p3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const g3=Object.freeze(Object.defineProperty({__proto__:null,dispatch:n0},Symbol.toStringTag,{value:"Module"})),v3=fD(g3),y3=v3.dispatch,xh=Math.PI/180,b3={archimedean:a0,rectangular:A3},Va=64,Fo=2048;var x3=function(){var e=[256,256],t=_3,n=E3,r=O3,i=i0,a=i0,s=w3,o=S3,l=a0,c=[],u=1/0,d=y3("word","end"),h=null,p=Math.random,f={},v=R3;f.canvas=function(g){return arguments.length?(v=tr(g),f):v},f.start=function(){var g=m(v()),x=k3((e[0]>>5)*e[1]),O=null,E=c.length,w=-1,A=[],I=c.map(function(L,$){return L.text=t.call(this,L,$),L.font=n.call(this,L,$),L.style=i.call(this,L,$),L.weight=a.call(this,L,$),L.rotate=s.call(this,L,$),L.size=~~r.call(this,L,$),L.padding=o.call(this,L,$),L}).sort(function(L,$){return $.size-L.size});return h&&clearInterval(h),h=setInterval(R,0),R(),f;function R(){for(var L=Date.now();Date.now()-L<u&&++w<E&&h;){var $=I[w];$.x=e[0]*(p()+.5)>>1,$.y=e[1]*(p()+.5)>>1,T3(g,$,I,w),$.hasText&&y(x,$,O)&&(A.push($),d.call("word",f,$),O?M3(O,$):O=[{x:$.x+$.x0,y:$.y+$.y0},{x:$.x+$.x1,y:$.y+$.y1}],$.x-=e[0]>>1,$.y-=e[1]>>1)}w>=E&&(f.stop(),d.call("end",f,A,O))}},f.stop=function(){h&&(clearInterval(h),h=null);for(const g of c)delete g.sprite;return f};function m(g){const x=g.getContext("2d",{willReadFrequently:!0});g.width=g.height=1;const O=Math.sqrt(x.getImageData(0,0,1,1).data.length>>2);return g.width=(Va<<5)/O,g.height=Fo/O,x.fillStyle=x.strokeStyle="red",{context:x,ratio:O}}function y(g,x,O){e[0],e[1];for(var E=x.x,w=x.y,A=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),R=p()<.5?1:-1,L=-R,$,F,P;($=I(L+=R))&&(F=~~$[0],P=~~$[1],!(Math.min(Math.abs(F),Math.abs(P))>=A));)if(x.x=E+F,x.y=w+P,!(x.x+x.x0<0||x.y+x.y0<0||x.x+x.x1>e[0]||x.y+x.y1>e[1])&&(!O||C3(x,O))&&!$3(x,g,e[0])){for(var H=x.sprite,_=x.width>>5,C=e[0]>>5,k=x.x-(_<<4),U=k&127,B=32-U,X=x.y1-x.y0,Y=(x.y+x.y0)*C+(k>>5),ot,it=0;it<X;it++){ot=0;for(var xt=0;xt<=_;xt++)g[Y+xt]|=ot<<B|(xt<_?(ot=H[it*_+xt])>>>U:0);Y+=C}return!0}return!1}return f.timeInterval=function(g){return arguments.length?(u=g??1/0,f):u},f.words=function(g){return arguments.length?(c=g,f):c},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=tr(g),f):n},f.fontStyle=function(g){return arguments.length?(i=tr(g),f):i},f.fontWeight=function(g){return arguments.length?(a=tr(g),f):a},f.rotate=function(g){return arguments.length?(s=tr(g),f):s},f.text=function(g){return arguments.length?(t=tr(g),f):t},f.spiral=function(g){return arguments.length?(l=b3[g]||g,f):l},f.fontSize=function(g){return arguments.length?(r=tr(g),f):r},f.padding=function(g){return arguments.length?(o=tr(g),f):o},f.random=function(g){return arguments.length?(p=g,f):p},f.on=function(){var g=d.on.apply(d,arguments);return g===d?f:g},f};function _3(e){return e.text}function E3(){return"serif"}function i0(){return"normal"}function O3(e){return Math.sqrt(e.value)}function w3(){return(~~(random()*6)-3)*30}function S3(){return 1}function T3(e,t,n,r){if(!t.sprite){var i=e.context,a=e.ratio;i.clearRect(0,0,(Va<<5)/a,Fo/a);var s=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/a)+"px "+t.font;const $=i.measureText(t.text),F=-Math.floor($.width/2);let P=($.width+1)*a,H=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*xh),d=Math.cos(t.rotate*xh),h=P*d,p=P*u,f=H*d,v=H*u;P=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,H=~~Math.max(Math.abs(p+f),Math.abs(p-f))}else P=P+31>>5<<5;if(H>l&&(l=H),s+P>=Va<<5&&(s=0,o+=l,l=0),o+H>=Fo)break;i.translate((s+(P>>1))/a,(o+(H>>1))/a),t.rotate&&i.rotate(t.rotate*xh),i.fillText(t.text,F,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,F,0)),i.restore(),t.width=P,t.height=H,t.xoff=s,t.yoff=o,t.x1=P>>1,t.y1=H>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=P}for(var m=i.getImageData(0,0,(Va<<5)/a,Fo/a).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var g=t.width,x=g>>5,O=t.y1-t.y0,E=0;E<O*x;E++)y[E]=0;if(s=t.xoff,s==null)return;o=t.yoff;for(var w=0,A=-1,I=0;I<O;I++){for(var E=0;E<g;E++){var R=x*I+(E>>5),L=m[(o+I)*(Va<<5)+(s+E)<<2]?1<<31-E%32:0;y[R]|=L,w|=L}w?A=I:(t.y0++,O--,I--,o++)}t.y1=t.y0+A,t.sprite=y.slice(0,(t.y1-t.y0)*x)}}}function $3(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,a=e.x-(i<<4),s=a&127,o=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>s:0))&t[c+h])return!0;c+=n}return!1}function M3(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function C3(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function a0(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function A3(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(a){var s=a<0?-1:1;switch(Math.sqrt(1+4*s*a)-s&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function k3(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function R3(){return document.createElement("canvas")}function tr(e){return typeof e=="function"?e:function(){return e}}const L3=Sv(x3);class D3 extends yt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),a=this.getFontSizeScale(i),s=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=s.wordCloud,{groupMapsTo:c}=s.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=L3().size([u,d]).words(i.map(function(f){const v=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:v,value:v}})).padding(5).rotate(0).fontSize(f=>a(f.size)).on("end",p);h.start();function p(f){const v=N.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(f,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.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),a=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),s=i.length>0,o=s?Ke(i):[1,1];return tn().domain(o).range(s?n.wordCloud.fontSizeRange(a,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Hs(a=>{const s=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));a===null?s.attr("opacity",1):s.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,s){const o=this;i(o),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOVER,{event:a,element:D(this),datum:s}),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:s.text},{label:t.tooltip.valueLabel,value:s.value},{label:Et(t,"locale.translations.group")||Et(t,"tooltip.groupLabel")||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:s[n]})}]})}).on("mousemove",function(a,s){const o=D(this);r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEMOVE,{element:o,datum:s}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,s){r.services.events.dispatchEvent(S.WordCloud.WORD_CLICK,{event:a,element:D(this),datum:s})}).on("mouseout",function(a,s){const o=D(this);i(null),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOUT,{event:a,element:o,datum:s}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class I3 extends yt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.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(),a=b(this.getOptions(),"geoData"),s=this.model.getCombinedData(),o={},l={};Object.keys(s).forEach(m=>{typeof s[m].value=="number"?o[m]=s[m]:l[m]=s[m]});const c=gI(a,Object.values(l)),u=pI(a,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=pk().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",La()([[0,0],[0,10]]));const v=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case un.geoEqualEarth:t=Rk();break;case un.geoAlbers:t=Sk();break;case un.geoConicEqualArea:t=Wg();break;case un.geoConicEquidistant:t=Ak();break;case un.geoEquirectangular:t=Mk();break;case un.geoMercator:t=Tk();break;case un.geoNaturalEarth1:t=Lk();break;default:throw new Error("Projection is not supported.")}return t}}class N3 extends I3{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({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 a=D(this);t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEOVER,{event:r,element:a,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.SHOW,{event:r,hoveredElement:a,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Pr.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const a=D(this);t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEOUT,{event:r,element:a,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.HIDE,{event:r,hoveredElement:a})})}}function _h(e){var t=e==null?0:e.length;return t?cs(e,1):[]}function P3(e){return nd(ad(e,void 0,_h),e+"")}function s0(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 a=Array(i);++r<i;)a[r]=e[r+t];return a}function U3(e,t){return t.length<2?e:Vl(e,s0(t,0,-1))}function B3(e,t){return t=ls(t,e),e=U3(e,t),e==null||delete e[zi(tp(t))]}function H3(e){return yd(e)?void 0:e}var V3=1,F3=2,G3=4,j3=P3(function(e,t){var n={};if(e==null)return n;var r=!1;t=Cl(t,function(a){return a=ls(a,e),r||(r=a.length>1),a}),Vr(e,Md(e),n),r&&(n=Wi(n,V3|F3|G3,H3));for(var i=t.length;i--;)B3(n,t[i]);return n});function o0(e){return Math.log(e)}function l0(e){return Math.exp(e)}function z3(e){return-Math.log(-e)}function W3(e){return-Math.exp(-e)}function q3(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Y3(e){return e===10?q3:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Z3(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 c0(e){return(t,n)=>-e(-t,n)}function X3(e){const t=e(o0,l0),n=t.domain;let r=10,i,a;function s(){return i=Z3(r),a=Y3(r),n()[0]<0?(i=c0(i),a=c0(a),e(z3,W3)):e(o0,l0),t}return t.base=function(o){return arguments.length?(r=+o,s()):r},t.domain=function(o){return arguments.length?(n(o),s()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,v;const m=o==null?10:+o;let y=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(v=h<0?f/a(-h):f*a(h),!(v<c)){if(v>u)break;y.push(v)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(v=h>0?f/a(-h):f*a(h),!(v<c)){if(v>u)break;y.push(v)}y.length*2<m&&(y=ms(c,u,m))}else y=ms(h,p,Math.min(p-h,m)).map(a);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=ia(l)).precision==null&&(l.trim=!0),l=Ec(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/a(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(Ff(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),t}function u0(){const e=X3(nf()).domain([1,10]);return e.copy=()=>wc(e,u0()).base(e.base()),Kr.apply(e,arguments),e}function Go(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 jo(e){this._context=e}jo.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:Go(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:Go(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K3(e){return new jo(e)}function h0(e){this._context=e}h0.prototype={areaStart:Xn,areaEnd:Xn,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:Go(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Q3(e){return new h0(e)}function d0(e){this._context=e}d0.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:Go(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J3(e){return new d0(e)}function p0(e,t){this._basis=new jo(e),this._beta=t}p0.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],a=e[n]-r,s=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*a),this._beta*t[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const tU=function e(t){function n(r){return t===1?new jo(r):new p0(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function zo(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 Eh(e,t){this._context=e,this._k=(1-t)/6}Eh.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:zo(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:zo(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 eU=function e(t){function n(r){return new Eh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Oh(e,t){this._context=e,this._k=(1-t)/6}Oh.prototype={areaStart:Xn,areaEnd:Xn,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:zo(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 nU=function e(t){function n(r){return new Oh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function wh(e,t){this._context=e,this._k=(1-t)/6}wh.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:zo(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 rU=function e(t){function n(r){return new wh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Sh(e,t,n){var r=e._x1,i=e._y1,a=e._x2,s=e._y2;if(e._l01_a>de){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>de){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);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,s,e._x2,e._y2)}function f0(e,t){this._context=e,this._alpha=t}f0.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:Sh(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 iU=function e(t){function n(r){return t?new f0(r,t):new Eh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function m0(e,t){this._context=e,this._alpha=t}m0.prototype={areaStart:Xn,areaEnd:Xn,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:Sh(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 aU=function e(t){function n(r){return t?new m0(r,t):new Oh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function g0(e,t){this._context=e,this._alpha=t}g0.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:Sh(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 sU=function e(t){function n(r){return t?new g0(r,t):new wh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function v0(e){return e<0?-1:1}function y0(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(v0(a)+v0(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function b0(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Th(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function Wo(e){this._context=e}Wo.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:Th(this,this._t0,b0(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,Th(this,b0(this,n=y0(this,e,t)),n);break;default:Th(this,this._t0,n=y0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function x0(e){this._context=new _0(e)}(x0.prototype=Object.create(Wo.prototype)).point=function(e,t){Wo.prototype.point.call(this,t,e)};function _0(e){this._context=e}_0.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function oU(e){return new Wo(e)}function lU(e){return new x0(e)}function E0(e){this._context=e}E0.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=O0(e),i=O0(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function O0(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function cU(e){return new E0(e)}function qo(e,t){this._context=e,this._t=t}qo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 uU(e){return new qo(e,.5)}function hU(e){return new qo(e,0)}function dU(e){return new qo(e,1)}class pU extends Pn{zoomIn(t,n,r){let i,a,s;const o=r||Jr;t&&(i=t.x,a=t.y,s=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(${s}) translate(${-i},${-a})`),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||Jr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_OUT)}}class fU extends Pn{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 mU extends Pn{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 a=URL.createObjectURL(new Blob([t],{type:i}));r.href=a,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}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 gU extends Pn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(S.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(b(uf,n,"duration")||uf.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Fa(e,t){const n=wt(e),r=wt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function vU(e,t){const n=wt(e),r=wt(t);return n.getFullYear()-r.getFullYear()}function yU(e,t){const n=wt(e),r=wt(t),i=Fa(n,r),a=Math.abs(vU(n,r));n.setFullYear(1584),r.setFullYear(1584);const s=Fa(n,r)===-i,o=i*(a-+s);return o===0?0:o}function $h(e,t){const n=wt(e);if(isNaN(t))return nn(e,NaN);if(!t)return n;const r=n.getDate(),i=nn(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const a=i.getDate();return r>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function w0(e,t){return $h(e,t*12)}function bU(e,t){return w0(e,-t)}function xU(e,t){const n=wt(e),r=wt(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function _U(e){const t=wt(e);return t.setHours(23,59,59,999),t}function EU(e){const t=wt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function OU(e){const t=wt(e);return+_U(t)==+EU(t)}function wU(e,t){const n=wt(e),r=wt(t),i=Fa(n,r),a=Math.abs(xU(n,r));let s;if(a<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let o=Fa(n,r)===-i;OU(wt(e))&&a===1&&Fa(e,r)===1&&(o=!1),s=i*(a-Number(o))}return s===0?0:s}function SU(e,t){return $h(e,-t)}function TU(e,t){const n=wt(e),r=wt(t),i=S0(n,r),a=Math.abs(Sf(n,r));n.setDate(n.getDate()-i*a);const s=+(S0(n,r)===-i),o=i*(a-s);return o===0?0:o}function S0(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 T0(e,t){const n=wt(e);return isNaN(t)?nn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function $U(e,t){return T0(e,-t)}function Mh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Ch(e,t){return+wt(e)-+wt(t)}function MU(e,t,n){const r=Ch(e,t)/Ef;return Mh(void 0)(r)}function Ah(e,t){const n=+wt(e);return nn(e,n+t)}function $0(e,t){return Ah(e,t*Ef)}function CU(e,t){return $0(e,-t)}function M0(e,t,n){const r=Ch(e,t)/_f;return Mh(void 0)(r)}function kh(e,t){return Ah(e,t*_f)}function C0(e,t){return kh(e,-t)}function A0(e,t,n){const r=Ch(e,t)/1e3;return Mh(void 0)(r)}function Rh(e,t){return Ah(e,t*1e3)}function k0(e,t){return Rh(e,-t)}class AU extends Pn{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=b(n,"axes",this.secondaryDomainAxisPosition),a=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(a))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,a=b(r,"axes",this.secondaryRangeAxisPosition);let s;if(t!==null?s=t[i]:n&&n.length>0&&(s=n[0]),a!=null&&a.correspondingDatasets&&a.correspondingDatasets.includes(s))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return b(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===G.BOTTOM||t===G.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(G).map(t=>G[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===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=Jt.VERTICAL:this.orientation=Jt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const a=this.model.getOptions(),s=b(a,"axes");((t=s[G.LEFT])!=null&&t.correspondingDatasets&&s[G.RIGHT]||(n=s[G.RIGHT])!=null&&n.correspondingDatasets&&s[G.LEFT]||(r=s[G.TOP])!=null&&r.correspondingDatasets&&s[G.BOTTOM]||(i=s[G.BOTTOM])!=null&&i.correspondingDatasets&&s[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=b(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]===tt.LINEAR||this.scaleTypes[t]===tt.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=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.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 a=this.model.getOptions(),s=b(a,"axes")[r],{mapsTo:o}=s,l=b(i,o)!==null?i[o]:i;let c;switch(n){case tt.LABELS:c=t(l)+t.step()/2;break;case tt.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],a=this.model.getOptions(),s=b(a,"axes")[r],{mapsTo:o}=s,l=t[o]!==void 0?t[o]:t;return[i(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(b(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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=b(r,"axes",t);if(i.scaleType===tt.TIME){const a=b(r,"timeScale","addSpaceOnEdges");return kU(n,a)}else return RU(n,qn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.LEFT)===null&&b(n,G.RIGHT)!==null||b(n,G.RIGHT,"main")===!0||r&&b(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.BOTTOM)===null&&b(n,G.TOP)!==null||b(n,G.TOP,"main")===!0||r&&b(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=b(r,"axes",t.primary),a=b(r,"axes",n.primary),s=i.scaleType||tt.LINEAR,o=a.scaleType||tt.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===tt.LABELS||o===tt.TIME)&&s===tt.LABELS||s===tt.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=b(n,"axes",t),i=b(n,"bounds"),{includeZero:a}=r,s=b(r,"scaleType")||tt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,fr(y,g=>g.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),g=this.model.getStackKeys({bins:y});return[g[0].split(":")[0],g[g.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=qn.ratio;if(r.domain)return s===tt.LABELS?r.domain:(s===tt.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&s===tt.LABELS)return Yi(o.map(y=>y[c]));let f,v;const m=this.model.getDataGroupNames();if(s===tt.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[p]}`);if(s===tt.TIME)v=o.map(y=>+new Date(y[c]));else if(i&&n.axes)v=[],o.forEach(y=>{v.push(y[c]),y[i.upperBoundMapsTo]&&v.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&v.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,g=this.model.getDataValuesGroupedByKeys({groups:m}),x=o.filter(E=>!m.includes(E[y])),O=[];g.forEach(E=>{const{...w}=E;let A=0,I=0;Object.values(j3(w,"sharedStackKey")).forEach(R=>{isNaN(R)||(R<0?I+=R:A+=R)}),O.push([I,A])}),v=[..._h(O),...x.map(E=>E[c])]}else v=[],o.forEach(y=>{const g=y[c];Array.isArray(g)&&g.length===2?(v.push(g[0]),v.push(g[1])):(l&&v.push(Math.max(y[c],y[l])),v.push(g))});return s!==tt.TIME&&s!==tt.LOG&&a&&v.push(0),d&&d.length>0&&d.forEach(y=>{const g=b(y,"value");g!==null&&v.push(g)}),f=Ke(v),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=b(n,"axes",t);if(!r)return null;const i=b(r,"scaleType")||tt.LINEAR;this.scaleTypes[t]=i;let a;return i===tt.TIME?a=om():i===tt.LOG?a=u0().base(r.base||10):i===tt.LABELS||i===tt.LABELS_RATIO?a=ha():a=tn(),a.domain(this.getScaleDomain(t)),a}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Jt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),b(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=b(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(),a=r.sort((s,o)=>o.value-s.value)[0];return this.getScaleTypeByPosition(n)===tt.TIME&&(typeof a.value=="string"||a.value.getTime===void 0)&&(a.value=new Date(a.value)),{threshold:a,scaleValue:i(a.value)}}getHighestRangeThreshold(){const t=b(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(),a=r.sort((s,o)=>o.value-s.value)[0];return{threshold:a,scaleValue:i(a.value)}}}function kU(e,t){const n=new Date(e[0]),r=new Date(e[1]);return yU(r,n)>1?[bU(n,t),w0(r,t)]:wU(r,n)>1?[SU(n,t),$h(r,t)]:TU(r,n)>1?[$U(n,t),T0(r,t)]:MU(r,n)>1?[CU(n,t),$0(r,t)]:M0(r,n)>30?[C0(n,t*30),kh(r,t*30)]:M0(r,n)>1?[C0(n,t),kh(r,t)]:A0(r,n)>15?[k0(n,t*15),Rh(r,t*15)]:A0(r,n)>1?[k0(n,t),Rh(r,t)]:[n,r]}function RU([e,t],n,r){const i=(t-e)*n,a=t<=0&&t+i>0?0:t+i;let s=e>=0&&e-i<0?0:e-i;if(r===tt.LOG&&s<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=e}return[s,a]}class LU extends Pn{constructor(){super(...arguments),this.curveTypes={curveLinear:qs,curveLinearClosed:dm,curveBasis:K3,curveBasisClosed:Q3,curveBasisOpen:J3,curveBundle:tU,curveCardinal:eU,curveCardinalClosed:nU,curveCardinalOpen:rU,curveCatmullRom:iU,curveCatmullRomClosed:aU,curveCatmullRomOpen:sU,curveMonotoneX:oU,curveMonotoneY:lU,curveNatural:cU,curveStep:uU,curveStepAfter:dU,curveStepBefore:hU}}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 DU extends Pn{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(this.model.getOptions(),"axes",t,"scaleType");return t===G.BOTTOM&&n===tt.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(),a=r.getDomainIdentifier(),s=b(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(s)&&s.length===2)return s;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Ke(n,o=>o[a]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),a=Object.assign({stacked:!1},n),s=b(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&i){const o=a.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=ke.handleWidth,a=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();a.domain(this.getDefaultZoomBarDomain());const s=a(r[0]),o=a(r[1]);if(o-s<i+1)return;const l=a.range(),c=o-s,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=s+u,h=o-u;d>=h&&(d=s+c/2-i/2,h=o-c/2+i/2);const p=[a.invert(d),a.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]),a=r(n[1]),s=r.range(),o=(s[1]-s[0])/2*(t/2),l=Math.max(i-o,s[0]),c=Math.min(a+o,s[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(),a=b(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<a}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}function IU(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:s0(e,t,n)}var NU="\\ud800-\\udfff",PU="\\u0300-\\u036f",UU="\\ufe20-\\ufe2f",BU="\\u20d0-\\u20ff",HU=PU+UU+BU,VU="\\ufe0e\\ufe0f",FU="\\u200d",GU=RegExp("["+FU+NU+HU+VU+"]");function R0(e){return GU.test(e)}function jU(e){return e.split("")}var L0="\\ud800-\\udfff",zU="\\u0300-\\u036f",WU="\\ufe20-\\ufe2f",qU="\\u20d0-\\u20ff",YU=zU+WU+qU,ZU="\\ufe0e\\ufe0f",XU="["+L0+"]",Lh="["+YU+"]",Dh="\\ud83c[\\udffb-\\udfff]",KU="(?:"+Lh+"|"+Dh+")",D0="[^"+L0+"]",I0="(?:\\ud83c[\\udde6-\\uddff]){2}",N0="[\\ud800-\\udbff][\\udc00-\\udfff]",QU="\\u200d",P0=KU+"?",U0="["+ZU+"]?",JU="(?:"+QU+"(?:"+[D0,I0,N0].join("|")+")"+U0+P0+")*",tB=U0+P0+JU,eB="(?:"+[D0+Lh+"?",Lh,I0,N0,XU].join("|")+")",nB=RegExp(Dh+"(?="+Dh+")|"+eB+tB,"g");function rB(e){return e.match(nB)||[]}function iB(e){return R0(e)?rB(e):jU(e)}function aB(e){return function(t){t=ji(t);var n=R0(t)?iB(t):void 0,r=n?n[0]:t.charAt(0),i=n?IU(n,1).join(""):t.slice(1);return r[e]()+i}}var sB=aB("toUpperCase");function oB(e){return sB(ji(e).toLowerCase())}var lB=Wm(function(e,t,n){return t=t.toLowerCase(),e+(n?oB(t):t)});class sn{constructor(t,n){this.components=[],this.services={canvasZoom:pU,domUtils:N,events:fU,files:mU,gradientUtils:Jc,transitions:gU},this.model=new fn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(S.Model.UPDATE,r=>{const i=!!b(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(S.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(a=>a));Promise.all(r).then(()=>this.services.events.dispatchEvent(S.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=b(r,"toolbar","enabled"),a={id:"legend",components:[new hh(this.model,this.services)],growth:ht.PREFERRED},s=b(r,"canvasZoom","enabled");s&&s===!0&&t.push(new DD(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new Ie(this.model,this.services,[l,...i?[c]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:b(n,"graphFrameRenderType")||rt.SVG},h=b(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Nt.COLUMN;if(h){const y=b(r,"legend","position");y==="left"?(p=Nt.ROW,r.legend.orientation||(r.legend.orientation=Br.VERTICAL)):y==="right"?(p=Nt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Br.VERTICAL)):y==="bottom"&&(p=Nt.COLUMN_REVERSE)}const f={id:"spacer",components:[new Vn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new Ie(this.model,this.services,[...h?[a]:[],...h?[f]:[],d],{direction:p})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Vn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(y)}return m.push(v),[new dh(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,m,{direction:Nt.COLUMN})]}}class Te extends sn{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:AU,curves:LU,zoom:DU}),this.model=new Er(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"zoomBar",G.TOP,"enabled"),a=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=this.services.cartesianScales.getMainXAxisPosition(),o=b(r,"axes",s,"scaleType"),l=i&&s===G.BOTTOM&&o===tt.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},p={id:"header",components:[new Ie(this.model,this.services,[d,...a?[h]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},f={id:"legend",components:[new hh(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new Mv(this.model,this.services),new ID(this.model,this.services)),t.push(new PD(this.model,this.services)),t.push(new UD(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=Nt.COLUMN;if(m){const w=b(this.model.getOptions(),"legend","position");w===Ur.LEFT?(y=Nt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Br.VERTICAL)):w===Ur.RIGHT?(y=Nt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Br.VERTICAL)):w===Ur.BOTTOM&&(y=Nt.COLUMN_REVERSE)}const g={id:"spacer",components:[new Vn(this.model,this.services)],growth:ht.PREFERRED},x={id:"full-frame",components:[new Ie(this.model,this.services,[...m?[f]:[],...m?[g]:[],v],{direction:y})],growth:ht.STRETCH},O={id:"zoom-bar",components:[new ND(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},E=[];if(u||a){E.push(p);const w={id:"spacer",components:[new Vn(this.model,this.services,a?{size:15}:void 0)],growth:ht.PREFERRED};E.push(w)}return l&&E.push(O),E.push(x),[new Rv(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,E,{direction:Nt.COLUMN})]}}class cB extends sn{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(zt(Pt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new iI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class uB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(wn(Pt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new xi(this.model,this.services),new Vv(this.model,this.services),new bn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class hB extends Te{constructor(t,n){super(t,n),this.model=new P$(this.services),this.model.setOptions(zt(Pt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new oI(this.model,this.services),new _i(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class dB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new lI(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class pB extends Te{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(zt(Pt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new cI(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class fB extends sn{constructor(t,n){super(t,n),this.model=new B$(this.services),this.model.setOptions(zt(Pt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled"),a=!!this.model.getOptions().title,s={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[s,...i?[o]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new zv(this.model,this.services,{chartType:"choropleth"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Nt.COLUMN_REVERSE,p={id:"spacer",components:[new Vn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(a||i){v.push(l);const m={id:"spacer",components:[new Vn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new dh(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,v,{direction:Nt.COLUMN})]}getComponents(){const t=[new N3(this.model,this.services)];return this.getChartComponents(t)}}class mB extends sn{constructor(t,n){super(t,n),this.model=new H$(this.services),this.model.setOptions(zt(Pt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new $I(this.model,this.services)];return this.getChartComponents(t)}}const B0={[Me.LINE]:[xi,bn],[Me.SCATTER]:[bn],[Me.AREA]:[Vv,xi,bn],[Me.STACKED_AREA]:[Kv,xi,Jv,Ho],[Me.SIMPLE_BAR]:[Xv],[Me.GROUPED_BAR]:[Zv,_i],[Me.STACKED_BAR]:[Qv,Ho]};class gB extends Te{constructor(t,n){super(t,n);const r=zt(Pt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Me.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 a=i.type;let s;if(typeof i.type=="string"){if(!Object.keys(B0).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=`${lB(i.type)}Chart`;return s=ct({},Pt[l],this.model.getOptions(),i.options),i.type===Me.STACKED_AREA&&(o=!0),B0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:s,stacked:o}))}else return s=ct({},this.model.getOptions(),i.options),new a(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:s})}).filter(i=>i!==null);return _h(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Me.STACKED_BAR||i.type===Me.STACKED_AREA),r=[new Se(this.model,this.services),new Ne(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID}),...n?[]:[new Jn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class H0 extends sn{constructor(t,n,r=!1){super(t,n),this.model=new V$(this.services),!r&&(this.model.setOptions(zt(Pt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Wv(this.model,this.services),new be(this.model,this.services,{skeleton:ee.PIE})];return this.getChartComponents(t)}}class vB extends H0{constructor(t,n){super(t,n,!0),this.model.setOptions(zt(Pt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new CI(this.model,this.services),new be(this.model,this.services,{skeleton:ee.DONUT})];return this.getChartComponents(t)}}class yB extends sn{constructor(t,n){super(t,n),this.model=new F$(this.services),this.model.setOptions(zt(Pt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new AI(this.model,this.services)];return this.getChartComponents(t)}}class bB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Zv(this.model,this.services),new _i(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class xB extends Te{constructor(t,n){super(t,n),this.model=new G$(this.services),this.model.setOptions(zt(Pt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=!!this.model.getOptions().title,s={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[s,...i?[o]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new zv(this.model,this.services,{chartType:"heatmap"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Nt.COLUMN_REVERSE,p={id:"spacer",components:[new Vn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(a||i){v.push(l);const m={id:"spacer",components:[new Vn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new Rv(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,v,{direction:Nt.COLUMN})]}getComponents(){const t=[new Se(this.model,this.services),new kI(this.model,this.services)];return this.getAxisChartComponents(t)}}class _B extends Te{constructor(t,n){super(t,n),this.model=new j$(this.services),this.model.setOptions(zt(Pt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yI(this.model,this.services),new RI(this.model,this.services)];return this.getAxisChartComponents(t)}}class EB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new xi(this.model,this.services),new bn(this.model,this.services,{handleThresholds:!0}),new NI(this.model,this.services),new _i(this.model,this.services)];return this.getAxisChartComponents(t)}}class OB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new LI(this.model,this.services),new bn(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class wB extends sn{constructor(t,n){var r;super(t,n),this.model=new z$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?ct(wn(Pt.proportionalMeterChart),n.options):ct(wn(Pt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new TI(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Vn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new DI(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new Ie(this.model,this.services,t,{direction:Nt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class SB extends sn{constructor(t,n){super(t,n),this.model=new W$(this.services),this.model.setOptions(zt(Pt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new II(this.model,this.services)];return this.getChartComponents(t)}}class TB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new bn(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class $B extends sn{constructor(t,n){super(t,n),this.model=new q$(this.services),this.model.setOptions(zt(Pt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new PI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class MB extends sn{constructor(t,n){super(t,n),this.model=new Y$(this.services),this.model.setOptions(zt(Pt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new d3(this.model,this.services)];return this.getChartComponents(t)}}class CB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Xv(this.model,this.services),new _i(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class AB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Ho(this.model,this.services),new Kv(this.model,this.services),new xi(this.model,this.services,{stacked:!0}),new Jv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class kB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Ho(this.model,this.services),new Qv(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ}),new _i(this.model,this.services)];return this.getAxisChartComponents(t)}}class RB extends sn{constructor(t,n){super(t,n),this.model=new Z$(this.services),this.model.setOptions(zt(Pt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new D3(this.model,this.services),new be(this.model,this.services,{skeleton:ee.PIE})];return this.getChartComponents(t)}}function LB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ih={exports:{}},Ga={};/**
85
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0);const a=t.model.getHierarchyLevel(),s=a>2&&!i.classed("focal"),o=b(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!s){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&&a<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:Et(p,"locale.translations.total")||Et(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(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&a<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=R(this),a=i.classed("non-focal"),s=b(t.model.getOptions(),"canvasZoom","enabled");if(s&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Jr)}else if(r.depth===2&&r.children&&!a&&s){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Jr),n.stopPropagation()}t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function MI(e,t){const n=Ji(this._current,e);return r=>(this._current=n(r),t(this._current))}class Wv extends yt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Vt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:a}=i.data,{valueMapsTo:s}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(L=>L[s]>0),l=this.computeRadius();this.arc=La().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=La().innerRadius(this.getInnerRadius()).outerRadius(l+Vt.hoverArc.outerRadiusOffset);const c=FL().value(L=>L[s]).sort(b(i,"pie","sortFunction")).padAngle(Vt.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",pt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,L=>L.data[a]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",L=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:L.data[a],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[a],null,L.data)).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[s]}, ${$c(L.data[s],o,s)+"%"}`).attrTween("d",function(L){return MI.bind(this)(L,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=b(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(L=>L.data[s]>0):[],v=N.appendOrSelect(r,"g.labels").attr("role",pt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,L=>L.data[a]);v.exit().attr("opacity",0).remove();const m=v.enter().append("text").classed("pie-label",!0),y=[];m.merge(v).style("text-anchor","middle").text(L=>i.pie.labels.formatter?i.pie.labels.formatter({...L,percentageValue:$c(L.data[s],o,s,!0)}):h($c(L.data[s],o,s),d)+"%").datum(function(L){const D=l+7,$=(L.endAngle-L.startAngle)/2+L.startAngle,F=$/Math.PI*180,P=this.getComputedTextLength();return L.textOffsetX=P/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+D)*Math.sin($),L.yPosition=(L.textOffsetY+D)*-Math.cos($),L}).attr("transform",function(L,D){const $=f.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(D>=$-2&&F<Vt.callout.minSliceDegree){let P,H;return L.index===$-1?(P=L.xPosition+Vt.callout.offsetX+Vt.callout.textMargin+L.textOffsetX,H=L.yPosition-Vt.callout.offsetY,L.direction=Ci.RIGHT,y.push(L)):(P=L.xPosition-Vt.callout.offsetX-L.textOffsetX-Vt.callout.textMargin,H=L.yPosition-Vt.callout.offsetY,L.direction=Ci.LEFT,y.push(L)),`translate(${P}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(y);const g=b(i,"donut")?"donut":"pie",x=b(i,g,"alignment"),{width:O}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),E=p?Vt.xOffset:0,w=p?Vt.yOffset:0;let A=l+E;x===te.CENTER?A=O/2:x===te.RIGHT&&(A=O-l-Vt.xOffset);let I=l+w;y.length>0&&(I+=Vt.yOffsetCallout),r.attr("x",A+7).attr("y",I),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",pt.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",pt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(a){const{xPosition:s,yPosition:o,direction:l}=a;return l===Ci.RIGHT?(a.startPos={x:s,y:o+a.textOffsetY},a.endPos={x:s+Vt.callout.offsetX,y:o-Vt.callout.offsetY+a.textOffsetY},a.intersectPointX=a.endPos.x-Vt.callout.horizontalLineLength):(a.startPos={x:s,y:o+a.textOffsetY},a.endPos={x:s-Vt.callout.offsetX,y:o-Vt.callout.offsetY+a.textOffsetY},a.intersectPointX=a.endPos.x+Vt.callout.horizontalLineLength),a}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return R(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",a=>a.startPos.x).attr("y1",a=>a.startPos.y).attr("x2",a=>a.intersectPointX).attr("y2",a=>a.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return R(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",a=>a.intersectPointX).attr("y1",a=>a.endPos.y).attr("x2",a=>a.endPos.x).attr("y2",a=>a.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=R(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(S.Pie.SLICE_MOUSEOVER,{event:n,element:R(this),datum:r});const{groupMapsTo:a}=t.getOptions().data,{valueMapsTo:s}=t.getOptions().pie;t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[a],value:r.data[s]}]})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Pie.SLICE_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);uA(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>t.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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+Vt.radiusOffset:i}}class CI extends Wv{constructor(){super(...arguments),this.type="donut",this.renderType=rt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),a=this.computeRadius(),s=b(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>s===null||s===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(a)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(R(this))}),s!==null&&s!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(a)).attr("y",i.donut.center.titleYPosition(a)).text(s)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=b(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 a;i%1===0&&r%1===0?a=Ap:a=Ae;const s=a(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(s(o)));else{const{code:c,number:u}=b(n,"locale");t.text(u(Math.floor(s(o)),c))}}}}const qv="4,10 8,6 12,10",Yv="12,6 8,10 4,6";class AI extends yt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return qm(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 b(t,"gauge","type")===or.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(b(n,"gauge","deltaArrow","direction")){case Qa.UP:return qv;case Qa.DOWN:return Yv;default:return t>0?qv:Yv}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),a=this.getValueRatio(),s=this.getArcSize(),o=this.getStartAngle(),l=a*s,c=o+l,u=o+s,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=La().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=La().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",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=b(r,"gauge","alignment"),{width:v}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===te.CENTER?m=v/2:f===te.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=b(n,"gauge","type"),i=this.getValue(),a=this.getDelta(),s=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let d=0;r===or.FULL&&!a?d=l(s):r===or.SEMI&&a&&(d=-(l(s)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(s),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:v,number:m}=b(n,"locale"),y=b(n,"gauge","numberFormatter"),g=f.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${p}px`).attr("text-anchor","middle").text(L=>{let D;return L!=null?D=Number(L.toFixed(2))%1!==0?L.toFixed(2):L.toFixed():D=0,y?y(D):m(Number(D),v)});const{width:x}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),O=p/2,E=u?"%":"",w=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${O}px`).attr("x",x/2).text(E),{width:A,height:I}=N.getSVGElementSize(w,{useBBox:!0});w.attr("y",`-${I/2}px`),f.attr("transform",`translate(-${A/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:a,number:s}=b(r,"locale");if(i){const o=this.computeRadius(),l=i?b(r,"gauge","deltaFontSize"):()=>0,c=i?b(r,"gauge","numberFormatter"):()=>null,u=b(r,"gauge","deltaArrow","size"),d=b(r,"gauge","numberSpacing"),h=b(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),v=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";v.data(i===null?[]:[i]),v.enter().append("text").classed("gauge-delta-number",!0).merge(v).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(O=>{let E;return O!=null?E=Number(O.toFixed(2))%1!==0?O.toFixed(2):O.toFixed():E=0,c?`${c(E)}${m}`:`${s(Number(E),a)}${m}`});const{width:y}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=b(r,"gauge","deltaArrow","enabled"),x=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);x.enter().append("svg").merge(x).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/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 O=R(this);N.appendOrSelect(O,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=b(r,"gauge","status");N.appendOrSelect(O,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").attr("points",t.getArrow(i))}),x.exit().remove(),v.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=b(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(S.Gauge.ARC_MOUSEOVER,{event:n,element:R(this),datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=b(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===or.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Zv extends bh{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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 a=this.getComponentContainer({withinChartClip:!0}),s=Yi(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=a.selectAll("g.bars").data(s,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",pt.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()===Jt.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,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,m),g=this.services.cartesianScales.getRangeValue(u),x=this.services.cartesianScales.getDomainValue(u)-h/2,O=x+h;if(!this.isOutsideZoomedDomain(x,O))return me({x0:p,x1:f,y0:y,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.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=R(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.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(a=>{var s;return((s=a.data)==null?void 0:s.length)>1});if(i){const a=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][a])-t(i.data[0][a]))}}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=b(t,"bars","width"),r=b(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ha().domain(t).rangeRound([0,this.getGroupWidth()])}}class kI extends yt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.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(),a=this.model.getUniqueDomain(),s=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=s,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const v=this.matrix[r][f].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})):(u=o,a.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const v=this.matrix[f][r].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Wn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Wn(l.range())},${c(r)})`),this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n.event,hoveredElement:R(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/a.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(S.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(S.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(S.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),b(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),a=r.getMainYScale(),s=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=a.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",v=>`heat-${v.index}`).classed("cell",!0).attr("transform",v=>`translate(${i(v[s])}, ${a(v[o])})`).append("rect").attr("class",v=>this.model.getColorClassName({value:v.value,originalClassName:`heat-${v.index}`})).classed("heat",!0).classed("null-state",v=>v.index===-1||v.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",v=>{const m=this.services.cartesianScales.getDomainIdentifier(v);return v.index===-1||v.value===null?`url(#${p})`:this.model.getFillColor(Number(v.value),v[m],v)}).attr("aria-label",v=>v.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=b(this.getOptions(),"heatmap","divider","state");return t!==Hr.OFF&&(t===Hr.AUTO&&of.minCellDividerDimension<=this.xBandwidth&&of.minCellDividerDimension<=this.yBandwidth||t===Hr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",a=n.getDomainIdentifier(),s=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=R(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=oa(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(S.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,items:[{label:o,value:u[a]},{label:l,value:u[s]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:R(this),datum:u}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_CLICK,{event:c,element:R(this),datum:u})}).on("mouseout",function(c,u){const d=R(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class LI extends yt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:a}=r.data,s=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(s,u=>Et(u,`0.${a}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",pt.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[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a],null,u)).attr("d",u=>{const d=Et(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,v=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-v)>0&&Math.abs(m-v)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?m+=1:m-=1),me({x0:p,x1:f,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=b(t,"locale"),a=this;this.parent.selectAll("path.bar").on("mouseover",function(s,o){const l=R(this);l.classed("hovered",!0);const c=i(parseFloat(Et(o,"data.x0")),r),u=i(parseFloat(Et(o,"data.x1")),r),d=a.services.cartesianScales.getRangeAxisPosition(),h=a.services.cartesianScales.getScaleLabel(d);a.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:l,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:a.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:o[n]})},{label:h,value:Et(o,`data.${o[n]}`)}]})}).on("mousemove",function(s){a.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("mouseout",function(){R(this).classed("hovered",!1),a.services.events.dispatchEvent(S.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class DI extends bn{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[i]!==n.datum[i]?Cn.weight.unselected:Cn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Cn.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[i]!==n.datum().name?Cn.opacity.unselected:Cn.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",Cn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:a}=this.services,s=a.getMainXScale(),o=a.getMainYScale(),l=a.getDomainIdentifier(),c=m=>a.getDomainValue(m),u=m=>a.getRangeValue(m),d=a.getOrientation(),[h,p]=kn(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const v=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===Jt.HORIZONTAL?v.attr("y1",p).attr("y2",p).attr("x1",s.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.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(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class RI extends yt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.SVG}getStackedBounds(t,n){let r=0;return t.map((i,a)=>a!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-se.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-se.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),a=b(i,"meter","proportional"),s=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;b(i,"meter","proportional")===null?u=100:u=b(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=tn().domain([0,u]).range([0,l]),h=this.getStackedBounds(s,d),p=b(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(a?se.height.proportional:se.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(a?se.height.proportional:se.height.default));const f=r.selectAll("rect.value").data(h),v=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!a?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",x=>x.x).attr("y",0).attr("height",()=>p||(a?se.height.proportional:se.height.default)).attr("class",x=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:x[c],originalClassName:v})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:t})).attr("width",x=>x.value>u?d(u):Math.max(x.width,2)).style("fill",x=>n.model.getFillColor(x[c],null,x)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),f.exit().remove();const m=b(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<s[0].value&&(y=s[0].value>u?u:s[0].value));const g=r.selectAll("line.peak").data(y==null?[]:[y]);g.enter().append("line").classed("peak",!0).merge(g).attr("y1",0).attr("y2",()=>p||(a?se.height.proportional:se.height.default)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:t})).attr("x1",x=>d(x)).attr("x2",x=>d(x)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),g.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=b(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,s){const o=R(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOVER,{event:a,element:o,datum:s}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:s[n],value:s.value}]}))}).on("mousemove",function(a,s){const o=R(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEMOVE,{event:a,element:o,datum:s}),i&&r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,s){r.services.events.dispatchEvent(S.Meter.METER_CLICK,{event:a,element:R(this),datum:s})}).on("mouseout",function(a,s){const o=R(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOUT,{event:a,element:o,datum:s}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class II extends yt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:a}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:a}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),a=b(n,"data","groupMapsTo"),s=fA(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[a]:l,[i]:null}))));return ct(s,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),a=b(n,"data","groupMapsTo");return t.map(({name:s,data:o})=>{const l=this.uniqueKeys.map(c=>({[a]:s,[r]:c,[i]:null}));return{name:s,data:ct(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?br.opacity.unselected:br.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?br.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",br.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),a=this.model.getData(),s=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:d}=b(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:v,xAxisRectHeight:m}=br;this.uniqueKeys=Array.from(new Set(a.map(_=>_[u]))),this.uniqueGroups=Array.from(new Set(a.map(_=>_[l]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(s);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),g=(Math.min(r,i)-y)/2;if(g<=0)return;const x=ha().domain(this.fullDataNormalized.map(_=>_[u])).range([0,2*Math.PI].map(_=>_-Math.PI/2)),O=Wn(this.fullDataNormalized.map(_=>_[d])),E=tn().domain([O>=0?0:O,fr(this.fullDataNormalized.map(_=>_[d]))]).range([v,g]).nice(f),w=E.ticks(f),A=(_,C,k)=>this.model.getFillColor(_,C,k),I=zL().angle(_=>x(_[u])+Math.PI/2).radius(_=>E(_[d])).curve(dm),L=this.uniqueKeys.map(_=>{const C=this.getLabelDimensions(_).width,k=y2(x(_),g);return C+k}),D={x:fr(L)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",pt.GROUP).selectAll("path").data(w,_=>_),F=_=>this.uniqueKeys.map(C=>({[u]:C,[d]:_}));$.join(_=>_.append("path").attr("opacity",0).attr("transform",`translate(${D.x}, ${D.y})`).attr("fill","none").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${D.x}, ${D.y})`).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:t})).attr("d",k=>I(F(k))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",pt.GROUP).selectAll("line").data(this.uniqueKeys,_=>_).join(_=>_.append("line").attr("opacity",0).attr("class",C=>`x-axis-${ui(C)}`).attr("stroke-dasharray","0").attr("x1",C=>Zt(x(C),0,D).x).attr("y1",C=>Zt(x(C),0,D).y).attr("x2",C=>Zt(x(C),0,D).x).attr("y2",C=>Zt(x(C),0,D).y).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",k=>Zt(x(k),E.range()[0],D).x).attr("y1",k=>Zt(x(k),E.range()[0],D).y).attr("x2",k=>Zt(x(k),E.range()[1],D).x).attr("y2",k=>Zt(x(k),E.range()[1],D).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",k=>Zt(x(k),E.range()[0],D).x).attr("y1",k=>Zt(x(k),E.range()[0],D).y).attr("x2",k=>Zt(x(k),E.range()[1],D).x).attr("y2",k=>Zt(x(k),E.range()[1],D).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",pt.GROUP).selectAll("text").data(this.uniqueKeys).join(_=>_.append("text").text(C=>C).attr("opacity",0).attr("x",C=>Zt(x(C),E.range()[1]+h,D).x).attr("y",C=>Zt(x(C),E.range()[1]+h,D).y).style("text-anchor",C=>$m(x(C)).textAnchor).style("dominant-baseline",C=>$m(x(C)).dominantBaseline).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",k=>Zt(x(k),E.range()[1]+h,D).x).attr("y",k=>Zt(x(k),E.range()[1]+h,D).y).end().finally(()=>{const k=b(o,"radar","alignment"),U=this.getAlignmentXOffset(k,n,this.getParent());n.attr("x",U)})),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",pt.GROUP).selectAll("path").data(this.groupedDataNormalized,_=>_.name).join(_=>_.append("path").attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C.name).attr("opacity",0).attr("transform",t?()=>`translate(${D.x}, ${D.y}) scale(${1+Math.random()*.35})`:`translate(${D.x}, ${D.y})`).style("fill",C=>A(C.name,null,C.data)).style("fill-opacity",br.opacity.selected).style("stroke",C=>A(C.name,null,C.data)).call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_enter",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",`translate(${D.x}, ${D.y})`),k.attr("opacity",1).attr("d",U=>I(U.data))}),_=>(_.attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).style("fill",C=>A(C.name,null,C.data)).style("stroke",C=>A(C.name,null,C.data)),_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${D.x}, ${D.y})`).attr("d",k=>I(k.data))),_),_=>_.call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_exit",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${D.x}, ${D.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",pt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(_=>b(_,d)!==null)).join(_=>_.append("circle").attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C[c]),_=>_,_=>_.remove()).attr("class",_=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:_[l],originalClassName:ui(_[u])})).attr("cx",_=>Zt(x(_[u]),E(_[d]),D).x).attr("cy",_=>Zt(x(_[u]),E(_[d]),D).y).attr("r",0).attr("opacity",0).style("fill",_=>A(_[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",pt.GROUP).selectAll("rect").data(this.uniqueKeys).join(_=>_.append("rect"),_=>_,_=>_.remove()).attr("x",D.x).attr("y",D.y-m/2).attr("width",E.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",_=>`rotate(${Mm(x(_))}, ${D.x}, ${D.y})`);const{code:P,number:H}=b(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",pt.GROUP).selectAll("text").data(Ke(w)).join(_=>_.append("text").attr("opacity",0).text(C=>H(C,P)).attr("x",C=>Zt(-Math.PI/2,E(C),D).x+p).attr("y",C=>Zt(-Math.PI/2,E(C),D).y).style("text-anchor","start").style("dominant-baseline","middle").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:t})).text(k=>k).attr("opacity",1).attr("x",k=>Zt(-Math.PI/2,E(k),D).x+p).attr("y",k=>Zt(-Math.PI/2,E(k),D).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,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:a}=N.getSVGElementSize(r,{useAttrs:!0});let s=0;return t===te.CENTER?s=Math.floor((a-i.width)/2):t===te.RIGHT&&(s=a-i.width),s}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=b(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const a=R(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOVER,{event:r,element:a,datum:i});const s=t.parent.select(`.x-axes .x-axis-${ui(i)}`),o=t.parent.selectAll(`.dots circle.${ui(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=b(c,"radar","axes","value");s.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",br.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:r,hoveredElement:a,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 a=R(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEMOVE,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Radar.X_AXIS_CLICK,{event:r,element:R(this),datum:i})}).on("mouseout",function(r,i){const a=R(this),s=t.parent.select(`.x-axes .x-axis-${ui(i)}`),o=t.parent.selectAll(`.dots circle.${ui(i)}`);s.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOUT,{event:r,element:a,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE)})}}class Xv extends bh{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(a,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,v;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),v=this.services.cartesianScales.getRangeValue(d[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,y)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-f);if(m!==0&&m<2&&(d>0&&s===Jt.VERTICAL||d<0&&s===Jt.HORIZONTAL?v=f-2:v=f+2),!this.isOutsideZoomedDomain(h,p))return me({x0:h,x1:p,y0:f,y1:v},s)}).attr("opacity",1).attr("role",pt.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=R(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:R(this),datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class NI extends be{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),r=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(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"),a=i.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",0).attr("x2",n).attr("y1",s=>s).attr("y2",s=>s),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 Kv extends yt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.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(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>b(a,0,i)!==n.datum().name?Mn.opacity.unselected:Mn.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",Mn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:a}=i.data,s=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:s,groups:this.configs.groups}),l=b(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=>b(p,0,a));this.areaGenerator=Hu().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=>b(p,0,a)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:b(p,0,a),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(b(p,0,a),null,p)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>b(p,0,a)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Mn.opacity.selected).attr("d",this.areaGenerator)}}class Qv extends bh{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),s=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(a,c=>b(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",pt.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 v=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(v-f)>0&&Math.abs(v-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&s.length>1?this.services.cartesianScales.getOrientation()===Jt.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?v+=1:v-=1)}return me({x0:h,x1:p,y0:f,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",pt.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,a){const s=R(this);s.classed("hovered",!0),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:i,element:s,datum:a});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]===a.data[a[n]]&&l[c].toString()===a.data.sharedStackKey&&l[n]===a[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:a.data.sharedStackKey,[c]:a.data[a[n]],[n]:a[n]}}r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:s,data:[o]})}).on("mousemove",function(i,a){const s=R(this);r.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:i,element:s,datum:a}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,a){r.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:i,element:R(this),datum:a})}).on("mouseout",function(i,a){const s=R(this);s.classed("hovered",!1),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:i,element:s,datum:a}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:s})})}getBarWidth(){const t=this.getOptions();if(b(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,a=b(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*a/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Jv extends bn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!b(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,a=Object.keys(r.axes).some(u=>r.axes[u].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=n.selectAll("g.dots").data(s,u=>b(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",pt.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,a=Object.keys(r.axes).some(l=>r.axes[l].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=[];return s.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const v=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),y=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(v)&&(a&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[y]: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 Ei=6;class PI extends yt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.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();n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const a=this.model.getOptions(),s=this.model.getDisplayData(),o=b(a,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(s),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+Ei:30-Ei},h=Ca({name:o,children:s}),p=10,f=r/6,v=w=>{const A=h.descendants().reverse(),I=h.links();let L=h,D=h;h.eachBefore(U=>{U.x<L.x&&(L=U),U.x>D.x&&(D=U)});const $=D.x-L.x,F=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,L.x,r,$].join(" ")),P=E.selectAll("g").data(A,U=>U.id),H=this,_=P.enter().append("g").attr("transform",()=>`translate(${w.y0},${w.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOVER,{event:U,element:R(this),datum:B})}).on("click",function(U,B){B.depth!==0&&(B.children=B.children?null:B._children,v(B)),H.services.events.dispatchEvent(S.Tree.NODE_CLICK,{event:U,element:R(this),datum:B})}).on("mouseout",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOUT,{event:U,element:R(this),datum:B})});_.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),_.append("text").attr("dy","0.31em").attr("x",U=>U._children?-Ei:Ei).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(_).transition(F).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(F).remove().attr("transform",()=>`translate(${w.y},${w.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const C=O.selectAll("path").data(I,U=>U.target.id),k=C.enter().append("path").attr("d",()=>{const U={x:w.x0,y:w.y0};return x({source:U,target:U})});C.merge(k).transition(F).attr("d",x),C.exit().transition(F).remove().attr("d",()=>{const U={x:w.x,y:w.y};return x({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},m=h.descendants(),y=m[m.length-1].depth,g=b(a,"tree","type")===Ka.DENDROGRAM?Vk().size([i,r-u-y*Ei-l]):ML().nodeSize([p,f]).size([i,r-u-y*Ei-l]),x=KL().x(w=>w.y).y(w=>w.x);h.x0=f/2,h.y0=0,h.descendants().forEach((w,A)=>{w.id=A,w._children=w.children}),g(h),n.attr("viewBox",[-d.left,-d.top,r,p]).style("user-select","none");const O=n.append("g").attr("class","links"),E=n.append("g").attr("class","nodes");v(h)}}var UI="#000000",BI="#ffffff",HI="#fcf4d6",VI="#fddc69",FI="#f1c21b",GI="#d2a106",jI="#b28600",zI="#8e6a00",WI="#684e00",qI="#483700",YI="#302400",ZI="#1c1500",XI={10:HI,20:VI,30:FI,40:GI,50:jI,60:zI,70:WI,80:qI,90:YI,100:ZI},KI="#fff2e8",QI="#ffd9be",JI="#ffb784",tN="#ff832b",eN="#eb6200",nN="#ba4e00",rN="#8a3800",iN="#5e2900",aN="#3e1a00",sN="#231000",oN={10:KI,20:QI,30:JI,40:tN,50:eN,60:nN,70:rN,80:iN,90:aN,100:sN},lN="#fff1f1",cN="#ffd7d9",uN="#ffb3b8",hN="#ff8389",dN="#fa4d56",pN="#da1e28",fN="#a2191f",mN="#750e13",gN="#520408",vN="#2d0709",yN={10:lN,20:cN,30:uN,40:hN,50:dN,60:pN,70:fN,80:mN,90:gN,100:vN},bN="#fff0f7",xN="#ffd6e8",_N="#ffafd2",EN="#ff7eb6",ON="#ee5396",wN="#d02670",SN="#9f1853",TN="#740937",$N="#510224",MN="#2a0a18",CN={10:bN,20:xN,30:_N,40:EN,50:ON,60:wN,70:SN,80:TN,90:$N,100:MN},AN="#f6f2ff",kN="#e8daff",LN="#d4bbff",DN="#be95ff",RN="#a56eff",IN="#8a3ffc",NN="#6929c4",PN="#491d8b",UN="#31135e",BN="#1c0f30",HN={10:AN,20:kN,30:LN,40:DN,50:RN,60:IN,70:NN,80:PN,90:UN,100:BN},VN="#edf5ff",FN="#d0e2ff",GN="#a6c8ff",jN="#78a9ff",zN="#4589ff",WN="#0f62fe",qN="#0043ce",YN="#002d9c",ZN="#001d6c",XN="#001141",KN={10:VN,20:FN,30:GN,40:jN,50:zN,60:WN,70:qN,80:YN,90:ZN,100:XN},QN="#e5f6ff",JN="#bae6ff",tP="#82cfff",eP="#33b1ff",nP="#1192e8",rP="#0072c3",iP="#00539a",aP="#003a6d",sP="#012749",oP="#061727",lP={10:QN,20:JN,30:tP,40:eP,50:nP,60:rP,70:iP,80:aP,90:sP,100:oP},cP="#d9fbfb",uP="#9ef0f0",hP="#3ddbd9",dP="#08bdba",pP="#009d9a",fP="#007d79",mP="#005d5d",gP="#004144",vP="#022b30",yP="#081a1c",bP={10:cP,20:uP,30:hP,40:dP,50:pP,60:fP,70:mP,80:gP,90:vP,100:yP},xP="#defbe6",_P="#a7f0ba",EP="#6fdc8c",OP="#42be65",wP="#24a148",SP="#198038",TP="#0e6027",$P="#044317",MP="#022d0d",CP="#071908",AP={10:xP,20:_P,30:EP,40:OP,50:wP,60:SP,70:TP,80:$P,90:MP,100:CP},kP="#f2f4f8",LP="#dde1e6",DP="#c1c7cd",RP="#a2a9b0",IP="#878d96",NP="#697077",PP="#4d5358",UP="#343a3f",BP="#21272a",HP="#121619",VP={10:kP,20:LP,30:DP,40:RP,50:IP,60:NP,70:PP,80:UP,90:BP,100:HP},FP="#f4f4f4",GP="#e0e0e0",jP="#c6c6c6",zP="#a8a8a8",WP="#8d8d8d",qP="#6f6f6f",YP="#525252",ZP="#393939",XP="#262626",KP="#161616",QP={10:FP,20:GP,30:jP,40:zP,50:WP,60:qP,70:YP,80:ZP,90:XP,100:KP},JP="#f7f3f2",t3="#e5e0df",e3="#cac5c4",n3="#ada8a8",r3="#8f8b8b",i3="#726e6e",a3="#565151",s3="#3c3838",o3="#272525",l3="#171414",c3={10:JP,20:t3,30:e3,40:n3,50:r3,60:i3,70:a3,80:s3,90:o3,100:l3},t0={black:{100:UI},blue:KN,coolGray:VP,cyan:lP,gray:QP,green:AP,magenta:CN,orange:oN,purple:HN,red:yN,teal:bP,warmGray:c3,white:{0:BI},yellow:XI};const u3=e=>{if(!e)return null;for(const t of Object.keys(t0)){const n=t0[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},e0=function(){const e=R(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Sn(t);let r;if(n&&(r=u3(n?n.hex():null)),r==null){const i=cc(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let h3=0;class d3 extends yt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),a=b(window,"location"),{width:s,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=Ca({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=DL().size([s,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",()=>h3++).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=R(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=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=R(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${f}`;return new URL(`#${v}`,a)+""}),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;const v=cc(this.model.getFillColor(f.data.name));return[{text:p.data.name,color:v.l<.5?"white":"black"}]},p=>p).join(p=>{const f=p.append("text").text(v=>v.text).style("fill",e0).attr("x",7).attr("y",18);return a&&f.attr("clip-path",function(){const v=R(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${m}`,a)+""})`}),f},p=>p.text(f=>f.text).style("fill",e0),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=R(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),s=r;for(;s.depth>1;)s=s.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&&(a=l),Sn(a).darker(.7).toString()}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:a,label:s.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Treemap.LEAF_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1);let a=r;for(;a.depth>1;)a=a.parent;i.transition().call(s=>t.services.transitions.setupTransition({transition:s,name:"graph_element_mouseout_fill_update"})).style("fill",s=>t.model.getFillColor(s.parent.data.name,null,s.data)),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}}var p3={value:function(){}};function n0(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Vo(n)}function Vo(e){this._=e}function f3(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=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}})}Vo.prototype=n0.prototype={constructor:Vo,on:function(e,t){var n=this._,r=f3(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=m3(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=r0(n[i],e.name,t);else if(t==null)for(i in n)n[i]=r0(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Vo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function m3(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function r0(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=p3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const g3=Object.freeze(Object.defineProperty({__proto__:null,dispatch:n0},Symbol.toStringTag,{value:"Module"})),v3=fR(g3),y3=v3.dispatch,xh=Math.PI/180,b3={archimedean:a0,rectangular:A3},Va=64,Fo=2048;var x3=function(){var e=[256,256],t=_3,n=E3,r=O3,i=i0,a=i0,s=w3,o=S3,l=a0,c=[],u=1/0,d=y3("word","end"),h=null,p=Math.random,f={},v=L3;f.canvas=function(g){return arguments.length?(v=tr(g),f):v},f.start=function(){var g=m(v()),x=k3((e[0]>>5)*e[1]),O=null,E=c.length,w=-1,A=[],I=c.map(function(D,$){return D.text=t.call(this,D,$),D.font=n.call(this,D,$),D.style=i.call(this,D,$),D.weight=a.call(this,D,$),D.rotate=s.call(this,D,$),D.size=~~r.call(this,D,$),D.padding=o.call(this,D,$),D}).sort(function(D,$){return $.size-D.size});return h&&clearInterval(h),h=setInterval(L,0),L(),f;function L(){for(var D=Date.now();Date.now()-D<u&&++w<E&&h;){var $=I[w];$.x=e[0]*(p()+.5)>>1,$.y=e[1]*(p()+.5)>>1,T3(g,$,I,w),$.hasText&&y(x,$,O)&&(A.push($),d.call("word",f,$),O?M3(O,$):O=[{x:$.x+$.x0,y:$.y+$.y0},{x:$.x+$.x1,y:$.y+$.y1}],$.x-=e[0]>>1,$.y-=e[1]>>1)}w>=E&&(f.stop(),d.call("end",f,A,O))}},f.stop=function(){h&&(clearInterval(h),h=null);for(const g of c)delete g.sprite;return f};function m(g){const x=g.getContext("2d",{willReadFrequently:!0});g.width=g.height=1;const O=Math.sqrt(x.getImageData(0,0,1,1).data.length>>2);return g.width=(Va<<5)/O,g.height=Fo/O,x.fillStyle=x.strokeStyle="red",{context:x,ratio:O}}function y(g,x,O){e[0],e[1];for(var E=x.x,w=x.y,A=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),L=p()<.5?1:-1,D=-L,$,F,P;($=I(D+=L))&&(F=~~$[0],P=~~$[1],!(Math.min(Math.abs(F),Math.abs(P))>=A));)if(x.x=E+F,x.y=w+P,!(x.x+x.x0<0||x.y+x.y0<0||x.x+x.x1>e[0]||x.y+x.y1>e[1])&&(!O||C3(x,O))&&!$3(x,g,e[0])){for(var H=x.sprite,_=x.width>>5,C=e[0]>>5,k=x.x-(_<<4),U=k&127,B=32-U,X=x.y1-x.y0,Y=(x.y+x.y0)*C+(k>>5),ot,it=0;it<X;it++){ot=0;for(var xt=0;xt<=_;xt++)g[Y+xt]|=ot<<B|(xt<_?(ot=H[it*_+xt])>>>U:0);Y+=C}return!0}return!1}return f.timeInterval=function(g){return arguments.length?(u=g??1/0,f):u},f.words=function(g){return arguments.length?(c=g,f):c},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=tr(g),f):n},f.fontStyle=function(g){return arguments.length?(i=tr(g),f):i},f.fontWeight=function(g){return arguments.length?(a=tr(g),f):a},f.rotate=function(g){return arguments.length?(s=tr(g),f):s},f.text=function(g){return arguments.length?(t=tr(g),f):t},f.spiral=function(g){return arguments.length?(l=b3[g]||g,f):l},f.fontSize=function(g){return arguments.length?(r=tr(g),f):r},f.padding=function(g){return arguments.length?(o=tr(g),f):o},f.random=function(g){return arguments.length?(p=g,f):p},f.on=function(){var g=d.on.apply(d,arguments);return g===d?f:g},f};function _3(e){return e.text}function E3(){return"serif"}function i0(){return"normal"}function O3(e){return Math.sqrt(e.value)}function w3(){return(~~(random()*6)-3)*30}function S3(){return 1}function T3(e,t,n,r){if(!t.sprite){var i=e.context,a=e.ratio;i.clearRect(0,0,(Va<<5)/a,Fo/a);var s=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/a)+"px "+t.font;const $=i.measureText(t.text),F=-Math.floor($.width/2);let P=($.width+1)*a,H=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*xh),d=Math.cos(t.rotate*xh),h=P*d,p=P*u,f=H*d,v=H*u;P=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,H=~~Math.max(Math.abs(p+f),Math.abs(p-f))}else P=P+31>>5<<5;if(H>l&&(l=H),s+P>=Va<<5&&(s=0,o+=l,l=0),o+H>=Fo)break;i.translate((s+(P>>1))/a,(o+(H>>1))/a),t.rotate&&i.rotate(t.rotate*xh),i.fillText(t.text,F,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,F,0)),i.restore(),t.width=P,t.height=H,t.xoff=s,t.yoff=o,t.x1=P>>1,t.y1=H>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=P}for(var m=i.getImageData(0,0,(Va<<5)/a,Fo/a).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var g=t.width,x=g>>5,O=t.y1-t.y0,E=0;E<O*x;E++)y[E]=0;if(s=t.xoff,s==null)return;o=t.yoff;for(var w=0,A=-1,I=0;I<O;I++){for(var E=0;E<g;E++){var L=x*I+(E>>5),D=m[(o+I)*(Va<<5)+(s+E)<<2]?1<<31-E%32:0;y[L]|=D,w|=D}w?A=I:(t.y0++,O--,I--,o++)}t.y1=t.y0+A,t.sprite=y.slice(0,(t.y1-t.y0)*x)}}}function $3(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,a=e.x-(i<<4),s=a&127,o=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>s:0))&t[c+h])return!0;c+=n}return!1}function M3(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function C3(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function a0(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function A3(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(a){var s=a<0?-1:1;switch(Math.sqrt(1+4*s*a)-s&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function k3(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function L3(){return document.createElement("canvas")}function tr(e){return typeof e=="function"?e:function(){return e}}const D3=Sv(x3);class R3 extends yt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),a=this.getFontSizeScale(i),s=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=s.wordCloud,{groupMapsTo:c}=s.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=D3().size([u,d]).words(i.map(function(f){const v=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:v,value:v}})).padding(5).rotate(0).fontSize(f=>a(f.size)).on("end",p);h.start();function p(f){const v=N.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(f,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.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),a=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),s=i.length>0,o=s?Ke(i):[1,1];return tn().domain(o).range(s?n.wordCloud.fontSizeRange(a,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Hs(a=>{const s=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));a===null?s.attr("opacity",1):s.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,s){const o=this;i(o),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOVER,{event:a,element:R(this),datum:s}),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:s.text},{label:t.tooltip.valueLabel,value:s.value},{label:Et(t,"locale.translations.group")||Et(t,"tooltip.groupLabel")||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:s[n]})}]})}).on("mousemove",function(a,s){const o=R(this);r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEMOVE,{element:o,datum:s}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,s){r.services.events.dispatchEvent(S.WordCloud.WORD_CLICK,{event:a,element:R(this),datum:s})}).on("mouseout",function(a,s){const o=R(this);i(null),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOUT,{event:a,element:o,datum:s}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class I3 extends yt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.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(),a=b(this.getOptions(),"geoData"),s=this.model.getCombinedData(),o={},l={};Object.keys(s).forEach(m=>{typeof s[m].value=="number"?o[m]=s[m]:l[m]=s[m]});const c=gI(a,Object.values(l)),u=pI(a,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=pk().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",Da()([[0,0],[0,10]]));const v=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case un.geoEqualEarth:t=Lk();break;case un.geoAlbers:t=Sk();break;case un.geoConicEqualArea:t=Wg();break;case un.geoConicEquidistant:t=Ak();break;case un.geoEquirectangular:t=Mk();break;case un.geoMercator:t=Tk();break;case un.geoNaturalEarth1:t=Dk();break;default:throw new Error("Projection is not supported.")}return t}}class N3 extends I3{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({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 a=R(this);t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEOVER,{event:r,element:a,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.SHOW,{event:r,hoveredElement:a,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEMOVE,{event:r,element:R(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Pr.CHOROPLETH_CLICK,{event:r,element:R(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const a=R(this);t.services.events.dispatchEvent(Pr.CHOROPLETH_MOUSEOUT,{event:r,element:a,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Nr.HIDE,{event:r,hoveredElement:a})})}}function _h(e){var t=e==null?0:e.length;return t?cs(e,1):[]}function P3(e){return nd(ad(e,void 0,_h),e+"")}function s0(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 a=Array(i);++r<i;)a[r]=e[r+t];return a}function U3(e,t){return t.length<2?e:Vl(e,s0(t,0,-1))}function B3(e,t){return t=ls(t,e),e=U3(e,t),e==null||delete e[zi(tp(t))]}function H3(e){return yd(e)?void 0:e}var V3=1,F3=2,G3=4,j3=P3(function(e,t){var n={};if(e==null)return n;var r=!1;t=Cl(t,function(a){return a=ls(a,e),r||(r=a.length>1),a}),Vr(e,Md(e),n),r&&(n=Wi(n,V3|F3|G3,H3));for(var i=t.length;i--;)B3(n,t[i]);return n});function o0(e){return Math.log(e)}function l0(e){return Math.exp(e)}function z3(e){return-Math.log(-e)}function W3(e){return-Math.exp(-e)}function q3(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Y3(e){return e===10?q3:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Z3(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 c0(e){return(t,n)=>-e(-t,n)}function X3(e){const t=e(o0,l0),n=t.domain;let r=10,i,a;function s(){return i=Z3(r),a=Y3(r),n()[0]<0?(i=c0(i),a=c0(a),e(z3,W3)):e(o0,l0),t}return t.base=function(o){return arguments.length?(r=+o,s()):r},t.domain=function(o){return arguments.length?(n(o),s()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,v;const m=o==null?10:+o;let y=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(v=h<0?f/a(-h):f*a(h),!(v<c)){if(v>u)break;y.push(v)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(v=h>0?f/a(-h):f*a(h),!(v<c)){if(v>u)break;y.push(v)}y.length*2<m&&(y=ms(c,u,m))}else y=ms(h,p,Math.min(p-h,m)).map(a);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=ia(l)).precision==null&&(l.trim=!0),l=Ec(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/a(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(Ff(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),t}function u0(){const e=X3(nf()).domain([1,10]);return e.copy=()=>wc(e,u0()).base(e.base()),Kr.apply(e,arguments),e}function Go(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 jo(e){this._context=e}jo.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:Go(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:Go(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K3(e){return new jo(e)}function h0(e){this._context=e}h0.prototype={areaStart:Xn,areaEnd:Xn,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:Go(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Q3(e){return new h0(e)}function d0(e){this._context=e}d0.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:Go(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J3(e){return new d0(e)}function p0(e,t){this._basis=new jo(e),this._beta=t}p0.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],a=e[n]-r,s=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*a),this._beta*t[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const tU=function e(t){function n(r){return t===1?new jo(r):new p0(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function zo(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 Eh(e,t){this._context=e,this._k=(1-t)/6}Eh.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:zo(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:zo(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 eU=function e(t){function n(r){return new Eh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Oh(e,t){this._context=e,this._k=(1-t)/6}Oh.prototype={areaStart:Xn,areaEnd:Xn,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:zo(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 nU=function e(t){function n(r){return new Oh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function wh(e,t){this._context=e,this._k=(1-t)/6}wh.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:zo(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 rU=function e(t){function n(r){return new wh(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Sh(e,t,n){var r=e._x1,i=e._y1,a=e._x2,s=e._y2;if(e._l01_a>de){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>de){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);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,s,e._x2,e._y2)}function f0(e,t){this._context=e,this._alpha=t}f0.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:Sh(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 iU=function e(t){function n(r){return t?new f0(r,t):new Eh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function m0(e,t){this._context=e,this._alpha=t}m0.prototype={areaStart:Xn,areaEnd:Xn,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:Sh(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 aU=function e(t){function n(r){return t?new m0(r,t):new Oh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function g0(e,t){this._context=e,this._alpha=t}g0.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:Sh(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 sU=function e(t){function n(r){return t?new g0(r,t):new wh(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function v0(e){return e<0?-1:1}function y0(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(v0(a)+v0(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function b0(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Th(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function Wo(e){this._context=e}Wo.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:Th(this,this._t0,b0(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,Th(this,b0(this,n=y0(this,e,t)),n);break;default:Th(this,this._t0,n=y0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function x0(e){this._context=new _0(e)}(x0.prototype=Object.create(Wo.prototype)).point=function(e,t){Wo.prototype.point.call(this,t,e)};function _0(e){this._context=e}_0.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function oU(e){return new Wo(e)}function lU(e){return new x0(e)}function E0(e){this._context=e}E0.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=O0(e),i=O0(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function O0(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function cU(e){return new E0(e)}function qo(e,t){this._context=e,this._t=t}qo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 uU(e){return new qo(e,.5)}function hU(e){return new qo(e,0)}function dU(e){return new qo(e,1)}class pU extends Pn{zoomIn(t,n,r){let i,a,s;const o=r||Jr;t&&(i=t.x,a=t.y,s=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(${s}) translate(${-i},${-a})`),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_IN,{element:R(t)})}zoomOut(t,n){const r=n||Jr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_OUT)}}class fU extends Pn{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 mU extends Pn{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 a=URL.createObjectURL(new Blob([t],{type:i}));r.href=a,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}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 gU extends Pn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(S.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(b(uf,n,"duration")||uf.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Fa(e,t){const n=wt(e),r=wt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function vU(e,t){const n=wt(e),r=wt(t);return n.getFullYear()-r.getFullYear()}function yU(e,t){const n=wt(e),r=wt(t),i=Fa(n,r),a=Math.abs(vU(n,r));n.setFullYear(1584),r.setFullYear(1584);const s=Fa(n,r)===-i,o=i*(a-+s);return o===0?0:o}function $h(e,t){const n=wt(e);if(isNaN(t))return nn(e,NaN);if(!t)return n;const r=n.getDate(),i=nn(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const a=i.getDate();return r>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function w0(e,t){return $h(e,t*12)}function bU(e,t){return w0(e,-t)}function xU(e,t){const n=wt(e),r=wt(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function _U(e){const t=wt(e);return t.setHours(23,59,59,999),t}function EU(e){const t=wt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function OU(e){const t=wt(e);return+_U(t)==+EU(t)}function wU(e,t){const n=wt(e),r=wt(t),i=Fa(n,r),a=Math.abs(xU(n,r));let s;if(a<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let o=Fa(n,r)===-i;OU(wt(e))&&a===1&&Fa(e,r)===1&&(o=!1),s=i*(a-Number(o))}return s===0?0:s}function SU(e,t){return $h(e,-t)}function TU(e,t){const n=wt(e),r=wt(t),i=S0(n,r),a=Math.abs(Sf(n,r));n.setDate(n.getDate()-i*a);const s=+(S0(n,r)===-i),o=i*(a-s);return o===0?0:o}function S0(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 T0(e,t){const n=wt(e);return isNaN(t)?nn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function $U(e,t){return T0(e,-t)}function Mh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Ch(e,t){return+wt(e)-+wt(t)}function MU(e,t,n){const r=Ch(e,t)/Ef;return Mh(void 0)(r)}function Ah(e,t){const n=+wt(e);return nn(e,n+t)}function $0(e,t){return Ah(e,t*Ef)}function CU(e,t){return $0(e,-t)}function M0(e,t,n){const r=Ch(e,t)/_f;return Mh(void 0)(r)}function kh(e,t){return Ah(e,t*_f)}function C0(e,t){return kh(e,-t)}function A0(e,t,n){const r=Ch(e,t)/1e3;return Mh(void 0)(r)}function Lh(e,t){return Ah(e,t*1e3)}function k0(e,t){return Lh(e,-t)}class AU extends Pn{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=b(n,"axes",this.secondaryDomainAxisPosition),a=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(a))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,a=b(r,"axes",this.secondaryRangeAxisPosition);let s;if(t!==null?s=t[i]:n&&n.length>0&&(s=n[0]),a!=null&&a.correspondingDatasets&&a.correspondingDatasets.includes(s))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return b(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===G.BOTTOM||t===G.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(G).map(t=>G[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===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=Jt.VERTICAL:this.orientation=Jt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const a=this.model.getOptions(),s=b(a,"axes");((t=s[G.LEFT])!=null&&t.correspondingDatasets&&s[G.RIGHT]||(n=s[G.RIGHT])!=null&&n.correspondingDatasets&&s[G.LEFT]||(r=s[G.TOP])!=null&&r.correspondingDatasets&&s[G.BOTTOM]||(i=s[G.BOTTOM])!=null&&i.correspondingDatasets&&s[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=b(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]===tt.LINEAR||this.scaleTypes[t]===tt.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=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.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 a=this.model.getOptions(),s=b(a,"axes")[r],{mapsTo:o}=s,l=b(i,o)!==null?i[o]:i;let c;switch(n){case tt.LABELS:c=t(l)+t.step()/2;break;case tt.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],a=this.model.getOptions(),s=b(a,"axes")[r],{mapsTo:o}=s,l=t[o]!==void 0?t[o]:t;return[i(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(b(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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=b(r,"axes",t);if(i.scaleType===tt.TIME){const a=b(r,"timeScale","addSpaceOnEdges");return kU(n,a)}else return LU(n,qn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.LEFT)===null&&b(n,G.RIGHT)!==null||b(n,G.RIGHT,"main")===!0||r&&b(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.BOTTOM)===null&&b(n,G.TOP)!==null||b(n,G.TOP,"main")===!0||r&&b(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=b(r,"axes",t.primary),a=b(r,"axes",n.primary),s=i.scaleType||tt.LINEAR,o=a.scaleType||tt.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===tt.LABELS||o===tt.TIME)&&s===tt.LABELS||s===tt.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=b(n,"axes",t),i=b(n,"bounds"),{includeZero:a}=r,s=b(r,"scaleType")||tt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,fr(y,g=>g.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),g=this.model.getStackKeys({bins:y});return[g[0].split(":")[0],g[g.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=qn.ratio;if(r.domain)return s===tt.LABELS?r.domain:(s===tt.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&s===tt.LABELS)return Yi(o.map(y=>y[c]));let f,v;const m=this.model.getDataGroupNames();if(s===tt.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[p]}`);if(s===tt.TIME)v=o.map(y=>+new Date(y[c]));else if(i&&n.axes)v=[],o.forEach(y=>{v.push(y[c]),y[i.upperBoundMapsTo]&&v.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&v.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,g=this.model.getDataValuesGroupedByKeys({groups:m}),x=o.filter(E=>!m.includes(E[y])),O=[];g.forEach(E=>{const{...w}=E;let A=0,I=0;Object.values(j3(w,"sharedStackKey")).forEach(L=>{isNaN(L)||(L<0?I+=L:A+=L)}),O.push([I,A])}),v=[..._h(O),...x.map(E=>E[c])]}else v=[],o.forEach(y=>{const g=y[c];Array.isArray(g)&&g.length===2?(v.push(g[0]),v.push(g[1])):(l&&v.push(Math.max(y[c],y[l])),v.push(g))});return s!==tt.TIME&&s!==tt.LOG&&a&&v.push(0),d&&d.length>0&&d.forEach(y=>{const g=b(y,"value");g!==null&&v.push(g)}),f=Ke(v),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=b(n,"axes",t);if(!r)return null;const i=b(r,"scaleType")||tt.LINEAR;this.scaleTypes[t]=i;let a;return i===tt.TIME?a=om():i===tt.LOG?a=u0().base(r.base||10):i===tt.LABELS||i===tt.LABELS_RATIO?a=ha():a=tn(),a.domain(this.getScaleDomain(t)),a}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Jt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),b(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=b(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(),a=r.sort((s,o)=>o.value-s.value)[0];return this.getScaleTypeByPosition(n)===tt.TIME&&(typeof a.value=="string"||a.value.getTime===void 0)&&(a.value=new Date(a.value)),{threshold:a,scaleValue:i(a.value)}}getHighestRangeThreshold(){const t=b(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(),a=r.sort((s,o)=>o.value-s.value)[0];return{threshold:a,scaleValue:i(a.value)}}}function kU(e,t){const n=new Date(e[0]),r=new Date(e[1]);return yU(r,n)>1?[bU(n,t),w0(r,t)]:wU(r,n)>1?[SU(n,t),$h(r,t)]:TU(r,n)>1?[$U(n,t),T0(r,t)]:MU(r,n)>1?[CU(n,t),$0(r,t)]:M0(r,n)>30?[C0(n,t*30),kh(r,t*30)]:M0(r,n)>1?[C0(n,t),kh(r,t)]:A0(r,n)>15?[k0(n,t*15),Lh(r,t*15)]:A0(r,n)>1?[k0(n,t),Lh(r,t)]:[n,r]}function LU([e,t],n,r){const i=(t-e)*n,a=t<=0&&t+i>0?0:t+i;let s=e>=0&&e-i<0?0:e-i;if(r===tt.LOG&&s<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=e}return[s,a]}class DU extends Pn{constructor(){super(...arguments),this.curveTypes={curveLinear:qs,curveLinearClosed:dm,curveBasis:K3,curveBasisClosed:Q3,curveBasisOpen:J3,curveBundle:tU,curveCardinal:eU,curveCardinalClosed:nU,curveCardinalOpen:rU,curveCatmullRom:iU,curveCatmullRomClosed:aU,curveCatmullRomOpen:sU,curveMonotoneX:oU,curveMonotoneY:lU,curveNatural:cU,curveStep:uU,curveStepAfter:dU,curveStepBefore:hU}}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 RU extends Pn{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(this.model.getOptions(),"axes",t,"scaleType");return t===G.BOTTOM&&n===tt.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(),a=r.getDomainIdentifier(),s=b(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(s)&&s.length===2)return s;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Ke(n,o=>o[a]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),a=Object.assign({stacked:!1},n),s=b(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&i){const o=a.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=ke.handleWidth,a=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();a.domain(this.getDefaultZoomBarDomain());const s=a(r[0]),o=a(r[1]);if(o-s<i+1)return;const l=a.range(),c=o-s,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=s+u,h=o-u;d>=h&&(d=s+c/2-i/2,h=o-c/2+i/2);const p=[a.invert(d),a.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]),a=r(n[1]),s=r.range(),o=(s[1]-s[0])/2*(t/2),l=Math.max(i-o,s[0]),c=Math.min(a+o,s[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(),a=b(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<a}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}function IU(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:s0(e,t,n)}var NU="\\ud800-\\udfff",PU="\\u0300-\\u036f",UU="\\ufe20-\\ufe2f",BU="\\u20d0-\\u20ff",HU=PU+UU+BU,VU="\\ufe0e\\ufe0f",FU="\\u200d",GU=RegExp("["+FU+NU+HU+VU+"]");function L0(e){return GU.test(e)}function jU(e){return e.split("")}var D0="\\ud800-\\udfff",zU="\\u0300-\\u036f",WU="\\ufe20-\\ufe2f",qU="\\u20d0-\\u20ff",YU=zU+WU+qU,ZU="\\ufe0e\\ufe0f",XU="["+D0+"]",Dh="["+YU+"]",Rh="\\ud83c[\\udffb-\\udfff]",KU="(?:"+Dh+"|"+Rh+")",R0="[^"+D0+"]",I0="(?:\\ud83c[\\udde6-\\uddff]){2}",N0="[\\ud800-\\udbff][\\udc00-\\udfff]",QU="\\u200d",P0=KU+"?",U0="["+ZU+"]?",JU="(?:"+QU+"(?:"+[R0,I0,N0].join("|")+")"+U0+P0+")*",tB=U0+P0+JU,eB="(?:"+[R0+Dh+"?",Dh,I0,N0,XU].join("|")+")",nB=RegExp(Rh+"(?="+Rh+")|"+eB+tB,"g");function rB(e){return e.match(nB)||[]}function iB(e){return L0(e)?rB(e):jU(e)}function aB(e){return function(t){t=ji(t);var n=L0(t)?iB(t):void 0,r=n?n[0]:t.charAt(0),i=n?IU(n,1).join(""):t.slice(1);return r[e]()+i}}var sB=aB("toUpperCase");function oB(e){return sB(ji(e).toLowerCase())}var lB=Wm(function(e,t,n){return t=t.toLowerCase(),e+(n?oB(t):t)});class sn{constructor(t,n){this.components=[],this.services={canvasZoom:pU,domUtils:N,events:fU,files:mU,gradientUtils:Jc,transitions:gU},this.model=new fn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(S.Model.UPDATE,r=>{const i=!!b(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(S.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(a=>a));Promise.all(r).then(()=>this.services.events.dispatchEvent(S.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=b(r,"toolbar","enabled"),a={id:"legend",components:[new hh(this.model,this.services)],growth:ht.PREFERRED},s=b(r,"canvasZoom","enabled");s&&s===!0&&t.push(new RR(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new Ie(this.model,this.services,[l,...i?[c]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:b(n,"graphFrameRenderType")||rt.SVG},h=b(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Nt.COLUMN;if(h){const y=b(r,"legend","position");y==="left"?(p=Nt.ROW,r.legend.orientation||(r.legend.orientation=Br.VERTICAL)):y==="right"?(p=Nt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Br.VERTICAL)):y==="bottom"&&(p=Nt.COLUMN_REVERSE)}const f={id:"spacer",components:[new Vn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new Ie(this.model,this.services,[...h?[a]:[],...h?[f]:[],d],{direction:p})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Vn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(y)}return m.push(v),[new dh(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,m,{direction:Nt.COLUMN})]}}class Te extends sn{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:AU,curves:DU,zoom:RU}),this.model=new Er(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"zoomBar",G.TOP,"enabled"),a=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=this.services.cartesianScales.getMainXAxisPosition(),o=b(r,"axes",s,"scaleType"),l=i&&s===G.BOTTOM&&o===tt.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},p={id:"header",components:[new Ie(this.model,this.services,[d,...a?[h]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},f={id:"legend",components:[new hh(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new Mv(this.model,this.services),new IR(this.model,this.services)),t.push(new PR(this.model,this.services)),t.push(new UR(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=Nt.COLUMN;if(m){const w=b(this.model.getOptions(),"legend","position");w===Ur.LEFT?(y=Nt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Br.VERTICAL)):w===Ur.RIGHT?(y=Nt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Br.VERTICAL)):w===Ur.BOTTOM&&(y=Nt.COLUMN_REVERSE)}const g={id:"spacer",components:[new Vn(this.model,this.services)],growth:ht.PREFERRED},x={id:"full-frame",components:[new Ie(this.model,this.services,[...m?[f]:[],...m?[g]:[],v],{direction:y})],growth:ht.STRETCH},O={id:"zoom-bar",components:[new NR(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},E=[];if(u||a){E.push(p);const w={id:"spacer",components:[new Vn(this.model,this.services,a?{size:15}:void 0)],growth:ht.PREFERRED};E.push(w)}return l&&E.push(O),E.push(x),[new Lv(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,E,{direction:Nt.COLUMN})]}}class cB extends sn{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(zt(Pt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new iI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class uB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(wn(Pt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new xi(this.model,this.services),new Vv(this.model,this.services),new bn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class hB extends Te{constructor(t,n){super(t,n),this.model=new P$(this.services),this.model.setOptions(zt(Pt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new oI(this.model,this.services),new _i(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class dB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new lI(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class pB extends Te{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(zt(Pt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new cI(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class fB extends sn{constructor(t,n){super(t,n),this.model=new B$(this.services),this.model.setOptions(zt(Pt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled"),a=!!this.model.getOptions().title,s={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[s,...i?[o]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new zv(this.model,this.services,{chartType:"choropleth"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Nt.COLUMN_REVERSE,p={id:"spacer",components:[new Vn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(a||i){v.push(l);const m={id:"spacer",components:[new Vn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new dh(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,v,{direction:Nt.COLUMN})]}getComponents(){const t=[new N3(this.model,this.services)];return this.getChartComponents(t)}}class mB extends sn{constructor(t,n){super(t,n),this.model=new H$(this.services),this.model.setOptions(zt(Pt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new $I(this.model,this.services)];return this.getChartComponents(t)}}const B0={[Me.LINE]:[xi,bn],[Me.SCATTER]:[bn],[Me.AREA]:[Vv,xi,bn],[Me.STACKED_AREA]:[Kv,xi,Jv,Ho],[Me.SIMPLE_BAR]:[Xv],[Me.GROUPED_BAR]:[Zv,_i],[Me.STACKED_BAR]:[Qv,Ho]};class gB extends Te{constructor(t,n){super(t,n);const r=zt(Pt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Me.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 a=i.type;let s;if(typeof i.type=="string"){if(!Object.keys(B0).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=`${lB(i.type)}Chart`;return s=ct({},Pt[l],this.model.getOptions(),i.options),i.type===Me.STACKED_AREA&&(o=!0),B0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:s,stacked:o}))}else return s=ct({},this.model.getOptions(),i.options),new a(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:s})}).filter(i=>i!==null);return _h(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Me.STACKED_BAR||i.type===Me.STACKED_AREA),r=[new Se(this.model,this.services),new Ne(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID}),...n?[]:[new Jn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class H0 extends sn{constructor(t,n,r=!1){super(t,n),this.model=new V$(this.services),!r&&(this.model.setOptions(zt(Pt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Wv(this.model,this.services),new be(this.model,this.services,{skeleton:ee.PIE})];return this.getChartComponents(t)}}class vB extends H0{constructor(t,n){super(t,n,!0),this.model.setOptions(zt(Pt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new CI(this.model,this.services),new be(this.model,this.services,{skeleton:ee.DONUT})];return this.getChartComponents(t)}}class yB extends sn{constructor(t,n){super(t,n),this.model=new F$(this.services),this.model.setOptions(zt(Pt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new AI(this.model,this.services)];return this.getChartComponents(t)}}class bB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Zv(this.model,this.services),new _i(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class xB extends Te{constructor(t,n){super(t,n),this.model=new G$(this.services),this.model.setOptions(zt(Pt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=!!this.model.getOptions().title,s={id:"title",components:[new Ha(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new Co(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[s,...i?[o]:[]],{direction:Nt.ROW,alignItems:sr.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new zv(this.model,this.services,{chartType:"heatmap"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Nt.COLUMN_REVERSE,p={id:"spacer",components:[new Vn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(a||i){v.push(l);const m={id:"spacer",components:[new Vn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new Lv(this.model,this.services),new No(this.model,this.services),new Ie(this.model,this.services,v,{direction:Nt.COLUMN})]}getComponents(){const t=[new Se(this.model,this.services),new kI(this.model,this.services)];return this.getAxisChartComponents(t)}}class _B extends Te{constructor(t,n){super(t,n),this.model=new j$(this.services),this.model.setOptions(zt(Pt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yI(this.model,this.services),new LI(this.model,this.services)];return this.getAxisChartComponents(t)}}class EB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new xi(this.model,this.services),new bn(this.model,this.services,{handleThresholds:!0}),new NI(this.model,this.services),new _i(this.model,this.services)];return this.getAxisChartComponents(t)}}class OB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new DI(this.model,this.services),new bn(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class wB extends sn{constructor(t,n){var r;super(t,n),this.model=new z$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?ct(wn(Pt.proportionalMeterChart),n.options):ct(wn(Pt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new TI(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Vn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new RI(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new Ie(this.model,this.services,t,{direction:Nt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class SB extends sn{constructor(t,n){super(t,n),this.model=new W$(this.services),this.model.setOptions(zt(Pt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new II(this.model,this.services)];return this.getChartComponents(t)}}class TB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new bn(this.model,this.services),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class $B extends sn{constructor(t,n){super(t,n),this.model=new q$(this.services),this.model.setOptions(zt(Pt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new PI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class MB extends sn{constructor(t,n){super(t,n),this.model=new Y$(this.services),this.model.setOptions(zt(Pt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new d3(this.model,this.services)];return this.getChartComponents(t)}}class CB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Xv(this.model,this.services),new _i(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class AB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Ho(this.model,this.services),new Kv(this.model,this.services),new xi(this.model,this.services,{stacked:!0}),new Jv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new be(this.model,this.services,{skeleton:ee.GRID})];return this.getAxisChartComponents(t)}}class kB extends Te{constructor(t,n){super(t,n),this.model.setOptions(zt(Pt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Ho(this.model,this.services),new Qv(this.model,this.services),new be(this.model,this.services,{skeleton:ee.VERT_OR_HORIZ}),new _i(this.model,this.services)];return this.getAxisChartComponents(t)}}class LB extends sn{constructor(t,n){super(t,n),this.model=new Z$(this.services),this.model.setOptions(zt(Pt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new R3(this.model,this.services),new be(this.model,this.services,{skeleton:ee.PIE})];return this.getChartComponents(t)}}function DB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ih={exports:{}},Ga={};/**
86
86
  * @license React
87
87
  * react-jsx-runtime.production.min.js
88
88
  *
@@ -90,7 +90,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
90
90
  *
91
91
  * This source code is licensed under the MIT license found in the
92
92
  * LICENSE file in the root directory of this source tree.
93
- */var V0;function DB(){if(V0)return Ga;V0=1;var e=ce,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(o,l,c){var u,d={},h=null,p=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!a.hasOwnProperty(u)&&(d[u]=l[u]);if(o&&o.defaultProps)for(u in l=o.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:o,key:h,ref:p,props:d,_owner:i.current}}return Ga.Fragment=n,Ga.jsx=s,Ga.jsxs=s,Ga}var ja={};/**
93
+ */var V0;function RB(){if(V0)return Ga;V0=1;var e=ce,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(o,l,c){var u,d={},h=null,p=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!a.hasOwnProperty(u)&&(d[u]=l[u]);if(o&&o.defaultProps)for(u in l=o.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:o,key:h,ref:p,props:d,_owner:i.current}}return Ga.Fragment=n,Ga.jsx=s,Ga.jsxs=s,Ga}var ja={};/**
94
94
  * @license React
95
95
  * react-jsx-runtime.development.js
96
96
  *
@@ -98,7 +98,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
98
98
  *
99
99
  * This source code is licensed under the MIT license found in the
100
100
  * LICENSE file in the root directory of this source tree.
101
- */var F0;function IB(){return F0||(F0=1,process.env.NODE_ENV!=="production"&&function(){var e=ce,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),f=Symbol.iterator,v="@@iterator";function m(M){if(M===null||typeof M!="object")return null;var z=f&&M[f]||M[v];return typeof z=="function"?z:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(M){{for(var z=arguments.length,Q=new Array(z>1?z-1:0),ut=1;ut<z;ut++)Q[ut-1]=arguments[ut];x("error",M,Q)}}function x(M,z,Q){{var ut=y.ReactDebugCurrentFrame,Ot=ut.getStackAddendum();Ot!==""&&(z+="%s",Q=Q.concat([Ot]));var Ct=Q.map(function(_t){return String(_t)});Ct.unshift("Warning: "+z),Function.prototype.apply.call(console[M],console,Ct)}}var O=!1,E=!1,w=!1,A=!1,I=!1,R;R=Symbol.for("react.module.reference");function L(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===a||I||M===i||M===c||M===u||A||M===p||O||E||w||typeof M=="object"&&M!==null&&(M.$$typeof===h||M.$$typeof===d||M.$$typeof===s||M.$$typeof===o||M.$$typeof===l||M.$$typeof===R||M.getModuleId!==void 0))}function $(M,z,Q){var ut=M.displayName;if(ut)return ut;var Ot=z.displayName||z.name||"";return Ot!==""?Q+"("+Ot+")":Q}function F(M){return M.displayName||"Context"}function P(M){if(M==null)return null;if(typeof M.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case o:var z=M;return F(z)+".Consumer";case s:var Q=M;return F(Q._context)+".Provider";case l:return $(M,M.render,"ForwardRef");case d:var ut=M.displayName||null;return ut!==null?ut:P(M.type)||"Memo";case h:{var Ot=M,Ct=Ot._payload,_t=Ot._init;try{return P(_t(Ct))}catch{return null}}}return null}var H=Object.assign,_=0,C,k,U,B,X,Y,ot;function it(){}it.__reactDisabledLog=!0;function xt(){{if(_===0){C=console.log,k=console.info,U=console.warn,B=console.error,X=console.group,Y=console.groupCollapsed,ot=console.groupEnd;var M={configurable:!0,enumerable:!0,value:it,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}_++}}function at(){{if(_--,_===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},M,{value:C}),info:H({},M,{value:k}),warn:H({},M,{value:U}),error:H({},M,{value:B}),group:H({},M,{value:X}),groupCollapsed:H({},M,{value:Y}),groupEnd:H({},M,{value:ot})})}_<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=y.ReactCurrentDispatcher,et;function mt(M,z,Q){{if(et===void 0)try{throw Error()}catch(Ot){var ut=Ot.stack.trim().match(/\n( *(at )?)/);et=ut&&ut[1]||""}return`
101
+ */var F0;function IB(){return F0||(F0=1,process.env.NODE_ENV!=="production"&&function(){var e=ce,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),f=Symbol.iterator,v="@@iterator";function m(M){if(M===null||typeof M!="object")return null;var z=f&&M[f]||M[v];return typeof z=="function"?z:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(M){{for(var z=arguments.length,Q=new Array(z>1?z-1:0),ut=1;ut<z;ut++)Q[ut-1]=arguments[ut];x("error",M,Q)}}function x(M,z,Q){{var ut=y.ReactDebugCurrentFrame,Ot=ut.getStackAddendum();Ot!==""&&(z+="%s",Q=Q.concat([Ot]));var Ct=Q.map(function(_t){return String(_t)});Ct.unshift("Warning: "+z),Function.prototype.apply.call(console[M],console,Ct)}}var O=!1,E=!1,w=!1,A=!1,I=!1,L;L=Symbol.for("react.module.reference");function D(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===a||I||M===i||M===c||M===u||A||M===p||O||E||w||typeof M=="object"&&M!==null&&(M.$$typeof===h||M.$$typeof===d||M.$$typeof===s||M.$$typeof===o||M.$$typeof===l||M.$$typeof===L||M.getModuleId!==void 0))}function $(M,z,Q){var ut=M.displayName;if(ut)return ut;var Ot=z.displayName||z.name||"";return Ot!==""?Q+"("+Ot+")":Q}function F(M){return M.displayName||"Context"}function P(M){if(M==null)return null;if(typeof M.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case o:var z=M;return F(z)+".Consumer";case s:var Q=M;return F(Q._context)+".Provider";case l:return $(M,M.render,"ForwardRef");case d:var ut=M.displayName||null;return ut!==null?ut:P(M.type)||"Memo";case h:{var Ot=M,Ct=Ot._payload,_t=Ot._init;try{return P(_t(Ct))}catch{return null}}}return null}var H=Object.assign,_=0,C,k,U,B,X,Y,ot;function it(){}it.__reactDisabledLog=!0;function xt(){{if(_===0){C=console.log,k=console.info,U=console.warn,B=console.error,X=console.group,Y=console.groupCollapsed,ot=console.groupEnd;var M={configurable:!0,enumerable:!0,value:it,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}_++}}function at(){{if(_--,_===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},M,{value:C}),info:H({},M,{value:k}),warn:H({},M,{value:U}),error:H({},M,{value:B}),group:H({},M,{value:X}),groupCollapsed:H({},M,{value:Y}),groupEnd:H({},M,{value:ot})})}_<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=y.ReactCurrentDispatcher,et;function mt(M,z,Q){{if(et===void 0)try{throw Error()}catch(Ot){var ut=Ot.stack.trim().match(/\n( *(at )?)/);et=ut&&ut[1]||""}return`
102
102
  `+et+M}}var q=!1,J;{var dt=typeof WeakMap=="function"?WeakMap:Map;J=new dt}function j(M,z){if(!M||q)return"";{var Q=J.get(M);if(Q!==void 0)return Q}var ut;q=!0;var Ot=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ct;Ct=K.current,K.current=null,xt();try{if(z){var _t=function(){throw Error()};if(Object.defineProperty(_t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_t,[])}catch(Bt){ut=Bt}Reflect.construct(M,[],_t)}else{try{_t.call()}catch(Bt){ut=Bt}M.call(_t.prototype)}}else{try{throw Error()}catch(Bt){ut=Bt}M()}}catch(Bt){if(Bt&&ut&&typeof Bt.stack=="string"){for(var T=Bt.stack.split(`
103
103
  `),Z=ut.stack.split(`
104
104
  `),W=T.length-1,lt=Z.length-1;W>=1&&lt>=0&&T[W]!==Z[lt];)lt--;for(;W>=1&&lt>=0;W--,lt--)if(T[W]!==Z[lt]){if(W!==1||lt!==1)do if(W--,lt--,lt<0||T[W]!==Z[lt]){var At=`
@@ -106,14 +106,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
106
106
 
107
107
  Check the render method of \``+M+"`."}return""}}function Qo(M){return""}var $i={};function Jo(M){{var z=Ko();if(!z){var Q=typeof M=="string"?M:M.displayName||M.name;Q&&(z=`
108
108
 
109
- Check the top-level render call using <`+Q+">.")}return z}}function Xa(M,z){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Q=Jo(z);if($i[Q])return;$i[Q]=!0;var ut="";M&&M._owner&&M._owner!==jn.current&&(ut=" It was passed a child from "+P(M._owner.type)+"."),ar(M),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,ut),ar(null)}}function tl(M,z){{if(typeof M!="object")return;if(za(M))for(var Q=0;Q<M.length;Q++){var ut=M[Q];xn(ut)&&Xa(ut,z)}else if(xn(M))M._store&&(M._store.validated=!0);else if(M){var Ot=m(M);if(typeof Ot=="function"&&Ot!==M.entries)for(var Ct=Ot.call(M),_t;!(_t=Ct.next()).done;)xn(_t.value)&&Xa(_t.value,z)}}}function el(M){{var z=M.type;if(z==null||typeof z=="string")return;var Q;if(typeof z=="function")Q=z.propTypes;else if(typeof z=="object"&&(z.$$typeof===l||z.$$typeof===d))Q=z.propTypes;else return;if(Q){var ut=P(z);Pe(Q,M.props,"prop",ut,M)}else if(z.PropTypes!==void 0&&!Kt){Kt=!0;var Ot=P(z);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ot||"Unknown")}typeof z.getDefaultProps=="function"&&!z.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nl(M){{for(var z=Object.keys(M.props),Q=0;Q<z.length;Q++){var ut=z[Q];if(ut!=="children"&&ut!=="key"){ar(M),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ut),ar(null);break}}M.ref!==null&&(ar(M),g("Invalid attribute `ref` supplied to `React.Fragment`."),ar(null))}}var rl={};function _n(M,z,Q,ut,Ot,Ct){{var _t=L(M);if(!_t){var T="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Z=Qo();Z?T+=Z:T+=Ko();var W;M===null?W="null":za(M)?W="array":M!==void 0&&M.$$typeof===t?(W="<"+(P(M.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):W=typeof M,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,T)}var lt=Nh(M,z,Q,Ot,Ct);if(lt==null)return lt;if(_t){var At=z.children;if(At!==void 0)if(ut)if(za(At)){for(var Ut=0;Ut<At.length;Ut++)tl(At[Ut],M);Object.freeze&&Object.freeze(At)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tl(At,M)}if(jt.call(z,"key")){var oe=P(M),Bt=Object.keys(z).filter(function(ol){return ol!=="key"}),$e=Bt.length>0?"{key: someKey, "+Bt.join(": ..., ")+": ...}":"{key: someKey}";if(!rl[oe+$e]){var le=Bt.length>0?"{"+Bt.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
109
+ Check the top-level render call using <`+Q+">.")}return z}}function Xa(M,z){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Q=Jo(z);if($i[Q])return;$i[Q]=!0;var ut="";M&&M._owner&&M._owner!==jn.current&&(ut=" It was passed a child from "+P(M._owner.type)+"."),ar(M),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,ut),ar(null)}}function tl(M,z){{if(typeof M!="object")return;if(za(M))for(var Q=0;Q<M.length;Q++){var ut=M[Q];xn(ut)&&Xa(ut,z)}else if(xn(M))M._store&&(M._store.validated=!0);else if(M){var Ot=m(M);if(typeof Ot=="function"&&Ot!==M.entries)for(var Ct=Ot.call(M),_t;!(_t=Ct.next()).done;)xn(_t.value)&&Xa(_t.value,z)}}}function el(M){{var z=M.type;if(z==null||typeof z=="string")return;var Q;if(typeof z=="function")Q=z.propTypes;else if(typeof z=="object"&&(z.$$typeof===l||z.$$typeof===d))Q=z.propTypes;else return;if(Q){var ut=P(z);Pe(Q,M.props,"prop",ut,M)}else if(z.PropTypes!==void 0&&!Kt){Kt=!0;var Ot=P(z);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ot||"Unknown")}typeof z.getDefaultProps=="function"&&!z.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nl(M){{for(var z=Object.keys(M.props),Q=0;Q<z.length;Q++){var ut=z[Q];if(ut!=="children"&&ut!=="key"){ar(M),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ut),ar(null);break}}M.ref!==null&&(ar(M),g("Invalid attribute `ref` supplied to `React.Fragment`."),ar(null))}}var rl={};function _n(M,z,Q,ut,Ot,Ct){{var _t=D(M);if(!_t){var T="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Z=Qo();Z?T+=Z:T+=Ko();var W;M===null?W="null":za(M)?W="array":M!==void 0&&M.$$typeof===t?(W="<"+(P(M.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):W=typeof M,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,T)}var lt=Nh(M,z,Q,Ot,Ct);if(lt==null)return lt;if(_t){var At=z.children;if(At!==void 0)if(ut)if(za(At)){for(var Ut=0;Ut<At.length;Ut++)tl(At[Ut],M);Object.freeze&&Object.freeze(At)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tl(At,M)}if(jt.call(z,"key")){var oe=P(M),Bt=Object.keys(z).filter(function(ol){return ol!=="key"}),$e=Bt.length>0?"{key: someKey, "+Bt.join(": ..., ")+": ...}":"{key: someKey}";if(!rl[oe+$e]){var le=Bt.length>0?"{"+Bt.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
110
110
  let props = %s;
111
111
  <%s {...props} />
112
112
  React keys must be passed directly to JSX without using spread:
113
113
  let props = %s;
114
- <%s key={someKey} {...props} />`,$e,oe,le,oe),rl[oe+$e]=!0}}return M===r?nl(lt):el(lt),lt}}function Mi(M,z,Q){return _n(M,z,Q,!0)}function il(M,z,Q){return _n(M,z,Q,!1)}var al=il,sl=Mi;ja.Fragment=r,ja.jsx=al,ja.jsxs=sl}()),ja}process.env.NODE_ENV==="production"?Ih.exports=DB():Ih.exports=IB();var Wt=Ih.exports;class Gt extends ce.PureComponent{constructor(){super(...arguments);Ph(this,"chart");Ph(this,"chartRef",ce.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 Wt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class NB extends Gt{createChart(t,n,r){return new cB(t,{data:n,options:r})}}class PB extends Gt{createChart(t,n,r){return new uB(t,{data:n,options:r})}}class UB extends Gt{createChart(t,n,r){return new hB(t,{data:n,options:r})}}class BB extends Gt{createChart(t,n,r){return new dB(t,{data:n,options:r})}}class HB extends Gt{createChart(t,n,r){return new pB(t,{data:n,options:r})}}class G0 extends Gt{createChart(t,n,r){return new fB(t,{data:n,options:r})}}class VB extends Gt{createChart(t,n,r){return new mB(t,{data:n,options:r})}}class FB extends Gt{createChart(t,n,r){return new gB(t,{data:n,options:r})}}class GB extends Gt{createChart(t,n,r){return new vB(t,{data:n,options:r})}}class jB extends Gt{createChart(t,n,r){return new yB(t,{data:n,options:r})}}class zB extends Gt{createChart(t,n,r){return new bB(t,{data:n,options:r})}}class WB extends Gt{createChart(t,n,r){return new xB(t,{data:n,options:r})}}class qB extends Gt{createChart(t,n,r){return new _B(t,{data:n,options:r})}}class YB extends Gt{createChart(t,n,r){return new EB(t,{data:n,options:r})}}class ZB extends Gt{createChart(t,n,r){return new OB(t,{data:n,options:r})}}class XB extends Gt{createChart(t,n,r){return new wB(t,{data:n,options:r})}}class KB extends Gt{createChart(t,n,r){return new H0(t,{data:n,options:r})}}class QB extends Gt{createChart(t,n,r){return new SB(t,{data:n,options:r})}}class JB extends Gt{createChart(t,n,r){return new TB(t,{data:n,options:r})}}class t5 extends Gt{createChart(t,n,r){return new CB(t,{data:n,options:r})}}class e5 extends Gt{createChart(t,n,r){return new AB(t,{data:n,options:r})}}class n5 extends Gt{createChart(t,n,r){return new kB(t,{data:n,options:r})}}class r5 extends Gt{createChart(t,n,r){return new $B(t,{data:n,options:r})}}class i5 extends Gt{createChart(t,n,r){return new MB(t,{data:n,options:r})}}class a5 extends Gt{createChart(t,n,r){return new RB(t,{data:n,options:r})}}var j0={exports:{}};/*!
114
+ <%s key={someKey} {...props} />`,$e,oe,le,oe),rl[oe+$e]=!0}}return M===r?nl(lt):el(lt),lt}}function Mi(M,z,Q){return _n(M,z,Q,!0)}function il(M,z,Q){return _n(M,z,Q,!1)}var al=il,sl=Mi;ja.Fragment=r,ja.jsx=al,ja.jsxs=sl}()),ja}process.env.NODE_ENV==="production"?Ih.exports=RB():Ih.exports=IB();var Wt=Ih.exports;class Gt extends ce.PureComponent{constructor(){super(...arguments);Ph(this,"chart");Ph(this,"chartRef",ce.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 Wt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class NB extends Gt{createChart(t,n,r){return new cB(t,{data:n,options:r})}}class PB extends Gt{createChart(t,n,r){return new uB(t,{data:n,options:r})}}class UB extends Gt{createChart(t,n,r){return new hB(t,{data:n,options:r})}}class BB extends Gt{createChart(t,n,r){return new dB(t,{data:n,options:r})}}class HB extends Gt{createChart(t,n,r){return new pB(t,{data:n,options:r})}}class G0 extends Gt{createChart(t,n,r){return new fB(t,{data:n,options:r})}}class VB extends Gt{createChart(t,n,r){return new mB(t,{data:n,options:r})}}class FB extends Gt{createChart(t,n,r){return new gB(t,{data:n,options:r})}}class GB extends Gt{createChart(t,n,r){return new vB(t,{data:n,options:r})}}class jB extends Gt{createChart(t,n,r){return new yB(t,{data:n,options:r})}}class zB extends Gt{createChart(t,n,r){return new bB(t,{data:n,options:r})}}class WB extends Gt{createChart(t,n,r){return new xB(t,{data:n,options:r})}}class qB extends Gt{createChart(t,n,r){return new _B(t,{data:n,options:r})}}class YB extends Gt{createChart(t,n,r){return new EB(t,{data:n,options:r})}}class ZB extends Gt{createChart(t,n,r){return new OB(t,{data:n,options:r})}}class XB extends Gt{createChart(t,n,r){return new wB(t,{data:n,options:r})}}class KB extends Gt{createChart(t,n,r){return new H0(t,{data:n,options:r})}}class QB extends Gt{createChart(t,n,r){return new SB(t,{data:n,options:r})}}class JB extends Gt{createChart(t,n,r){return new TB(t,{data:n,options:r})}}class t5 extends Gt{createChart(t,n,r){return new CB(t,{data:n,options:r})}}class e5 extends Gt{createChart(t,n,r){return new AB(t,{data:n,options:r})}}class n5 extends Gt{createChart(t,n,r){return new kB(t,{data:n,options:r})}}class r5 extends Gt{createChart(t,n,r){return new $B(t,{data:n,options:r})}}class i5 extends Gt{createChart(t,n,r){return new MB(t,{data:n,options:r})}}class a5 extends Gt{createChart(t,n,r){return new LB(t,{data:n,options:r})}}var j0={exports:{}};/*!
115
115
  Copyright (c) 2018 Jed Watson.
116
116
  Licensed under the MIT License (MIT), see
117
117
  http://jedwatson.github.io/classnames
118
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var a="",s=0;s<arguments.length;s++){var o=arguments[s];o&&(a=i(a,r(o)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return n.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var s="";for(var o in a)t.call(a,o)&&a[o]&&(s=i(s,o));return s}function i(a,s){return s?a?a+" "+s:a+s:a}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(j0);var s5=j0.exports;const er=LB(s5),nr="cds",o5=({tag:e="div",className:t,children:n,color:r,href:i,position:a="static",stacked:s,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${nr}--cc--card-node`,u=er(c,{[`${c}--stacked`]:s,[`${c}--${l}`]:l,[t]:t});return Wt.jsx(l,{className:u,style:{borderColor:r,position:a},tabIndex:0,...o,children:n})},l5=({children:e,farsideColumn:t=!1,...n})=>{const r=`${nr}--cc--card-node`,i=er(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Wt.jsx("div",{className:i,...n,children:e})},c5=({children:e,...t})=>{const n=`${nr}--cc--card-node`,r=er(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("label",{className:r,...t,children:e})},u5=({children:e,...t})=>{const n=`${nr}--cc--card-node`,r=er(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},h5=({children:e,...t})=>{const n=`${nr}--cc--card-node`,r=er(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},d5=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:a,variant:s=null,...o})=>{const l=`${nr}--cc--edge`,c=er(l,{[`${l}--${s}`]:s,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&a&&(u=bI(i,a)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Wt.jsxs("g",{className:c,...o,children:[Wt.jsx("path",{d:u,className:`${l}__container`}),Wt.jsx("path",{d:u,className:`${l}__outer`}),Wt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},Dr=({color:e,d:t,id:n,orient:r="auto",height:i,width:a,position:s="end",className:o,refX:l,refY:c,...u})=>{const d=`${nr}--cc--marker`,h=er(d,o),p=s==="end"?(a||0)/2+.5:.5,f=(i||0)/2;return Wt.jsx("marker",{className:h,markerHeight:i,markerWidth:a,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u,children:Wt.jsx("path",{d:t,style:{fill:e}})})},p5=e=>Wt.jsx(Dr,{d:xI.d,...e}),f5=e=>Wt.jsx(Dr,{d:_I.d,...e}),m5=e=>Wt.jsx(Dr,{d:EI.d,...e}),g5=e=>Wt.jsx(Dr,{d:OI.d,...e}),v5=e=>Wt.jsx(Dr,{d:wI.d,...e}),y5=e=>Wt.jsx(Dr,{d:SI.d,...e}),b5=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:a,renderIcon:s,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const p=o?"a":h.onClick?"button":t,f=`${nr}--cc--shape-node`,v=er(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?Wt.jsx("div",{className:`${f}__title`,children:n}):null,y=i?Wt.jsx("div",{className:`${f}__subtitle`,children:i}):null,g=a?Wt.jsx("div",{className:`${f}__description`,children:a}):null;return Wt.jsxs(p,{className:v,style:{height:l,width:l,position:u},tabIndex:0,...h,children:[Wt.jsx("div",{className:`${f}__icon`,children:s}),Wt.jsxs("div",{className:`${f}__body`,style:{position:d},children:[m,y,g]})]})};V.Alignments=te,V.AlluvialChart=NB,V.AreaChart=PB,V.AreaEvent=ml,V.ArrowDirections=Qa,V.ArrowLeftMarker=p5,V.ArrowRightMarker=f5,V.AxisEvent=fl,V.AxisFlavor=Li,V.AxisPositions=G,V.AxisTitleOrientations=Ja,V.BarEvent=bl,V.BoxplotChart=UB,V.BoxplotEvent=xl,V.BubbleChart=BB,V.BulletChart=HB,V.CalloutDirections=Ci,V.CanvasZoomEvent=pl,V.CardNode=o5,V.CardNodeColumn=l5,V.CardNodeLabel=c5,V.CardNodeSubtitle=u5,V.CardNodeTitle=h5,V.CartesianOrientations=Jt,V.ChartEvent=zn,V.ChartTheme=$l,V.ChartTypes=Me,V.ChoroplethChart=G0,V.CircleMarker=m5,V.CirclePackChart=VB,V.ColorClassNameTypes=st,V.ColorLegendType=Ri,V.ComboChart=FB,V.DiamondMarker=g5,V.DividerStatus=Hr,V.DominantBaseline=cn,V.DonutChart=GB,V.Edge=d5,V.ExperimentalChoroplethChart=G0,V.GaugeChart=jB,V.GaugeEvent=yl,V.GaugeTypes=or,V.GroupedBarChart=zB,V.HeatmapChart=WB,V.HistogramChart=qB,V.LayoutAlignItems=sr,V.LayoutDirection=Nt,V.LayoutGrowth=ht,V.LegendItemType=ne,V.LegendOrientations=Br,V.LegendPositions=Ur,V.LineChart=YB,V.LineEvent=El,V.LollipopChart=ZB,V.Marker=Dr,V.MeterChart=XB,V.ModalEvent=cl,V.ModelEvent=ul,V.PieChart=KB,V.PieEvent=vl,V.Projection=un,V.RadarChart=QB,V.RadarEvent=Ol,V.RenderTypes=rt,V.ScaleTypes=tt,V.ScatterChart=JB,V.ScatterEvent=_l,V.ShapeNode=b5,V.SimpleBarChart=t5,V.Skeletons=ee,V.SquareMarker=v5,V.StackedAreaChart=e5,V.StackedBarChart=n5,V.Statuses=Ai,V.TeeMarker=y5,V.TextAnchor=ln,V.ThresholdEvent=Tl,V.TickRotations=ki,V.ToolbarControlTypes=Tt,V.TooltipEvent=Nr,V.TreeChart=r5,V.TreeEvent=wl,V.TreeTypes=Ka,V.TreemapChart=i5,V.TreemapEvent=Sl,V.TruncationTypes=Ue,V.WordCloudChart=a5,V.WordCloudEvent=gl,V.ZoomBarTypes=qe,V.ZoomDomainEvent=dl,V.ZoombarEvent=hl,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
118
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var a="",s=0;s<arguments.length;s++){var o=arguments[s];o&&(a=i(a,r(o)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return n.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var s="";for(var o in a)t.call(a,o)&&a[o]&&(s=i(s,o));return s}function i(a,s){return s?a?a+" "+s:a+s:a}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(j0);var s5=j0.exports;const er=DB(s5),nr="cds",o5=({tag:e="div",className:t,children:n,color:r,href:i,position:a="static",stacked:s,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${nr}--cc--card-node`,u=er(c,{[`${c}--stacked`]:s,[`${c}--${l}`]:l,[t]:t});return Wt.jsx(l,{className:u,style:{borderColor:r,position:a},tabIndex:0,...o,children:n})},l5=({children:e,farsideColumn:t=!1,...n})=>{const r=`${nr}--cc--card-node`,i=er(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Wt.jsx("div",{className:i,...n,children:e})},c5=({children:e,...t})=>{const n=`${nr}--cc--card-node`,r=er(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("label",{className:r,...t,children:e})},u5=({children:e,...t})=>{const n=`${nr}--cc--card-node`,r=er(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},h5=({children:e,...t})=>{const n=`${nr}--cc--card-node`,r=er(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Wt.jsx("div",{className:r,...t,children:e})},d5=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:a,variant:s=null,...o})=>{const l=`${nr}--cc--edge`,c=er(l,{[`${l}--${s}`]:s,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&a&&(u=bI(i,a)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Wt.jsxs("g",{className:c,...o,children:[Wt.jsx("path",{d:u,className:`${l}__container`}),Wt.jsx("path",{d:u,className:`${l}__outer`}),Wt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},Rr=({color:e,d:t,id:n,orient:r="auto",height:i,width:a,position:s="end",className:o,refX:l,refY:c,...u})=>{const d=`${nr}--cc--marker`,h=er(d,o),p=s==="end"?(a||0)/2+.5:.5,f=(i||0)/2;return Wt.jsx("marker",{className:h,markerHeight:i,markerWidth:a,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u,children:Wt.jsx("path",{d:t,style:{fill:e}})})},p5=e=>Wt.jsx(Rr,{d:xI.d,...e}),f5=e=>Wt.jsx(Rr,{d:_I.d,...e}),m5=e=>Wt.jsx(Rr,{d:EI.d,...e}),g5=e=>Wt.jsx(Rr,{d:OI.d,...e}),v5=e=>Wt.jsx(Rr,{d:wI.d,...e}),y5=e=>Wt.jsx(Rr,{d:SI.d,...e}),b5=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:a,renderIcon:s,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const p=o?"a":h.onClick?"button":t,f=`${nr}--cc--shape-node`,v=er(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?Wt.jsx("div",{className:`${f}__title`,children:n}):null,y=i?Wt.jsx("div",{className:`${f}__subtitle`,children:i}):null,g=a?Wt.jsx("div",{className:`${f}__description`,children:a}):null;return Wt.jsxs(p,{className:v,style:{height:l,width:l,position:u},tabIndex:0,...h,children:[Wt.jsx("div",{className:`${f}__icon`,children:s}),Wt.jsxs("div",{className:`${f}__body`,style:{position:d},children:[m,y,g]})]})};V.Alignments=te,V.AlluvialChart=NB,V.AreaChart=PB,V.AreaEvent=ml,V.ArrowDirections=Qa,V.ArrowLeftMarker=p5,V.ArrowRightMarker=f5,V.AxisEvent=fl,V.AxisFlavor=Di,V.AxisPositions=G,V.AxisTitleOrientations=Ja,V.BarEvent=bl,V.BoxplotChart=UB,V.BoxplotEvent=xl,V.BubbleChart=BB,V.BulletChart=HB,V.CalloutDirections=Ci,V.CanvasZoomEvent=pl,V.CardNode=o5,V.CardNodeColumn=l5,V.CardNodeLabel=c5,V.CardNodeSubtitle=u5,V.CardNodeTitle=h5,V.CartesianOrientations=Jt,V.ChartEvent=zn,V.ChartTheme=$l,V.ChartTypes=Me,V.ChoroplethChart=G0,V.CircleMarker=m5,V.CirclePackChart=VB,V.ColorClassNameTypes=st,V.ColorLegendType=Li,V.ComboChart=FB,V.DiamondMarker=g5,V.DividerStatus=Hr,V.DominantBaseline=cn,V.DonutChart=GB,V.Edge=d5,V.ExperimentalChoroplethChart=G0,V.GaugeChart=jB,V.GaugeEvent=yl,V.GaugeTypes=or,V.GroupedBarChart=zB,V.HeatmapChart=WB,V.HistogramChart=qB,V.LayoutAlignItems=sr,V.LayoutDirection=Nt,V.LayoutGrowth=ht,V.LegendItemType=ne,V.LegendOrientations=Br,V.LegendPositions=Ur,V.LineChart=YB,V.LineEvent=El,V.LollipopChart=ZB,V.Marker=Rr,V.MeterChart=XB,V.ModalEvent=cl,V.ModelEvent=ul,V.PieChart=KB,V.PieEvent=vl,V.Projection=un,V.RadarChart=QB,V.RadarEvent=Ol,V.RenderTypes=rt,V.ScaleTypes=tt,V.ScatterChart=JB,V.ScatterEvent=_l,V.ShapeNode=b5,V.SimpleBarChart=t5,V.Skeletons=ee,V.SquareMarker=v5,V.StackedAreaChart=e5,V.StackedBarChart=n5,V.Statuses=Ai,V.TeeMarker=y5,V.TextAnchor=ln,V.ThresholdEvent=Tl,V.TickRotations=ki,V.ToolbarControlTypes=Tt,V.TooltipEvent=Nr,V.TreeChart=r5,V.TreeEvent=wl,V.TreeTypes=Ka,V.TreemapChart=i5,V.TreemapEvent=Sl,V.TruncationTypes=Ue,V.WordCloudChart=a5,V.WordCloudEvent=gl,V.ZoomBarTypes=qe,V.ZoomDomainEvent=dl,V.ZoombarEvent=hl,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
119
119
  //# sourceMappingURL=index.umd.cjs.map