@kenyaemr/esm-lab-manifest-app 5.4.2-pre.2546 → 5.4.2-pre.2553

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.
Files changed (149) hide show
  1. package/.turbo/turbo-build.log +6 -33
  2. package/dist/127.js +1 -0
  3. package/dist/136.js +1 -0
  4. package/dist/136.js.map +1 -0
  5. package/dist/152.js +22 -0
  6. package/dist/152.js.map +1 -0
  7. package/dist/185.js +66 -1
  8. package/dist/185.js.map +1 -1
  9. package/dist/220.js +1 -0
  10. package/dist/220.js.map +1 -0
  11. package/dist/224.js +1 -0
  12. package/dist/224.js.map +1 -0
  13. package/dist/267.js +1 -0
  14. package/dist/267.js.map +1 -0
  15. package/dist/{441.js → 290.js} +1 -1
  16. package/dist/290.js.map +1 -0
  17. package/dist/329.js +1 -0
  18. package/dist/329.js.map +1 -0
  19. package/dist/333.js +1 -0
  20. package/dist/333.js.map +1 -0
  21. package/dist/40.js +1 -0
  22. package/dist/419.js +17 -0
  23. package/dist/419.js.map +1 -0
  24. package/dist/430.js +1 -0
  25. package/dist/430.js.map +1 -0
  26. package/dist/466.js +1 -0
  27. package/dist/466.js.map +1 -0
  28. package/dist/472.js +1 -0
  29. package/dist/472.js.map +1 -0
  30. package/dist/478.js +1 -0
  31. package/dist/478.js.map +1 -0
  32. package/dist/543.js +1 -0
  33. package/dist/543.js.map +1 -0
  34. package/dist/548.js +1 -0
  35. package/dist/548.js.map +1 -0
  36. package/dist/569.js +1 -0
  37. package/dist/569.js.map +1 -0
  38. package/dist/581.js +1 -0
  39. package/dist/581.js.map +1 -0
  40. package/dist/607.js +1 -0
  41. package/dist/607.js.map +1 -0
  42. package/dist/611.js +1 -0
  43. package/dist/611.js.map +1 -0
  44. package/dist/638.js +1 -0
  45. package/dist/638.js.map +1 -0
  46. package/dist/642.js +1 -0
  47. package/dist/642.js.map +1 -0
  48. package/dist/660.js +1 -0
  49. package/dist/660.js.map +1 -0
  50. package/dist/689.js +1 -0
  51. package/dist/689.js.map +1 -0
  52. package/dist/786.js +1 -0
  53. package/dist/786.js.map +1 -0
  54. package/dist/798.js +1 -1
  55. package/dist/798.js.map +1 -1
  56. package/dist/810.js +1 -0
  57. package/dist/810.js.map +1 -0
  58. package/dist/847.js +1 -0
  59. package/dist/847.js.map +1 -0
  60. package/dist/85.js +1 -0
  61. package/dist/85.js.map +1 -0
  62. package/dist/91.js +1 -0
  63. package/dist/91.js.map +1 -0
  64. package/dist/916.js +1 -0
  65. package/dist/947.js +1 -0
  66. package/dist/947.js.map +1 -0
  67. package/dist/989.js +15 -0
  68. package/dist/989.js.map +1 -0
  69. package/dist/998.js +1 -0
  70. package/dist/998.js.map +1 -0
  71. package/dist/kenyaemr-esm-lab-manifest-app.js +5 -1
  72. package/dist/kenyaemr-esm-lab-manifest-app.js.buildmanifest.json +363 -326
  73. package/dist/kenyaemr-esm-lab-manifest-app.js.map +1 -1
  74. package/dist/main.js +5 -1
  75. package/dist/main.js.map +1 -1
  76. package/dist/routes.json +1 -1
  77. package/package.json +23 -26
  78. package/rspack.config.js +1 -0
  79. package/dist/144.js +0 -2
  80. package/dist/144.js.LICENSE.txt +0 -19
  81. package/dist/144.js.map +0 -1
  82. package/dist/155.js +0 -1
  83. package/dist/155.js.map +0 -1
  84. package/dist/160.js +0 -1
  85. package/dist/160.js.map +0 -1
  86. package/dist/171.js +0 -1
  87. package/dist/171.js.map +0 -1
  88. package/dist/197.js +0 -1
  89. package/dist/216.js +0 -2
  90. package/dist/216.js.LICENSE.txt +0 -9
  91. package/dist/216.js.map +0 -1
  92. package/dist/225.js +0 -1
  93. package/dist/225.js.map +0 -1
  94. package/dist/247.js +0 -1
  95. package/dist/247.js.map +0 -1
  96. package/dist/294.js +0 -1
  97. package/dist/300.js +0 -1
  98. package/dist/395.js +0 -1
  99. package/dist/395.js.map +0 -1
  100. package/dist/401.js +0 -1
  101. package/dist/401.js.map +0 -1
  102. package/dist/41.js +0 -2
  103. package/dist/41.js.LICENSE.txt +0 -9
  104. package/dist/41.js.map +0 -1
  105. package/dist/427.js +0 -2
  106. package/dist/427.js.LICENSE.txt +0 -5
  107. package/dist/427.js.map +0 -1
  108. package/dist/435.js +0 -1
  109. package/dist/435.js.map +0 -1
  110. package/dist/441.js.map +0 -1
  111. package/dist/470.js +0 -1
  112. package/dist/470.js.map +0 -1
  113. package/dist/495.js +0 -1
  114. package/dist/495.js.map +0 -1
  115. package/dist/625.js +0 -1
  116. package/dist/625.js.map +0 -1
  117. package/dist/743.js +0 -1
  118. package/dist/743.js.map +0 -1
  119. package/dist/76.js +0 -2
  120. package/dist/76.js.LICENSE.txt +0 -29
  121. package/dist/76.js.map +0 -1
  122. package/dist/768.js +0 -1
  123. package/dist/768.js.map +0 -1
  124. package/dist/772.js +0 -2
  125. package/dist/772.js.LICENSE.txt +0 -7
  126. package/dist/772.js.map +0 -1
  127. package/dist/789.js +0 -1
  128. package/dist/789.js.map +0 -1
  129. package/dist/801.js +0 -1
  130. package/dist/801.js.map +0 -1
  131. package/dist/834.js +0 -1
  132. package/dist/834.js.map +0 -1
  133. package/dist/855.js +0 -1
  134. package/dist/855.js.map +0 -1
  135. package/dist/876.js +0 -1
  136. package/dist/876.js.map +0 -1
  137. package/dist/89.js +0 -1
  138. package/dist/89.js.map +0 -1
  139. package/dist/913.js +0 -2
  140. package/dist/913.js.LICENSE.txt +0 -32
  141. package/dist/913.js.map +0 -1
  142. package/dist/931.js +0 -1
  143. package/dist/931.js.map +0 -1
  144. package/dist/932.js +0 -1
  145. package/dist/932.js.map +0 -1
  146. package/dist/943.js +0 -2
  147. package/dist/943.js.LICENSE.txt +0 -39
  148. package/dist/943.js.map +0 -1
  149. package/webpack.config.js +0 -1
package/dist/772.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 772.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_kenyaemr_esm_lab_manifest_app=globalThis.webpackChunk_kenyaemr_esm_lab_manifest_app||[]).push([[772],{1890:(t,e,n)=>{n.d(e,{UU:()=>p_,Wh:()=>F});var i=n(380),r=(t=>(t.RENDER_FINISHED="render-finished",t.RESIZE="chart-resize",t.MOUSEOVER="chart-mouseover",t.MOUSEOUT="chart-mouseout",t))(r||{}),o=(t=>(t.SHOW="show-modal",t.HIDE="hide-modal",t))(o||{}),s=(t=>(t.UPDATE="model-update",t))(s||{}),a=(t=>(t.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",t.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",t.BUTTON_CLICK="toolbar-button-click",t.SHOW_TOOLTIP="toolbar-show-tooltip",t.HIDE_TOOLTIP="toolbar-hide-tooltip",t))(a||{}),l=(t=>(t.UPDATE="zoom-bar-update",t.SELECTION_START="zoom-bar-selection-start",t.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",t.SELECTION_END="zoom-bar-selection-end",t))(l||{}),c=(t=>(t.CHANGE="zoom-domain-change",t))(c||{}),u=(t=>(t.CANVAS_ZOOM_IN="canvas-zoom-in",t.CANVAS_ZOOM_OUT="canvas-zoom-out",t))(u||{}),h=(t=>(t.LABEL_MOUSEOVER="axis-label-mouseover",t.LABEL_MOUSEMOVE="axis-label-mousemove",t.LABEL_CLICK="axis-label-click",t.LABEL_MOUSEOUT="axis-label-mouseout",t.LABEL_FOCUS="axis-label-focus",t.LABEL_BLUR="axis-label-blur",t.RENDER_COMPLETE="axis-render-complete",t))(h||{}),d=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(d||{}),f=(t=>(t.WORD_MOUSEOVER="wordcloud-word-mouseover",t.WORD_MOUSEMOVE="wordcloud-word-mousemove",t.WORD_CLICK="wordcloud-word-click",t.WORD_MOUSEOUT="wordcloud-word-mouseout",t))(f||{}),p=(t=>(t.SLICE_MOUSEOVER="pie-slice-mouseover",t.SLICE_MOUSEMOVE="pie-slice-mousemove",t.SLICE_CLICK="pie-slice-click",t.SLICE_MOUSEOUT="pie-slice-mouseout",t))(p||{}),g=(t=>(t.ARC_MOUSEOVER="gauge-arc-mouseover",t.ARC_MOUSEMOVE="gauge-arc-mousemove",t.ARC_CLICK="gauge-arc-click",t.ARC_MOUSEOUT="gauge-arc-mouseout",t))(g||{}),m=(t=>(t.BAR_MOUSEOVER="bar-mouseover",t.BAR_MOUSEMOVE="bar-mousemove",t.BAR_CLICK="bar-click",t.BAR_MOUSEOUT="bar-mouseout",t))(m||{}),y=(t=>(t.BOX_MOUSEOVER="box-mouseover",t.BOX_MOUSEMOVE="box-mousemove",t.BOX_CLICK="box-click",t.BOX_MOUSEOUT="box-mouseout",t.OUTLIER_MOUSEOVER="outlier-mouseover",t.OUTLIER_MOUSEMOVE="outlier-mousemove",t.OUTLIER_CLICK="outlier-click",t.OUTLIER_MOUSEOUT="outlier-mouseout",t))(y||{}),v=(t=>(t.SCATTER_MOUSEOVER="scatter-mouseover",t.SCATTER_MOUSEMOVE="scatter-mousemove",t.SCATTER_CLICK="scatter-click",t.SCATTER_MOUSEOUT="scatter-mouseout",t))(v||{}),_=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(_||{}),b=(t=>(t.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",t.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",t.X_AXIS_CLICK="radar-x-axis-click",t.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",t))(b||{}),x=(t=>(t.NODE_MOUSEOVER="tree-node-mouseover",t.NODE_CLICK="tree-node-click",t.NODE_MOUSEOUT="tree-node-mouseout",t))(x||{}),w=(t=>(t.LEAF_MOUSEOVER="leaf-mouseover",t.LEAF_MOUSEMOVE="leaf-mousemove",t.LEAF_CLICK="leaf-click",t.LEAF_MOUSEOUT="leaf-mouseout",t))(w||{}),E=(t=>(t.SHOW="show-tooltip",t.MOVE="move-tooltip",t.HIDE="hide-tooltip",t))(E||{}),T=(t=>(t.SHOW="show-threshold",t.HIDE="hide-threshold",t))(T||{}),S=(t=>(t.ITEM_HOVER="legend-item-onhover",t.ITEM_CLICK="legend-item-onclick",t.ITEM_MOUSEOUT="legend-item-onmouseout",t.ITEMS_UPDATE="legend-items-update",t))(S||{}),O=(t=>(t.CIRCLE_MOUSEOVER="circle-leaf-mouseover",t.CIRCLE_CLICK="circle-leaf-click",t.CIRCLE_MOUSEOUT="circle-leaf-mouseout",t.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",t))(O||{}),M=(t=>(t.NODE_MOUSEOVER="alluvial-node-mouseover",t.NODE_CLICK="alluvial-node-click",t.NODE_MOUSEOUT="alluvial-node-mouseout",t.NODE_MOUSEMOVE="alluvial-node-mousemove",t.LINE_MOUSEOVER="alluvial-line-mouseover",t.LINE_CLICK="alluvial-line-click",t.LINE_MOUSEOUT="alluvial-line-mouseout",t.LINE_MOUSEMOVE="alluvial-line-mousemove",t))(M||{}),A=(t=>(t.METER_MOUSEOVER="meter-mouseover",t.METER_CLICK="meter-click",t.METER_MOUSEOUT="meter-mouseout",t.METER_MOUSEMOVE="meter-mousemove",t))(A||{}),C=(t=>(t.HEATMAP_MOUSEOVER="heatmap-mouseover",t.HEATMAP_CLICK="heatmap-click",t.HEATMAP_MOUSEOUT="heatmap-mouseout",t.HEATMAP_MOUSEMOVE="hetmap-mousemove",t))(C||{}),D=(t=>(t.CHOROPLETH_MOUSEOVER="choropleth-mouseover",t.CHOROPLETH_CLICK="choropleth-click",t.CHOROPLETH_MOUSEOUT="choropleth-mouseout",t.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",t))(D||{});const k=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:M,Area:d,Axis:h,Bar:m,Boxplot:y,CanvasZoom:u,Chart:r,Choropleth:D,CirclePack:O,Gauge:g,Heatmap:C,Legend:S,Line:_,Meter:A,Modal:o,Model:s,Pie:p,Radar:b,Scatter:v,Threshold:T,Toolbar:a,Tooltip:E,Tree:x,Treemap:w,WordCloud:f,ZoomBar:l,ZoomDomain:c},Symbol.toStringTag,{value:"Module"}));var L=(t=>(t.HTML="html",t.SVG="svg",t))(L||{}),R=(t=>(t.WHITE="white",t.G100="g100",t.G90="g90",t.G10="g10",t))(R||{}),I=(t=>(t.BACKGROUND="background",t.FILL="fill",t.STROKE="stroke",t.TOOLTIP="tooltip",t))(I||{}),N=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t))(N||{}),P=(t=>(t.GRAPH_VIEW="graph_view",t.SLIDER_VIEW="slider_view",t))(P||{}),U=(t=>(t.END_LINE="end_line",t.MID_LINE="mid_line",t.FRONT_LINE="front_line",t.NONE="none",t))(U||{}),B=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(B||{}),F=(t=>(t.TIME="time",t.LINEAR="linear",t.LOG="log",t.LABELS="labels",t.LABELS_RATIO="labels-ratio",t))(F||{}),H=(t=>(t.RIGHT="right",t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t))(H||{}),$=(t=>(t.LEFT="left",t.CENTER="center",t.RIGHT="right",t))($||{}),z=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(z||{}),G=(t=>(t.TREE="tree",t.DENDROGRAM="dendrogram",t))(G||{}),j=(t=>(t.ROW="row",t.COLUMN="column",t.ROW_REVERSE="row-reverse",t.COLUMN_REVERSE="column-reverse",t))(j||{}),V=(t=>(t.FIXED="fixed",t.PREFERRED="preferred",t.STRETCH="stretch",t))(V||{}),W=(t=>(t.CENTER="center",t))(W||{}),Y=(t=>(t.GRID="grid",t.VERT_OR_HORIZ="vertOrHoriz",t.PIE="pie",t.DONUT="donut",t))(Y||{}),Z=(t=>(t.SEMI="semi",t.FULL="full",t))(Z||{}),X=(t=>(t.ALWAYS="always",t.AUTO="auto",t.NEVER="never",t))(X||{}),q=(t=>(t.SCATTER="scatter",t.LINE="line",t.SIMPLE_BAR="simple-bar",t.STACKED_BAR="stacked-bar",t.GROUPED_BAR="grouped-bar",t.AREA="area",t.STACKED_AREA="stacked-area",t))(q||{}),K=(t=>(t.EXPORT_CSV="Export as CSV",t.EXPORT_PNG="Export as PNG",t.EXPORT_JPG="Export as JPG",t.ZOOM_IN="Zoom in",t.ZOOM_OUT="Zoom out",t.RESET_ZOOM="Reset zoom",t.MAKE_FULLSCREEN="Make fullscreen",t.EXIT_FULLSCREEN="Exit fullscreen",t.SHOW_AS_DATATABLE="Show as data-table",t.CUSTOM="Custom",t))(K||{}),Q=(t=>(t.LEFT="left",t.RIGHT="right",t))(Q||{}),J=(t=>(t.CHECKBOX="checkbox",t.RADIUS="radius",t.AREA="area",t.SIZE="size",t.LINE="line",t.QUARTILE="quartile",t.ZOOM="zoom",t))(J||{}),tt=(t=>(t.ON="on",t.AUTO="auto",t.OFF="off",t))(tt||{}),et=(t=>(t.DEFAULT="default",t.HOVERABLE="hoverable",t))(et||{}),nt=(t=>(t.geoEqualEarth="geoEqualEarth",t.geoAlbers="geoAlbers",t.geoConicEqualArea="geoConicEqualArea",t.geoConicEquidistant="geoConicEquidistant",t.geoEquirectangular="geoEquirectangular",t.geoMercator="geoMercator",t.geoNaturalEarth1="geoNaturalEarth1",t))(nt||{}),it=(t=>(t["15seconds"]="15seconds",t.minute="minute",t["30minutes"]="30minutes",t.hourly="hourly",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.yearly="yearly",t))(it||{});function rt(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function ot(t){return(e,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,r=n?.width?String(n.width):e;i=t.formattingValues[r]||t.formattingValues[e]}else{const e=t.defaultWidth,r=n?.width?String(n.width):t.defaultWidth;i=t.values[r]||t.values[e]}return i[t.argumentCallback?t.argumentCallback(e):e]}}function st(t){return(e,n={})=>{const i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const s=o[0],a=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}(a,t=>t.test(s)):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}(a,t=>t.test(s));let c;return c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:e.slice(s.length)}}}const at=6048e5,lt=36e5,ct=Symbol.for("constructDateFrom");function ut(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&ct in t?t[ct](e):t instanceof Date?new t.constructor(e):new Date(e)}function ht(t,...e){const n=ut.bind(null,e.find(t=>"object"==typeof t));return e.map(n)}let dt={};function ft(){return dt}function pt(t,e){return ut(e||t,t)}function gt(t,e){const n=ft(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=pt(t,e?.in),o=r.getDay(),s=(o<i?7:0)+o-i;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}const mt={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"}},yt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vt={ordinalNumber:(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ot({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ot({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:ot({values:{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"]},defaultWidth:"wide"}),day:ot({values:{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"]},defaultWidth:"wide"}),dayPeriod:ot({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},_t={ordinalNumber:(xt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(xt.matchPattern);if(!n)return null;const i=n[0],r=t.match(xt.parsePattern);if(!r)return null;let o=xt.valueCallback?xt.valueCallback(r[0]):r[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(i.length)}}),era:st({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:st({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:st({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:st({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:st({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},bt={code:"en-US",formatDistance:(t,e,n)=>{let i;const r=mt[t];return i="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:{date:rt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:rt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:rt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(t,e,n,i)=>yt[t],localize:vt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};var xt,wt="object"==typeof global&&global&&global.Object===Object&&global,Et="object"==typeof self&&self&&self.Object===Object&&self,Tt=wt||Et||Function("return this")(),St=Tt.Symbol,Ot=Object.prototype,Mt=Ot.hasOwnProperty,At=Ot.toString,Ct=St?St.toStringTag:void 0,Dt=Object.prototype.toString,kt=St?St.toStringTag:void 0;function Lt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":kt&&kt in Object(t)?function(t){var e=Mt.call(t,Ct),n=t[Ct];try{t[Ct]=void 0;var i=!0}catch{}var r=At.call(t);return i&&(e?t[Ct]=n:delete t[Ct]),r}(t):function(t){return Dt.call(t)}(t)}function Rt(t){return null!=t&&"object"==typeof t}function It(t){return"symbol"==typeof t||Rt(t)&&"[object Symbol]"==Lt(t)}function Nt(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}var Pt=Array.isArray,Ut=St?St.prototype:void 0,Bt=Ut?Ut.toString:void 0;function Ft(t){if("string"==typeof t)return t;if(Pt(t))return Nt(t,Ft)+"";if(It(t))return Bt?Bt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Ht(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function $t(t){return t}function zt(t){if(!Ht(t))return!1;var e=Lt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Gt=Tt["__core-js_shared__"],jt=function(){var t=/[^.]+$/.exec(Gt&&Gt.keys&&Gt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Vt=Function.prototype.toString;function Wt(t){if(null!=t){try{return Vt.call(t)}catch{}try{return t+""}catch{}}return""}var Yt=/^\[object .+?Constructor\]$/,Zt=Function.prototype,Xt=Object.prototype,qt=Zt.toString,Kt=Xt.hasOwnProperty,Qt=RegExp("^"+qt.call(Kt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jt(t,e){var n=function(t,e){return t?.[e]}(t,e);return function(t){return!(!Ht(t)||function(t){return!!jt&&jt in t}(t))&&(zt(t)?Qt:Yt).test(Wt(t))}(n)?n:void 0}var te=Jt(Tt,"WeakMap"),ee=Object.create,ne=function(){function t(){}return function(e){if(!Ht(e))return{};if(ee)return ee(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ie(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var re=Date.now;function oe(t){return function(){return t}}var se=function(){try{var t=Jt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ae=se?function(t,e){return se(t,"toString",{configurable:!0,enumerable:!1,value:oe(e),writable:!0})}:$t,le=function(t){var e=0,n=0;return function(){var i=re(),r=16-(i-n);if(n=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ae);function ce(t){return t!=t}function ue(t,e){return!(null==t||!t.length)&&function(t,e){return e==e?function(t,e){for(var n=-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e):function(t,e){for(var n=t.length,i=-1;++i<n;)if(e(t[i],i,t))return i;return-1}(t,ce)}(t,e)>-1}var he=/^(?:0|[1-9]\d*)$/;function de(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&("number"==n||"symbol"!=n&&he.test(t))&&t>-1&&t%1==0&&t<e}function fe(t,e,n){"__proto__"==e&&se?se(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function pe(t,e){return t===e||t!=t&&e!=e}var ge=Object.prototype.hasOwnProperty;function me(t,e,n){var i=t[e];(!ge.call(t,e)||!pe(i,n)||void 0===n&&!(e in t))&&fe(t,e,n)}function ye(t,e,n,i){var r=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=void 0;void 0===l&&(l=t[a]),r?fe(n,a,l):me(n,a,l)}return n}var ve=Math.max;function _e(t,e,n){return e=ve(void 0===e?t.length-1:e,0),function(){for(var i=arguments,r=-1,o=ve(i.length-e,0),s=Array(o);++r<o;)s[r]=i[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=i[r];return a[e]=n(s),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,a)}}function be(t,e){return le(_e(t,e,$t),t+"")}function xe(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function we(t){return null!=t&&xe(t.length)&&!zt(t)}var Ee=Object.prototype;function Te(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ee)}function Se(t){return Rt(t)&&"[object Arguments]"==Lt(t)}var Oe=Object.prototype,Me=Oe.hasOwnProperty,Ae=Oe.propertyIsEnumerable,Ce=Se(function(){return arguments}())?Se:function(t){return Rt(t)&&Me.call(t,"callee")&&!Ae.call(t,"callee")},De="object"==typeof exports&&exports&&!exports.nodeType&&exports,ke=De&&"object"==typeof module&&module&&!module.nodeType&&module,Le=ke&&ke.exports===De?Tt.Buffer:void 0,Re=(Le?Le.isBuffer:void 0)||function(){return!1},Ie={};function Ne(t){return function(e){return t(e)}}Ie["[object Float32Array]"]=Ie["[object Float64Array]"]=Ie["[object Int8Array]"]=Ie["[object Int16Array]"]=Ie["[object Int32Array]"]=Ie["[object Uint8Array]"]=Ie["[object Uint8ClampedArray]"]=Ie["[object Uint16Array]"]=Ie["[object Uint32Array]"]=!0,Ie["[object Arguments]"]=Ie["[object Array]"]=Ie["[object ArrayBuffer]"]=Ie["[object Boolean]"]=Ie["[object DataView]"]=Ie["[object Date]"]=Ie["[object Error]"]=Ie["[object Function]"]=Ie["[object Map]"]=Ie["[object Number]"]=Ie["[object Object]"]=Ie["[object RegExp]"]=Ie["[object Set]"]=Ie["[object String]"]=Ie["[object WeakMap]"]=!1;var Pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ue=Pe&&"object"==typeof module&&module&&!module.nodeType&&module,Be=Ue&&Ue.exports===Pe&&wt.process,Fe=function(){try{return Ue&&Ue.require&&Ue.require("util").types||Be&&Be.binding&&Be.binding("util")}catch{}}(),He=Fe&&Fe.isTypedArray,$e=He?Ne(He):function(t){return Rt(t)&&xe(t.length)&&!!Ie[Lt(t)]},ze=Object.prototype.hasOwnProperty;function Ge(t,e){var n=Pt(t),i=!n&&Ce(t),r=!n&&!i&&Re(t),o=!n&&!i&&!r&&$e(t),s=n||i||r||o,a=s?function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(t.length,String):[],l=a.length;for(var c in t)(e||ze.call(t,c))&&(!s||!("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||de(c,l)))&&a.push(c);return a}function je(t,e){return function(n){return t(e(n))}}var Ve=je(Object.keys,Object),We=Object.prototype.hasOwnProperty;function Ye(t){if(!Te(t))return Ve(t);var e=[];for(var n in Object(t))We.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Ze(t){return we(t)?Ge(t):Ye(t)}var Xe=Object.prototype.hasOwnProperty;function qe(t){return we(t)?Ge(t,!0):function(t){if(!Ht(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Te(t),n=[];for(var i in t)"constructor"==i&&(e||!Xe.call(t,i))||n.push(i);return n}(t)}var Ke=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qe=/^\w*$/;function Je(t,e){if(Pt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!It(t))||Qe.test(t)||!Ke.test(t)||null!=e&&t in Object(e)}var tn=Jt(Object,"create"),en=Object.prototype.hasOwnProperty,nn=Object.prototype.hasOwnProperty;function rn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function on(t,e){for(var n=t.length;n--;)if(pe(t[n][0],e))return n;return-1}rn.prototype.clear=function(){this.__data__=tn?tn(null):{},this.size=0},rn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},rn.prototype.get=function(t){var e=this.__data__;if(tn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return en.call(e,t)?e[t]:void 0},rn.prototype.has=function(t){var e=this.__data__;return tn?void 0!==e[t]:nn.call(e,t)},rn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=tn&&void 0===e?"__lodash_hash_undefined__":e,this};var sn=Array.prototype.splice;function an(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}an.prototype.clear=function(){this.__data__=[],this.size=0},an.prototype.delete=function(t){var e=this.__data__,n=on(e,t);return!(n<0||(n==e.length-1?e.pop():sn.call(e,n,1),--this.size,0))},an.prototype.get=function(t){var e=this.__data__,n=on(e,t);return n<0?void 0:e[n][1]},an.prototype.has=function(t){return on(this.__data__,t)>-1},an.prototype.set=function(t,e){var n=this.__data__,i=on(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};var ln=Jt(Tt,"Map");function cn(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function hn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var s=t.apply(this,i);return n.cache=o.set(r,s)||o,s};return n.cache=new(hn.Cache||un),n}un.prototype.clear=function(){this.size=0,this.__data__={hash:new rn,map:new(ln||an),string:new rn}},un.prototype.delete=function(t){var e=cn(this,t).delete(t);return this.size-=e?1:0,e},un.prototype.get=function(t){return cn(this,t).get(t)},un.prototype.has=function(t){return cn(this,t).has(t)},un.prototype.set=function(t,e){var n=cn(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},hn.Cache=un;var dn,fn,pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gn=/\\(\\)?/g,mn=(dn=hn(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(pn,function(t,n,i,r){e.push(i?r.replace(gn,"$1"):n||t)}),e},function(t){return 500===fn.size&&fn.clear(),t}),fn=dn.cache,dn);function yn(t){return null==t?"":Ft(t)}function vn(t,e){return Pt(t)?t:Je(t,e)?[t]:mn(yn(t))}function _n(t){if("string"==typeof t||It(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function bn(t,e){for(var n=0,i=(e=vn(e,t)).length;null!=t&&n<i;)t=t[_n(e[n++])];return n&&n==i?t:void 0}function xn(t,e,n){var i=null==t?void 0:bn(t,e);return void 0===i?n:i}function wn(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}var En=St?St.isConcatSpreadable:void 0;function Tn(t){return Pt(t)||Ce(t)||!!(En&&t&&t[En])}function Sn(t,e,n,i,r){var o=-1,s=t.length;for(n||(n=Tn),r||(r=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?Sn(a,e-1,n,i,r):wn(r,a):i||(r[r.length]=a)}return r}var On=je(Object.getPrototypeOf,Object),Mn=Function.prototype,An=Object.prototype,Cn=Mn.toString,Dn=An.hasOwnProperty,kn=Cn.call(Object);function Ln(t){if(!Rt(t)||"[object Object]"!=Lt(t))return!1;var e=On(t);if(null===e)return!0;var n=Dn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Cn.call(n)==kn}function Rn(t){var e=this.__data__=new an(t);this.size=e.size}Rn.prototype.clear=function(){this.__data__=new an,this.size=0},Rn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Rn.prototype.get=function(t){return this.__data__.get(t)},Rn.prototype.has=function(t){return this.__data__.has(t)},Rn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof an){var i=n.__data__;if(!ln||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new un(i)}return n.set(t,e),this.size=n.size,this};var In="object"==typeof exports&&exports&&!exports.nodeType&&exports,Nn=In&&"object"==typeof module&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===In?Tt.Buffer:void 0,Un=Pn?Pn.allocUnsafe:void 0;function Bn(t,e){if(e)return t.slice();var n=t.length,i=Un?Un(n):new t.constructor(n);return t.copy(i),i}function Fn(){return[]}var Hn=Object.prototype.propertyIsEnumerable,$n=Object.getOwnPropertySymbols,zn=$n?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,i=null==t?0:t.length,r=0,o=[];++n<i;){var s=t[n];e(s)&&(o[r++]=s)}return o}($n(t),function(e){return Hn.call(t,e)}))}:Fn,Gn=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)wn(e,zn(t)),t=On(t);return e}:Fn;function jn(t,e,n){var i=e(t);return Pt(t)?i:wn(i,n(t))}function Vn(t){return jn(t,Ze,zn)}function Wn(t){return jn(t,qe,Gn)}var Yn=Jt(Tt,"DataView"),Zn=Jt(Tt,"Promise"),Xn=Jt(Tt,"Set"),qn="[object Map]",Kn="[object Promise]",Qn="[object Set]",Jn="[object WeakMap]",ti="[object DataView]",ei=Wt(Yn),ni=Wt(ln),ii=Wt(Zn),ri=Wt(Xn),oi=Wt(te),si=Lt;(Yn&&si(new Yn(new ArrayBuffer(1)))!=ti||ln&&si(new ln)!=qn||Zn&&si(Zn.resolve())!=Kn||Xn&&si(new Xn)!=Qn||te&&si(new te)!=Jn)&&(si=function(t){var e=Lt(t),n="[object Object]"==e?t.constructor:void 0,i=n?Wt(n):"";if(i)switch(i){case ei:return ti;case ni:return qn;case ii:return Kn;case ri:return Qn;case oi:return Jn}return e});var ai=Object.prototype.hasOwnProperty,li=Tt.Uint8Array;function ci(t){var e=new t.constructor(t.byteLength);return new li(e).set(new li(t)),e}var ui=/\w*$/,hi=St?St.prototype:void 0,di=hi?hi.valueOf:void 0;function fi(t,e){var n=e?ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function pi(t){return"function"!=typeof t.constructor||Te(t)?{}:ne(On(t))}var gi=Fe&&Fe.isMap,mi=gi?Ne(gi):function(t){return Rt(t)&&"[object Map]"==si(t)},yi=Fe&&Fe.isSet,vi=yi?Ne(yi):function(t){return Rt(t)&&"[object Set]"==si(t)},_i="[object Arguments]",bi="[object Function]",xi="[object Object]",wi={};function Ei(t,e,n,i,r,o){var s,a=1&e,l=2&e,c=4&e;if(n&&(s=r?n(t,i,r,o):n(t)),void 0!==s)return s;if(!Ht(t))return t;var u=Pt(t);if(u){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ai.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!a)return ie(t,s)}else{var h=si(t),d=h==bi||"[object GeneratorFunction]"==h;if(Re(t))return Bn(t,a);if(h==xi||h==_i||d&&!r){if(s=l||d?{}:pi(t),!a)return l?function(t,e){return ye(t,Gn(t),e)}(t,function(t,e){return t&&ye(e,qe(e),t)}(s,t)):function(t,e){return ye(t,zn(t),e)}(t,function(t,e){return t&&ye(e,Ze(e),t)}(s,t))}else{if(!wi[h])return r?t:{};s=function(t,e,n){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return ci(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var n=e?ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return fi(t,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,ui.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return di?Object(di.call(t)):{}}(t)}}(t,h,a)}}o||(o=new Rn);var f=o.get(t);if(f)return f;o.set(t,s),vi(t)?t.forEach(function(i){s.add(Ei(i,e,n,i,t,o))}):mi(t)&&t.forEach(function(i,r){s.set(r,Ei(i,e,n,r,t,o))});var p=u?void 0:(c?l?Wn:Vn:l?qe:Ze)(t);return function(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n););}(p||t,function(i,r){p&&(i=t[r=i]),me(s,r,Ei(i,e,n,r,t,o))}),s}function Ti(t){return Ei(t,5)}function Si(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new un;++e<n;)this.add(t[e])}function Oi(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}function Mi(t,e){return t.has(e)}function Ai(t,e,n,i,r,o){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var h=-1,d=!0,f=2&n?new Si:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var p=t[h],g=e[h];if(i)var m=s?i(g,p,h,e,t,o):i(p,g,h,t,e,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!Oi(e,function(t,e){if(!Mi(f,e)&&(p===t||r(p,t,n,i,o)))return f.push(e)})){d=!1;break}}else if(p!==g&&!r(p,g,n,i,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function Ci(t){var e=-1,n=Array(t.size);return t.forEach(function(t,i){n[++e]=[i,t]}),n}function Di(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}wi[_i]=wi["[object Array]"]=wi["[object ArrayBuffer]"]=wi["[object DataView]"]=wi["[object Boolean]"]=wi["[object Date]"]=wi["[object Float32Array]"]=wi["[object Float64Array]"]=wi["[object Int8Array]"]=wi["[object Int16Array]"]=wi["[object Int32Array]"]=wi["[object Map]"]=wi["[object Number]"]=wi[xi]=wi["[object RegExp]"]=wi["[object Set]"]=wi["[object String]"]=wi["[object Symbol]"]=wi["[object Uint8Array]"]=wi["[object Uint8ClampedArray]"]=wi["[object Uint16Array]"]=wi["[object Uint32Array]"]=!0,wi["[object Error]"]=wi[bi]=wi["[object WeakMap]"]=!1,Si.prototype.add=Si.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Si.prototype.has=function(t){return this.__data__.has(t)};var ki=St?St.prototype:void 0,Li=ki?ki.valueOf:void 0,Ri=Object.prototype.hasOwnProperty,Ii="[object Arguments]",Ni="[object Array]",Pi="[object Object]",Ui=Object.prototype.hasOwnProperty;function Bi(t,e,n,i,r){return t===e||(null==t||null==e||!Rt(t)&&!Rt(e)?t!=t&&e!=e:function(t,e,n,i,r,o){var s=Pt(t),a=Pt(e),l=s?Ni:si(t),c=a?Ni:si(e),u=(l=l==Ii?Pi:l)==Pi,h=(c=c==Ii?Pi:c)==Pi,d=l==c;if(d&&Re(t)){if(!Re(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new Rn),s||$e(t)?Ai(t,e,n,i,r,o):function(t,e,n,i,r,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new li(t),new li(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return pe(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Ci;case"[object Set]":var l=1&i;if(a||(a=Di),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;i|=2,s.set(t,e);var u=Ai(a(t),a(e),i,r,o,s);return s.delete(t),u;case"[object Symbol]":if(Li)return Li.call(t)==Li.call(e)}return!1}(t,e,l,n,i,r,o);if(!(1&n)){var f=u&&Ui.call(t,"__wrapped__"),p=h&&Ui.call(e,"__wrapped__");if(f||p){var g=f?t.value():t,m=p?e.value():e;return o||(o=new Rn),r(g,m,n,i,o)}}return!!d&&(o||(o=new Rn),function(t,e,n,i,r,o){var s=1&n,a=Vn(t),l=a.length;if(l!=Vn(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Ri.call(e,u)))return!1}var h=o.get(t),d=o.get(e);if(h&&d)return h==e&&d==t;var f=!0;o.set(t,e),o.set(e,t);for(var p=s;++c<l;){var g=t[u=a[c]],m=e[u];if(i)var y=s?i(m,g,u,e,t,o):i(g,m,u,t,e,o);if(!(void 0===y?g===m||r(g,m,n,i,o):y)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var v=t.constructor,_=e.constructor;v!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _)&&(f=!1)}return o.delete(t),o.delete(e),f}(t,e,n,i,r,o))}(t,e,n,i,Bi,r))}function Fi(t){return t==t&&!Ht(t)}function Hi(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function $i(t,e){return null!=t&&e in Object(t)}function zi(t){return"function"==typeof t?t:null==t?$t:"object"==typeof t?Pt(t)?function(t,e){return Je(t)&&Fi(e)?Hi(_n(t),e):function(n){var i=xn(n,t);return void 0===i&&i===e?function(t,e){return null!=t&&function(t,e,n){for(var i=-1,r=(e=vn(e,t)).length,o=!1;++i<r;){var s=_n(e[i]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++i!=r?o:!!(r=null==t?0:t.length)&&xe(r)&&de(s,r)&&(Pt(t)||Ce(t))}(t,e,$i)}(n,t):Bi(e,i,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Ze(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,Fi(r)]}return e}(t);return 1==e.length&&e[0][2]?Hi(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n){var i=n.length,r=i;if(null==t)return!r;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<r;){var s=(o=n[i])[0],a=t[s],l=o[1];if(o[2]){if(void 0===a&&!(s in t))return!1}else if(!Bi(l,a,3,void 0,new Rn))return!1}return!0}(n,0,e)}}(t):function(t){return Je(t)?function(t){return function(e){return e?.[t]}}(_n(t)):function(t){return function(e){return bn(e,t)}}(t)}(t)}var Gi=function(t,e,n){for(var i=-1,r=Object(t),o=n(t),s=o.length;s--;){var a=o[++i];if(!1===e(r[a],a,r))break}return t};function ji(t,e,n){(void 0!==n&&!pe(t[e],n)||void 0===n&&!(e in t))&&fe(t,e,n)}function Vi(t){return Rt(t)&&we(t)}function Wi(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Yi(t,e,n,i,r){t!==e&&Gi(e,function(o,s){if(r||(r=new Rn),Ht(o))!function(t,e,n,i,r,o,s){var a=Wi(t,n),l=Wi(e,n),c=s.get(l);if(c)ji(t,n,c);else{var u=o?o(a,l,n+"",t,e,s):void 0,h=void 0===u;if(h){var d=Pt(l),f=!d&&Re(l),p=!d&&!f&&$e(l);u=l,d||f||p?Pt(a)?u=a:Vi(a)?u=ie(a):f?(h=!1,u=Bn(l,!0)):p?(h=!1,u=fi(l,!0)):u=[]:Ln(l)||Ce(l)?(u=a,Ce(a)?u=function(t){return ye(t,qe(t))}(a):(!Ht(a)||zt(a))&&(u=pi(l))):h=!1}h&&(s.set(l,u),r(u,l,i,o,s),s.delete(l)),ji(t,n,u)}}(t,e,s,n,Yi,i,r);else{var a=i?i(Wi(t,s),o,s+"",t,e,r):void 0;void 0===a&&(a=o),ji(t,s,a)}},qe)}function Zi(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Xi=Object.prototype.hasOwnProperty;var qi=function(t){return be(function(e,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(r--,o):void 0,s&&function(t,e,n){if(!Ht(n))return!1;var i=typeof e;return!!("number"==i?we(n)&&de(e,n.length):"string"==i&&e in n)&&pe(n[e],t)}(n[0],n[1],s)&&(o=r<3?void 0:o,r=1),e=Object(e);++i<r;){var a=n[i];a&&t(e,a,i)}return e})}(function(t,e,n){Yi(t,e,n)}),Ki=Xn&&1/Di(new Xn([,-0]))[1]==1/0?function(t){return new Xn(t)}:function(){};function Qi(t,e,n){var i=-1,r=ue,o=t.length,s=!0,a=[],l=a;if(o>=200){var c=e?null:Ki(t);if(c)return Di(c);s=!1,r=Mi,l=new Si}else l=e?[]:a;t:for(;++i<o;){var u=t[i],h=e?e(u):u;if(u=0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),a.push(u)}else r(l,h,n)||(l!==a&&l.push(h),a.push(u))}return a}var Ji=be(function(t){var e=Zi(t);return Vi(e)&&(e=void 0),Qi(Sn(t,1,Vi,!0),zi(e))});function tr(t){return t&&t.length?Qi(t):[]}function er(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function nr(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ir(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=er,n=(e,n)=>er(t(e),n),i=(e,n)=>t(e)-n):(e=t===er||t===nr?t:rr,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const s=r(t,e,n,o-1);return s>n&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function rr(){return 0}const or=ir(er).right;function sr(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(void 0===n?o>=o&&(n=i=o):(n>o&&(n=o),i<o&&(i=o)))}return[n,i]}ir(function(t){return null===t?NaN:+t}).center;let ar=class extends Map{constructor(t,e=cr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(lr(this,t))}has(t){return super.has(lr(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}(this,t))}};function lr({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function cr(t){return null!==t&&"object"==typeof t?t.valueOf():t}const ur=Math.sqrt(50),hr=Math.sqrt(10),dr=Math.sqrt(2);function fr(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=ur?10:o>=hr?5:o>=dr?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?fr(t,e,2*n):[a,l,c]}function pr(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const i=e<t,[r,o,s]=i?fr(e,t,n):fr(t,e,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let t=0;t<a;++t)l[t]=(o-t)/-s;else for(let t=0;t<a;++t)l[t]=(o-t)*s;else if(s<0)for(let t=0;t<a;++t)l[t]=(r+t)/-s;else for(let t=0;t<a;++t)l[t]=(r+t)*s;return l}function gr(t,e,n){return fr(t=+t,e=+e,n=+n)[2]}function mr(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?gr(e,t,n):gr(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function yr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}var vr={value:()=>{}};function _r(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new br(i)}function br(t){this._=t}function xr(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function wr(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=vr,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}br.prototype=_r.prototype={constructor:br,on:function(t,e){var n,i=this._,r=function(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=r[o]).type)i[n]=wr(i[n],t.name,e);else if(null==e)for(n in i)i[n]=wr(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=r[o]).type)&&(n=xr(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new br(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};var Er="http://www.w3.org/1999/xhtml";const Tr={svg:"http://www.w3.org/2000/svg",xhtml:Er,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Sr(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Tr.hasOwnProperty(e)?{space:Tr[e],local:t}:t}function Or(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Er&&e.documentElement.namespaceURI===Er?e.createElement(t):e.createElementNS(n,t)}}function Mr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ar(t){var e=Sr(t);return(e.local?Mr:Or)(e)}function Cr(){}function Dr(t){return null==t?Cr:function(){return this.querySelector(t)}}function kr(){return[]}function Lr(t){return null==t?kr:function(){return this.querySelectorAll(t)}}function Rr(t){return function(){return this.matches(t)}}function Ir(t){return function(e){return e.matches(t)}}var Nr=Array.prototype.find;function Pr(){return this.firstElementChild}var Ur=Array.prototype.filter;function Br(){return Array.from(this.children)}function Fr(t){return new Array(t.length)}function Hr(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function $r(t,e,n,i,r,o){for(var s,a=0,l=e.length,c=o.length;a<c;++a)(s=e[a])?(s.__data__=o[a],i[a]=s):n[a]=new Hr(t,o[a]);for(;a<l;++a)(s=e[a])&&(r[a]=s)}function zr(t,e,n,i,r,o,s){var a,l,c,u=new Map,h=e.length,d=o.length,f=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(f[a]=c=s.call(l,l.__data__,a,e)+"",u.has(c)?r[a]=l:u.set(c,l));for(a=0;a<d;++a)c=s.call(t,o[a],a,o)+"",(l=u.get(c))?(i[a]=l,l.__data__=o[a],u.delete(c)):n[a]=new Hr(t,o[a]);for(a=0;a<h;++a)(l=e[a])&&u.get(f[a])===l&&(r[a]=l)}function Gr(t){return t.__data__}function jr(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Vr(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Wr(t){return function(){this.removeAttribute(t)}}function Yr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zr(t,e){return function(){this.setAttribute(t,e)}}function Xr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function qr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Kr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Qr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Jr(t){return function(){this.style.removeProperty(t)}}function to(t,e,n){return function(){this.style.setProperty(t,e,n)}}function eo(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function no(t,e){return t.style.getPropertyValue(e)||Qr(t).getComputedStyle(t,null).getPropertyValue(e)}function io(t){return function(){delete this[t]}}function ro(t,e){return function(){this[t]=e}}function oo(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function so(t){return t.trim().split(/^|\s+/)}function ao(t){return t.classList||new lo(t)}function lo(t){this._node=t,this._names=so(t.getAttribute("class")||"")}function co(t,e){for(var n=ao(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function uo(t,e){for(var n=ao(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ho(t){return function(){co(this,t)}}function fo(t){return function(){uo(this,t)}}function po(t,e){return function(){(e.apply(this,arguments)?co:uo)(this,t)}}function go(){this.textContent=""}function mo(t){return function(){this.textContent=t}}function yo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function vo(){this.innerHTML=""}function _o(t){return function(){this.innerHTML=t}}function bo(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function xo(){this.nextSibling&&this.parentNode.appendChild(this)}function wo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Eo(){return null}function To(){var t=this.parentNode;t&&t.removeChild(this)}function So(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Oo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mo(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function Ao(t,e,n){return function(){var i,r=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),void(i.value=e);this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Co(t,e,n){var i=Qr(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Do(t,e){return function(){return Co(this,t,e)}}function ko(t,e){return function(){return Co(this,t,e.apply(this,arguments))}}Hr.prototype={constructor:Hr,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},lo.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Lo=[null];function Ro(t,e){this._groups=t,this._parents=e}function Io(){return new Ro([[document.documentElement]],Lo)}function No(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}function Po(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Uo(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Bo(){}Ro.prototype=Io.prototype={constructor:Ro,select:function(t){"function"!=typeof t&&(t=Dr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s,a=e[r],l=a.length,c=i[r]=new Array(l),u=0;u<l;++u)(o=a[u])&&(s=t.call(o,o.__data__,u,a))&&("__data__"in o&&(s.__data__=o.__data__),c[u]=s);return new Ro(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}(t):Lr(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,c=0;c<l;++c)(s=a[c])&&(i.push(t.call(s,s.__data__,c,a)),r.push(s));return new Ro(i,r)},selectChild:function(t){return this.select(null==t?Pr:function(t){return function(){return Nr.call(this.children,t)}}("function"==typeof t?t:Ir(t)))},selectChildren:function(t){return this.selectAll(null==t?Br:function(t){return function(){return Ur.call(this.children,t)}}("function"==typeof t?t:Ir(t)))},filter:function(t){"function"!=typeof t&&(t=Rr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new Ro(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,Gr);var n=e?zr:$r,i=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=i[c],h=r[c],d=h.length,f=jr(t.call(u,u&&u.__data__,c,i)),p=f.length,g=a[c]=new Array(p),m=s[c]=new Array(p);n(u,h,g,m,l[c]=new Array(d),f,e);for(var y,v,_=0,b=0;_<p;++_)if(y=g[_]){for(_>=b&&(b=_+1);!(v=m[b])&&++b<p;);y._next=v||null}}return(s=new Ro(s,i))._enter=a,s._exit=l,s},enter:function(){return new Ro(this._enter||this._groups.map(Fr),this._parents)},exit:function(){return new Ro(this._exit||this._groups.map(Fr),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var c,u=n[l],h=i[l],d=u.length,f=a[l]=new Array(d),p=0;p<d;++p)(c=u[p]||h[p])&&(f[p]=c);for(;l<r;++l)a[l]=n[l];return new Ro(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,s=r[o];--o>=0;)(i=r[o])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Vr);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s,a=n[o],l=a.length,c=r[o]=new Array(l),u=0;u<l;++u)(s=a[u])&&(c[u]=s);c.sort(e)}return new Ro(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],s=0,a=o.length;s<a;++s)(r=o[s])&&t.call(r,r.__data__,s,o);return this},attr:function(t,e){var n=Sr(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?Yr:Wr:"function"==typeof e?n.local?Kr:qr:n.local?Xr:Zr)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Jr:"function"==typeof e?eo:to)(t,e,n??"")):no(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?io:"function"==typeof e?oo:ro)(t,e)):this.node()[t]},classed:function(t,e){var n=so(t+"");if(arguments.length<2){for(var i=ao(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?po:e?ho:fo)(n,e))},text:function(t){return arguments.length?this.each(null==t?go:("function"==typeof t?yo:mo)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?vo:("function"==typeof t?bo:_o)(t)):this.node().innerHTML},raise:function(){return this.each(xo)},lower:function(){return this.each(wo)},append:function(t){var e="function"==typeof t?t:Ar(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:Ar(t),i=null==e?Eo:"function"==typeof e?e:Dr(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(To)},clone:function(t){return this.select(t?Oo:So)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?Ao:Mo,i=0;i<s;++i)this.each(a(o[i],e,n));return this}var a=this.node().__on;if(a)for(var l,c=0,u=a.length;c<u;++c)for(i=0,l=a[c];i<s;++i)if((r=o[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ko:Do)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],o=0,s=r.length;o<s;++o)(i=r[o])&&(yield i)}};var Fo=.7,Ho=1/Fo,$o="\\s*([+-]?\\d+)\\s*",zo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jo=/^#([0-9a-f]{3,8})$/,Vo=new RegExp(`^rgb\\(${$o},${$o},${$o}\\)$`),Wo=new RegExp(`^rgb\\(${Go},${Go},${Go}\\)$`),Yo=new RegExp(`^rgba\\(${$o},${$o},${$o},${zo}\\)$`),Zo=new RegExp(`^rgba\\(${Go},${Go},${Go},${zo}\\)$`),Xo=new RegExp(`^hsl\\(${zo},${Go},${Go}\\)$`),qo=new RegExp(`^hsla\\(${zo},${Go},${Go},${zo}\\)$`),Ko={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};function Qo(){return this.rgb().formatHex()}function Jo(){return this.rgb().formatRgb()}function ts(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=jo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?es(e):3===n?new rs(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ns(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ns(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Vo.exec(t))?new rs(e[1],e[2],e[3],1):(e=Wo.exec(t))?new rs(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Yo.exec(t))?ns(e[1],e[2],e[3],e[4]):(e=Zo.exec(t))?ns(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Xo.exec(t))?us(e[1],e[2]/100,e[3]/100,1):(e=qo.exec(t))?us(e[1],e[2]/100,e[3]/100,e[4]):Ko.hasOwnProperty(t)?es(Ko[t]):"transparent"===t?new rs(NaN,NaN,NaN,0):null}function es(t){return new rs(t>>16&255,t>>8&255,255&t,1)}function ns(t,e,n,i){return i<=0&&(t=e=n=NaN),new rs(t,e,n,i)}function is(t,e,n,i){return 1===arguments.length?function(t){return t instanceof Bo||(t=ts(t)),t?new rs((t=t.rgb()).r,t.g,t.b,t.opacity):new rs}(t):new rs(t,e,n,i??1)}function rs(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function os(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}`}function ss(){const t=as(this.opacity);return`${1===t?"rgb(":"rgba("}${ls(this.r)}, ${ls(this.g)}, ${ls(this.b)}${1===t?")":`, ${t})`}`}function as(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ls(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function cs(t){return((t=ls(t))<16?"0":"")+t.toString(16)}function us(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ds(t,e,n,i)}function hs(t){if(t instanceof ds)return new ds(t.h,t.s,t.l,t.opacity);if(t instanceof Bo||(t=ts(t)),!t)return new ds;if(t instanceof ds)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n<i):n===o?(i-e)/a+2:(e-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new ds(s,a,l,t.opacity)}function ds(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function fs(t){return(t=(t||0)%360)<0?t+360:t}function ps(t){return Math.max(0,Math.min(1,t||0))}function gs(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Po(Bo,ts,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Qo,formatHex:Qo,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return hs(this).formatHsl()},formatRgb:Jo,toString:Jo}),Po(rs,is,Uo(Bo,{brighter(t){return t=null==t?Ho:Math.pow(Ho,t),new rs(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Fo:Math.pow(Fo,t),new rs(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new rs(ls(this.r),ls(this.g),ls(this.b),as(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:os,formatHex:os,formatHex8:function(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}${cs(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ss,toString:ss})),Po(ds,function(t,e,n,i){return 1===arguments.length?hs(t):new ds(t,e,n,i??1)},Uo(Bo,{brighter(t){return t=null==t?Ho:Math.pow(Ho,t),new ds(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Fo:Math.pow(Fo,t),new ds(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new rs(gs(t>=240?t-240:t+120,r,i),gs(t,r,i),gs(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new ds(fs(this.h),ps(this.s),ps(this.l),as(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 t=as(this.opacity);return`${1===t?"hsl(":"hsla("}${fs(this.h)}, ${100*ps(this.s)}%, ${100*ps(this.l)}%${1===t?")":`, ${t})`}`}}));const ms=t=>()=>t;function ys(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):ms(isNaN(t)?e:t)}const vs=function t(e){var n=function(t){return 1==(t=+t)?ys:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):ms(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=is(t)).r,(e=is(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=ys(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function _s(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function bs(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=Ms(t[n],e[n]);for(;n<i;++n)s[n]=e[n];return function(t){for(n=0;n<r;++n)s[n]=o[n](t);return s}}function xs(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function ws(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Es(t,e){var n,i={},r={};for(n in(null===t||"object"!=typeof t)&&(t={}),(null===e||"object"!=typeof e)&&(e={}),e)n in t?i[n]=Ms(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Ts=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ss=new RegExp(Ts.source,"g");function Os(t,e){var n,i,r,o=Ts.lastIndex=Ss.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=Ts.exec(t))&&(i=Ss.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:ws(n,i)})),o=Ss.lastIndex;return o<e.length&&(r=e.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function Ms(t,e){var n,i=typeof e;return null==e||"boolean"===i?ms(e):("number"===i?ws:"string"===i?(n=ts(e))?(e=n,vs):Os:e instanceof ts?vs:e instanceof Date?xs:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?_s:Array.isArray(e)?bs:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Es:ws)(t,e)}function As(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Cs,Ds=180/Math.PI,ks={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ls(t,e,n,i,r,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*Ds,skewX:Math.atan(l)*Ds,scaleX:s,scaleY:a}}function Rs(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,i,r,o,s,a){if(t!==r||i!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:ws(t,r)},{i:l-2,x:ws(i,o)})}else(r||o)&&s.push("translate("+r+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:ws(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:ws(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,l),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:ws(t,n)},{i:a-2,x:ws(e,i)})}else(1!==n||1!==i)&&o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var Is,Ns,Ps=Rs(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ks:Ls(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),Us=Rs(function(t){return null!=t&&(Cs||(Cs=document.createElementNS("http://www.w3.org/2000/svg","g")),Cs.setAttribute("transform",t),t=Cs.transform.baseVal.consolidate())?Ls((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ks},", ",")",")"),Bs=0,Fs=0,Hs=0,$s=0,zs=0,Gs=0,js="object"==typeof performance&&performance.now?performance:Date,Vs="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ws(){return zs||(Vs(Ys),zs=js.now()+Gs)}function Ys(){zs=0}function Zs(){this._call=this._time=this._next=null}function Xs(t,e,n){var i=new Zs;return i.restart(t,e,n),i}function qs(){zs=($s=js.now())+Gs,Bs=Fs=0;try{!function(){Ws(),++Bs;for(var t,e=Is;e;)(t=zs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Bs}()}finally{Bs=0,function(){for(var t,e,n=Is,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Is=e);Ns=t,Qs(i)}(),zs=0}}function Ks(){var t=js.now(),e=t-$s;e>1e3&&(Gs-=e,$s=t)}function Qs(t){Bs||(Fs&&(Fs=clearTimeout(Fs)),t-zs>24?(t<1/0&&(Fs=setTimeout(qs,t-js.now()-Gs)),Hs&&(Hs=clearInterval(Hs))):(Hs||($s=js.now(),Hs=setInterval(Ks,1e3)),Bs=1,Vs(qs)))}function Js(t,e,n){var i=new Zs;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}Zs.prototype=Xs.prototype={constructor:Zs,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ws():+n)+(null==e?0:+e),!this._next&&Ns!==this&&(Ns?Ns._next=this:Is=this,Ns=this),this._call=t,this._time=n,Qs()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qs())}};var ta=_r("start","end","cancel","interrupt"),ea=[];function na(t,e,n,i,r,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(l){var c,u,h,d;if(1!==n.state)return a();for(c in r)if((d=r[c]).name===n.name){if(3===d.state)return Js(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[c])}if(Js(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(d=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=d);i.length=u+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(a),n.state=5,1),o=-1,s=i.length;++o<s;)i[o].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),a())}function a(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=Xs(function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)},0,n.time)}(t,n,{name:e,index:i,group:r,on:ta,tween:ea,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function ia(t,e){var n=oa(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function ra(t,e){var n=oa(t,e);if(n.state>3)throw new Error("too late; already running");return n}function oa(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function sa(t,e){var n,i,r,o=t.__transition,s=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):s=!1;s&&delete t.__transition}}function aa(t,e){var n,i;return function(){var r=ra(this,t),o=r.tween;if(o!==n)for(var s=0,a=(i=n=o).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}r.tween=i}}function la(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=ra(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}o.tween=r}}function ca(t,e,n){var i=t._id;return t.each(function(){var t=ra(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return oa(t,i).value[e]}}function ua(t,e){var n;return("number"==typeof e?ws:e instanceof ts?vs:(n=ts(e))?(e=n,vs):Os)(t,e)}function ha(t){return function(){this.removeAttribute(t)}}function da(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fa(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===i?r:r=e(i=s,n)}}function pa(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===i?r:r=e(i=s,n)}}function ga(t,e,n){var i,r,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttribute(t):(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l))}}function ma(t,e,n){var i,r,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l))}}function ya(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function va(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function _a(t,e){return function(){ia(this,t).delay=+e.apply(this,arguments)}}function ba(t,e){return e=+e,function(){ia(this,t).delay=e}}function xa(t,e){return function(){ra(this,t).duration=+e.apply(this,arguments)}}function wa(t,e){return e=+e,function(){ra(this,t).duration=e}}var Ea=Io.prototype.constructor;function Ta(t){return function(){this.style.removeProperty(t)}}var Sa=0;function Oa(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ma(){return++Sa}var Aa=Io.prototype;function Ca(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Oa.prototype={constructor:Oa,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Dr(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a,l,c=i[s],u=c.length,h=o[s]=new Array(u),d=0;d<u;++d)(a=c[d])&&(l=t.call(a,a.__data__,d,c))&&("__data__"in a&&(l.__data__=a.__data__),h[d]=l,na(h[d],e,n,d,h,oa(a,n)));return new Oa(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Lr(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l,c=i[a],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var d,f=t.call(l,l.__data__,h,c),p=oa(l,n),g=0,m=f.length;g<m;++g)(d=f[g])&&na(d,e,n,g,f,p);o.push(f),s.push(l)}return new Oa(o,s,e,n)},selectChild:Aa.selectChild,selectChildren:Aa.selectChildren,filter:function(t){"function"!=typeof t&&(t=Rr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new Oa(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l,c=e[a],u=n[a],h=c.length,d=s[a]=new Array(h),f=0;f<h;++f)(l=c[f]||u[f])&&(d[f]=l);for(;a<i;++a)s[a]=e[a];return new Oa(s,this._parents,this._name,this._id)},selection:function(){return new Ea(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Ma(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,c=0;c<l;++c)if(s=a[c]){var u=oa(s,e);na(s,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Oa(i,this._parents,t,n)},call:Aa.call,nodes:Aa.nodes,node:Aa.node,size:Aa.size,empty:Aa.empty,each:Aa.each,on:function(t,e){var n=this._id;return arguments.length<2?oa(this.node(),n).on.on(t):this.each(function(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?ia:ra;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}(n,t,e))},attr:function(t,e){var n=Sr(t),i="transform"===n?Us:ua;return this.attrTween(t,"function"==typeof e?(n.local?ma:ga)(n,i,ca(this,"attr."+t,e)):null==e?(n.local?da:ha)(n):(n.local?pa:fa)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=Sr(t);return this.tween(n,(i.local?ya:va)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Ps:ua;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=no(this,t),s=(this.style.removeProperty(t),no(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}(t,i)).on("end.style."+t,Ta(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var s=no(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=no(this,t)),s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a))}}(t,i,ca(this,"style."+t,e))).each(function(t,e){var n,i,r,o,s="style."+e,a="end."+s;return function(){var l=ra(this,t),c=l.on,u=null==l.value[s]?o||(o=Ta(e)):void 0;(c!==n||r!==u)&&(i=(n=c).copy()).on(a,r=u),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var s=no(this,t);return s===o?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,o,n)),i}return o._value=e,o}(t,e,n??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(ca(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=oa(this.node(),n).tween,o=0,s=r.length;o<s;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?aa:la)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?_a:ba)(e,t)):oa(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?xa:wa)(e,t)):oa(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){ra(this,t).ease=e}}(e,t)):oa(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;ra(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){0===--r&&o()}};n.each(function(){var n=ra(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e}),0===r&&o()})},[Symbol.iterator]:Aa[Symbol.iterator]};var Da={time:null,delay:0,duration:250,ease:Ca};function ka(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function La(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Ra(t){return(t=La(Math.abs(t)))?t[1]:NaN}Io.prototype.interrupt=function(t){return this.each(function(){sa(this,t)})},Io.prototype.transition=function(t){var e,n;t instanceof Oa?(e=t._id,t=t._name):(e=Ma(),(n=Da).time=Ws(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,c=0;c<l;++c)(s=a[c])&&na(s,t,e,c,a,n||ka(s,e));return new Oa(i,this._parents,t,e)};var Ia,Na=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pa(t){if(!(e=Na.exec(t)))throw new Error("invalid format: "+t);var e;return new Ua({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ua(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ba(t,e){var n=La(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Pa.prototype=Ua.prototype,Ua.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Fa={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ba(100*t,e),r:Ba,s:function(t,e){var n=La(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(Ia=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+La(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ha(t){return t}var $a,za,Ga,ja=Array.prototype.map,Va=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Wa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}$a=function(t){var e=void 0===t.grouping||void 0===t.thousands?Ha:function(t,e){return function(n,i){for(var r=n.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}(ja.call(t.grouping,Number),t.thousands+""),n=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",r=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Ha:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(ja.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",a=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function c(t){var c=(t=Pa(t)).fill,u=t.align,h=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Fa[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="=");var _="$"===d?n:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===d?i:/[%p]/.test(v)?s:"",x=Fa[v],w=/[defgprs%]/.test(v);function E(t){var n,i,s,d=_,E=b;if("c"===v)E=x(t)+E,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:x(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),T&&0==+t&&"+"!==h&&(T=!1),d=(T?"("===h?h:a:"-"===h||"("===h?"":h)+d,E=("s"===v?Va[8+Ia/3]:"")+E+(T&&"("===h?")":""),w)for(n=-1,i=t.length;++n<i;)if(48>(s=t.charCodeAt(n))||s>57){E=(46===s?r+t.slice(n+1):t.slice(n))+E,t=t.slice(0,n);break}}g&&!f&&(t=e(t,1/0));var S=d.length+t.length+E.length,O=S<p?new Array(p-S+1).join(c):"";switch(g&&f&&(t=e(O+t,O.length?p-E.length:1/0),O=""),u){case"<":t=d+t+E+O;break;case"=":t=d+O+t+E;break;case"^":t=O.slice(0,S=O.length>>1)+d+t+E+O.slice(S);break;default:t=O+d+t+E}return o(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),E.toString=function(){return t+""},E}return{format:c,formatPrefix:function(t,e){var n=c(((t=Pa(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Ra(e)/3))),r=Math.pow(10,-i),o=Va[8+i/3];return function(t){return n(r*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),za=$a.format,Ga=$a.formatPrefix;const Ya=Symbol("implicit");function Za(){var t=new ar,e=[],n=[],i=Ya;function r(r){let o=t.get(r);if(void 0===o){if(i!==Ya)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new ar;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Za(e,n).unknown(i)},Wa.apply(r,arguments),r}function Xa(t){return+t}var qa=[0,1];function Ka(t){return t}function Qa(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Ja(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=Qa(r,i),o=n(s,o)):(i=Qa(i,r),o=n(o,s)),function(t){return o(i(t))}}function tl(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=Qa(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){var n=or(t,e,1,i)-1;return o[n](r[n](e))}}function el(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function nl(){var t,e,n,i,r,o,s=qa,a=qa,l=Ms,c=Ka;function u(){var t=Math.min(s.length,a.length);return c!==Ka&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(s[0],s[t-1])),i=t>2?tl:Ja,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),a,l)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=i(a,s.map(t),ws)))(n)))},h.domain=function(t){return arguments.length?(s=Array.from(t,Xa),u()):s.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=As,u()},h.clamp=function(t){return arguments.length?(c=!!t||Ka,u()):c!==Ka},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function il(){return nl()(Ka,Ka)}function rl(t){var e=t.domain;return t.ticks=function(t){var n=e();return pr(n[0],n[n.length-1],t??10)},t.tickFormat=function(t,n){var i=e();return function(t,e,n,i){var r,o=mr(t,e,n);switch((i=Pa(i??",f")).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null==i.precision&&!isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ra(e)/3)))-Ra(Math.abs(t)))}(o,s))&&(i.precision=r),Ga(i,s);case"":case"e":case"g":case"p":case"r":null==i.precision&&!isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ra(e)-Ra(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=r-("e"===i.type));break;case"f":case"%":null==i.precision&&!isNaN(r=function(t){return Math.max(0,-Ra(Math.abs(t)))}(o))&&(i.precision=r-2*("%"===i.type))}return za(i)}(i[0],i[i.length-1],t??10,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(r=l,l=c,c=r,r=s,s=a,a=r);u-- >0;){if((r=gr(l,c,n))===i)return o[s]=l,o[a]=c,e(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function ol(){var t=il();return t.copy=function(){return el(t,ol())},Wa.apply(t,arguments),rl(t)}function sl(t,e,n){this.k=t,this.x=e,this.y=n}sl.prototype={constructor:sl,scale:function(t){return 1===t?this:new sl(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new sl(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},sl.prototype;const al="cds",ll=7,cl=2.5,ul=3.5,hl={reference:"value",compareTo:"marker"},dl=4,fl={duration:1e3,ease:Ca,zoomLevel:3},pl={"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1},gl={defaultBins:10},ml={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}},yl=24,vl={defaultOffset:4,horizontalOffset:10},_l={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}},bl={height:{[P.GRAPH_VIEW]:32,[P.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},xl=[{type:J.RADIUS,name:"Radius"},{type:J.AREA,name:"Poor area"},{type:J.AREA,name:"Satisfactory area"},{type:J.AREA,name:"Great area"},{type:J.QUARTILE,name:"Quartiles"}],wl={type:U.END_LINE,threshold:16,numCharacter:14},El={code:typeof navigator<"u"&&navigator?.language||"en-US",number:(t,e=navigator?.language||"en-US")=>t?.toLocaleString?.(e),date:(t,e=navigator?.language||"en-US",n={},i=null)=>i||t.toLocaleDateString(e,n),time:(t,e=navigator?.language||"en-US",n={},i=null)=>i||t.toLocaleTimeString(e,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"}}},Tl={enabled:!0,position:H.BOTTOM,clickable:!0,truncation:wl,alignment:$.LEFT,order:null,additionalItems:[]},Sl={enabled:!0,showTotal:!0,truncation:wl,groupLabel:"Group"},Ol={top:{visible:!0,includeZero:!0,truncation:wl},bottom:{visible:!0,includeZero:!0,truncation:wl},left:{visible:!0,includeZero:!0,truncation:wl},right:{visible:!0,includeZero:!0,truncation:wl}},Ml={addSpaceOnEdges:1,showDayName:!1,localeObject:bt,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 Al=!1;try{Al=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(xt){console.warn("Fullscreen capabilities check failed: ",xt.message)}const Cl={width:null,height:null,resizable:!0,theme:R.WHITE,tooltip:Sl,legend:Tl,locale:El,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:K.SHOW_AS_DATATABLE},...Al?[{type:K.MAKE_FULLSCREEN}]:[],{type:K.EXPORT_CSV},{type:K.EXPORT_PNG},{type:K.EXPORT_JPG}]}},Dl=qi({},Cl,{thematic:{projection:nt.geoNaturalEarth1}}),kl=qi({},Cl,{axes:Ol,timeScale:Ml,grid:{x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},ruler:{enabled:!0},zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:P.GRAPH_VIEW}}}),Ll=qi({},kl,{bars:{maxWidth:16,spacingFactor:.25},timeScale:qi(Ml,{addSpaceOnEdges:1})}),Rl=qi({},Ll,{}),Il=qi({},Ll,{}),Nl=qi({},Ll,{bars:qi({},Ll.bars,{dividerSize:1.5})}),Pl=qi({},Ll,{}),Ul=qi({},kl,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),Bl=Ul,Fl=qi({},Ul,{points:{radius:3,filled:!1,enabled:!0}}),Hl=qi({},Fl,{timeScale:qi(Ml,{addSpaceOnEdges:0})}),$l=Hl,zl=qi({},kl,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:t=>{const e=Math.min(t.width,t.height);return[3*e/400,25*e/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:J.RADIUS,name:"Radius"}]}}),Gl=qi({},kl,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:J.AREA,name:"Poor area"},{type:J.AREA,name:"Satisfactory area"},{type:J.AREA,name:"Great area"},{type:J.QUARTILE,name:"Quartiles"}]}}),jl=qi({},Ll,{bars:{dividerSize:1.5},timeScale:qi(Ml,{addSpaceOnEdges:0})}),Vl=qi({},Cl,{tooltip:qi({},Sl,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:t=>{const e=Math.min(t.width,t.height);return[20*e/400,75*e/400]},wordMapsTo:"word"}}),Wl=qi({},Cl,{pie:{labels:{formatter:null,enabled:!0},alignment:$.LEFT,sortFunction:null,valueMapsTo:"value"}}),Yl=qi({},Cl,{legend:{enabled:!1},gauge:{type:Z.SEMI,arcWidth:16,deltaArrow:{size:t=>t/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:t=>t/8,valueFontSize:t=>t/2.5,alignment:$.LEFT}}),Zl=qi({},Wl,{donut:{center:{numberFontSize:t=>`${Math.min(t/100*24,24)}px`,titleFontSize:t=>`${Math.min(t/100*15,15)}px`,titleYPosition:t=>Math.min(t/80*20,20)},alignment:$.LEFT}}),Xl=qi({},Cl,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),ql=qi({},Xl,{legend:{enabled:!0}}),Kl=qi({},Cl,{radar:{axes:{angle:"key",value:"value"},alignment:$.LEFT},tooltip:{gridline:{enabled:!0}}}),Ql=qi({},Ll,{comboChartTypes:[]}),Jl=qi({tree:{type:G.TREE}},Cl,{}),tc=qi({},Cl,{data:qi(Cl.data,{groupMapsTo:"name"})}),ec=qi({},Cl,{circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},{data:qi(Cl.data,{groupMapsTo:"name"})}),nc=qi({},Cl,{alluvial:{data:qi(Cl.data,{groupMapsTo:"source"}),nodeAlignment:$.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),ic=qi({},Cl,{axes:Ol,heatmap:{divider:{state:tt.AUTO},colorLegend:{type:"linear"}}}),rc={alluvialChart:nc,areaChart:Hl,axisChart:kl,boxplotChart:Pl,bubbleChart:zl,bulletChart:Gl,chart:Cl,circlePackChart:ec,choroplethChart:qi({},Dl,{choropleth:{colorLegend:{type:"linear"}}}),comboChart:Ql,donutChart:Zl,gaugeChart:Yl,groupedBarChart:Il,heatmapChart:ic,histogramChart:jl,lineChart:Fl,lollipopChart:Bl,meterChart:Xl,pieChart:Wl,proportionalMeterChart:ql,radarChart:Kl,scatterChart:Ul,simpleBarChart:Rl,stackedAreaChart:$l,stackedBarChart:Nl,thematicChart:Dl,treeChart:Jl,treemapChart:tc,wordCloudChart:Vl};function oc(t){if(!t)return;const e=t.getAttribute("transform").match(/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/);if(!e)return null;if(e[0]){const t=e[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:t[0],ty:t[1]}}return null}function sc(t,e,n){return n>t.length?t:e===U.MID_LINE?t.substr(0,n/2)+"..."+t.substr(-n/2):e===U.FRONT_LINE?"..."+t.substr(-n):e===U.END_LINE?t.substr(0,n)+"...":void 0}function ac(t,e){const n=lc(t,"legend","additionalItems"),i=lc(e,"legend","additionalItems");if(n&&i){const r=i.map(t=>t.type),o=n.map(t=>t.type),s=xl.filter(t=>o.includes(t.type)&&!r.includes(t.type));t.legend.additionalItems=s,e.legend.additionalItems=Ji(s,i,"name")}}const lc=(t,...e)=>{let n=t;if(n){for(const t of e){if(null===n[t]||void 0===n[t])return null;n=n[t]}return n}return null},cc=(t,e)=>e===B.HORIZONTAL?{y0:t.x0,y1:t.x1,x0:t.y0,x1:t.y1}:t,uc=(t,e)=>{const{x0:n,x1:i,y0:r,y1:o}=cc(t,e);return`M${n},${r}L${n},${o}L${i},${o}L${i},${r}L${n},${r}`};function hc(t,e,n){return n===B.VERTICAL?[t,e]:[e,t]}function dc(t){const e=pt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function fc(t,e){const n=pt(t,e?.in);return n.setHours(0,0,0,0),n}function pc(t,e,n){const[i,r]=ht(0,t,e),o=fc(i),s=fc(r),a=+o-dc(o),l=+s-dc(s);return Math.round((a-l)/864e5)}function gc(t,e){return gt(t,{...e,weekStartsOn:1})}function mc(t,e){const n=pt(t,e?.in),i=n.getFullYear(),r=ut(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const o=gc(r),s=ut(n,0);s.setFullYear(i,0,4),s.setHours(0,0,0,0);const a=gc(s);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function yc(t,e){const n=pt(t,e?.in),i=n.getFullYear(),r=ft(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=ut(e?.in||t,0);s.setFullYear(i+1,0,o),s.setHours(0,0,0,0);const a=gt(s,e),l=ut(e?.in||t,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=gt(l,e);return+n>=+a?i+1:+n>=+c?i:i-1}function vc(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const _c={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return vc("yy"===e?i%100:i,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):vc(n+1,2)},d:(t,e)=>vc(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>vc(t.getHours()%12||12,e.length),H:(t,e)=>vc(t.getHours(),e.length),m:(t,e)=>vc(t.getMinutes(),e.length),s:(t,e)=>vc(t.getSeconds(),e.length),S(t,e){const n=e.length,i=t.getMilliseconds();return vc(Math.trunc(i*Math.pow(10,n-3)),e.length)}},bc={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),i=e>0?e:1-e;return n.ordinalNumber(i,{unit:"year"})}return _c.y(t,e)},Y:function(t,e,n,i){const r=yc(t,i),o=r>0?r:1-r;return"YY"===e?vc(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):vc(o,e.length)},R:function(t,e){return vc(mc(t),e.length)},u:function(t,e){return vc(t.getFullYear(),e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return vc(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return vc(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return _c.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return vc(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const r=function(t,e){const n=pt(t,e?.in),i=+gt(n,e)-+function(t,e){const n=ft(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=yc(t,e),o=ut(e?.in||t,0);return o.setFullYear(r,0,i),o.setHours(0,0,0,0),gt(o,e)}(n,e);return Math.round(i/at)+1}(t,i);return"wo"===e?n.ordinalNumber(r,{unit:"week"}):vc(r,e.length)},I:function(t,e,n){const i=function(t,e){const n=pt(t,e?.in),i=+gc(n)-+function(t){const e=mc(t,void 0),n=ut(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),gc(n)}(n);return Math.round(i/at)+1}(t);return"Io"===e?n.ordinalNumber(i,{unit:"week"}):vc(i,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):_c.d(t,e)},D:function(t,e,n){const i=function(t,e){const n=pt(t,e?.in);return pc(n,function(t){const e=pt(t,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}(n))+1}(t);return"Do"===e?n.ordinalNumber(i,{unit:"dayOfYear"}):vc(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":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"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return vc(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});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"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return vc(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),r=0===i?7:i;switch(e){case"i":return String(r);case"ii":return vc(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let r;switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let r;switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return _c.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):_c.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return"Ko"===e?n.ordinalNumber(i,{unit:"hour"}):vc(i,e.length)},k:function(t,e,n){let i=t.getHours();return 0===i&&(i=24),"ko"===e?n.ordinalNumber(i,{unit:"hour"}):vc(i,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):_c.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):_c.s(t,e)},S:function(t,e){return _c.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return wc(i);case"XXXX":case"XX":return Ec(i);default:return Ec(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return wc(i);case"xxxx":case"xx":return Ec(i);default:return Ec(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+xc(i,":");default:return"GMT"+Ec(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+xc(i,":");default:return"GMT"+Ec(i,":")}},t:function(t,e,n){return vc(Math.trunc(+t/1e3),e.length)},T:function(t,e,n){return vc(+t,e.length)}};function xc(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=Math.trunc(i/60),o=i%60;return 0===o?n+String(r):n+String(r)+e+vc(o,2)}function wc(t,e){return t%60==0?(t>0?"-":"+")+vc(Math.abs(t)/60,2):Ec(t,e)}function Ec(t,e=""){const n=t>0?"-":"+",i=Math.abs(t);return n+vc(Math.trunc(i/60),2)+e+vc(i%60,2)}const Tc=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Sc=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Oc={p:Sc,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Tc(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",Tc(i,e)).replace("{{time}}",Sc(r,e))}},Mc=/^D+$/,Ac=/^Y+$/,Cc=["D","DD","YY","YYYY"];const Dc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Lc=/^'([^]*?)'?$/,Rc=/''/g,Ic=/[a-zA-Z]/;function Nc(t,e,n){const i=ft(),r=n?.locale??i.locale??bt,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=pt(t,n?.in);if(!function(t){return!(!function(t){return t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t||isNaN(+pt(t)))}(a))throw new RangeError("Invalid time value");let l=e.match(kc).map(t=>{const e=t[0];return"p"===e||"P"===e?(0,Oc[e])(t,r.formatLong):t}).join("").match(Dc).map(t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Pc(t)};if(bc[e])return{isToken:!0,value:t};if(e.match(Ic))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:r};return l.map(i=>{if(!i.isToken)return i.value;const o=i.value;return(!n?.useAdditionalWeekYearTokens&&function(t){return Ac.test(t)}(o)||!n?.useAdditionalDayOfYearTokens&&function(t){return Mc.test(t)}(o))&&function(t,e,n){const i=function(t,e,n){const i="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,n);if(console.warn(i),Cc.includes(t))throw new RangeError(i)}(o,e,String(t)),(0,bc[o[0]])(a,o,r.localize,c)}).join("")}function Pc(t){const e=t.match(Lc);return e?e[1].replace(Rc,"'"):t}const Uc=[["15seconds",15e3],["minute",6e4],["30minutes",18e5],["hourly",36e5],["daily",864e5],["monthly",2592e6],["quarterly",7776e6],["yearly",31104e6]];function Bc(t,e,n,i,r){const o=0===e,s=2===Number(Nc(new Date(t),"c")),a=1===Number(Nc(new Date(t),"q")),l=0!==e?n[e-1]:null;switch(i){case"15seconds":case"minute":case"30minutes":case"hourly":return o||function(t){const{s:e,m:n,H:i}=Hc(t);return 0===i&&0===n&&0===e}(t)||zc(t,l)||Gc(t);case"daily":return r?o||s||Gc(t):o||zc(t,l)||Gc(t);case"weekly":return o||s||Gc(t);case"monthly":return o||Gc(t);case"quarterly":return o||a;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function Fc(t,e,n,i,r,o){const s=r.showDayName,a="daily"===i&&s?"weekly":i,l=new Date(t),c=lc(r,"timeIntervalFormats")[a],u=lc(c,"primary"),h=lc(c,"secondary"),d=Bc(t,e,n,i,s);let f=d?u:h;"15seconds"===i&&0!==l.getMilliseconds()&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=r.localeObject,{code:g,optionsObject:m}=o,y=m[i].type,v=m[i][d?"primary":"secondary"][f];if("quarterly"!==i&&v)return o[y](l,g,v);{const t=Nc(l,f,{locale:p}).split("").map(t=>{const e=Number(t);return" "===t||Number.isNaN(e)?t:e?.toLocaleString?.(g)});return o[y](l,g,{},t.join(""))}}function Hc(t){const e=new Date(t);return{M:e.getMonth()+1,d:e.getDate(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}function $c(t,e){if(it[e])return e;if(1===t.length)return"15seconds";const n=function(t){if(t)return t.slice(1).map((e,n)=>e-t[n])}(t);return function(t){const e=Uc.reduce((e,[,n],i)=>{const r=Uc[e][1];return Math.abs(r-t)<Math.abs(n-t)?e:i},0);return Uc[e][0]}(function(t){let e;for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);return e}(n))}function zc(t,e){return Hc(t).M!==Hc(e).M}function Gc(t){const{M:e,d:n,s:i,m:r,H:o}=Hc(t);return 1===e&&1===n&&0===o&&0===r&&0===i}function jc(t){return void 0===t?"":t.toISOString()}var Vc=(t=>(t.GRAPHICS_DOCUMENT="graphics-document",t.GRAPHICS_OBJECT="graphics-object",t.GRAPHICS_SYMBOL="graphics-symbol",t.GROUP="group",t.DOCUMENT="document",t.CHECKBOX="checkbox",t.BUTTON="button",t.MENU="menu",t.MENU_ITEM="menuitem",t.IMG="img",t))(Vc||{}),Wc=function(t,e){if(null==t)return t;if(!we(t))return function(t,e){return t&&Gi(t,e,Ze)}(t,e);for(var n=t.length,i=-1,r=Object(t);++i<n&&!1!==e(r[i],i,r););return t};function Yc(t){return function(){return t}}function Zc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Xc(t,e,n,i){for(var r=-1,o=null==t?0:t.length;++r<o;){var s=t[r];e(i,s,n(s),t)}return i}function qc(t,e,n,i){return Wc(t,function(t,r,o){e(i,t,n(t),o)}),i}Array.prototype.slice;var Kc=Object.prototype.hasOwnProperty,Qc=function(t){return function(e,n){return(Pt(e)?Xc:qc)(e,t,zi(n),{})}}(function(t,e,n){Kc.call(t,n)?t[n].push(e):fe(t,n,[e])});function Jc(t){return t}var tu=Array.prototype.slice;function eu(t){return()=>t}function nu(t){return Math.max(1,Math.ceil(Math.log(function(t){let e=0;for(let n of t)null!=n&&(n=+n)>=n&&++e;return e}(t))/Math.LN2)+1)}function iu(t,e){if((r=t.length)>1)for(var n,i,r,o=1,s=t[e[0]],a=s.length;o<r;++o)for(i=s,s=t[e[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function ru(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function ou(t,e){return t[e]}function su(t){const e=[];return e.key=t,e}function au(){var t=Yc([]),e=ru,n=iu,i=ou;function r(r){var o,s,a=Array.from(t.apply(this,arguments),su),l=a.length,c=-1;for(const t of r)for(o=0,++c;o<l;++o)(a[o][c]=[0,+i(t,a[o].key,c,r)]).data=t;for(o=0,s=Zc(e(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Yc(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Yc(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?ru:"function"==typeof t?t:Yc(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=t??iu,r):n},r}function lu(t,e){if((a=t.length)>0)for(var n,i,r,o,s,a,l=0,c=t[e[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(r=(i=t[e[n]][l])[1]-i[0])>0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=s,i[0]=s+=r):(i[0]=0,i[1]=r)}class cu{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:e}){const n=this.getOptions(),{code:i,date:r,number:o}=lc(n,"locale"),s=lc(n,"tabularRepModal","tableHeadingFormatter"),a=lc(n,"tabularRepModal","tableCellFormatter"),{cartesianScales:l}=this.services,c=l?.getDomainAxisScaleType();let u;return c===F.TIME&&(u=t=>r(t,i,{month:"short",day:"numeric",year:"numeric"})),["function"==typeof s?s(t):t,..."function"==typeof a?a(e):e.map(t=>{u&&(t[1]=u(t[1]));for(const e in t){const n=t[e];"number"==typeof n&&(t[e]=o(n,i))}return t})]}getAllDataFromDomain(t){if(!this.getData())return null;const e=this.getOptions();let n=this.getData();const i=this.getDataGroups(),{groupMapsTo:r}=lc(e,"data"),o=lc(e,"axes");return t&&(n=n.filter(e=>t.includes(e[r]))),o&&Object.keys(o).forEach(t=>{const e=o[t].mapsTo,i=o[t].scaleType;if((i===F.LINEAR||i===F.LOG)&&(n=n.map(t=>({...t,[e]:null===t[e]?t[e]:Number(t[e])}))),e&&o[t].domain)if(i===F.LABELS)n=n.filter(n=>o[t].domain.includes(n[e]));else{const[i,r]=o[t].domain;n=n.filter(t=>!(e in t)||t[e]>=i&&t[e]<=r)}}),n.filter(t=>i.find(e=>e.name===t[r]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:e}=ml.items.status,n=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(t=>n.find(n=>n.name===t[i]&&n.status===e))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const e=this.sanitize(Ti(t)),n=this.generateDataGroups(e);return this.set({data:e,dataGroups:n}),e}getDataGroups(t){return lc(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(e=>t.includes(e.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:e}=ml.items.status;return this.getDataGroups(t).filter(t=>t.status===e)}getDataGroupNames(t){return this.getDataGroups(t).map(t=>t.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(t=>t.name)}aggregateBinDataByGroup(t){return Qc(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),e=this.getOptions(),n=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),r=e.axes[n],{groupMapsTo:o}=e.data,{bins:s=gl.defaultBins}=r,a=Array.isArray(s),l=function(){var t=Jc,e=sr,n=nu;function i(i){Array.isArray(i)||(i=Array.from(i));var r,o,s,a=i.length,l=new Array(a);for(r=0;r<a;++r)l[r]=t(i[r],r,i);var c=e(l),u=c[0],h=c[1],d=n(l,u,h);if(!Array.isArray(d)){const t=h,n=+d;if(e===sr&&([u,h]=function(t,e,n){let i;for(;;){const r=gr(t,e,n);if(r===i||0===r||!isFinite(r))return[t,e];r>0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}(u,h,n)),(d=pr(u,h,n))[0]<=u&&(s=gr(u,h,n)),d[d.length-1]>=h)if(t>=h&&e===sr){const t=gr(u,h,n);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else d.pop()}for(var f=d.length,p=0,g=f;d[p]<=u;)++p;for(;d[g-1]>h;)--g;(p||g<f)&&(d=d.slice(p,g),f=g-p);var m,y=new Array(f+1);for(r=0;r<=f;++r)(m=y[r]=[]).x0=r>0?d[r-1]:u,m.x1=r<f?d[r]:h;if(isFinite(s)){if(s>0)for(r=0;r<a;++r)null!=(o=l[r])&&u<=o&&o<=h&&y[Math.min(f,Math.floor((o-u)/s))].push(i[r]);else if(s<0)for(r=0;r<a;++r)if(null!=(o=l[r])&&u<=o&&o<=h){const t=Math.floor((u-o)*s);y[Math.min(f,t+(d[t]<=o))].push(i[r])}}else for(r=0;r<a;++r)null!=(o=l[r])&&u<=o&&o<=h&&y[or(d,o,0,f)].push(i[r]);return y}return i.value=function(e){return arguments.length?(t="function"==typeof e?e:eu(e),i):t},i.domain=function(t){return arguments.length?(e="function"==typeof t?t:eu([t[0],t[1]]),i):e},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:eu(Array.isArray(t)?tu.call(t):t),i):n},i}().value(t=>t[i]).thresholds(s)(t);if(a)l[l.length-1].x1=s[s.length-1];else{const t=l[0].x1-l[0].x0;l[l.length-1].x1=+l[l.length-1].x0+t}const c=a?[s[0],s[s.length-1]]:[l[0].x0,l[l.length-1].x1],u=Array.from(new Set(t.map(t=>t[o]))),h=[];return l.forEach(t=>{const e=`${t.x0}-${t.x1}`,n=this.aggregateBinDataByGroup(t);u.forEach(i=>{h.push({group:i,key:e,value:n[i]||0,bin:t.x0})})}),{bins:l,binsDomain:c}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:e}=t.data,n=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:i});return au().keys(n)(r).map((t,i)=>Object.keys(t).filter(t=>!isNaN(t)).map(r=>{const o=t[r];return o[e]=n[i],o}))}getGroupedData(t){const e=this.getDisplayData(t),n={},{groupMapsTo:i}=this.getOptions().data;return e.map(t=>{const e=t[i];null!==n[e]&&void 0!==n[e]?n[e].push(t):n[e]=[t]}),Object.keys(n).map(t=>({name:t,data:n[t]}))}getStackKeys({bins:t=null,groups:e=null}={bins:null,groups:null}){const n=this.getOptions(),i=this.getDisplayData(e);let r;r=t?t.map(t=>`${t.x0}:${t.x1}`):tr(i.map(t=>{const e=this.services.cartesianScales.getDomainIdentifier(t);return t[e]instanceof Date?jc(t[e]):t[e]&&"function"==typeof t[e].toString?t[e].toString():t[e]}));const o=this.services.cartesianScales.domainAxisPosition,s=n.axes[o].scaleType;return s===F.TIME?r.sort((t,e)=>new Date(t)-new Date(e)):(s===F.LOG||s===F.LINEAR)&&r.sort((t,e)=>t-e),r}getDataValuesGroupedByKeys({bins:t=null,groups:e=null}){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getDisplayData(e),o=this.getDataGroupNames(),s=this.getStackKeys({bins:t,groups:e});return t?s.map(e=>{const[n,r]=e.split(":"),s={x0:n,x1:r},a=t.find(t=>t.x0.toString()===n.toString());return o.forEach(t=>{s[t]=a.filter(e=>e[i]===t).length}),s}):s.map(t=>{const e={sharedStackKey:t};return o.forEach(n=>{const o=r.find(e=>{const r=this.services.cartesianScales.getDomainIdentifier(e);return e[i]===n&&Object.prototype.hasOwnProperty.call(e,r)&&(e[r]instanceof Date?jc(e[r])===t:e[r].toString()===t)}),s=this.services.cartesianScales.getRangeIdentifier(e);e[n]=o?o[s]:null}),e})}getStackedData({percentage:t=!1,groups:e=null,divergent:n=!1}){const i=this.getOptions(),{groupMapsTo:r}=i.data,o=this.getActiveDataGroupNames(e),s=this.getDataValuesGroupedByKeys({groups:e});if(t){const t=function(t){for(var e=-1,n=null==t?0:t.length,i={};++e<n;){var r=t[e];i[r[0]]=r[1]}return i}(s.map(t=>[t.sharedStackKey,0]));s.forEach(e=>{o.forEach(n=>{t[e.sharedStackKey]+=e[n]})}),s.forEach(e=>{o.forEach(n=>{const i=t[e.sharedStackKey];t[e.sharedStackKey]?e[n]=e[n]/i*100:e[n]=0})})}return(n?au().offset(lu):au()).keys(o)(s).map((t,e)=>Object.keys(t).filter(t=>!isNaN(t)).map(n=>{const i=t[n];return i[r]=o[e],i}))}getOptions(){return this.state.options}set(t,e){this.state=Object.assign({},this.state,t);const n=Object.assign({skipUpdate:!1,animate:!0},e);n.skipUpdate||this.update(n.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const e=this.getOptions();ac(e,t),this.set({options:qi(e,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(k.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:e,DISABLED:n}=ml.items.status,i=this.getDataGroups(),r=i.some(t=>t.status===n),o=i.filter(t=>t.status===e);if(r)if(1===o.length&&o[0].name===t)i.forEach((t,n)=>{i[n].status=e});else{const r=i.findIndex(e=>e.name===t);i[r].status=i[r].status===n?e:n}else i.forEach((r,o)=>{i[o].status=r.name===t?e:n});const s=i.filter(t=>t.status===e),a=this.getOptions();i.some(t=>t.status===n)?a.data.selectedGroups=s.map(t=>t.name):a.data.selectedGroups=[],this.services.events.dispatchEvent(k.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,e,n,i){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(t,e,n,i):i}getFillColor(t,e,n){const i=this.getOptions(),r=lc(this.colorScale,t);return i.getFillColor?i.getFillColor(t,e,n,r):r}getStrokeColor(t,e,n){const i=this.getOptions(),r=lc(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,e,n,r):r}isUserProvidedColorScaleValid(){const t=lc(this.getOptions(),"color","scale"),e=this.getDataGroups();return null!=t&&0!=Object.keys(t).length&&e.some(e=>Object.keys(t).includes(e.name))}getColorClassName(t){const e=this.colorClassNames(t.dataGroupName);let n=t.originalClassName;return t.classNameTypes.forEach(i=>n=t.originalClassName?`${n} ${i}-${e}`:`${i}-${e}`),n||""}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 e=[],{datasets:n,labels:i}=t;return n.forEach(t=>{t.data.forEach((n,r)=>{let o;const s=lc(t,"label");if(null===s){o=lc(i,r)||"Ungrouped"}else o=s;const a={group:o,key:i[r]};isNaN(n)?(a.value=n.value,a.date=n.date):a.value=n,e.push(a)})}),e}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(t=>t.map(t=>`"${("&ndash;"===t?"–":t).split(/[,;'"`]/).map(t=>function(t){const e=t.trim();return["=","+","-","@","\t","\r"].includes(e.charAt(0))?` ${e}`:/[,\"\n]/.test(e)?`"${e}"`:e}(t)).join("")}"`)).map(t=>t.join(",")).join("\n"),e=this.getOptions();let n="myChart";const i=lc(e,"fileDownload","fileName");"function"==typeof i?n=i("csv"):"string"==typeof i&&(n=i),this.services.files.downloadCSV(t,`${n}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return this.getTabularData(t)}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{-1===this.allDataGroups.indexOf(t)&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:e}=this.getOptions().data,{ACTIVE:n,DISABLED:i}=ml.items.status,r=this.getOptions(),o=tr(t.map(t=>t[e]));r.data.selectedGroups.length&&(r.data.selectedGroups.every(t=>o.includes(t))||(r.data.selectedGroups=[]));const s=t=>!r.data.selectedGroups.length||r.data.selectedGroups.includes(t)?n:i;return o.map(t=>({name:t,status:s(t)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),e=lc(t,"color","scale");Object.keys(e).forEach(t=>{this.allDataGroups.includes(t)||console.warn(`"${t}" does not exist in data groups.`)}),this.allDataGroups.filter(t=>e[t]).forEach(t=>this.colorScale[t]=e[t])}setColorClassNames(){const t=lc(this.getOptions(),"color","pairing");let e=lc(t,"numberOfVariants");(!e||e<this.allDataGroups.length)&&(e=this.allDataGroups.length);let n=lc(t,"option");const i=e>5?14:e;n=n<=pl[`${i}-color`]?n:1;const r=this.allDataGroups.map((t,e)=>`${i}-${n}-${e%14+1}`);this.colorClassNames=Za().range(r).domain(this.allDataGroups)}}class uu extends cu{constructor(t){super(t),this.axisFlavor=et.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,e=this.getOptions(),n=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return n&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(n=>{const r=i[n];t.scales[r]?i[n]={position:r,label:t.getScaleLabel(r),identifier:lc(e,"axes",r,"mapsTo")}:i[n]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:n}=e.data,{primaryDomain:i,primaryRange:r,secondaryDomain:o,secondaryRange:s}=this.assignRangeAndDomains(),{number:a,code:l}=lc(this.getOptions(),"locale"),c=["Group",i.label,r.label,...o?[o.label]:[],...s?[s.label]:[]],u=t.map(t=>[t[n],null===t[i.identifier]?"&ndash;":t[i.identifier],null===t[r.identifier]||isNaN(t[r.identifier])?"&ndash;":a(t[r.identifier],l),...o?[null===t[o.identifier]?"&ndash;":t[o.identifier]]:[],...s?[null===t[s.identifier]||isNaN(t[s.identifier])?"&ndash;":t[s.identifier]]:[]]);return super.formatTable({headers:c,cells:u})}setData(t){let e;if(t&&(e=super.setData(t),lc(this.getOptions(),"zoomBar",N.TOP,"enabled"))){const t=lc(this.getOptions(),"zoomBar",N.TOP,"data");this.setZoomBarData(t)}return e}setZoomBarData(t){const e=t?this.sanitize(Ti(t)):this.getDisplayData();let n=e;const{cartesianScales:i}=this.services;if(e&&i.domainAxisPosition&&i.rangeAxisPosition){const t=i.getDomainIdentifier(),r=i.getRangeIdentifier();let o=e.map(e=>e[t].getTime());o=tr(o).sort(),n=o.map(n=>{let i=0;const o={};return e.forEach(e=>{e[t].getTime()===n&&(i+=e[r])}),o[t]=new Date(n),o[r]=i,o})}this.set({zoomBarData:n})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const e=this.getOptions();if(!e.axes)return t;const n=[];return Object.keys(N).forEach(t=>{const i=N[t],r=e.axes[i];if(r&&r.scaleType===F.TIME){const t=r.mapsTo;(null!==t||void 0!==t)&&n.push(t)}}),n.length>0&&t.forEach(t=>{n.forEach(e=>{null===lc(t,e,"getTime")&&(t[e]=new Date(t[e]))})}),t}sanitize(t){return t=super.sanitize(t),this.sanitizeDateValues(t)}}var hu=/\s/,du=/^\s+/;var fu=/^[-+]0x[0-9a-f]+$/i,pu=/^0b[01]+$/i,gu=/^0o[0-7]+$/i,mu=parseInt;function yu(t){if("number"==typeof t)return t;if(It(t))return NaN;if(Ht(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ht(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=function(t){return t&&t.slice(0,function(t){for(var e=t.length;e--&&hu.test(t.charAt(e)););return e}(t)+1).replace(du,"")}(t);var n=pu.test(t);return n||gu.test(t)?mu(t.slice(2),n?2:8):fu.test(t)?NaN:+t}var vu=function(){return Tt.Date.now()},_u=Math.max,bu=Math.min;function xu(t){return"string"==typeof t?new Ro([[document.querySelector(t)]],[document.documentElement]):new Ro([[t]],Lo)}function wu(){var t,e,n=Za().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;t=(f-d)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),a&&(d=Math.round(d),e=Math.round(e));var p=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}(n).map(function(e){return d+t*e});return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return wu(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},Wa.apply(h(),arguments)}function Eu(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],s=t[r];return s<o&&(n=i,i=r,r=n,n=o,o=s,s=n),t[i]=e.floor(o),t[r]=e.ceil(s),t}const Tu=new Date,Su=new Date;function Ou(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<i);return s},r.filter=n=>Ou(e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},(t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}),n&&(r.count=(e,i)=>(Tu.setTime(+e),Su.setTime(+i),t(Tu),t(Su),Math.floor(n(Tu,Su))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t===0:e=>r.count(0,e)%t===0):r:null)),r}const Mu=Ou(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Mu.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Ou(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Mu:null),Mu.range;const Au=1e3,Cu=6e4,Du=60*Cu,ku=24*Du,Lu=7*ku,Ru=30*ku,Iu=365*ku,Nu=Ou(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Au)},(t,e)=>(e-t)/Au,t=>t.getUTCSeconds());Nu.range;const Pu=Ou(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Au)},(t,e)=>{t.setTime(+t+e*Cu)},(t,e)=>(e-t)/Cu,t=>t.getMinutes());Pu.range;const Uu=Ou(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Cu)},(t,e)=>(e-t)/Cu,t=>t.getUTCMinutes());Uu.range;const Bu=Ou(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Au-t.getMinutes()*Cu)},(t,e)=>{t.setTime(+t+e*Du)},(t,e)=>(e-t)/Du,t=>t.getHours());Bu.range;const Fu=Ou(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Du)},(t,e)=>(e-t)/Du,t=>t.getUTCHours());Fu.range;const Hu=Ou(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Cu)/ku,t=>t.getDate()-1);Hu.range;const $u=Ou(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ku,t=>t.getUTCDate()-1);$u.range;const zu=Ou(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ku,t=>Math.floor(t/ku));function Gu(t){return Ou(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Cu)/Lu)}zu.range;const ju=Gu(0),Vu=Gu(1),Wu=Gu(2),Yu=Gu(3),Zu=Gu(4),Xu=Gu(5),qu=Gu(6);function Ku(t){return Ou(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/Lu)}ju.range,Vu.range,Wu.range,Yu.range,Zu.range,Xu.range,qu.range;const Qu=Ku(0),Ju=Ku(1),th=Ku(2),eh=Ku(3),nh=Ku(4),ih=Ku(5),rh=Ku(6);Qu.range,Ju.range,th.range,eh.range,nh.range,ih.range,rh.range;const oh=Ou(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()),t=>t.getMonth());oh.range;const sh=Ou(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear()),t=>t.getUTCMonth());sh.range;const ah=Ou(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ah.every=t=>isFinite(t=Math.floor(t))&&t>0?Ou(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)}):null,ah.range;const lh=Ou(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());lh.every=t=>isFinite(t=Math.floor(t))&&t>0?Ou(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null,lh.range;const[ch,uh]=function(t,e,n,i,r,o){const s=[[Nu,1,Au],[Nu,5,5e3],[Nu,15,15e3],[Nu,30,3e4],[o,1,Cu],[o,5,5*Cu],[o,15,15*Cu],[o,30,30*Cu],[r,1,Du],[r,3,3*Du],[r,6,6*Du],[r,12,12*Du],[i,1,ku],[i,2,2*ku],[n,1,Lu],[e,1,Ru],[e,3,3*Ru],[t,1,Iu]];function a(e,n,i){const r=Math.abs(n-e)/i,o=ir(([,,t])=>t).right(s,r);if(o===s.length)return t.every(mr(e/Iu,n/Iu,i));if(0===o)return Mu.every(Math.max(mr(e,n,i),1));const[a,l]=s[r/s[o-1][2]<s[o][2]/r?o-1:o];return a.every(l)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:a(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},a]}(ah,oh,ju,Hu,Bu,Pu);function hh(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function dh(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function fh(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var ph,gh,mh={"-":"",_:" ",0:"0"},yh=/^\s*\d+/,vh=/^%/,_h=/[\\^$*+?|[\]().{}]/g;function bh(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function xh(t){return t.replace(_h,"\\$&")}function wh(t){return new RegExp("^(?:"+t.map(xh).join("|")+")","i")}function Eh(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function Th(t,e,n){var i=yh.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Sh(t,e,n){var i=yh.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Oh(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Mh(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Ah(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Ch(t,e,n){var i=yh.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Dh(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function kh(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Lh(t,e,n){var i=yh.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Rh(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Ih(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Nh(t,e,n){var i=yh.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Ph(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Uh(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Bh(t,e,n){var i=yh.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Fh(t,e,n){var i=yh.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Hh(t,e,n){var i=yh.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function $h(t,e,n){var i=vh.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function zh(t,e,n){var i=yh.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Gh(t,e,n){var i=yh.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function jh(t,e){return bh(t.getDate(),e,2)}function Vh(t,e){return bh(t.getHours(),e,2)}function Wh(t,e){return bh(t.getHours()%12||12,e,2)}function Yh(t,e){return bh(1+Hu.count(ah(t),t),e,3)}function Zh(t,e){return bh(t.getMilliseconds(),e,3)}function Xh(t,e){return Zh(t,e)+"000"}function qh(t,e){return bh(t.getMonth()+1,e,2)}function Kh(t,e){return bh(t.getMinutes(),e,2)}function Qh(t,e){return bh(t.getSeconds(),e,2)}function Jh(t){var e=t.getDay();return 0===e?7:e}function td(t,e){return bh(ju.count(ah(t)-1,t),e,2)}function ed(t){var e=t.getDay();return e>=4||0===e?Zu(t):Zu.ceil(t)}function nd(t,e){return t=ed(t),bh(Zu.count(ah(t),t)+(4===ah(t).getDay()),e,2)}function id(t){return t.getDay()}function rd(t,e){return bh(Vu.count(ah(t)-1,t),e,2)}function od(t,e){return bh(t.getFullYear()%100,e,2)}function sd(t,e){return bh((t=ed(t)).getFullYear()%100,e,2)}function ad(t,e){return bh(t.getFullYear()%1e4,e,4)}function ld(t,e){var n=t.getDay();return bh((t=n>=4||0===n?Zu(t):Zu.ceil(t)).getFullYear()%1e4,e,4)}function cd(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+bh(e/60|0,"0",2)+bh(e%60,"0",2)}function ud(t,e){return bh(t.getUTCDate(),e,2)}function hd(t,e){return bh(t.getUTCHours(),e,2)}function dd(t,e){return bh(t.getUTCHours()%12||12,e,2)}function fd(t,e){return bh(1+$u.count(lh(t),t),e,3)}function pd(t,e){return bh(t.getUTCMilliseconds(),e,3)}function gd(t,e){return pd(t,e)+"000"}function md(t,e){return bh(t.getUTCMonth()+1,e,2)}function yd(t,e){return bh(t.getUTCMinutes(),e,2)}function vd(t,e){return bh(t.getUTCSeconds(),e,2)}function _d(t){var e=t.getUTCDay();return 0===e?7:e}function bd(t,e){return bh(Qu.count(lh(t)-1,t),e,2)}function xd(t){var e=t.getUTCDay();return e>=4||0===e?nh(t):nh.ceil(t)}function wd(t,e){return t=xd(t),bh(nh.count(lh(t),t)+(4===lh(t).getUTCDay()),e,2)}function Ed(t){return t.getUTCDay()}function Td(t,e){return bh(Ju.count(lh(t)-1,t),e,2)}function Sd(t,e){return bh(t.getUTCFullYear()%100,e,2)}function Od(t,e){return bh((t=xd(t)).getUTCFullYear()%100,e,2)}function Md(t,e){return bh(t.getUTCFullYear()%1e4,e,4)}function Ad(t,e){var n=t.getUTCDay();return bh((t=n>=4||0===n?nh(t):nh.ceil(t)).getUTCFullYear()%1e4,e,4)}function Cd(){return"+0000"}function Dd(){return"%"}function kd(t){return+t}function Ld(t){return Math.floor(+t/1e3)}function Rd(t){return new Date(t)}function Id(t){return t instanceof Date?+t:+new Date(+t)}function Nd(t,e,n,i,r,o,s,a,l,c){var u=il(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),_=c("%B"),b=c("%Y");function x(t){return(l(t)<t?f:a(t)<t?p:s(t)<t?g:o(t)<t?m:i(t)<t?r(t)<t?y:v:n(t)<t?_:b)(t)}return u.invert=function(t){return new Date(h(t))},u.domain=function(t){return arguments.length?d(Array.from(t,Id)):d().map(Rd)},u.ticks=function(e){var n=d();return t(n[0],n[n.length-1],e??10)},u.tickFormat=function(t,e){return null==e?x:c(e)},u.nice=function(t){var n=d();return(!t||"function"!=typeof t.range)&&(t=e(n[0],n[n.length-1],t??10)),t?d(Eu(n,t)):u},u.copy=function(){return el(u,Nd(t,e,n,i,r,o,s,a,l,c))},u}function Pd(){return Wa.apply(Nd(ch,uh,ah,oh,ju,Hu,Bu,Pu,Nu,gh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}ph=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,c=wh(r),u=Eh(r),h=wh(o),d=Eh(o),f=wh(s),p=Eh(s),g=wh(a),m=Eh(a),y=wh(l),v=Eh(l),_={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:jh,e:jh,f:Xh,g:sd,G:ld,H:Vh,I:Wh,j:Yh,L:Zh,m:qh,M:Kh,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:kd,s:Ld,S:Qh,u:Jh,U:td,V:nd,w:id,W:rd,x:null,X:null,y:od,Y:ad,Z:cd,"%":Dd},b={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:ud,e:ud,f:gd,g:Od,G:Ad,H:hd,I:dd,j:fd,L:pd,m:md,M:yd,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:kd,s:Ld,S:vd,u:_d,U:bd,V:wd,w:Ed,W:Td,x:null,X:null,y:Sd,Y:Md,Z:Cd,"%":Dd},x={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return T(t,e,n,i)},d:Ih,e:Ih,f:Hh,g:Dh,G:Ch,H:Ph,I:Ph,j:Nh,L:Fh,m:Rh,M:Uh,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Lh,Q:zh,s:Gh,S:Bh,u:Sh,U:Oh,V:Mh,w:Th,W:Ah,x:function(t,e,i){return T(t,n,e,i)},X:function(t,e,n){return T(t,i,e,n)},y:Dh,Y:Ch,Z:kh,"%":$h};function w(t,e){return function(n){var i,r,o,s=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===t.charCodeAt(a)&&(s.push(t.slice(l,a)),null!=(r=mh[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(t.slice(l,a)),s.join("")}}function E(t,e){return function(n){var i,r,o=fh(1900,void 0,1);if(T(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=dh(fh(o.y,0,1))).getUTCDay(),i=r>4||0===r?Ju.ceil(i):Ju(i),i=$u.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=hh(fh(o.y,0,1))).getDay(),i=r>4||0===r?Vu.ceil(i):Vu(i),i=Hu.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?dh(fh(o.y,0,1)).getUTCDay():hh(fh(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,dh(o)):hh(o)}}function T(t,e,n,i){for(var r,o,s=0,a=e.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(o=x[r in mh?e.charAt(s++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return _.x=w(n,_),_.X=w(i,_),_.c=w(e,_),b.x=w(n,b),b.X=w(i,b),b.c=w(e,b),{format:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=E(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=E(t+="",!0);return e.toString=function(){return t},e}}}({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"]}),gh=ph.format,ph.parse,ph.utcFormat,ph.utcParse;const Ud=Math.abs,Bd=Math.atan2,Fd=Math.cos,Hd=Math.max,$d=Math.min,zd=Math.sin,Gd=Math.sqrt,jd=1e-12,Vd=Math.PI,Wd=Vd/2,Yd=2*Vd;function Zd(t){return t>=1?Wd:t<=-1?-Wd:Math.asin(t)}function Xd(t){this._context=t}function qd(t){return new Xd(t)}function Kd(){}function Qd(t){this._context=t}function Jd(t){return new Qd(t)}Xd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},Qd.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};const tf=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function ef(t){const e=[];for(let n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function nf(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function rf(t,e={}){const n=e.width||function(t){const e=nf(t,"border-left-width"),n=nf(t,"border-right-width");return t.clientWidth+e+n}(t),i=e.height||function(t){const e=nf(t,"border-top-width"),n=nf(t,"border-bottom-width");return t.clientHeight+e+n}(t);return{width:n,height:i}}const of=16384;function sf(t){return new Promise((e,n)=>{const i=new Image;i.decode=()=>e(i),i.onload=()=>e(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=t})}const af=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return null!==n&&(n.constructor.name===e.name||af(n,e))};function lf(t,e,n){const i=window.getComputedStyle(t,n),r=i.getPropertyValue("content");if(""===r||"none"===r)return;const o=tf();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(function(t,e,n){const i=`.${t}:${e}`,r=n.cssText?function(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}(n):function(t){return ef(t).map(e=>`${e}: ${t.getPropertyValue(e)}${t.getPropertyPriority(e)?" !important":""};`).join(" ")}(n);return document.createTextNode(`${i}{${r}}`)}(o,n,i)),e.appendChild(s)}const cf="application/font-woff",uf="image/jpeg",hf={woff:cf,woff2:cf,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:uf,jpeg:uf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function df(t){const e=function(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}(t).toLowerCase();return hf[e]||""}function ff(t){return-1!==t.search(/^(data:)/)}async function pf(t,e,n){const i=await fetch(t,e);if(404===i.status)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise((t,e)=>{const o=new FileReader;o.onerror=e,o.onloadend=()=>{try{t(n({res:i,result:o.result}))}catch(t){e(t)}},o.readAsDataURL(r)})}const gf={};async function mf(t,e,n){const i=function(t,e,n){let i=t.replace(/\?.*/,"");return n&&(i=t),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}(t,e,n.includeQueryParams);if(null!=gf[i])return gf[i];let r;n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const i=await pf(t,n.fetchRequestInit,({res:t,result:n})=>(e||(e=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(n)));r=function(t,e){return`data:${e};base64,${t}`}(i,e)}catch(e){r=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${t}`;e&&(i="string"==typeof e?e:e.message),i&&console.warn(i)}return gf[i]=r,r}const yf=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();async function vf(t,e,n){return n||!e.filter||e.filter(t)?Promise.resolve(t).then(t=>async function(t,e){return af(t,HTMLCanvasElement)?async function(t){const e=t.toDataURL();return"data:,"===e?t.cloneNode(!1):sf(e)}(t):af(t,HTMLVideoElement)?async function(t,e){if(t.currentSrc){const e=document.createElement("canvas"),n=e.getContext("2d");return e.width=t.clientWidth,e.height=t.clientHeight,n?.drawImage(t,0,0,e.width,e.height),sf(e.toDataURL())}const n=t.poster,i=df(n);return sf(await mf(n,i,e))}(t,e):af(t,HTMLIFrameElement)?async function(t){var e;try{if(null!==(e=t?.contentDocument)&&void 0!==e&&e.body)return await vf(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}(t):t.cloneNode(!1)}(t,e)).then(n=>async function(t,e,n){var i,r;let o=[];return o=yf(t)&&t.assignedNodes?ef(t.assignedNodes()):af(t,HTMLIFrameElement)&&null!==(i=t.contentDocument)&&void 0!==i&&i.body?ef(t.contentDocument.body.childNodes):ef((null!==(r=t.shadowRoot)&&void 0!==r?r:t).childNodes),0===o.length||af(t,HTMLVideoElement)||await o.reduce((t,i)=>t.then(()=>vf(i,n)).then(t=>{t&&e.appendChild(t)}),Promise.resolve()),e}(t,n,e)).then(e=>function(t,e){return af(e,Element)&&(function(t,e){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):ef(i).forEach(r=>{let o=i.getPropertyValue(r);"font-size"===r&&o.endsWith("px")&&(o=Math.floor(parseFloat(o.substring(0,o.length-2)))-.1+"px"),af(t,HTMLIFrameElement)&&"display"===r&&"inline"===o&&(o="block"),"d"===r&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(r,o,i.getPropertyPriority(r))})}(t,e),function(t,e){lf(t,e,":before"),lf(t,e,":after")}(t,e),function(t,e){af(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),af(t,HTMLInputElement)&&e.setAttribute("value",t.value)}(t,e),function(t,e){if(af(t,HTMLSelectElement)){const n=e,i=Array.from(n.children).find(e=>t.value===e.getAttribute("value"));i&&i.setAttribute("selected","")}}(t,e)),e}(t,e)).then(t=>async function(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(0===n.length)return t;const i={};for(let r=0;r<n.length;r++){const o=n[r].getAttribute("xlink:href");if(o){const n=t.querySelector(o),r=document.querySelector(o);!n&&r&&!i[o]&&(i[o]=await vf(r,e,!0))}}const r=Object.values(i);if(r.length){const e="http://www.w3.org/1999/xhtml",n=document.createElementNS(e,"svg");n.setAttribute("xmlns",e),n.style.position="absolute",n.style.width="0",n.style.height="0",n.style.overflow="hidden",n.style.display="none";const i=document.createElementNS(e,"defs");n.appendChild(i);for(let t=0;t<r.length;t++)i.appendChild(r[t]);t.appendChild(n)}return t}(t,e)):null}const _f=/url\((['"]?)([^'"]+?)\1\)/g,bf=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,xf=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function wf(t){return-1!==t.search(_f)}async function Ef(t,e,n){if(!wf(t))return t;const i=function(t,{preferredFontFormat:e}){return e?t.replace(xf,t=>{for(;;){const[n,,i]=bf.exec(t)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}(t,n);return function(t){const e=[];return t.replace(_f,(t,n,i)=>(e.push(i),t)),e.filter(t=>!ff(t))}(i).reduce((t,i)=>t.then(t=>async function(t,e,n,i,r){try{const o=n?function(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),e&&(i.href=e),r.href=t,r.href}(e,n):e,s=df(e);let a;return r||(a=await mf(o,s,i)),t.replace(function(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}(e),`$1${a}$3`)}catch{}return t}(t,i,e,n)),Promise.resolve(i))}async function Tf(t,e,n){var i;const r=null===(i=e.style)||void 0===i?void 0:i.getPropertyValue(t);if(r){const i=await Ef(r,null,n);return e.style.setProperty(t,i,e.style.getPropertyPriority(t)),!0}return!1}async function Sf(t,e){af(t,Element)&&(await async function(t,e){await Tf("background",t,e)||await Tf("background-image",t,e),await Tf("mask",t,e)||await Tf("mask-image",t,e)}(t,e),await async function(t,e){const n=af(t,HTMLImageElement);if((!n||ff(t.src))&&(!af(t,SVGImageElement)||ff(t.href.baseVal)))return;const i=n?t.src:t.href.baseVal,r=await mf(i,df(i),e);await new Promise((e,i)=>{t.onload=e,t.onerror=i;const o=t;o.decode&&(o.decode=e),"lazy"===o.loading&&(o.loading="eager"),n?(t.srcset="",t.src=r):t.href.baseVal=r})}(t,e),await async function(t,e){const n=ef(t.childNodes).map(t=>Sf(t,e));await Promise.all(n).then(()=>t)}(t,e))}const Of={};async function Mf(t){let e=Of[t];return null!=e||(e={url:t,cssText:await(await fetch(t)).text()},Of[t]=e),e}async function Af(t,e){let n=t.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,r=(n.match(/url\([^)]+\)/g)||[]).map(async r=>{let o=r.replace(i,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),pf(o,e.fetchRequestInit,({result:t})=>(n=n.replace(r,`url(${t})`),[r,t]))});return Promise.all(r).then(()=>n)}function Cf(t){if(null==t)return[];const e=[];let n=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const t=i.exec(n);if(null===t)break;e.push(t[0])}n=n.replace(i,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=r.exec(n);if(null===t){if(t=o.exec(n),null===t)break;r.lastIndex=o.lastIndex}else o.lastIndex=r.lastIndex;e.push(t[0])}return e}async function Df(t,e){const n=null!=e.fontEmbedCSS?e.fontEmbedCSS:e.skipFonts?null:await async function(t,e){const n=await async function(t,e){if(null==t.ownerDocument)throw new Error("Provided element is not within a Document");const n=ef(t.ownerDocument.styleSheets),i=await async function(t,e){const n=[],i=[];return t.forEach(n=>{if("cssRules"in n)try{ef(n.cssRules||[]).forEach((t,r)=>{if(t.type===CSSRule.IMPORT_RULE){let o=r+1;const s=Mf(t.href).then(t=>Af(t,e)).then(t=>Cf(t).forEach(t=>{try{n.insertRule(t,t.startsWith("@import")?o+=1:n.cssRules.length)}catch(e){console.error("Error inserting rule from remote css",{rule:t,error:e})}})).catch(t=>{console.error("Error loading remote css",t.toString())});i.push(s)}})}catch(r){const o=t.find(t=>null==t.href)||document.styleSheets[0];null!=n.href&&i.push(Mf(n.href).then(t=>Af(t,e)).then(t=>Cf(t).forEach(t=>{o.insertRule(t,n.cssRules.length)})).catch(t=>{console.error("Error loading remote stylesheet",t)})),console.error("Error inlining remote css file",r)}}),Promise.all(i).then(()=>(t.forEach(t=>{if("cssRules"in t)try{ef(t.cssRules||[]).forEach(t=>{n.push(t)})}catch(e){console.error(`Error while reading CSS rules from ${t.href}`,e)}}),n))}(n,e);return function(t){return t.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>wf(t.style.getPropertyValue("src")))}(i)}(t,e);return(await Promise.all(n.map(t=>{const n=t.parentStyleSheet?t.parentStyleSheet.href:null;return Ef(t.cssText,n,e)}))).join("\n")}(t,e);if(n){const e=document.createElement("style"),i=document.createTextNode(n);e.appendChild(i),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}}async function kf(t,e={}){const{width:n,height:i}=rf(t,e),r=await vf(t,e,!0);return await Df(r,e),await Sf(r,e),function(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const i=e.style;null!=i&&Object.keys(i).forEach(t=>{n[t]=i[t]})}(r,e),await async function(t,e,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),o=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${e}`),r.setAttribute("height",`${n}`),r.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),r.appendChild(o),o.appendChild(t),async function(t){return Promise.resolve().then(()=>(new XMLSerializer).serializeToString(t)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}(r)}(r,n,i)}async function Lf(t,e={}){const{width:n,height:i}=rf(t,e),r=await kf(t,e),o=await sf(r),s=document.createElement("canvas"),a=s.getContext("2d"),l=e.pixelRatio||function(){let t,e;try{e=process}catch{}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}(),c=e.canvasWidth||n,u=e.canvasHeight||i;return s.width=c*l,s.height=u*l,e.skipAutoScale||function(t){(t.width>of||t.height>of)&&(t.width>of&&t.height>of?t.width>t.height?(t.height*=of/t.width,t.width=of):(t.width*=of/t.height,t.height=of):t.width>of?(t.height*=of/t.width,t.width=of):(t.width*=of/t.height,t.height=of))}(s),s.style.width=`${c}`,s.style.height=`${u}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}let Rf=class{constructor(t,e){this.model=t,this.services=e,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}},If=class t extends Rf{constructor(t,e){super(t,e)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,e={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=xu(t));const n={width:0,height:0},i=t=>{t&&Object.keys(n).forEach(e=>{if(t[e]){const i=t[e],r=parseFloat(i);i&&r>n[e]&&-1===(""+i).indexOf("%")&&(n[e]=r)}})},r={width:t.attr("width"),height:t.attr("height")},o=t.node();let s,a,l,c,u;try{"function"==typeof o.getBBox&&(s=o.getBBox(),a={width:s.width,height:s.height})}catch(t){console.error(t)}try{"function"==typeof o?.getBoundingClientRect&&(l=o.getBoundingClientRect(),c={width:l.width,height:l.height})}catch(t){console.error(t)}if(o instanceof SVGSVGElement&&(u={width:o.clientWidth,height:o.clientHeight}),e){if(e.useAttrs&&(i(r),n.width>0&&n.height>0))return n;if(e.useClientDimensions&&(i(u),n.width>0&&n.height>0))return u;if(e.useBBox&&(i(a),n.width>0&&n.height>0))return a;if(e.useBoundingRect&&(i(c),n.width>0&&n.height>0))return c}try{i({width:lc(t.node(),"width","baseVal","value"),height:lc(t.node(),"height","baseVal","value")})}catch{i(u),i(a),i(r)}return n}static appendOrSelect(t,e){const n=t.select(`${e}`);if(n.empty()){let n,i,r=e.split("#");return 2===r.length?(n=r[0],r=r[1].split("."),i=r[0]):(r=e.split("."),n=r[0]),t.append(n).attr("id",i).attr("class",r.slice(1).join(" "))}return n}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,e=!1){const n={left:0,top:0},i=t.getBoundingClientRect(),r=e?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{n.left=i.left-r.left,n.top=i.top-r.top}catch(t){console.error(t)}return n}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor(281474976710656*(1+Math.random())).toString(16)}addMainContainer(){const t=this.model.getOptions(),e=lc(t,"style","prefix"),n=xu(this.getHolder()).append("div").classed(`${al}--${e}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");n.append("g").attr("class","DONT_STYLE_ME_css_styles_verifier"),this.mainContainer=n.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:e,height:n,theme:i}=this.model.getOptions();e!==this.width&&(t.style.width=e,this.width=e),n!==this.height&&(t.style.height=n,this.height=n),xu(this.getHolder()).classed(`${al}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,e=this.model.getOptions(),n=xu(this.getHolder());n.classed("filled",!0),async function(t,e={}){return(await Lf(t,e)).toDataURL("image/jpeg",e.quality||1)}(this.getMainContainer(),{quality:1,filter:t=>!(t.classList&&t.classList.contains("cds--cc--toolbar"))}).then(function(i){let r="myChart";const o=lc(e,"fileDownload","fileName");"function"==typeof o?r=o("jpg"):"string"==typeof o&&(r=o),t.services.files?.downloadImage(i,`${r}.jpg`),n.classed("filled",!1)})}exportToPNG(){const t=this,e=this.model.getOptions(),n=xu(this.getHolder());n.classed("filled",!0),async function(t,e={}){return(await Lf(t,e)).toDataURL()}(this.getMainContainer(),{quality:1,filter:t=>!(t.classList&&t.classList.contains("cds--cc--toolbar"))}).then(function(i){let r="myChart";const o=lc(e,"fileDownload","fileName");"function"==typeof o?r=o("png"):"string"==typeof o&&(r=o),t.services.files?.downloadImage(i,`${r}.png`),n.classed("filled",!1)}).catch(function(t){console.error("oops, something went wrong!",t)})}isFullScreenMode(){return xu(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();xu(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=xu(this.getHolder()),e=t.classed("fullscreen");t.classed("fullscreen",!e)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:e}=t.getSVGElementSize(xu(this.mainContainer),{useBBox:!0}),n=xu(this.mainContainer).attr("class"),i=xu(this.mainContainer).selectAll(`.${n} > svg`);let r=0;i.nodes().forEach(function(e){r+=Number(t.getSVGElementSize(xu(e),{useBBox:!0}).height)}),r<=e?xu(this.mainContainer).attr("height",r):xu(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&xu(t).on("mouseover",()=>{this.services.events?.dispatchEvent(k.Chart.MOUSEOVER)}).on("mouseout",()=>{this.services.events?.dispatchEvent(k.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let e=t.clientWidth,n=t.clientHeight;const i=function(t,e,n){var i,r,o,s,a,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=i,o=r;return i=r=void 0,c=e,s=t.apply(o,n)}function p(t){var n=t-l;return void 0===l||n>=e||n<0||h&&t-c>=o}function g(){var t=vu();if(p(t))return m(t);a=setTimeout(g,function(t){var n=e-(t-l);return h?bu(n,o-(t-c)):n}(t))}function m(t){return a=void 0,d&&i?f(t):(i=r=void 0,s)}function y(){var t=vu(),n=p(t);if(i=arguments,r=this,l=t,n){if(void 0===a)return function(t){return c=t,a=setTimeout(g,e),u?f(t):s}(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return void 0===a&&(a=setTimeout(g,e)),s}return e=yu(e)||0,Ht(n)&&(u=!!n.leading,o=(h="maxWait"in n)?_u(yu(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},y.flush=function(){return void 0===a?s:m(vu())},y}(()=>{t&&(Math.abs(e-t.clientWidth)>1||Math.abs(n-t.clientHeight)>1)&&(e=t.clientWidth,n=t.clientHeight,this.services.events?.dispatchEvent(k.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},Nf=class t extends Rf{static appendOrUpdateLinearGradient(t){let e=t.svg.select(`defs linearGradient#${t.id}`);e.empty()&&(e=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)),e.selectAll("stop").remove(),e.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",t=>t.offset).style("stop-color",t=>t.color).style("stop-opacity",t=>t.opacity)}static getOffsetRatio(t){return(100*Math.abs(t[1])/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(e,n){let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return e[0]<0&&e[1]>0&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:t.getOffsetRatio(e),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};var Pf=function(t){return function(e){return t?.[e]}}({À:"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"}),Uf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Bf=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),Ff=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$f="\\ud800-\\udfff",zf="\\u2700-\\u27bf",Gf="a-z\\xdf-\\xf6\\xf8-\\xff",jf="A-Z\\xc0-\\xd6\\xd8-\\xde",Vf="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Wf="["+Vf+"]",Yf="\\d+",Zf="["+zf+"]",Xf="["+Gf+"]",qf="[^"+$f+Vf+Yf+zf+Gf+jf+"]",Kf="(?:\\ud83c[\\udde6-\\uddff]){2}",Qf="[\\ud800-\\udbff][\\udc00-\\udfff]",Jf="["+jf+"]",tp="(?:"+Xf+"|"+qf+")",ep="(?:"+Jf+"|"+qf+")",np="(?:['’](?:d|ll|m|re|s|t|ve))?",ip="(?:['’](?:D|LL|M|RE|S|T|VE))?",rp="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",op="[\\ufe0e\\ufe0f]?",sp=op+rp+"(?:\\u200d(?:"+["[^"+$f+"]",Kf,Qf].join("|")+")"+op+rp+")*",ap="(?:"+[Zf,Kf,Qf].join("|")+")"+sp,lp=RegExp([Jf+"?"+Xf+"+"+np+"(?="+[Wf,Jf,"$"].join("|")+")",ep+"+"+ip+"(?="+[Wf,Jf+tp,"$"].join("|")+")",Jf+"?"+tp+"+"+np,Jf+"+"+ip,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yf,ap].join("|"),"g");var cp=RegExp("['’]","g");function up(t){return function(e){return function(t,e,n){for(var i=-1,r=null==t?0:t.length;++i<r;)n=e(n,t[i],i,t);return n}(function(t,e){return t=yn(t),void 0===e?function(t){return Hf.test(t)}(t)?function(t){return t.match(lp)||[]}(t):function(t){return t.match(Ff)||[]}(t):t.match(e)||[]}(function(t){return(t=yn(t))&&t.replace(Uf,Pf).replace(Bf,"")}(e).replace(cp,"")),t,"")}}be(function(t,e,n){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout(function(){t.apply(void 0,n)},e)}(t,yu(e)||0,n)}),up(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()});class hp{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],o=t+r,s=Math.abs(t)<Math.abs(r)?t-(o-r):r-(o-t);s&&(e[n++]=s),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,o=0;if(r>0){for(o=t[--r];r>0&&(e=o,n=t[--r],o=e+n,i=n-(o-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=o+n,n==e-o&&(o=e))}return o}}function dp(t){return t}var fp=1e-6;function pp(t){return"translate("+t+",0)"}function gp(t){return"translate(0,"+t+")"}function mp(t){return e=>+t(e)}function yp(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function vp(){return!this.__axis}function _p(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?pp:gp;function d(d){var f=i??(e.ticks?e.ticks.apply(e,n):e.domain()),p=r??(e.tickFormat?e.tickFormat.apply(e,n):dp),g=Math.max(o,0)+a,m=e.range(),y=+m[0]+l,v=+m[m.length-1]+l,_=(e.bandwidth?yp:mp)(e.copy(),l),b=d.selection?d.selection():d,x=b.selectAll(".domain").data([null]),w=b.selectAll(".tick").data(f,e).order(),E=w.exit(),T=w.enter().append("g").attr("class","tick"),S=w.select("line"),O=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(T),S=S.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",c*o)),O=O.merge(T.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==b&&(x=x.transition(d),w=w.transition(d),S=S.transition(d),O=O.transition(d),E=E.transition(d).attr("opacity",fp).attr("transform",function(t){return isFinite(t=_(t))?h(t+l):this.getAttribute("transform")}),T.attr("opacity",fp).attr("transform",function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:_(t))+l)})),E.remove(),x.attr("d",4===t||2===t?s?"M"+c*s+","+y+"H"+l+"V"+v+"H"+c*s:"M"+l+","+y+"V"+v:s?"M"+y+","+c*s+"V"+l+"H"+v+"V"+c*s:"M"+y+","+l+"H"+v),w.attr("opacity",1).attr("transform",function(t){return h(_(t)+l)}),S.attr(u+"2",c*o),O.attr(u,c*g).text(p),b.filter(vp).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each(function(){this.__axis=_})}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(o=s=+t,d):o},d.tickSizeInner=function(t){return arguments.length?(o=+t,d):o},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function bp(t){return _p(1,t)}function xp(t){return _p(2,t)}function wp(t){return _p(3,t)}function Ep(t){return _p(4,t)}const Tp={capture:!0,passive:!1};function Sp(t){t.preventDefault(),t.stopImmediatePropagation()}const Op=t=>+t,Mp=t=>()=>t;function Ap(t,{sourceEvent:e,target:n,selection:i,mode:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Cp(t){t.preventDefault(),t.stopImmediatePropagation()}var Dp={name:"drag"},kp={name:"space"},Lp={name:"handle"},Rp={name:"center"};const{abs:Ip,max:Np,min:Pp}=Math;function Up(t){return[+t[0],+t[1]]}function Bp(t){return[Up(t[0]),Up(t[1])]}var Fp={name:"x",handles:["w","e"].map(Wp),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Hp={},$p={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"},zp={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Gp={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},jp={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Vp={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Wp(t){return{type:t}}function Yp(t){return!t.ctrlKey&&!t.button}function Zp(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Xp(){return navigator.maxTouchPoints||"ontouchstart"in this}function qp(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Kp(){return function(t){var e,n=Zp,i=Yp,r=Xp,o=!0,s=_r("start","brush","end"),a=6;function l(e){var n=e.property("__brush",g).selectAll(".overlay").data([Wp("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",$p.overlay).merge(n).each(function(){var t=qp(this).extent;xu(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Wp("selection")]).enter().append("rect").attr("class","selection").attr("cursor",$p.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return $p[t.type]}),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=xu(this),e=qp(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new h(t,e,n):i}function h(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function d(n){if((!e||n.touches)&&i.apply(this,arguments)){var r,s,a,l,h,d,f,p,g,m,y,v=this,_=n.target.__data__.type,b="selection"===(o&&n.metaKey?_="overlay":_)?Dp:o&&n.altKey?Rp:Lp,x=t===Hp?null:jp[_],w=t===Fp?null:Vp[_],E=qp(v),T=E.extent,S=E.selection,O=T[0][0],M=T[0][1],A=T[1][0],C=T[1][1],D=0,k=0,L=x&&w&&o&&n.shiftKey,R=Array.from(n.touches||[n],t=>{const e=t.identifier;return(t=No(t,v)).point0=t.slice(),t.identifier=e,t});sa(v);var I=u(v,arguments,!0).beforestart();if("overlay"===_){S&&(g=!0);const e=[R[0],R[1]||R[0]];E.selection=S=[[r=t===Hp?O:Pp(e[0][0],e[1][0]),a=t===Fp?M:Pp(e[0][1],e[1][1])],[h=t===Hp?A:Np(e[0][0],e[1][0]),f=t===Fp?C:Np(e[0][1],e[1][1])]],R.length>1&&F(n)}else r=S[0][0],a=S[0][1],h=S[1][0],f=S[1][1];s=r,l=a,d=h,p=f;var N=xu(v).attr("pointer-events","none"),P=N.selectAll(".overlay").attr("cursor",$p[_]);if(n.touches)I.moved=B,I.ended=H;else{var U=xu(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",H,!0);o&&U.on("keydown.brush",function(t){switch(t.keyCode){case 16:L=x&&w;break;case 18:b===Lp&&(x&&(h=d-D*x,r=s+D*x),w&&(f=p-k*w,a=l+k*w),b=Rp,F(t));break;case 32:(b===Lp||b===Rp)&&(x<0?h=d-D:x>0&&(r=s-D),w<0?f=p-k:w>0&&(a=l-k),b=kp,P.attr("cursor",$p.selection),F(t));break;default:return}Cp(t)},!0).on("keyup.brush",function(t){switch(t.keyCode){case 16:L&&(m=y=L=!1,F(t));break;case 18:b===Rp&&(x<0?h=d:x>0&&(r=s),w<0?f=p:w>0&&(a=l),b=Lp,F(t));break;case 32:b===kp&&(t.altKey?(x&&(h=d-D*x,r=s+D*x),w&&(f=p-k*w,a=l+k*w),b=Rp):(x<0?h=d:x>0&&(r=s),w<0?f=p:w>0&&(a=l),b=Lp),P.attr("cursor",$p[_]),F(t));break;default:return}Cp(t)},!0),function(t){var e=t.document.documentElement,n=xu(t).on("dragstart.drag",Sp,Tp);"onselectstart"in e?n.on("selectstart.drag",Sp,Tp):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(n.view)}c.call(v),I.start(n,b.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of R)t.identifier===e.identifier&&(t.cur=No(e,v));if(L&&!m&&!y&&1===R.length){const t=R[0];Ip(t.cur[0]-t[0])>Ip(t.cur[1]-t[1])?y=!0:m=!0}for(const t of R)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,Cp(t),F(t)}function F(t){const e=R[0],n=e.point0;var i;switch(D=e[0]-n[0],k=e[1]-n[1],b){case kp:case Dp:x&&(D=Np(O-r,Pp(A-h,D)),s=r+D,d=h+D),w&&(k=Np(M-a,Pp(C-f,k)),l=a+k,p=f+k);break;case Lp:R[1]?(x&&(s=Np(O,Pp(A,R[0][0])),d=Np(O,Pp(A,R[1][0])),x=1),w&&(l=Np(M,Pp(C,R[0][1])),p=Np(M,Pp(C,R[1][1])),w=1)):(x<0?(D=Np(O-r,Pp(A-r,D)),s=r+D,d=h):x>0&&(D=Np(O-h,Pp(A-h,D)),s=r,d=h+D),w<0?(k=Np(M-a,Pp(C-a,k)),l=a+k,p=f):w>0&&(k=Np(M-f,Pp(C-f,k)),l=a,p=f+k));break;case Rp:x&&(s=Np(O,Pp(A,r-D*x)),d=Np(O,Pp(A,h+D*x))),w&&(l=Np(M,Pp(C,a-k*w)),p=Np(M,Pp(C,f+k*w)))}d<s&&(x*=-1,i=r,r=h,h=i,i=s,s=d,d=i,_ in zp&&P.attr("cursor",$p[_=zp[_]])),p<l&&(w*=-1,i=a,a=f,f=i,i=l,l=p,p=i,_ in Gp&&P.attr("cursor",$p[_=Gp[_]])),E.selection&&(S=E.selection),m&&(s=S[0][0],d=S[1][0]),y&&(l=S[0][1],p=S[1][1]),(S[0][0]!==s||S[0][1]!==l||S[1][0]!==d||S[1][1]!==p)&&(E.selection=[[s,l],[d,p]],c.call(v),I.brush(t,b.name))}function H(t){if(function(t){t.stopImmediatePropagation()}(t),t.touches){if(t.touches.length)return;e&&clearTimeout(e),e=setTimeout(function(){e=null},500)}else(function(t,e){var n=t.document.documentElement,i=xu(t).on("dragstart.drag",null);e&&(i.on("click.drag",Sp,Tp),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)})(t.view,g),U.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);N.attr("pointer-events","all"),P.attr("cursor",$p.overlay),E.selection&&(S=E.selection),function(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}(S)&&(E.selection=null,c.call(v)),I.end(t,b.name)}}function f(t){u(this,arguments).moved(t)}function p(t){u(this,arguments).ended(t)}function g(){var e=this.__brush||{selection:null};return e.extent=Bp(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n,i){e.tween?e.on("start.brush",function(t){u(this,arguments).beforestart().start(t)}).on("interrupt.brush end.brush",function(t){u(this,arguments).end(t)}).tween("brush",function(){var e=this,i=e.__brush,r=u(e,arguments),o=i.selection,s=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=Ms(o,s);function l(t){i.selection=1===t&&null===s?null:a(t),c.call(e),r.brush()}return null!==o&&null!==s?l:l(1)}):e.each(function(){var e=this,r=arguments,o=e.__brush,s=t.input("function"==typeof n?n.apply(e,r):n,o.extent),a=u(e,r).beforestart();sa(e),o.selection=null===s?null:s,c.call(e),a.start(i).brush(i).end(i)})},l.clear=function(t,e){l.move(t,null,e)},h.prototype={beforestart:function(){return 1===++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,e){return this.starting?(this.starting=!1,this.emit("start",t,e)):this.emit("brush",t),this},brush:function(t,e){return this.emit("brush",t,e),this},end:function(t,e){return 0===--this.active&&(delete this.state.emitter,this.emit("end",t,e)),this},emit:function(e,n,i){var r=xu(this.that).datum();s.call(e,this.that,new Ap(e,{sourceEvent:n,target:l,selection:t.output(this.state.selection),mode:i,dispatch:s}),r)}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:Mp(Bp(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:Mp(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:Mp(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(o=!!t,l):o},l.on=function(){var t=s.on.apply(s,arguments);return t===s?l:t},l}(Fp)}const Qp=Math.PI,Jp=2*Qp,tg=1e-6,eg=Jp-tg;function ng(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}let ig=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?ng:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ng;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,r,o){this._append`C${+t},${+e},${+n},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,s=this._y1,a=n-t,l=i-e,c=o-t,u=s-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>tg)if(Math.abs(u*a-l*c)>tg&&r){let d=n-o,f=i-s,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((Qp-Math.acos((p+h-g)/(2*m*y)))/2),_=v/y,b=v/m;Math.abs(_-1)>tg&&this._append`L${t+_*c},${e+_*u}`,this._append`A${r},${r},0,0,${+(u*d>c*f)},${this._x1=t+b*a},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),a=n*Math.sin(i),l=t+s,c=e+a,u=1^o,h=o?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>tg||Math.abs(this._y1-c)>tg)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%Jp+Jp),h>eg?this._append`A${n},${n},0,1,${u},${t-s},${e-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>tg&&this._append`A${n},${n},0,${+(h>=Qp)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};var rg=Math.PI,og=2*rg,sg=rg/180,ag=Math.abs,lg=(Math.atan,Math.atan2,Math.cos),cg=(Math.exp,Math.log,Math.sin,Math.sign,Math.sqrt);Math.tan;function ug(t,e){return ag(t)>rg&&(t-=Math.round(t/og)*og),[t,e]}function hg(){}function dg(t,e){return[t,e]}ug.invert=ug,new hp,new hp,new hp,hg.prototype={constructor:hg,point:function(t,e){this.stream.point(t,e)},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()}},lg(30*sg),dg.invert=dg;cg(3);function fg(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function pg(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=mg)):void 0===e&&(e=gg);for(var n,i,r,o,s,a=new _g(t),l=[a];n=l.pop();)if((r=e(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new _g(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(vg)}function gg(t){return t.children}function mg(t){return Array.isArray(t)?t[1]:null}function yg(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function vg(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function _g(t){this.data=t,this.depth=this.height=0,this.parent=null}function bg(t,e,n,i,r){for(var o,s=t.children,a=-1,l=s.length,c=t.value&&(i-e)/t.value;++a<l;)(o=s[a]).y0=n,o.y1=r,o.x0=e,o.x1=e+=o.value*c}function xg(t,e,n,i,r){for(var o,s=t.children,a=-1,l=s.length,c=t.value&&(r-n)/t.value;++a<l;)(o=s[a]).x0=e,o.x1=i,o.y0=n,o.y1=n+=o.value*c}function wg(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new ig(e)}function Eg(t){return t.innerRadius}function Tg(t){return t.outerRadius}function Sg(t){return t.startAngle}function Og(t){return t.endAngle}function Mg(t){return t&&t.padAngle}function Ag(t,e,n,i,r,o,s){var a=t-n,l=e-i,c=(s?o:-o)/Gd(a*a+l*l),u=c*l,h=-c*a,d=t+u,f=e+h,p=n+u,g=i+h,m=(d+p)/2,y=(f+g)/2,v=p-d,_=g-f,b=v*v+_*_,x=r-o,w=d*g-p*f,E=(_<0?-1:1)*Gd(Hd(0,x*x*b-w*w)),T=(w*_-v*E)/b,S=(-w*v-_*E)/b,O=(w*_+v*E)/b,M=(-w*v+_*E)/b,A=T-m,C=S-y,D=O-m,k=M-y;return A*A+C*C>D*D+k*k&&(T=O,S=M),{cx:T,cy:S,x01:-u,y01:-h,x11:T*(r/x-1),y11:S*(r/x-1)}}function Cg(t){return t[0]}function Dg(t){return t[1]}function kg(t,e){var n=Yc(!0),i=null,r=qd,o=null,s=wg(a);function a(a){var l,c,u,h=(a=Zc(a)).length,d=!1;for(null==i&&(o=r(u=s())),l=0;l<=h;++l)!(l<h&&n(c=a[l],l,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(c,l,a),+e(c,l,a));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Cg:Yc(t),e="function"==typeof e?e:void 0===e?Dg:Yc(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:Yc(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Yc(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:Yc(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),a):i},a}function Lg(t,e,n){var i=null,r=Yc(!0),o=null,s=qd,a=null,l=wg(c);function c(c){var u,h,d,f,p,g=(c=Zc(c)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(a=s(p=l())),u=0;u<=g;++u){if(!(u<g&&r(f=c[u],u,c))===m)if(m=!m)h=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=u-1;d>=h;--d)a.point(y[d],v[d]);a.lineEnd(),a.areaEnd()}m&&(y[u]=+t(f,u,c),v[u]=+e(f,u,c),a.point(i?+i(f,u,c):y[u],n?+n(f,u,c):v[u]))}if(p)return a=null,p+""||null}function u(){return kg().defined(r).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?Cg:Yc(+t),e="function"==typeof e?e:Yc(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Dg:Yc(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:Yc(+e),i=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:Yc(+e),c):t},c.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Yc(+t),c):i},c.y=function(t){return arguments.length?(e="function"==typeof t?t:Yc(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:Yc(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Yc(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:Yc(!!t),c):r},c.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),c):s},c.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),c):o},c}function Rg(t){this._curve=t}_g.prototype=pg.prototype={constructor:_g,count:function(){return this.eachAfter(fg)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(t.call(e,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return pg(this).eachBefore(yg)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}},Object.create(_g.prototype),function t(e){function n(t,n,i,r,o){!function(t,e,n,i,r,o){for(var s,a,l,c,u,h,d,f,p,g,m,y=[],v=e.children,_=0,b=0,x=v.length,w=e.value;_<x;){l=r-n,c=o-i;do{u=v[b++].value}while(!u&&b<x);for(h=d=u,m=u*u*(g=Math.max(c/l,l/c)/(w*t)),p=Math.max(d/m,m/h);b<x;++b){if(u+=a=v[b].value,a<h&&(h=a),a>d&&(d=a),m=u*u*g,(f=Math.max(d/m,m/h))>p){u-=a;break}p=f}y.push(s={value:u,dice:l<c,children:v.slice(_,b)}),s.dice?bg(s,n,i,r,w?i+=c*u/w:o):xg(s,n,i,w?n+=l*u/w:r,o),w-=u,_=b}}(e,t,n,i,r,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}((1+Math.sqrt(5))/2),function(t){function e(e){return new Rg(t(e))}e._curve=t}(qd),Rg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};let Ig=class{constructor(t,e,n){if(this.type="",this.renderType=L.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=e,n&&(this.configs=n,this.configs.id)){const t=lc(this.model.getOptions(),"style","prefix");this.id=`${t}--${this.configs.id}`}this.parent||this.setParent(xu(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){const e=this.parent;if(this.parent=t,(!e||e.node()!==t.node())&&this.type){const t=lc(this.model.getOptions(),"style","prefix");this.parent?.classed(`${al}--${t}--${this.type}`,!0),e&&e.classed(`${al}--${t}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const e=lc(this.model.getOptions(),"style","prefix"),n=this.id?`#${this.id}`:"",i=If.appendOrSelect(this.parent,`${this.renderType===L.SVG?"svg":"div"}${n}.${al}--${e}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const t=this.model.get("chartClipId");if(t){const e=xu(`#${t}`).select("rect");if(0!==e.size()){const n=parseFloat(e.attr("height")),r=parseFloat(e.attr("width"));!isNaN(n)&&!isNaN(r)&&n>0&&r>0&&i.attr("clip-path",`url(#${t})`)}}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?qi({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};const{entries:Ng,setPrototypeOf:Pg,isFrozen:Ug,getPrototypeOf:Bg,getOwnPropertyDescriptor:Fg}=Object;let{freeze:Hg,seal:$g,create:zg}=Object,{apply:Gg,construct:jg}=typeof Reflect<"u"&&Reflect;Hg||(Hg=function(t){return t}),$g||($g=function(t){return t}),Gg||(Gg=function(t,e,n){return t.apply(e,n)}),jg||(jg=function(t,e){return new t(...e)});const Vg=om(Array.prototype.forEach),Wg=om(Array.prototype.lastIndexOf),Yg=om(Array.prototype.pop),Zg=om(Array.prototype.push),Xg=om(Array.prototype.splice),qg=om(String.prototype.toLowerCase),Kg=om(String.prototype.toString),Qg=om(String.prototype.match),Jg=om(String.prototype.replace),tm=om(String.prototype.indexOf),em=om(String.prototype.trim),nm=om(Object.prototype.hasOwnProperty),im=om(RegExp.prototype.test),rm=function(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return jg(t,n)}}(TypeError);function om(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Gg(t,e,i)}}function sm(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qg;Pg&&Pg(t,null);let i=e.length;for(;i--;){let r=e[i];if("string"==typeof r){const t=n(r);t!==r&&(Ug(e)||(e[i]=t),r=t)}t[r]=!0}return t}function am(t){for(let e=0;e<t.length;e++)nm(t,e)||(t[e]=null);return t}function lm(t){const e=zg(null);for(const[n,i]of Ng(t))nm(t,n)&&(Array.isArray(i)?e[n]=am(i):i&&"object"==typeof i&&i.constructor===Object?e[n]=lm(i):e[n]=i);return e}function cm(t,e){for(;null!==t;){const n=Fg(t,e);if(n){if(n.get)return om(n.get);if("function"==typeof n.value)return om(n.value)}t=Bg(t)}return function(){return null}}const um=Hg(["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"]),hm=Hg(["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"]),dm=Hg(["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"]),fm=Hg(["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"]),pm=Hg(["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"]),gm=Hg(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mm=Hg(["#text"]),ym=Hg(["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"]),vm=Hg(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","slope","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","tablevalues","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"]),_m=Hg(["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"]),bm=Hg(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xm=$g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wm=$g(/<%[\w\W]*|[\w\W]*%>/gm),Em=$g(/\$\{[\w\W]*/gm),Tm=$g(/^data-[\-\w.\u00B7-\uFFFF]+$/),Sm=$g(/^aria-[\-\w]+$/),Om=$g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mm=$g(/^(?:\w+script|data):/i),Am=$g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Cm=$g(/^html$/i),Dm=$g(/^[a-z][.\w]*(-[.\w]+)+$/i);var km=Object.freeze({__proto__:null,ARIA_ATTR:Sm,ATTR_WHITESPACE:Am,CUSTOM_ELEMENT:Dm,DATA_ATTR:Tm,DOCTYPE_NAME:Cm,ERB_EXPR:wm,IS_ALLOWED_URI:Om,IS_SCRIPT_OR_DATA:Mm,MUSTACHE_EXPR:xm,TMPLIT_EXPR:Em});var Lm=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:typeof window>"u"?null:window;const n=e=>t(e);if(n.version="3.2.6",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let{document:i}=e;const r=i,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,g=c.prototype,m=cm(g,"cloneNode"),y=cm(g,"remove"),v=cm(g,"nextSibling"),_=cm(g,"childNodes"),b=cm(g,"parentNode");if("function"==typeof a){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let x,w="";const{implementation:E,createNodeIterator:T,createDocumentFragment:S,getElementsByTagName:O}=i,{importNode:M}=r;let A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Ng&&"function"==typeof b&&E&&void 0!==E.createHTMLDocument;const{MUSTACHE_EXPR:C,ERB_EXPR:D,TMPLIT_EXPR:k,DATA_ATTR:L,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:P}=km;let{IS_ALLOWED_URI:U}=km,B=null;const F=sm({},[...um,...hm,...dm,...pm,...mm]);let H=null;const $=sm({},[...ym,...vm,..._m,...bm]);let z=Object.seal(zg(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}})),G=null,j=null,V=!0,W=!0,Y=!1,Z=!0,X=!1,q=!0,K=!1,Q=!1,J=!1,tt=!1,et=!1,nt=!1,it=!0,rt=!1,ot=!0,st=!1,at={},lt=null;const ct=sm({},["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 ut=null;const ht=sm({},["audio","video","img","source","image","track"]);let dt=null;const ft=sm({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",gt="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml";let yt=mt,vt=!1,_t=null;const bt=sm({},[pt,gt,mt],Kg);let xt=sm({},["mi","mo","mn","ms","mtext"]),wt=sm({},["annotation-xml"]);const Et=sm({},["title","style","font","a","script"]);let Tt=null;const St=["application/xhtml+xml","text/html"];let Ot=null,Mt=null;const At=i.createElement("form"),Ct=function(t){return t instanceof RegExp||t instanceof Function},Dt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Mt||Mt!==t){if((!t||"object"!=typeof t)&&(t={}),t=lm(t),Tt=-1===St.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Ot="application/xhtml+xml"===Tt?Kg:qg,B=nm(t,"ALLOWED_TAGS")?sm({},t.ALLOWED_TAGS,Ot):F,H=nm(t,"ALLOWED_ATTR")?sm({},t.ALLOWED_ATTR,Ot):$,_t=nm(t,"ALLOWED_NAMESPACES")?sm({},t.ALLOWED_NAMESPACES,Kg):bt,dt=nm(t,"ADD_URI_SAFE_ATTR")?sm(lm(ft),t.ADD_URI_SAFE_ATTR,Ot):ft,ut=nm(t,"ADD_DATA_URI_TAGS")?sm(lm(ht),t.ADD_DATA_URI_TAGS,Ot):ht,lt=nm(t,"FORBID_CONTENTS")?sm({},t.FORBID_CONTENTS,Ot):ct,G=nm(t,"FORBID_TAGS")?sm({},t.FORBID_TAGS,Ot):lm({}),j=nm(t,"FORBID_ATTR")?sm({},t.FORBID_ATTR,Ot):lm({}),at=!!nm(t,"USE_PROFILES")&&t.USE_PROFILES,V=!1!==t.ALLOW_ARIA_ATTR,W=!1!==t.ALLOW_DATA_ATTR,Y=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,X=t.SAFE_FOR_TEMPLATES||!1,q=!1!==t.SAFE_FOR_XML,K=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,nt=t.RETURN_TRUSTED_TYPE||!1,J=t.FORCE_BODY||!1,it=!1!==t.SANITIZE_DOM,rt=t.SANITIZE_NAMED_PROPS||!1,ot=!1!==t.KEEP_CONTENT,st=t.IN_PLACE||!1,U=t.ALLOWED_URI_REGEXP||Om,yt=t.NAMESPACE||mt,xt=t.MATHML_TEXT_INTEGRATION_POINTS||xt,wt=t.HTML_INTEGRATION_POINTS||wt,z=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Ct(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Ct(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),et&&(tt=!0),at&&(B=sm({},mm),H=[],!0===at.html&&(sm(B,um),sm(H,ym)),!0===at.svg&&(sm(B,hm),sm(H,vm),sm(H,bm)),!0===at.svgFilters&&(sm(B,dm),sm(H,vm),sm(H,bm)),!0===at.mathMl&&(sm(B,pm),sm(H,_m),sm(H,bm))),t.ADD_TAGS&&(B===F&&(B=lm(B)),sm(B,t.ADD_TAGS,Ot)),t.ADD_ATTR&&(H===$&&(H=lm(H)),sm(H,t.ADD_ATTR,Ot)),t.ADD_URI_SAFE_ATTR&&sm(dt,t.ADD_URI_SAFE_ATTR,Ot),t.FORBID_CONTENTS&&(lt===ct&&(lt=lm(lt)),sm(lt,t.FORBID_CONTENTS,Ot)),ot&&(B["#text"]=!0),K&&sm(B,["html","head","body"]),B.table&&(sm(B,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw rm('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw rm('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=t.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else void 0===x&&(x=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,o)),null!==x&&"string"==typeof w&&(w=x.createHTML(""));Hg&&Hg(t),Mt=t}},kt=sm({},[...hm,...dm,...fm]),Lt=sm({},[...pm,...gm]),Rt=function(t){Zg(n.removed,{element:t});try{b(t).removeChild(t)}catch{y(t)}},It=function(t,e){try{Zg(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch{Zg(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(tt||et)try{Rt(e)}catch{}else try{e.setAttribute(t,"")}catch{}},Nt=function(t){let e=null,n=null;if(J)t="<remove></remove>"+t;else{const e=Qg(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Tt&&yt===mt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=x?x.createHTML(t):t;if(yt===mt)try{e=(new f).parseFromString(r,Tt)}catch{}if(!e||!e.documentElement){e=E.createDocument(yt,"template",null);try{e.documentElement.innerHTML=vt?w:r}catch{}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),yt===mt?O.call(e,K?"html":"body")[0]:K?e.documentElement:o},Pt=function(t){return T.call(t.ownerDocument||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ut=function(t){return t instanceof d&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof h)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},Bt=function(t){return"function"==typeof l&&t instanceof l};function Ft(t,e,i){Vg(t,t=>{t.call(n,e,i,Mt)})}const Ht=function(t){let e=null;if(Ft(A.beforeSanitizeElements,t,null),Ut(t))return Rt(t),!0;const i=Ot(t.nodeName);if(Ft(A.uponSanitizeElement,t,{tagName:i,allowedTags:B}),q&&t.hasChildNodes()&&!Bt(t.firstElementChild)&&im(/<[/\w!]/g,t.innerHTML)&&im(/<[/\w!]/g,t.textContent)||7===t.nodeType||q&&8===t.nodeType&&im(/<[/\w]/g,t.data))return Rt(t),!0;if(!B[i]||G[i]){if(!G[i]&&zt(i)&&(z.tagNameCheck instanceof RegExp&&im(z.tagNameCheck,i)||z.tagNameCheck instanceof Function&&z.tagNameCheck(i)))return!1;if(ot&&!lt[i]){const e=b(t)||t.parentNode,n=_(t)||t.childNodes;if(n&&e)for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(t.__removalCount||0)+1,e.insertBefore(r,v(t))}}return Rt(t),!0}return t instanceof c&&!function(t){let e=b(t);(!e||!e.tagName)&&(e={namespaceURI:yt,tagName:"template"});const n=qg(t.tagName),i=qg(e.tagName);return!!_t[t.namespaceURI]&&(t.namespaceURI===gt?e.namespaceURI===mt?"svg"===n:e.namespaceURI===pt?"svg"===n&&("annotation-xml"===i||xt[i]):!!kt[n]:t.namespaceURI===pt?e.namespaceURI===mt?"math"===n:e.namespaceURI===gt?"math"===n&&wt[i]:!!Lt[n]:t.namespaceURI===mt?!(e.namespaceURI===gt&&!wt[i]||e.namespaceURI===pt&&!xt[i])&&!Lt[n]&&(Et[n]||!kt[n]):!("application/xhtml+xml"!==Tt||!_t[t.namespaceURI]))}(t)||("noscript"===i||"noembed"===i||"noframes"===i)&&im(/<\/no(script|embed|frames)/i,t.innerHTML)?(Rt(t),!0):(X&&3===t.nodeType&&(e=t.textContent,Vg([C,D,k],t=>{e=Jg(e,t," ")}),t.textContent!==e&&(Zg(n.removed,{element:t.cloneNode()}),t.textContent=e)),Ft(A.afterSanitizeElements,t,null),!1)},$t=function(t,e,n){if(it&&("id"===e||"name"===e)&&(n in i||n in At))return!1;if((!W||j[e]||!im(L,e))&&(!V||!im(R,e)))if(!H[e]||j[e]){if(!(zt(t)&&(z.tagNameCheck instanceof RegExp&&im(z.tagNameCheck,t)||z.tagNameCheck instanceof Function&&z.tagNameCheck(t))&&(z.attributeNameCheck instanceof RegExp&&im(z.attributeNameCheck,e)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(e))||"is"===e&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&im(z.tagNameCheck,n)||z.tagNameCheck instanceof Function&&z.tagNameCheck(n))))return!1}else if(!dt[e]&&!im(U,Jg(n,N,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==tm(n,"data:")||!ut[t])&&(!Y||im(I,Jg(n,N,"")))&&n)return!1;return!0},zt=function(t){return"annotation-xml"!==t&&Qg(t,P)},Gt=function(t){Ft(A.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||Ut(t))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let r=e.length;for(;r--;){const o=e[r],{name:s,namespaceURI:a,value:l}=o,c=Ot(s),u=l;let h="value"===s?u:em(u);if(i.attrName=c,i.attrValue=h,i.keepAttr=!0,i.forceKeepAttr=void 0,Ft(A.uponSanitizeAttribute,t,i),h=i.attrValue,rt&&("id"===c||"name"===c)&&(It(s,t),h="user-content-"+h),q&&im(/((--!?|])>)|<\/(style|title)/i,h)){It(s,t);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){It(s,t);continue}if(!Z&&im(/\/>/i,h)){It(s,t);continue}X&&Vg([C,D,k],t=>{h=Jg(h,t," ")});const d=Ot(t.nodeName);if($t(d,c,h)){if(x&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!a)switch(p.getAttributeType(d,c)){case"TrustedHTML":h=x.createHTML(h);break;case"TrustedScriptURL":h=x.createScriptURL(h)}if(h!==u)try{a?t.setAttributeNS(a,s,h):t.setAttribute(s,h),Ut(t)?Rt(t):Yg(n.removed)}catch{It(s,t)}}else It(s,t)}Ft(A.afterSanitizeAttributes,t,null)},jt=function t(e){let n=null;const i=Pt(e);for(Ft(A.beforeSanitizeShadowDOM,e,null);n=i.nextNode();)Ft(A.uponSanitizeShadowNode,n,null),Ht(n),Gt(n),n.content instanceof s&&t(n.content);Ft(A.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,a=null,c=null;if(vt=!t,vt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Bt(t)){if("function"!=typeof t.toString)throw rm("toString is not a function");if("string"!=typeof(t=t.toString()))throw rm("dirty is not a string, aborting")}if(!n.isSupported)return t;if(Q||Dt(e),n.removed=[],"string"==typeof t&&(st=!1),st){if(t.nodeName){const e=Ot(t.nodeName);if(!B[e]||G[e])throw rm("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)i=Nt("\x3c!----\x3e"),o=i.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!tt&&!X&&!K&&-1===t.indexOf("<"))return x&&nt?x.createHTML(t):t;if(i=Nt(t),!i)return tt?null:nt?w:""}i&&J&&Rt(i.firstChild);const u=Pt(st?t:i);for(;a=u.nextNode();)Ht(a),Gt(a),a.content instanceof s&&jt(a.content);if(st)return t;if(tt){if(et)for(c=S.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(H.shadowroot||H.shadowrootmode)&&(c=M.call(r,c,!0)),c}let h=K?i.outerHTML:i.innerHTML;return K&&B["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&im(Cm,i.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+h),X&&Vg([C,D,k],t=>{h=Jg(h,t," ")}),x&&nt?x.createHTML(h):h},n.setConfig=function(){Dt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){Mt=null,Q=!1},n.isValidAttribute=function(t,e,n){Mt||Dt({});const i=Ot(t),r=Ot(e);return $t(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&Zg(A[t],e)},n.removeHook=function(t,e){if(void 0!==e){const n=Wg(A[t],e);return-1===n?void 0:Xg(A[t],n,1)[0]}return Yg(A[t])},n.removeHooks=function(t){A[t]=[]},n.removeAllHooks=function(){A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Rm=t=>Lm.sanitize(t,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),Im=t=>Lm.sanitize(t,{ALLOWED_TAGS:[]}),Nm=class t extends Ig{constructor(){super(...arguments),this.type="toolbar",this.renderType=L.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(k.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(k.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const e=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(lc(this.getOptions(),"data","loading"))e.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=e.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:t,overflowMenuItemList:n}=this.getControlConfigs();n&&t.push(this.getOverflowButtonConfig());const i=e.selectAll("div.toolbar-control").data(t,t=>t.id);i.exit().remove();const r=i.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;r.merge(i).classed("disabled",t=>t.shouldBeDisabled()).attr("role","button").attr("aria-disabled",t=>t.shouldBeDisabled()).attr("aria-label",t=>t.title).html(t=>`\n\t\t\t<button\n\t \t\t\ttype="button"\n\t\t\t\tclass="cds--overflow-menu__trigger cds--overflow-menu__trigger"\n\t\t\t\taria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${Im(t.id)}`)}" aria-label="${Im(t.title)}">\n\t\t\t\t<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">\n\t\t\t\t\t${(t=>Lm.sanitize(t,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}))(t.iconSVG.content)}\n\t\t\t\t</svg>\n\t\t\t</button>`).each(function(t,e){xu(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",void 0!==t.iconSVG.width?t.iconSVG.width:"20px").style("height",void 0!==t.iconSVG.height?t.iconSVG.height:"20px"),xu(this).select("button").on("mouseover focus",function(e){const n=xu(this);n.classed("hovered",!0),o.services.events.dispatchEvent(k.Toolbar.SHOW_TOOLTIP,{event:e,hoveredElement:n,content:t.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(k.Toolbar.HIDE_TOOLTIP)}).on("click",e=>{t.shouldBeDisabled()||o.triggerFunctionAndEvent(t,e,this)}).on("keydown",n=>{n.key&&"Enter"===n.key||" "===n.key?(n.preventDefault(),o.triggerFunctionAndEvent(t,n,this)):n.key&&"ArrowLeft"===n.key?o.focusOnPreviousEnabledToolbarItem(e):n.key&&"ArrowRight"===n.key&&o.focusOnNextEnabledToolbarItem(e)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),e=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,t=>lc(t,"id"));e.exit().remove();const n=e.enter().append("li").attr("id",t=>this.services.domUtils.generateElementIDString(`control-${t.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);n.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),n.merge(e).classed("cds--overflow-menu-options__option--disabled",t=>t.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",t=>t.shouldBeDisabled()).attr("aria-disabled",t=>t.shouldBeDisabled()).selectAll("button").text(t=>t.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),xu(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(k.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(k.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const e=this.getToolbarButtonItems();let n=e.length;for(let i=t-1;i>=0;i--)if(!e[i].shouldBeDisabled()){n=i;break}if(n<e.length){const t=xu(`button#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)}`).node();"focus"in t&&t.focus()}}focusOnNextEnabledToolbarItem(t){const e=this.getToolbarButtonItems();let n=-1;for(let i=t+1;i<e.length;i++)if(!e[i].shouldBeDisabled()){n=i;break}if(n>-1){const t=xu(`button#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)}`).node();"focus"in t&&t.focus()}}focusOnPreviousEnabledMenuItem(t){const e=this.getOverflowMenuItems();let n=e.length;for(let i=t-1;i>=0;i--)if(!e[i].shouldBeDisabled()){n=i;break}if(n<e.length){const t=xu(`#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)} button`).node();"focus"in t&&t.focus()}}focusOnNextEnabledMenuItem(t){const e=this.getOverflowMenuItems();let n=-1;for(let i=t+1;i<e.length;i++)if(!e[i].shouldBeDisabled()){n=i;break}if(n>-1){const t=xu(`#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)} button`).node();"focus"in t&&t.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const e=this;this.getOverflowMenuItems().forEach((n,i)=>{const r=xu(`#${this.services.domUtils.generateElementIDString(`control-${n.id}`)}`);null!==r&&(r.on("click",()=>{e.triggerFunctionAndEvent(n,t,r.node()),e.updateOverflowMenu(!1)}),r.on("keydown",o=>{o&&"Enter"===o.key?e.triggerFunctionAndEvent(n,t,r.node()):o&&"ArrowUp"===o.key?e.focusOnPreviousEnabledMenuItem(i):o&&"ArrowDown"===o.key?e.focusOnNextEnabledMenuItem(i):o&&"Escape"===o.key&&e.updateOverflowMenu(!1),o.preventDefault()}))}),e.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,e,n){"function"==typeof t.shouldBeDisabled&&t.shouldBeDisabled()||("function"==typeof t.clickFunction&&t.clickFunction(e),this.services.events.dispatchEvent(k.Toolbar.BUTTON_CLICK,{control:t,event:e,element:n}))}getControlConfigs(){const e=lc(this.getOptions(),"toolbar","numberOfIcons")-1,n=lc(this.getOptions(),"toolbar","controls"),i=[],r=[],o=[];return n.forEach(n=>{let s=null;if(n.type===K.CUSTOM)null===lc(n,"id")&&(n.id="toolbar-button-"+t.buttonID++),null===lc(n,"shouldBeDisabled")&&(n.shouldBeDisabled=()=>!1),s=n;else{const t=this.services.domUtils.isFullScreenMode();n.type===K.MAKE_FULLSCREEN&&t?n.type=K.EXIT_FULLSCREEN:n.type===K.EXIT_FULLSCREEN&&!t&&(n.type=K.MAKE_FULLSCREEN),s=this.getControlConfigByType(n.type)}s&&(s.text=n.text?n.text:n.type,-1!==s.id.indexOf("toolbar-export")?i.push(s):r.length<e?null===lc(s,"iconSVG","content")?o.push(s):r.push(s):o.push(s))}),o.push(...i),o.length?{buttonList:r,overflowMenuItemList:o}:{buttonList:r}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:e}=this.getControlConfigs();return e&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=lc(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>\n\t\t\t\t<circle cx="16" cy="16" r="2"></circle>\n\t\t\t\t<circle cx="16" cy="24" r="2"></circle>'},clickFunction:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const e=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),n=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:r,exportAsJPG:o,exportAsPNG:s,zoomIn:a,zoomOut:l,resetZoom:c,makeFullScreen:u,exitFullScreen:h,showAsTable:d}=lc(i,"locale","translations","toolbar");let f;switch(t){case K.ZOOM_IN:e&&(f={id:"toolbar-zoomIn",title:a,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case K.ZOOM_OUT:e&&(f={id:"toolbar-zoomOut",title:l,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case K.RESET_ZOOM:e&&(f={id:"toolbar-resetZoom",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case K.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:u,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case K.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 K.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:d,shouldBeDisabled:()=>0===n.length,clickFunction:()=>this.services.events.dispatchEvent(k.Modal.SHOW)};break;case K.EXPORT_CSV:f={id:"toolbar-export-CSV",title:r,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case K.EXPORT_PNG:f={id:"toolbar-export-PNG",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case K.EXPORT_JPG:f={id:"toolbar-export-JPG",title:o,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 K.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"/>\n\t\t\t\t\t\t<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 K.ZOOM_OUT:return'<rect x="9" y="13" width="10" height="2"/>\n\t\t\t\t\t\t<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 K.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 K.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 K.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 K.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 K.EXPORT_CSV:case K.EXPORT_JPG:case K.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)}}};Nm.buttonID=0;let Pm=Nm;const Um=class t extends Ig{constructor(e,n,i,r){super(e,n,r),this.type="layout",this.configs=r,this.children=i,this._instanceID=t.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(t=>{t.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let e=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>{const e=lc(t,"growth");return e===V.PREFERRED||e===V.FIXED}).each(function(t){e+=t.size}),e}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>lc(t,"growth")===V.STRETCH).size()}render(t=!0){const e=this.model.getOptions(),n=this.parent,{width:i,height:r}=If.getHTMLElementSize(n.node()),o=this.configs.direction===j.ROW||this.configs.direction===j.ROW_REVERSE,s=lc(this.model.getOptions(),"style","prefix"),a=n.classed(`${al}--${s}--layout-row`,this.configs.direction===j.ROW).classed(`${al}--${s}--layout-row-reverse`,this.configs.direction===j.ROW_REVERSE).classed(`${al}--${s}--layout-column`,this.configs.direction===j.COLUMN).classed(`${al}--${s}--layout-column-reverse`,this.configs.direction===j.COLUMN_REVERSE).classed(`${al}--${s}--layout-alignitems-center`,this.configs.alignItems===W.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,t=>t.id);a.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",t=>`layout-child layout-child-${this._instanceID} ${t.id}`).each(function(n){n.components.forEach(i=>{const r=xu(this),o=lc(n,"renderType")===L.SVG;i.setParent(o?If.appendOrSelect(r,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):r),o&&!r.select("svg.layout-svg-wrapper").attr("aria-label")&&r.select("svg.layout-svg-wrapper").attr("aria-label",e?.accessibility?.svgAriaLabel||e?.title);const s=lc(n,"growth");(s===V.PREFERRED||s===V.FIXED)&&i.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(t){const e=lc(t,"growth"),n=lc(t,"renderType")===L.SVG?If.getSVGElementSize(xu(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):If.getHTMLElementSize(this);if(e===V.PREFERRED){const e=o?n.width:n.height,s=o?i:r;t.size=e/s*100}}),a.exit().remove(),this.children.filter(t=>lc(t,"growth")===V.STRETCH).forEach(t=>{t.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,t=>t.id);o?l.style("width",t=>t.size/100*i+"px").style("height","100%"):l.style("height",t=>t.size/100*r+"px").style("width","100%"),l.each(function(e){e.components.forEach(n=>{lc(e,"growth")===V.STRETCH&&n.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(e=>{e.components.forEach(e=>e.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(e=>{e.components.forEach(e=>e.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(t=>t.destroy())})}};Um.instanceID=Math.floor(99999999999*Math.random());let Bm=Um;class Fm extends Ig{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||yl}px`).style("height",`${this.configs.size||yl}px`).attr("opacity",0)}}class Hm extends Ig{constructor(t,e,n){super(t,e,n),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const t=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${t}__modal-title`).attr("aria-describedby",`${t}__modal-description`).attr("tabindex",-1).style("opacity",1).style("visibility","visible"),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),this.modal.on("click",this.handleHideModal),this.modal.select(".cds--modal-container").on("click",t=>{t.stopPropagation()}),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=t=>{"Escape"===t.key&&this.handleHideModal()},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null).style("opacity",0).style("visibility","hidden"),this.modal.on("click",null),this.modal.select(".cds--modal-container").on("click",null),this.modal.select(".cds--modal-close").on("click",null),typeof window<"u"&&window.removeEventListener("keydown",this.handleEscapeKey)},this.init()}addEventListeners(){this.services.events.addEventListener(k.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(k.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),e=this.model.getOptions(),{title:n,downloadAsCSV:i}=lc(e,"locale","translations","tabularRep"),r=lc(e,"style","prefix"),o=this.model.getTabularDataArray();return`\n\t\t<div class="cds--modal-container">\n\t\t\t<div class="cds--modal-header">\n\n\t\t\t\t<p class="cds--modal-header__label cds--type-delta" id="modal-title">${n}</p>\n\n\t\t\t\t<p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${Im(e.title)}</p>\n\n\t\t\t\t<button class="cds--modal-close" type="button" data-modal-close aria-label="close modal" data-modal-primary-focus>\n\t\t\t\t\t<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="cds--modal-close__icon">\n\t\t\t\t\t\t<path d="M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z"></path>\n\t\t\t\t\t</svg>\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t\t<div class="cds--modal-content">\n\t\t\t\t<table class="cds--data-table cds--data-table--no-border">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t${xn(o,0).map(t=>`<th scope="col">\n\t\t\t\t\t\t\t\t<div class="cds--table-header-label">${Im(t)}</div>\n\t\t\t\t\t\t\t</th>`).join("")}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\n\t\t\t\t\t<tbody>${o.slice(1).map(t=>`\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t${t.map(t=>`<td>${Im(t)}</td>`).join("")}\n\t\t\t\t\t\t\t</tr>`).join("")}\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\n\t\t\t<div class="cds--modal-footer">\n\t\t\t <div class="${al}--${r}-modal-footer-spacer"></div>\n\t\t\t <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>\n\t\t\t</div>\n\t\t</div>`}render(t=!1){const e=this.model.getOptions();if(!this.isEventListenerAdded){const t=xu(this.services.domUtils.getHolder()),n=lc(e,"style","prefix");this.modal=If.appendOrSelect(t,`div.${al}--${n}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class $m extends Ig{constructor(){super(...arguments),this.type="title",this.renderType=L.HTML}render(t=!1){const e=this.getComponentContainer(),n=lc(this.getOptions(),"title"),i=e.selectAll("p.title").data([n]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(t=>Im(t)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const t=this;i.on("mouseover",function(e){t.services.events.dispatchEvent(k.Tooltip.SHOW,{event:e,hoveredElement:i,content:i.text()})}).on("mousemove",function(e){t.services.events.dispatchEvent(k.Tooltip.MOVE,{event:e})}).on("mouseout",function(){t.services.events.dispatchEvent(k.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,e){if(e<=0)return;const n=t.text();if(t.node().getComputedTextLength()>e){t.append("tspan").text("...");const i=If.appendOrSelect(t,"tspan").node().getComputedTextLength(),r=t.text(),o=this.getSubstringIndex(t.node(),0,r.length-1,e-i);t.html(r.substring(0,o-1)).append("tspan").text("...");const s=this;t.on("mouseover",function(e){s.services.events.dispatchEvent(k.Tooltip.SHOW,{event:e,hoveredElement:t,content:n})}).on("mousemove",function(t){s.services.events.dispatchEvent(k.Tooltip.MOVE,{event:t})}).on("mouseout",function(){s.services.events.dispatchEvent(k.Tooltip.HIDE)})}}getMaxTitleWidth(){return If.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,e,n,i){const r=Math.floor((n+e)/2);return t.getSubStringLength(0,r)>i?this.getSubstringIndex(t,e,r,i):t.getSubStringLength(0,r)<i?t.getSubStringLength(0,r+1)>i?r:this.getSubstringIndex(t,r,n,i):r}}class zm extends Ig{constructor(){super(...arguments),this.type="legend",this.renderType=L.HTML}render(t=!1){const e=this.getOptions(),n=lc(e,"legend"),i=lc(n,"alignment"),r=lc(e,"legend","orientation");let o=this.model.getDataGroups();const{DISABLED:s}=ml.items.status,a=o.some(t=>t.status===s),l=lc(n,"order"),c=this.getComponentContainer().classed("center-aligned",i===$.CENTER).classed("right-aligned",i===$.RIGHT).classed(r||"horizontal",!0).classed("has-deactivated-items",a).attr("role",Vc.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");l&&(o=this.sortDataGroups(o,l));const u=c.selectAll("div.legend-item").data(o,t=>t.name),h=u.enter().append("div").attr("class","legend-item");h.merge(c.selectAll("div.legend-item")).classed("active",function(t){return t.status===ml.items.status.ACTIVE});const d=lc(this.getOptions(),"legend","clickable");c.classed("clickable",d&&o.length>1);const f=ml.checkbox.radius,p=h.append("div").classed("checkbox",!0),g=p.merge(u.select("div.checkbox")).attr("role",Vc.CHECKBOX).attr("tabindex",d?0:-1).attr("aria-labelledby",(t,e)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${e}-title`)).attr("aria-checked",({status:t})=>t===ml.items.status.ACTIVE).attr("width",2*f).attr("height",2*f).attr("class",t=>this.model.getColorClassName({classNameTypes:[I.BACKGROUND],dataGroupName:t.name,originalClassName:"checkbox"})).style("background",t=>t.status===ml.items.status.ACTIVE?this.model.getFillColor(t.name)||this.model.getStrokeColor(t.name):null).classed("active",function(t){return t.status===ml.items.status.ACTIVE});p.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(u.select("p"));const m=lc(e,"legend","additionalItems");if(m&&o.length){const t=this,e=c.selectAll("div.additional-item").data(m);e.exit().remove();const n=e.enter().append("div").merge(e).classed("legend-item",!0).classed("additional",!0).attr("role","img").attr("aria-labelledby",(t,e)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+e}-title`));n.selectAll("*").remove();let i,r=1;n.append("svg").classed("icon",!0).each(function(e){const n=xu(this);i&&i==e.type?r++:(i=e.type,r=1),t.addAdditionalItem(n,e,r)}),n.append("p").merge(n.select("p")),this.truncateLegendText()}u.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),d&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,e){if(t.sort((t,n)=>e.indexOf(t.name)-e.indexOf(n.name)),e.length<t.length){const n=t.length-e.length;return t.slice(n).concat(t.slice(0,n))}return t}addAdditionalItem(t,e,n){const{width:i,height:r}=ml.area;if(e.type===J.RADIUS?t.style("width",`${r}px`).style("height",`${r}px`):t.style("width",`${i}px`).style("height",`${r}px`),e.type===J.RADIUS){const{iconData:n,fill:i,stroke:r}=ml.radius;t.attr("fill","none").selectAll("circle").data(n).enter().append("circle").classed("radius",!0).attr("role",Vc.IMG).attr("aria-label","radius").attr("cx",t=>t.cx).attr("cy",t=>t.cy).attr("r",t=>t.r).style("fill",e.fill?e.fill:i).style("stroke",e.stroke?e.stroke:r)}else if(e.type===J.LINE){const r=ml.line;t.select("line.line").empty()&&t.append("line").classed(`line-${n}`,!0).attr("role",Vc.IMG).attr("aria-label","line").attr("x1",0).attr("y1",r.yPosition).attr("x2",i).attr("y2",r.yPosition).style("stroke",e.stroke?e.stroke:r.stroke).style("stroke-width",r.strokeWidth)}else if(e.type===J.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${n}`,!0).attr("role",Vc.IMG).attr("aria-label","area").attr("width",i).attr("height",r).style("fill",n>3&&!e.fill?ml.area.fill:e.fill).style("stroke",e.stroke);else if(e.type===J.SIZE){const{iconData:n,fill:i,stroke:r}=ml.size;t.attr("fill","none").attr("role",Vc.IMG).attr("aria-label","size").selectAll("rect").data(n).enter().append("rect").classed("size",!0).attr("width",t=>t.width).attr("height",t=>t.height).attr("y",()=>0).style("fill",e.fill?e.fill:i).style("stroke",e.stroke?e.stroke:r).style("stroke-width",1)}else if(e.type===J.QUARTILE){const{iconData:e}=ml.quartile;t.selectAll("rect").attr("role",Vc.IMG).attr("aria-label","quartile").data(e).enter().append("rect").attr("class",(t,e)=>"quartile-"+(0===e?"wrapper":"line")).attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height)}else if(e.type===J.ZOOM){const{iconData:n,color:i}=lc(ml,"zoom"),r=t.attr("role",Vc.IMG).attr("aria-label","zoom").selectAll("g.icon").data(n).enter();r.append("g").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.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",()=>e.color?e.color:i),r.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",()=>e.color?e.color:i)}}truncateLegendText(){const t=this.getComponentContainer(),e=lc(this.getOptions(),"legend","truncation"),n=lc(e,"type"),i=lc(e,"threshold"),r=lc(e,"numCharacter"),o=t.selectAll("div.legend-item p");o.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),n!==U.NONE?o.html(function(t){const e=Im(t.name);return e.length>i&&e.length!==r?sc(e,n,r):e}):o.html(t=>Im(t.name))}addEventListeners(){const t=this,e=this.getComponentContainer(),n=this.getOptions(),i=lc(n,"legend"),r=lc(i,"truncation");e.selectAll("div.legend-item").on("mouseover",function(e){t.services.events.dispatchEvent(k.Legend.ITEM_HOVER,{hoveredElement:xu(this)});const n=xu(this);n.select("div.checkbox").classed("hovered",!0);const i=n.datum();i.name.length>r.threshold&&r.numCharacter<i.name.length&&r.type!==U.NONE&&t.services.events.dispatchEvent(k.Tooltip.SHOW,{event:e,hoveredElement:n,content:i.name})}).on("mousemove",function(e){xu(this).datum().name.length>r.threshold&&r.type!==U.NONE&&t.services.events.dispatchEvent(k.Tooltip.MOVE,{event:e})}).on("click",function(){t.services.events.dispatchEvent(k.Legend.ITEM_CLICK,{clickedElement:xu(this)});const e=xu(this).datum();t.model.toggleDataLabel(e.name)}).on("mouseout",function(){const e=xu(this);e.select("div.checkbox").classed("hovered",!1),e.datum().name.length>r.threshold&&r.type!==U.NONE&&t.services.events.dispatchEvent(k.Tooltip.HIDE),t.services.events.dispatchEvent(k.Legend.ITEM_MOUSEOUT,{hoveredElement:e})}),e.selectAll("div.legend-item div.checkbox").on("keyup",function(e){e.key&&"Tab"===e.key&&t.services.events.dispatchEvent(k.Legend.ITEM_HOVER,{hoveredElement:xu(this)})}),e.selectAll("div.legend-item div.checkbox").on("keydown",function(e,n){e.key&&" "===e.key?(e.preventDefault(),t.model.toggleDataLabel(n.name)):e.key&&"Tab"===e.key&&t.services.events.dispatchEvent(k.Legend.ITEM_MOUSEOUT,{hoveredElement:xu(this)})}),e.selectAll("g.additional-item").on("mouseover",function(e){const n=xu(this),i=n.datum();i.name.length>r.threshold&&t.services.events.dispatchEvent(k.Tooltip.SHOW,{event:e,hoveredElement:n,content:i.name})})}}class Gm extends Ig{constructor(t,e,n){super(t,e,n),this.type="chart-clip",this.renderType=L.SVG,this.chartClipId="chart-clip-id-"+Math.floor(99999999999*Math.random()),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:e}=this.services;if(!e)throw new Error("Service cartesianScales was undefined");const n=e.getMainXScale(),i=e.getMainYScale(),[r,o]=n.range(),[s,a]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=If.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=If.appendOrSelect(this.chartClipPath,`rect.${this.type}`);o-r>0&&l.attr("x",r).attr("y",a).attr("width",o-r).attr("height",s-a),this.chartClipPath.merge(l).lower()}}class jm extends Gm{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(99999999999*Math.random())}createClipPath(){const t=this.parent,{width:e,height:n}=If.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=If.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=If.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",e).attr("height",n),this.chartClipPath.merge(i).lower()}}var Vm,Wm;!function(t){t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"}(Wm||(Wm={}));var Ym=((Vm={})[Wm.LEFT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left-e.offsetWidth)}},Vm[Wm.RIGHT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left+n.width)}},Vm[Wm.TOP]=function(t,e,n){return{top:Math.round(t.top-e.offsetHeight),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Vm[Wm.BOTTOM]=function(t,e,n){return{top:Math.round(t.top+n.height),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Vm),Zm=typeof window<"u"?window:{innerHeight:0,innerWidth:0},Xm=function(){function t(t){void 0===t&&(t={}),this.positions=Ym,this.positions=Object.assign({},Ym,t)}return t.prototype.getRelativeOffset=function(t){for(var e={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&"static"===getComputedStyle(t.offsetParent).position;)e.left+=t.offsetLeft,e.top+=t.offsetTop,t=t.offsetParent;return e},t.prototype.getAbsoluteOffset=function(t){for(var e=t,n={top:0,left:0};e.offsetParent;){var i=getComputedStyle(e.offsetParent);"static"===i.position&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(n.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(n.left+=parseInt(i.marginLeft,10))),e=e.offsetParent}var r=t.getBoundingClientRect(),o=document.body.getBoundingClientRect();return{top:r.top-o.top+n.top,left:r.left-o.left+n.left}},t.prototype.findRelative=function(t,e,n){var i=this.getRelativeOffset(t),r=t.getBoundingClientRect();return this.calculatePosition(i,r,e,n)},t.prototype.findAbsolute=function(t,e,n){var i=this.getAbsoluteOffset(t),r=t.getBoundingClientRect();return this.calculatePosition(i,r,e,n)},t.prototype.findPosition=function(t,e,n,i){void 0===i&&(i=this.getAbsoluteOffset.bind(this));var r=i(t),o=t.getBoundingClientRect();return this.calculatePosition(r,o,e,n)},t.prototype.findPositionAt=function(t,e,n){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},e,n)},t.prototype.getPlacementBox=function(t,e){var n=t.offsetHeight+e.top,i=t.offsetWidth+e.left;return{top:e.top,bottom:n,left:e.left,right:i}},t.prototype.addOffset=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Object.assign({},t,{top:t.top+e,left:t.left+n})},t.prototype.setElement=function(t,e){t.style.top=e.top+"px",t.style.left=e.left+"px"},t.prototype.findBestPlacement=function(t,e,n,i,r){var o=this;void 0===i&&(i=this.defaultContainerFunction.bind(this)),void 0===r&&(r=this.findPosition.bind(this));var s=n.map(function(n){var s=r(t,e,n),a=o.getPlacementBox(e,s),l=0,c=0,u=i();a.top<u.top?l=u.top-a.top:a.bottom>u.height&&(l=a.bottom-u.height),a.left<u.left?c=u.left-a.left:a.right>u.width&&(c=a.right-u.width),l&&!c?c=1:c&&!l&&(l=1);var h=e.offsetHeight*e.offsetWidth;return{placement:n,weight:(h-l*c)/h}});return s.sort(function(t,e){return e.weight-t.weight}),s[0].placement},t.prototype.findBestPlacementAt=function(t,e,n,i){var r=this;return void 0===i&&(i=this.defaultContainerFunction.bind(this)),this.findBestPlacement(null,e,n,i,function(e,n,i){return r.findPositionAt(t,n,i)})},t.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Zm.innerHeight,width:Zm.innerWidth}},t.prototype.calculatePosition=function(t,e,n,i){return this.positions[i]?this.positions[i](t,n,e):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},t}();new Xm;class qm extends Ig{constructor(t,e,n){super(t,e,n),this.type="tooltip",this.renderType=L.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new Xm,this.handleShowTooltip=t=>{const e=t.detail.data||t.detail.items,n=xu(t.detail.event.target).datum();let i;const r=this.formatItems(this.getItems(t));i=t.detail.content?`<div class="title-tooltip"><p>${Rm(t.detail.content)}</p></div>`:Rm(this.getTooltipHTML(r));const o=If.appendOrSelect(this.tooltip,"div.content-box");if(lc(this.getOptions(),"tooltip","customHTML"))if(t.detail.content){const e=`<div class="title-tooltip"><p>${Rm(t.detail.content)}</p></div>`;o.html(e)}else o.html(`<div class="title-tooltip"><p>${Rm(this.model.getOptions().tooltip.customHTML(e,i,n))}</p></div>`);else o.html(i);o.selectAll(".datapoint-tooltip").each(function(t,e){const n=r[e];r[e]&&r[e].color&&xu(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",n.color)}),this.positionTooltip(t),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=t.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(k.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==k.Toolbar.SHOW_TOOLTIP&&!1===this.tooltip.classed("hidden")&&this.positionTooltip(t)}),this.services.events.addEventListener(k.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(k.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(k.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(k.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(k.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(k.Tooltip.MOVE,null),this.services.events.removeEventListener(k.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(k.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(k.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(k.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(k.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const e=this.getOptions(),n=lc(e,"tooltip","truncation","type"),i=lc(e,"tooltip","truncation","threshold"),r=lc(e,"tooltip","truncation","numCharacter");return n!==U.NONE?t.map(t=>{const e=t.labelIcon?12:0;return t.value=this.valueFormatter(t.value,t.label),t.label&&t.label.length+e>i&&(t.label=sc(t.label,n,r)),t.value&&t.value.length>i&&(t.value=sc(t.value,n,r)),t}):t.map(t=>(t.value=this.valueFormatter(t.value,t.label),t))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(t=>`<li>\n\t\t\t\t\t<div class="datapoint-tooltip${t.bold?" bold":""}">\n\t\t\t\t\t\t${t.class||t.color?`<div class="tooltip-color ${t.class}"></div>`:""}\n\t\t\t\t\t\t<div class="label">\n\t\t\t\t\t\t<p>${t.label||""}</p>\n\t\t\t\t\t\t${t.labelIcon?`<span class="label-icon"/>${t.labelIcon}</span>`:""}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${void 0===t.value||null===t.value?"":`<p class="value"/>${t.value}</p>`}\n\t\t\t\t\t</div>\n\t\t\t\t</li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,e){const n=this.getOptions(),i=lc(n,"tooltip","valueFormatter"),{code:r,number:o,date:s}=lc(n,"locale");if(i)return i(t,e);if(this.isDate(t))return s(t,r,{month:"short",day:"numeric",year:"numeric"});try{if("string"==typeof t&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return s(new Date(t),r,{month:"short",day:"numeric",year:"numeric"})}catch{}return o(t,r)}render(t=!1){const e=this.getOptions(),n=lc(e,"tooltip","enabled");if(n){const t=xu(this.services.domUtils.getHolder()),n=lc(e,"style","prefix");this.tooltip=If.appendOrSelect(t,`div.${al}--${n}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!n&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,e,n){const i=Object.assign({},t);return e==Wm.LEFT?i.left-=n:e==Wm.RIGHT?i.left+=n:e==Wm.TOP?i.top-=n:e==Wm.BOTTOM&&(i.top+=n),i}positionTooltip(t){const e=this.services.domUtils.getHolder(),n=e.offsetWidth,i=e.offsetHeight,r=this.tooltip.node(),o=this.getOptions(),s=lc(o,"zoomBar","top","enabled"),a=!!lc(t,"detail","noWrap"),l=Array.isArray(lc(t,"detail","placements")),c=l?lc(t,"detail","placements"):[Wm.RIGHT,Wm.LEFT,Wm.TOP,Wm.BOTTOM];let u,{horizontalOffset:h}=vl;const{defaultOffset:d}=vl;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",a),l){const e=lc(t,"detail","event","target"),o=this.services.domUtils.getElementOffset(e,!0);u=this.positionService.findBestPlacementAt(o,r,c,()=>({top:0,left:0,width:n,height:i}));let s=this.positionService.findPosition(e,r,u,()=>this.services.domUtils.getElementOffset(e));return s=this.addOffsetByPlacement(s,u,d),void this.positionService.setElement(r,s)}let f=lc(t,"detail","mousePosition");if(f){const t=lc(o,"zoomBar","top","type"),e=bl.height[t];s&&(f[1]+=e+bl.spacerHeight)}else f=No(lc(t,"detail","event"),e);u=f[0]/n>.9?Wm.LEFT:f[0]/n<.1?Wm.RIGHT:this.positionService.findBestPlacementAt({left:f[0],top:f[1]},r,c,()=>({top:void 0,left:void 0,width:n,height:i})),u===Wm.LEFT&&(h*=-1);const p=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},r,u);this.positionService.setElement(r,p)}}const Km=class t extends Ig{constructor(){super(...arguments),this.type="grid-brush",this.renderType=L.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const n=this.parent,i=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const r=If.appendOrSelect(n,"svg.chart-grid-backdrop"),o=If.appendOrSelect(r,`g.${this.type}`),s=If.appendOrSelect(o,this.selectionSelector),{width:a,height:l}=If.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();i.attr("transform",`translate(${d},0)`);const f=If.appendOrSelect(i,this.frontSelectionSelector);if(h&&u===F.TIME){let e=this.model.get("zoomDomain");void 0===e&&(e=this.services.zoom.getDefaultZoomBarDomain(),e&&this.model.set({zoomDomain:e},{animate:!1}));const n=e=>{const n=e[1]-e[0];let i="0,"+n.toString();const r=Math.floor(l/t.DASH_LENGTH),o=r*t.DASH_LENGTH;for(let e=0;e<r;e++)i+=","+t.DASH_LENGTH;i+=","+(l-o),r%2==1&&(i+=",0"),i+=","+n.toString(),i+=","+l.toString(),f.attr("stroke-dasharray",i)},i=t=>{const e=t.selection;null===e||e[0]===e[1]||(f.attr("x",parseFloat(s.attr("x"))+parseFloat(r.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),n(e))},c=(t,n)=>{const i=Pd().range([0,a]).domain(e);let r=[i.invert(t),i.invert(n)];r[0].valueOf()===r[1].valueOf()&&(r=this.services.zoom.getDefaultZoomBarDomain()),(e[0].valueOf()!==r[0].valueOf()||e[1].valueOf()!==r[1].valueOf())&&this.services.zoom.handleDomainChange(r)};let u;const h=t=>{const e=t.selection;null!==e&&(c(e[0],e[1]),o.call(u.move,null),f.style("display","none"))};0!=l&&0!=a&&(u=Kp().extent([[0,0],[a-1,l]]).on("start brush end",i).on("end.brushed",h),o.call(u));const d=this.services.zoom.getZoomRatio();r.on("click",function(t){if(t.shiftKey){const t=this.services.domUtils.getHolder(),e=No(o.node(),t)[0];let n=e-a*d/2;n<0&&(n=0);let i=e+a*d/2;i>a&&(i=a),c(n,i)}})}}};Km.DASH_LENGTH=4;let Qm=Km;class Jm extends Ig{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=L.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(99999999999*Math.random()),this.brush=Kp(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(k.ZoomBar.UPDATE,this.render.bind(this));const t=lc(this.getOptions(),"zoomBar",N.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const e=this.getComponentContainer({ariaLabel:"zoom bar"}),n=this.services.zoom.isZoomBarLoading(N.TOP),i=this.services.zoom.isZoomBarLocked(N.TOP),r=lc(this.getOptions(),"zoomBar",N.TOP,"type"),o=lc(this.getOptions(),"axes",N.BOTTOM,"highlights"),s=bl.height[r],{width:a}=If.getSVGElementSize(this.parent,{useAttrs:!0});if(0===a)return;let l=0;const c=this.model.get("axesMargins");c&&c.left&&(l=c.left);const u=If.appendOrSelect(e,"svg.zoom-container").attr("width","100%").attr("height",s).attr("opacity",1).attr("role","presentation");if(If.appendOrSelect(e,"rect.zoom-spacer").attr("x",0).attr("y",s).attr("width","100%").attr("height",bl.spacerHeight).attr("opacity",1).attr("fill","none"),r===P.GRAPH_VIEW?If.appendOrSelect(u,"rect.zoom-bg").attr("x",l).attr("y",0).attr("width",a-l).attr("height","100%").classed("zoom-bg-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):r===P.SLIDER_VIEW&&If.appendOrSelect(u,"rect.zoom-slider-bg").attr("x",l).attr("y",s/2-1).attr("width",a-l).attr("height",2).classed("zoom-slider-bg-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),n)return void this.renderSkeleton(u,l,a);const{cartesianScales:h}=this.services,d=h.getMainXScale(),f=h.getMainYScale(),p=h.getMainXScaleType();if(d&&p===F.TIME){let t=this.services.zoom.getZoomBarData();if(function(t){if(null==t)return!0;if(we(t)&&(Pt(t)||"string"==typeof t||"function"==typeof t.splice||Re(t)||$e(t)||Ce(t)))return!t.length;var e=si(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Te(t))return!Ye(t).length;for(var n in t)if(Xi.call(t,n))return!1;return!0}(t)||1===t.length)return;this.xScale=d.copy(),this.yScale=f.copy();const n=this.services.zoom.getDefaultZoomBarDomain(t);t=this.compensateDataForDefaultDomain(t,n);const c=this.model.get("initialZoomDomain"),h=lc(this.getOptions(),"zoomBar",N.TOP,"initialZoomDomain");h&&h[0]&&h[1]&&(h[0]=new Date(h[0]),h[1]=new Date(h[1])),!h||c&&c[0].valueOf()===h[0].valueOf()&&c[1].valueOf()===h[1].valueOf()?null===h&&null!==c&&this.model.set({initialZoomDomain:null,zoomDomain:qi([],n)},{skipUpdate:!0}):this.model.set({initialZoomDomain:qi([],h),zoomDomain:h?qi([],h):n},{skipUpdate:!0}),this.xScale.range([l,a]).domain(n),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,s-6]).domain(sr(t,t=>t.value));const p=this.model.get("zoomDomain");if(r===P.GRAPH_VIEW&&(this.renderZoomBarArea(u,"path.zoom-graph-area-unselected",t,null),this.updateClipPath(e,this.clipId,0,0,0,0),this.renderZoomBarArea(u,"path.zoom-graph-area",t,this.clipId),this.renderZoomBarBaseline(u,l,a),o)){const t=o.highlightStartMapsTo,e=o.highlightEndMapsTo,n=o.color,i=o.labelMapsTo;o.data.forEach((r,o)=>{If.appendOrSelect(u,`rect.highlight-${o}`).attr("height",s-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(r[t])).attr("width",this.xScale(r[e])-this.xScale(r[t])).style("fill",n&&n.scale[r[i]]?n.scale[r[i]]:null).style("fill-opacity",.1).style("stroke",n&&n.scale[r[i]]?n.scale[r[i]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(p,l,a);const g=If.appendOrSelect(e,this.brushSelector).call(this.brush);if(void 0!==p)if(p[0].valueOf()===p[1].valueOf())g.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const t=p.map(t=>this.xScale(t));t[1]-t[0]<this.MIN_SELECTION_DIFF||(g.call(this.brush.move,t),this.updateBrushHandle(this.getComponentContainer(),t))}i&&(this.brush.filter(()=>!1),g.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,e,n){const i=lc(this.getOptions(),"zoomBar",N.TOP,"type"),r=bl.height[i];this.brush.extent([[e,0],[n,r]]).on("start brush end",null).on("start brush end",e=>{const n=e.selection;null===n?this.handleBrushedEvent(e,t,this.xScale,this.xScale.range()):n[0]===n[1]||this.handleBrushedEvent(e,t,this.xScale,n)})}handleBrushedEvent(t,e,n,i){const r=[n.invert(i[0]),n.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),null!=t.sourceEvent&&("mousemove"===t.sourceEvent.type||"mouseup"===t.sourceEvent.type||"mousedown"===t.sourceEvent.type||"touchstart"===t.sourceEvent.type||"touchmove"===t.sourceEvent.type||"touchend"===t.sourceEvent.type)){let n;(void 0===e||e[0]!==r[0]||e[1]!==r[1])&&this.services.zoom.handleDomainChange(r,{dispatchEvent:!1}),"start"===t.type?n=k.ZoomBar.SELECTION_START:"brush"===t.type?n=k.ZoomBar.SELECTION_IN_PROGRESS:"end"===t.type&&(n=k.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(k.ZoomDomain.CHANGE,{newDomain:r})),this.services.events.dispatchEvent(n,{selection:i,newDomain:r})}}updateBrushHandle(t,e){const n=this,i=bl.handleWidth,r=lc(this.getOptions(),"zoomBar",N.TOP,"type"),o=bl.height[r],s=-i/2,a=bl.handleBarWidth,l=r===P.GRAPH_VIEW?bl.handleBarHeight:6,c=-a/2,u=(o-l)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(t){return"w"===t.type?Math.max(e[0]+s,n.maxSelectionRange[0]):"e"===t.type?Math.min(e[1]+s,n.maxSelectionRange[1]-i):void 0}).attr("y",0).attr("width",i).attr("height",o).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(t){return"handle-bar handle-bar--"+t.type}),h.attr("x",function(t){return"w"===t.type?Math.max(e[0]+c,n.maxSelectionRange[0]-s+c):"e"===t.type?Math.min(e[1]+c,n.maxSelectionRange[1]+s+c):void 0}).attr("y",u).attr("width",a).attr("height",l).attr("cursor","ew-resize"),r===P.SLIDER_VIEW&&this.updateSliderSelectedArea(e),this.updateClipPath(t,this.clipId,e[0],0,e[1]-e[0],o)}updateSliderSelectedArea(t){const e=lc(this.getOptions(),"zoomBar",N.TOP,"type"),n=bl.height[e],i=this.getComponentContainer().select("svg.zoom-container");If.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",n/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,e,n,i){const{cartesianScales:r}=this.services,o=r.getMainXAxisPosition(),s=r.getMainYAxisPosition(),a=r.getMainXScaleType(),l=r.getMainYScaleType(),c=(t,e,n)=>i=>r.getValueFromScale(t,e,n,i),u=c(this.xScale,a,o),h=c(this.yScale,l,s),d=lc(this.getOptions(),"zoomBar",N.TOP,"type"),f=bl.height[d],p=Lg().x(t=>u(t)).y0(f).y1(t=>f-h(t)),g=If.appendOrSelect(t,e).datum(n).attr("d",p);i&&g.attr("clip-path",`url(#${i})`)}updateClipPath(t,e,n,i,r,o){const s=If.appendOrSelect(t,"clipPath").attr("id",e);If.appendOrSelect(s,"rect").attr("x",n).attr("y",i).attr("width",r).attr("height",o)}compensateDataForDefaultDomain(t,e){if(!t||t.length<2)return;const n=Ti(t),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier();if(Number(e[0])<Number(n[0][i])){const t={};t[i]=e[0],t[r]=0,n.unshift(t)}if(Number(e[1])>Number(n[n.length-1][i])){const t={};t[i]=e[1],t[r]=0,n.push(t)}return n}renderZoomBarBaseline(t,e,n,i=!1){const r=lc(this.model.getOptions(),"zoomBar",N.TOP,"type"),o=bl.height[r],s=kg()([[e,o],[n,o]]);If.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",s).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,e,n){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),If.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),lc(this.getOptions(),"zoomBar",N.TOP,"type")===P.GRAPH_VIEW&&this.renderZoomBarBaseline(t,e,n,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(k.ZoomBar.UPDATE,this.render.bind(this))}}class ty extends Ig{constructor(t,e){super(t,e),this.type="threshold",this.renderType=L.SVG,this.positionService=new Xm}render(t=!1){const e=lc(this.getOptions(),"axes"),n=[];Object.keys(e).forEach(t=>{if(Object.values(N).includes(t)){const i=e[t];i.thresholds&&i.thresholds.length>0&&n.push({axisPosition:t,thresholds:i.thresholds,correspondingDatasets:i?.correspondingDatasets,mapsTo:i?.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(n,t=>t.axisPosition);i.exit().attr("opacity",0).remove();const r=i.enter().append("g").merge(i);r.attr("class",t=>`axis-thresholds ${t.axisPosition}`);const o=r.selectAll("g.threshold-group").data(t=>t.thresholds.map(e=>(e.axisPosition=t.axisPosition,e.datum=this.constructDatumObj(t,e),e)));o.exit().attr("opacity",0).remove();const s=o.enter().append("g");s.append("line").attr("class","threshold-line"),s.append("rect").attr("class","threshold-hoverable-area"),s.merge(o).attr("class","threshold-group");const a=this;r.each(function({axisPosition:e}){const n=a.services.cartesianScales.getScaleByPosition(e),i=a.services.cartesianScales.getScaleTypeByPosition(e);let r=null,o=null;e===N.LEFT||e===N.RIGHT?(o=n,r=a.services.cartesianScales.getMainXScale()):(r=n,o=a.services.cartesianScales.getMainYScale());const s=i===F.LABELS,[l,c]=r.range(),[u,h]=o.range(),{cartesianScales:d}=a.services,f=d.getOrientation(),[p,g]=hc(t=>d.getDomainValue(t),t=>d.getRangeValue(t),f),m=xu(this);e===N.TOP||e===N.BOTTOM?(m.selectAll("line.threshold-line").transition().call(e=>a.services.transitions.setupTransition({transition:e,name:"threshold-line-update",animate:t})).attr("y1",h).attr("y2",u).attr("x1",({datum:t})=>p(t)+(s?n.step()/2:0)).attr("x2",({datum:t})=>p(t)+(s?n.step()/2:0)).style("stroke",({fillColor:t})=>t),m.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:t})=>-p(t)).attr("width",Math.abs(u-h)).classed("rotate",!0)):(m.selectAll("line.threshold-line").transition().call(e=>a.services.transitions.setupTransition({transition:e,name:"threshold-line-update",animate:t})).attr("x1",l).attr("x2",c).attr("y1",({datum:t})=>g(t)+(s?n.step()/2:0)).attr("y2",({datum:t})=>g(t)+(s?n.step()/2:0)).style("stroke",({fillColor:t})=>t),m.selectAll("rect.threshold-hoverable-area").attr("x",l).attr("y",({datum:t})=>g(t)).attr("width",Math.abs(c-l)).classed("rotate",!1))}),this.services.events.addEventListener(k.Threshold.SHOW,t=>{this.setThresholdLabelPosition(t.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(k.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:e,axisPosition:n}=t,i=this.getOptions(),r=this.services.cartesianScales.getScaleTypeByPosition(n),{code:o,number:s}=lc(i,"locale");if(r===F.TIME){const t=[N.LEFT,N.RIGHT].includes(n),r=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),s=t?o:r,a=lc(i,"timeScale"),l=$c(s.ticks(),lc(a,"timeInterval"));return Fc(e,0,s.ticks(),l,a,i.locale)}return s(e,o)}appendThresholdLabel(){const t=xu(this.services.domUtils.getHolder()),e=lc(this.getOptions(),"style","prefix");this.label=If.appendOrSelect(t,`div.${al}--${e}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:e}){const n=this.services.domUtils.getHolder(),i=No(t,n),r=e.valueFormatter?e.valueFormatter(e.value):this.getFormattedValue(e);this.label.html(Im(`${e.label||"Threshold"}: ${r}`)).style("background-color",e.fillColor);const o=this.label.node(),s=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},o,[Wm.RIGHT,Wm.LEFT,Wm.TOP,Wm.BOTTOM],()=>({top:void 0,left:void 0,width:n.offsetWidth,height:n.offsetHeight})),a=this.positionService.findPositionAt({left:i[0],top:i[1]},o,s);this.positionService.setElement(o,a)}constructDatumObj(t,e){const n={};return t.correspondingDatasets&&(n.group=lc(t,"correspondingDatasets",0)),n[t.mapsTo]=e.value,n}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(e){xu(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(k.Threshold.SHOW,{event:e,hoveredElement:xu(this),datum:xu(this).datum()})}).on("mouseout",function(e){xu(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(k.Threshold.HIDE,{event:e,hoveredElement:xu(this),datum:xu(this).datum()})})}}class ey extends Ig{constructor(t,e){super(t,e),this.type="highlight",this.renderType=L.SVG,this.positionService=new Xm,this.highlightStrokeWidth=1}render(t=!1){const e=lc(this.getOptions(),"axes"),n=[];Object.keys(e).forEach(t=>{if(Object.values(N).includes(t)){const i=e[t];i.highlights&&i.highlights.data.length>0&&n.push({axisPosition:t,highlightStartMapsTo:i.highlights.highlightStartMapsTo,highlightEndMapsTo:i.highlights.highlightEndMapsTo,labelMapsTo:i.highlights.labelMapsTo,highlight:i.highlights.data,color:i.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(n,t=>t.axisPosition);i.exit().attr("opacity",0).remove();const r=i.enter().append("g").merge(i);r.attr("class",t=>`axis-highlight ${t.axisPosition}`);const o=r.selectAll("g.highlight-group").data(t=>t.highlight.map(e=>(e.axisPosition=t.axisPosition,e.highlightStartMapsTo=t.highlightStartMapsTo,e.labelMapsTo=t.labelMapsTo,e.color=t.color,e.highlightEndMapsTo=t.highlightEndMapsTo,e)));o.exit().attr("opacity",0).remove();const s=o.enter().append("g");s.append("rect").attr("class","highlight-bar"),s.append("line").attr("class","highlight-line"),s.merge(o).attr("class","highlight-group");const a=this;r.each(function({axisPosition:e}){const n=a.services.cartesianScales.getMainXScale(),i=a.services.cartesianScales.getMainYScale(),[r,o]=n.range(),[s,l]=i.range(),{cartesianScales:c}=a.services,u=c.getOrientation(),[h,d]=hc(t=>c.getDomainValue(t),t=>c.getRangeValue(t),u),f=xu(this);e===N.TOP||e===N.BOTTOM?f.selectAll("rect.highlight-bar").transition().call(e=>a.services.transitions.setupTransition({transition:e,name:"highlight-bar-update",animate:t})).attr("y",Math.max(l+a.highlightStrokeWidth,0)).attr("height",Math.max(s-2*a.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:t,...e})=>h(e[t])).attr("width",({highlightStartMapsTo:t,highlightEndMapsTo:e,...n})=>Math.max(h(n[e])-h(n[t]),0)).style("stroke",({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null):f.selectAll("rect.highlight-bar").transition().call(e=>a.services.transitions.setupTransition({transition:e,name:"highlight-bar-update",animate:t})).attr("x",r).attr("width",Math.max(o-r,0)).attr("y",({highlightEndMapsTo:t,...e})=>d(e[t])).attr("height",({highlightStartMapsTo:t,highlightEndMapsTo:e,...n})=>Math.max(d(n[t])-d(n[e]),0)).style("stroke",({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null)})}}class ny extends qm{getItems(t){if(t.detail.items)return t.detail.items;const{data:e}=t.detail;if(!e||!e.length||!e[0])return[];const n=this.getOptions(),{cartesianScales:i}=this.services,r=i.getDomainIdentifier(),o=i.isDualAxes(),{groupMapsTo:s}=n.data,a=i.getDomainLabel();let l=i.getRangeLabel();const c=e[0][r];let u;if(1===e.length){const r=e[0],h=i.getRangeIdentifier(r);if(o){const t=i.getRangeAxisPosition({datum:r,groups:[r[s]]});l=i.getScaleLabel(t)}const d=r[h];u=[{label:a,value:c},...Array.isArray(d)&&2===d.length?[{label:"Start",value:d[0]},{label:"End",value:d[1]}]:[{label:l,value:r[h]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(t=>u.push({label:t.label,value:t.value})),u.push({label:xn(n,"locale.translations.group")||xn(n,"tooltip.groupLabel"),value:r[s],color:this.model.getFillColor(r[s]),class:this.model.getColorClassName({classNameTypes:[I.TOOLTIP],dataGroupName:r[s]})})}else if(e.length>1&&(u=[{label:a,value:c}],u=u.concat(e.map(t=>{const e=t[i.getRangeIdentifier(t)];return{label:t[s],value:Array.isArray(e)&&2===e.length?`${e[0]} - ${e[1]}`:e,color:this.model.getFillColor(t[s]),class:this.model.getColorClassName({classNameTypes:[I.TOOLTIP],dataGroupName:t[s]})}}).sort((t,e)=>e.value-t.value)),!o&&!0===lc(n,"tooltip","showTotal"))){const t=i.getRangeIdentifier();u.push({label:xn(n,"locale.translations.total")||xn(n,"tooltip.totalLabel")||"Total",value:e.reduce((e,n)=>e+n[t],0),bold:!0})}return u}}var iy=Math.PI,ry=2*iy,oy=1e-6,sy=ry-oy;function ay(){this._x0=this._y0=this._x1=this._y1=null,this._=""}ay.prototype=function(){return new ay}.prototype={constructor:ay,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,c=o-t,u=s-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>oy)if(Math.abs(u*a-l*c)>oy&&r){var d=n-o,f=i-s,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((iy-Math.acos((p+h-g)/(2*m*y)))/2),_=v/y,b=v/m;Math.abs(_-1)>oy&&(this._+="L"+(t+_*c)+","+(e+_*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=t+b*a)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+s,c=e+a,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>oy||Math.abs(this._y1-c)>oy)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%ry+ry),h>sy?this._+="A"+n+","+n+",0,1,"+u+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>oy&&(this._+="A"+n+","+n+",0,"+ +(h>=iy)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}},Array.prototype.slice;class ly extends Ig{constructor(){super(...arguments),this.type="grid",this.renderType=L.SVG}render(t=!0){const e=lc(this.getOptions(),"grid","x","enabled"),n=lc(this.getOptions(),"grid","y","enabled");this.drawBackdrop(e,n),(e||n)&&(e&&(If.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),n&&(If.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const e=this.parent,n=this.backdrop.attr("height"),i=wp(this.services.cartesianScales.getMainXScale()).tickSizeInner(-n).tickSizeOuter(0);if(lc(this.getOptions(),"grid","x","alignWithAxisTicks")){const t=this.services.cartesianScales.getDomainAxisPosition(),e=lc(this.getOptions(),"axes",t,"ticks","values");e&&i.tickValues(e)}else{const t=lc(this.getOptions(),"grid","x","numberOfTicks");i.ticks(t)}const r=e.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${n})`);t?r.transition().call(e=>this.services.transitions.setupTransition({transition:e,name:"grid-update",animate:t})).call(i):r.call(i),this.cleanGrid(r)}drawYGrid(t){const e=this.parent,n=this.backdrop.attr("width"),i=Ep(this.services.cartesianScales.getMainYScale()).tickSizeInner(-n).tickSizeOuter(0);if(lc(this.getOptions(),"grid","y","alignWithAxisTicks")){const t=this.services.cartesianScales.getRangeAxisPosition(),e=lc(this.getOptions(),"axes",t,"ticks","values");e&&i.tickValues(e)}else{const t=lc(this.getOptions(),"grid","y","numberOfTicks");i.ticks(t)}const r=e.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?r.transition().call(e=>this.services.transitions.setupTransition({transition:e,name:"grid-update",animate:t})).call(i):r.call(i),this.cleanGrid(r)}getGridlineThreshold(t){const e=this.parent,n=e.selectAll(".x.grid .tick").nodes().sort((t,e)=>Number(oc(t).tx)-Number(oc(e).tx));let i=-1;if(!n.length)return;n.forEach(e=>{t[0]>=+oc(e).tx&&i++});const r=i+1<n.length?i+1:n.length,o=n[i],s=n[r];let a;if(o)if(s)a=+oc(s).tx-+oc(o).tx;else{const t=e.select("rect.chart-grid-backdrop").node();a=If.getSVGElementSize(t).width-+oc(o).tx}else a=+oc(s).tx;const{threshold:l}=this.getOptions().tooltip.gridline;return a*l}getActiveGridline(t){const e=lc(this.getOptions,"tooltip","gridline","threshold")||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const n=oc(this),i=Number(n.tx)-e,r=Number(n.tx)+e;return i<=t[0]&&t[0]<=r})}drawBackdrop(t,e){const n=this.parent,i=this.services.cartesianScales.getMainXScale(),r=this.services.cartesianScales.getMainYScale(),[o,s]=i.range(),[a,l]=r.range();this.backdrop=If.appendOrSelect(n,"svg.chart-grid-backdrop").attr("role","presentation");const c=If.appendOrSelect(this.backdrop,t||e?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(c).attr("x",o).attr("y",l).attr("width",Math.abs(s-o)).attr("height",Math.abs(a-l)).lower(),c.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class cy extends Ig{constructor(t,e,n){super(t,e,n),this.type="axes",this.renderType=L.SVG,this.truncation={[N.LEFT]:!1,[N.RIGHT]:!1,[N.TOP]:!1,[N.BOTTOM]:!1},n&&(this.configs=n),this.margins=this.configs.margins}render(t=!0){const{position:e}=this.configs,n=this.getOptions(),i=lc(n,"axes",e,"visible"),r=this.getComponentContainer({ariaLabel:"axes"}),{width:o,height:s}=If.getSVGElementSize(r,{useAttrs:!0}),a=If.appendOrSelect(r,`g.axis.${e}`);let l,c;if(e===N.BOTTOM||e===N.TOP?(l=this.configs.axes[N.LEFT]?this.margins.left:0,c=this.configs.axes[N.RIGHT]?o-this.margins.right:o):(l=s-this.margins.bottom,c=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const u=this.services.cartesianScales.getScaleByPosition(e);let h;switch(this.scaleType===F.LABELS||this.scaleType===F.LABELS_RATIO?u.rangeRound([l,c]):u.range([l,c]),e){case N.LEFT:h=Ep;break;case N.BOTTOM:h=wp;break;case N.RIGHT:h=xp;break;case N.TOP:h=bp}a.attr("aria-label",`${e} axis`);const d=!a.select("g.ticks").empty();let f=If.appendOrSelect(a,"g.ticks");d||(f.attr("role",`${Vc.GRAPHICS_OBJECT} ${Vc.GROUP}`),f.attr("aria-label",`${e} ticks`));const p=If.appendOrSelect(a,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${e} ticks`),g=lc(n,"axes",e),m=this.scaleType===F.TIME||g.scaleType===F.TIME,y=e===N.LEFT||e===N.RIGHT,v=this.model.get("zoomDomain");if(v&&m&&!y&&u.domain(v),!i)return void f.attr("aria-hidden",!0);const _=lc(g,"scaleType"),b=lc(n,"data","loading"),x=lc(g,"ticks","number"),w=lc(g,"ticks","values"),E=lc(g,"truncation","type"),T=lc(g,"truncation","threshold"),S=lc(g,"truncation","numCharacter"),O=null!==x,M=lc(n,"timeScale"),A=If.appendOrSelect(p,"g.tick"),C=If.appendOrSelect(A,"text").text("0"),D=If.getSVGElementSize(C.node(),{useBBox:!0}).height;A.remove();const k=this.scaleType||g.scaleType||F.LINEAR,L=h(u).tickSizeOuter(0);if(u.ticks){let t;if(O?t=x:(t=ll,y&&(t=this.getNumberOfFittingTicks(s,D,cl))),1===u.ticks().length&&0===u.ticks()[0]&&(t=0),L.ticks(t),m)if(u.ticks(t).length){const i=lc(n,"timeScale","addSpaceOnEdges"),r=lc(n,"axes",e,"domain"),o=u.copy();i&&!r&&o.nice(t);const s=o.ticks(t);i&&s.length>2&&!r&&(s.splice(s.length-1,1),s.splice(0,1)),L.tickValues(s)}else L.tickValues([])}let R;const I=lc(g,"ticks","formatter"),{code:P,number:B}=lc(n,"locale");if(m){const t=$c(L.tickValues(),lc(n,"timeScale","timeInterval"));R=null===I?(e,i)=>Fc(e,i,L.tickValues(),t,M,n.locale):(e,i)=>{const r=Fc(e,i,L.tickValues(),t,M,n.locale);return I(e,i,r)}}else null===I?k===F.LINEAR&&(R=t=>B(t,P)):R=I;L.tickFormat(R);const[H,$]=this.services.cartesianScales.getScaleByPosition(e).domain();let z;if(w){if(m)w.forEach((t,e)=>{void 0===t.getTime&&(w[e]=new Date(t))}),z=w.filter(t=>{const e=t.getTime();return e>=new Date(H).getTime()&&e<=new Date($).getTime()});else if(_===F.LABELS){const t=this.services.cartesianScales.getScaleByPosition(e).domain();z=w.filter(e=>t.includes(e))}else z=w.filter(t=>t>=H&&t<=$);L.tickValues(z)}switch(e){case N.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case N.BOTTOM:f.attr("transform",`translate(0, ${s-this.margins.bottom})`);break;case N.RIGHT:f.attr("transform",`translate(${o-this.margins.right}, 0)`);break;case N.TOP:f.attr("transform",`translate(0, ${this.margins.top})`)}const G=this.model.isDataEmpty();if(g.title){const t=If.appendOrSelect(a,"text.axis-title").html(G||b?"":Im(g.title)),n=lc(g,"titleOrientation");let i;switch(e){case N.LEFT:n===Q.RIGHT?t.attr("transform","rotate(90)").attr("y",0).attr("x",u.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):t.attr("transform","rotate(-90)").attr("y",0).attr("x",-u.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case N.BOTTOM:t.attr("transform",`translate(${this.margins.left/2+u.range()[1]/2}, ${s+4})`).style("text-anchor","middle");break;case N.RIGHT:n===Q.LEFT?t.attr("transform","rotate(-90)").attr("y",o).attr("x",-u.range()[0]/2).style("text-anchor","middle"):t.attr("transform","rotate(90)").attr("y",-o).attr("x",u.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case N.TOP:i=If.getSVGElementSize(t,{useBBox:!0}).height,t.attr("transform",`translate(${this.margins.left/2+u.range()[1]/2}, ${i/2})`).style("text-anchor","middle")}}if(m){const e=$c(L.tickValues(),lc(n,"timeScale","timeInterval")),i=M.showDayName,r=f;t&&(f=f.transition().call(e=>this.services.transitions.setupTransition({transition:e,name:"axis-update",animate:t}))),f=f.call(L),r.selectAll(".tick").data(L.tickValues(),u).order().select("text").attr("class",(t,n)=>Bc(t,n,L.tickValues(),e,i)?"tick-label--primary":"tick-label")}else f=t&&d?f.transition().call(e=>this.services.transitions.setupTransition({transition:e,name:"axis-update",animate:t})).call(L):f.call(L);if(p.call(L),e===N.BOTTOM||e===N.TOP){let t=!1;const n=lc(g,"ticks","rotation");if(n===X.ALWAYS)t=!0;else if(n===X.NEVER)t=!1;else if(!n||n===X.AUTO)if(u.step)t=p.selectAll("g.tick text").nodes().some(t=>If.getSVGElementSize(t,{useBBox:!0}).width>=u.step());else{t=!1;const e=p.append("text").text("A"),n=If.getSVGElementSize(e.node(),{useBBox:!0}).width;let i;p.selectAll("g.tick").each(function(){const e=xu(this),r=parseFloat(lc(oc(this),"tx"));null!==r&&i+e.text().length*n*.8>=r&&(t=!0),i=r}),e.remove()}t?(O||(L.ticks(this.getNumberOfFittingTicks(o,D,ul)),p.call(L),f.call(L)),a.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",e===N.TOP?"start":"end")):a.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(b?a.attr("opacity",0):a.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",t=>t),p.selectAll("g.tick").attr("aria-label",t=>t),E!==U.NONE&&_===F.LABELS&&!w){const t=this.services.cartesianScales.getScaleDomain(e);if(t.length>0){const n=r.select(`g.axis.${e} g.ticks g.tick`).html();a.selectAll("g.ticks g.tick").html(n);const i=this;a.selectAll("g.tick text").data(t).text(function(t){return t.length>T?(i.truncation[e]=!0,sc(t,E,S)):t}),this.getInvisibleAxisRef().selectAll("g.tick text").data(t).text(function(t){return t.length>T?sc(t,E,S):t}),a.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),a.selectAll("g.tick text").data(t)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:e}=this.configs,n=If.appendOrSelect(t,`g.axis.${e}`),i=this.getOptions(),r=lc(i,"axes",e),o=lc(r,"scaleType"),s=lc(r,"truncation","threshold"),a=this;n.selectAll("g.tick text").on("mouseover",function(t,e){a.services.events.dispatchEvent(k.Axis.LABEL_MOUSEOVER,{event:t,element:xu(this),datum:e}),o===F.LABELS&&e.length>s&&a.services.events.dispatchEvent(k.Tooltip.SHOW,{event:t,hoveredElement:xu(this),content:e})}).on("mousemove",function(t,e){a.services.events.dispatchEvent(k.Axis.LABEL_MOUSEMOVE,{event:t,element:xu(this),datum:e}),o===F.LABELS&&e.length>s&&a.services.events.dispatchEvent(k.Tooltip.MOVE,{event:t})}).on("click",function(t,e){a.services.events.dispatchEvent(k.Axis.LABEL_CLICK,{event:t,element:xu(this),datum:e})}).on("mouseout",function(t,e){a.services.events.dispatchEvent(k.Axis.LABEL_MOUSEOUT,{event:t,element:xu(this),datum:e}),o===F.LABELS&&a.services.events.dispatchEvent(k.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,e,n){return function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=yu(n))==n?n:0),void 0!==e&&(e=(e=yu(e))==e?e:0),function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}(yu(t),e,n)}(Math.floor(t/(e*n)),2,ll)}destroy(){const t=this.getComponentContainer(),{position:e}=this.configs;If.appendOrSelect(t,`g.axis.${e}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class uy extends cy{constructor(t,e,n){super(t,e,n)}render(t=!0){super.render(t),super.destroy();const e=this.configs.position,n=this.getComponentContainer({ariaLabel:"axes"}),i=If.appendOrSelect(n,`g.axis.${e}`),r=this;i.selectAll("g.tick").each(function(t,n){const i=xu(this);i.classed("tick-hover",!0).attr("tabindex",0===n?0:-1);const o=i.select("text"),{width:s,height:a}=If.getSVGElementSize(o,{useBBox:!0}),l=If.appendOrSelect(i,"rect.axis-holder");let c=0,u=0;switch(e){case N.LEFT:c=-s+Number(o.attr("x")),u=-a/2;break;case N.RIGHT:c=Math.abs(Number(o.attr("x"))),u=-a/2;break;case N.TOP:c=-s/2,u=-a+Number(o.attr("y"))/2,r.truncation[e]&&(c=0,l.attr("transform","rotate(-45)"));break;case N.BOTTOM:c=-s/2,u=a/2-2,r.truncation[e]&&(c=-s,l.attr("transform","rotate(-45)"))}l.attr("x",c-dl).attr("y",u).attr("width",s+2*dl).attr("height",a).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:e}=this.configs,n=If.appendOrSelect(t,`g.axis.${e}`),i=this.getOptions(),r=lc(i,"axes",e),o=lc(r,"scaleType"),s=lc(r,"truncation","threshold"),a=this;n.selectAll("g.tick.tick-hover").on("mouseover",function(t){const e=xu(this).select("text"),n=e.datum();a.services.events.dispatchEvent(k.Axis.LABEL_MOUSEOVER,{event:t,element:e,datum:n}),o===F.LABELS&&n.length>s&&a.services.events.dispatchEvent(k.Tooltip.SHOW,{event:t,element:e,datum:n})}).on("mousemove",function(t){const e=xu(this).select("text"),n=e.datum();a.services.events.dispatchEvent(k.Axis.LABEL_MOUSEMOVE,{event:t,element:e,datum:n}),a.services.events.dispatchEvent(k.Tooltip.MOVE,{event:t})}).on("click",function(t){a.services.events.dispatchEvent(k.Axis.LABEL_CLICK,{event:t,element:xu(this).select("text"),datum:xu(this).select("text").datum()})}).on("mouseout",function(t){a.services.events.dispatchEvent(k.Axis.LABEL_MOUSEOUT,{event:t,element:xu(this).select("text"),datum:xu(this).select("text").datum()}),o===F.LABELS&&a.services.events.dispatchEvent(k.Tooltip.HIDE)}).on("focus",function(t){const e={clientX:0,clientY:0};if(t.target){t.target.focus();const n=t.target.getBoundingClientRect();e.clientX=n.x,e.clientY=n.y}a.services.events.dispatchEvent(k.Axis.LABEL_FOCUS,{event:{...t,...e},element:xu(this),datum:xu(this).select("text").datum()})}).on("blur",function(t){a.services.events.dispatchEvent(k.Axis.LABEL_BLUR,{event:t,element:xu(this),datum:xu(this).select("text").datum()})}).on("keydown",function(t){t.key&&"Escape"===t.key&&(a.services.events.dispatchEvent(k.Tooltip.HIDE),a.services.events.dispatchEvent(k.Axis.LABEL_BLUR,{event:t,element:xu(this),datum:xu(this).select("text").datum()})),e===N.LEFT||e===N.RIGHT?t.key&&"ArrowUp"===t.key?a.goNext(this,t):t.key&&"ArrowDown"===t.key&&a.goPrevious(this,t):t.key&&"ArrowLeft"===t.key?a.goPrevious(this,t):t.key&&"ArrowRight"===t.key&&a.goNext(this,t)})}goNext(t,e){t.nextElementSibling&&"path"!==t.nextElementSibling.tagName&&t.nextElementSibling.dispatchEvent(new Event("focus")),e.preventDefault()}goPrevious(t,e){t.previousElementSibling&&"path"!==t.previousElementSibling.tagName&&t.previousElementSibling.dispatchEvent(new Event("focus")),e.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:e}=this.configs;If.appendOrSelect(t,`g.axis.${e}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class hy extends Ig{constructor(){super(...arguments),this.type="2D-axes",this.renderType=L.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const e={},n=Object.keys(N),i=lc(this.getOptions(),"axes");n.forEach(t=>{i[N[t]]&&(e[N[t]]=!0)}),this.configs.axes=e,n.forEach(t=>{const e=N[t];if(this.configs.axes[e]&&!this.children[e]){const t={position:e,axes:this.configs.axes,margins:this.margins},n=this.model.axisFlavor===et.DEFAULT?new cy(this.model,this.services,t):new uy(this.model,this.services,t);n.setModel(this.model),n.setServices(this.services),n.setParent(this.parent),this.children[e]=n}}),Object.keys(this.children).forEach(e=>{this.children[e].render(t)});const r={};Object.keys(this.children).forEach(t=>{const e=this.children[t],n=e.configs.position,i=e.getInvisibleAxisRef(),{width:o,height:s}=If.getSVGElementSize(i,{useBBox:!0});let a;switch(e.getTitleRef().empty()?a=0:(a=If.getSVGElementSize(e.getTitleRef(),{useBBox:!0}).height,(n===N.LEFT||n===N.RIGHT)&&(a+=5)),n){case N.TOP:r.top=s+a;break;case N.BOTTOM:r.bottom=s+a;break;case N.LEFT:r.left=o+a;break;case N.RIGHT:r.right=o+a}}),this.services.events.dispatchEvent(k.Axis.RENDER_COMPLETE),Object.keys(r).some(t=>this.margins[t]!==r[t])&&(this.margins=Object.assign(this.margins,r),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(k.ZoomBar.UPDATE),Object.keys(this.children).forEach(t=>{this.children[t].margins=this.margins}),this.render(!0))}}class dy extends Ig{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const e=lc(this.getOptions(),"data","loading");e?this.renderSkeleton(e):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Y.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Y.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Y.PIE)this.renderPieSkeleton(t);else{if(this.configs.skeleton!==Y.DONUT)throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`);this.renderDonutSkeleton(t)}}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const e=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),e===B.VERTICAL&&this.drawYGrid(t),e===B.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const e=this.computeOuterRadius();this.drawRing(e,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const e=this.computeOuterRadius(),n=this.computeInnerRadius();this.drawRing(e,n,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),e=this.services.cartesianScales.getMainYScale().range();this.xScale=ol().domain([0,1]).range(t),this.yScale=ol().domain([0,1]).range(e)}drawBackdrop(t){const e=this.parent,{width:n,height:i}=If.getSVGElementSize(e,{useAttrs:!0});this.backdrop=If.appendOrSelect(e,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",n).attr("height",i);const r=If.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");r.attr("width","100%").attr("height","100%");const[o]=this.xScale.range(),[,s]=this.yScale.range();this.backdrop.merge(r).attr("x",o).attr("y",s),r.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const e=+this.backdrop.attr("width"),n=lc(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(n).map(t=>t*e),r=If.appendOrSelect(this.backdrop,"g.x.skeleton"),o=r.selectAll("line").data(i);o.enter().append("line").merge(o).attr("x1",t=>t).attr("x2",t=>t).attr("y1",0).attr("y2","100%"),r.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 e=+this.backdrop.attr("height"),n=this.backdrop.attr("width"),i=lc(this.getOptions(),"grid","y","numberOfTicks"),r=this.xScale.ticks(i).map(t=>t*e),o=If.appendOrSelect(this.backdrop,"g.y.skeleton"),s=o.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",t=>t).attr("y2",t=>t),o.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,e,n=!0){const i=this.parent,{width:r,height:o}=If.getSVGElementSize(i,{useAttrs:!0}),s=If.appendOrSelect(i,"svg.chart-skeleton").attr("width",r).attr("height",o).attr("role","presentation"),a=0===e?"pie":"donut",l=lc(this.getOptions(),a,"alignment");If.appendOrSelect(s,"rect.chart-skeleton-area-container").attr("width",r).attr("height",o).attr("fill","none");const c=function(){var t=Eg,e=Tg,n=Yc(0),i=null,r=Sg,o=Og,s=Mg,a=null,l=wg(c);function c(){var c,u,h=+t.apply(this,arguments),d=+e.apply(this,arguments),f=r.apply(this,arguments)-Wd,p=o.apply(this,arguments)-Wd,g=Ud(p-f),m=p>f;if(a||(a=c=l()),d<h&&(u=d,d=h,h=u),d>jd)if(g>Yd-jd)a.moveTo(d*Fd(f),d*zd(f)),a.arc(0,0,d,f,p,!m),h>jd&&(a.moveTo(h*Fd(p),h*zd(p)),a.arc(0,0,h,p,f,m));else{var y,v,_=f,b=p,x=f,w=p,E=g,T=g,S=s.apply(this,arguments)/2,O=S>jd&&(i?+i.apply(this,arguments):Gd(h*h+d*d)),M=$d(Ud(d-h)/2,+n.apply(this,arguments)),A=M,C=M;if(O>jd){var D=Zd(O/h*zd(S)),k=Zd(O/d*zd(S));(E-=2*D)>jd?(x+=D*=m?1:-1,w-=D):(E=0,x=w=(f+p)/2),(T-=2*k)>jd?(_+=k*=m?1:-1,b-=k):(T=0,_=b=(f+p)/2)}var L=d*Fd(_),R=d*zd(_),I=h*Fd(w),N=h*zd(w);if(M>jd){var P,U=d*Fd(b),B=d*zd(b),F=h*Fd(x),H=h*zd(x);if(g<Vd)if(P=function(t,e,n,i,r,o,s,a){var l=n-t,c=i-e,u=s-r,h=a-o,d=h*l-u*c;if(!(d*d<jd))return[t+(d=(u*(e-o)-h*(t-r))/d)*l,e+d*c]}(L,R,F,H,U,B,I,N)){var $=L-P[0],z=R-P[1],G=U-P[0],j=B-P[1],V=1/zd(function(t){return t>1?0:t<-1?Vd:Math.acos(t)}(($*G+z*j)/(Gd($*$+z*z)*Gd(G*G+j*j)))/2),W=Gd(P[0]*P[0]+P[1]*P[1]);A=$d(M,(h-W)/(V-1)),C=$d(M,(d-W)/(V+1))}else A=C=0}T>jd?C>jd?(y=Ag(F,H,L,R,d,C,m),v=Ag(U,B,I,N,d,C,m),a.moveTo(y.cx+y.x01,y.cy+y.y01),C<M?a.arc(y.cx,y.cy,C,Bd(y.y01,y.x01),Bd(v.y01,v.x01),!m):(a.arc(y.cx,y.cy,C,Bd(y.y01,y.x01),Bd(y.y11,y.x11),!m),a.arc(0,0,d,Bd(y.cy+y.y11,y.cx+y.x11),Bd(v.cy+v.y11,v.cx+v.x11),!m),a.arc(v.cx,v.cy,C,Bd(v.y11,v.x11),Bd(v.y01,v.x01),!m))):(a.moveTo(L,R),a.arc(0,0,d,_,b,!m)):a.moveTo(L,R),h>jd&&E>jd?A>jd?(y=Ag(I,N,U,B,h,-A,m),v=Ag(L,R,F,H,h,-A,m),a.lineTo(y.cx+y.x01,y.cy+y.y01),A<M?a.arc(y.cx,y.cy,A,Bd(y.y01,y.x01),Bd(v.y01,v.x01),!m):(a.arc(y.cx,y.cy,A,Bd(y.y01,y.x01),Bd(y.y11,y.x11),!m),a.arc(0,0,h,Bd(y.cy+y.y11,y.cx+y.x11),Bd(v.cy+v.y11,v.cx+v.x11),m),a.arc(v.cx,v.cy,A,Bd(v.y11,v.x11),Bd(v.y01,v.x01),!m))):a.arc(0,0,h,w,x,m):a.lineTo(I,N)}else a.moveTo(0,0);if(a.closePath(),c)return a=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Vd/2;return[Fd(i)*n,zd(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Yc(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Yc(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Yc(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Yc(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Yc(+t),c):r},c.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Yc(+t),c):o},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Yc(+t),c):s},c.context=function(t){return arguments.length?(a=t??null,c):a},c}().innerRadius(e).outerRadius(t).startAngle(0).endAngle(2*Math.PI),u=t+Math.abs(-15),h=t+(Math.min(r,o)-2*t)/2,d=If.appendOrSelect(s,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${u}, ${h})`).attr("d",c).classed("shimmer-effect-areas",n).classed("empty-state-areas",!n).style("fill",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+30;l===$.CENTER?f=r/2:l===$.RIGHT&&(f=r-t-30);const p=t+20;d.attr("transform",`translate(${f}, ${p})`)}computeOuterRadius(){const{width:t,height:e}=If.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,e)/2-15}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const e="stop-bg-shimmer",n=this.parent.select(".chart-skeleton"),{width:i}=If.getSVGElementSize(this.parent,{useAttrs:!0}),r=i,o=If.appendOrSelect(n,"defs").lower(),s=If.appendOrSelect(o,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",0-3*.2*i).attr("x2",r).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),a=`\n\t\t\t<stop class="${e}" offset="0"></stop>\n\t\t\t<stop class="stop-shimmer" offset="0.2"></stop>\n\t\t\t<stop class="${e}" offset="0.4"></stop>\n\t\t`;s.html(a),function t(){s.attr("gradientTransform",`translate(${0-3*.2*i}, 0)`).transition().duration(2e3).delay(1e3).ease(Op).attr("gradientTransform",`translate(${r+3*.2*i}, 0)`).on("end",t)}()}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class fy extends Ig{constructor(){super(...arguments),this.type="zero-line",this.renderType=L.SVG}render(t){const e=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),n=this.services.cartesianScales.getScaleByPosition(e),[i,r]=n.domain(),o=i>0&&r<0||i<0&&r>0,s=this.getComponentContainer({isPresentational:!0});if(!o)return void s.selectAll("line.domain").remove();const[a,l]=this.services.cartesianScales.getDomainScale().range();let c=+n(0)+.5;c||(c=n.range()[0]);const u=cc({x0:a,x1:l,y0:c,y1:c},this.services.cartesianScales.getOrientation());If.appendOrSelect(s,"line.domain").transition().call(e=>this.services.transitions.setupTransition({transition:e,name:"zero-line-update",animate:t})).attr("y1",u.y0).attr("y2",u.y1).attr("x1",u.x0).attr("x2",u.x1)}}class py extends Ig{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const e=this.model.getDisplayData().length,n=this.services.cartesianScales.getMainXScale(),i=If.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!n.step){const n=lc(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*n/e)}return Math.min(t.bars.maxWidth,n.step()/2)}isOutsideZoomedDomain(t,e){if(this.model.getDisplayData().length<=1)return!1;const n=this.model.get("zoomDomain");if(void 0!==n){const i=this.services.cartesianScales.getDomainScale();return t<i(n[0])||e>i(n[1])}return!1}}class gy extends py{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=L.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:e}=t.detail,{groupMapsTo:n}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-hover-bar"})).attr("opacity",t=>t[n]!==e.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(k.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(k.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const e=this.model.getDisplayData(this.configs.groups),n=this.getOptions(),{groupMapsTo:i}=n.data;this.setGroupScale();const r=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),o=tr(e.map(t=>{const e=this.services.cartesianScales.getDomainIdentifier(t);return t[e]&&"function"==typeof t[e].toString?t[e].toString():t[e]})),s=r.selectAll("g.bars").data(o,t=>t);s.exit().attr("opacity",0).remove();const a=s.enter().append("g").classed("bars",!0).attr("role",Vc.GROUP).attr("data-name","bars").merge(s);a.transition().call(e=>this.services.transitions.setupTransition({transition:e,name:"bar-group-update-enter",animate:t})).attr("transform",t=>{const e=this.services.cartesianScales.getDomainValue(t)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===B.VERTICAL?`translate(${e}, 0)`:`translate(0, ${e})`});const l=a.selectAll("path.bar").data(t=>this.getDataCorrespondingToLabel(t),t=>t[i]);l.exit().attr("opacity",0).remove(),l.enter().append("path").attr("opacity",0).merge(l).classed("bar",!0).transition().call(e=>this.services.transitions.setupTransition({transition:e,name:"bar-update-enter",animate:t})).attr("class",t=>this.model.getColorClassName({classNameTypes:[I.FILL],dataGroupName:t[i],originalClassName:"bar"})).style("fill",t=>{const e=this.services.cartesianScales.getDomainIdentifier(t);return this.model.getFillColor(t[i],t[e],t)}).attr("d",t=>{const e=this.groupScale(t[i]),n=this.getBarWidth(),r=e,o=e+n,s=this.services.cartesianScales.getRangeAxisPosition({datum:t}),a=this.services.cartesianScales.getDomainLowerBound(s),l=this.services.cartesianScales.getValueThroughAxisPosition(s,a),c=this.services.cartesianScales.getRangeValue(t),u=this.services.cartesianScales.getDomainValue(t)-n/2,h=u+n;if(!this.isOutsideZoomedDomain(u,h))return uc({x0:r,x1:o,y0:l,y1:c},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",Vc.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",t=>t.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(e,n){const i=xu(this);i.classed("hovered",!0),t.services.events.dispatchEvent(k.Bar.BAR_MOUSEOVER,{event:e,element:i,datum:n}),t.services.events.dispatchEvent(k.Tooltip.SHOW,{event:e,hoveredElement:i,data:[n]})}).on("mousemove",function(e,n){const i=xu(this);t.services.events.dispatchEvent(k.Bar.BAR_MOUSEMOVE,{event:e,element:i,datum:n}),t.services.events.dispatchEvent(k.Tooltip.MOVE,{event:e})}).on("click",function(e,n){t.services.events.dispatchEvent(k.Bar.BAR_CLICK,{event:e,element:xu(this),datum:n})}).on("mouseout",function(e,n){const i=xu(this);i.classed("hovered",!1),t.services.events.dispatchEvent(k.Bar.BAR_MOUSEOUT,{event:e,element:i,datum:n}),t.services.events.dispatchEvent(k.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(k.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(k.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(e=>e[this.services.cartesianScales.getDomainIdentifier(e)].toString()===t)}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),e=this.getTotalGroupPadding();return this.getBarWidth()*t.length+e}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),e=this.model.getGroupedData(this.configs.groups);let n=this.defaultStepFactor;if("function"==typeof t.step)n=t.step();else if(e.length>0){const i=e.find(t=>t.data?.length>1);if(i){const e=this.services.cartesianScales.getDomainIdentifier(i.data[0]);n=Math.abs(t(i.data[1][e])-t(i.data[0][e]))}}return n}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return 1===t.length?0:Math.min(5,this.getDomainScaleStep()/this.defaultStepFactor*5)*(t.length-1)}getBarWidth(){const t=this.getOptions(),e=lc(t,"bars","width"),n=lc(t,"bars","maxWidth");if(null!==e&&(null===n||e<=n))return e;const i=this.model.getGroupedData(this.configs.groups).length,r=this.getTotalGroupPadding();return Math.min(n,(this.getDomainScaleStep()-r)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=wu().domain(t).rangeRound([0,this.getGroupWidth()])}}function my(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){var n=!1;try{n=this instanceof t}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}),n}var yy={value:function(){}};function vy(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new _y(i)}function _y(t){this._=t}function by(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function xy(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=yy,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}_y.prototype=vy.prototype={constructor:_y,on:function(t,e){var n,i=this._,r=function(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=r[o]).type)i[n]=xy(i[n],t.name,e);else if(null==e)for(n in i)i[n]=xy(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=r[o]).type)&&(n=by(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new _y(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};const wy=my(Object.freeze(Object.defineProperty({__proto__:null,dispatch:vy},Symbol.toStringTag,{value:"Module"})));var Ey,Ty;function Sy(t){return null!=t&&t.length?Sn(t,1):[]}function Oy(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(r);++i<r;)o[i]=t[i+e];return o}function My(t,e){return null==(t=function(t,e){return e.length<2?t:bn(t,Oy(e,0,-1))}(t,e=vn(e,t)))||delete t[_n(Zi(e))]}function Ay(t){return Ln(t)?void 0:t}!function(){if(Ty)return Ey;Ty=1;const t=wy.dispatch,e=Math.PI/180,n={archimedean:p,rectangular:function(t){var e=4*t[0]/t[1],n=0,i=0;return function(t){var r=t<0?-1:1;switch(Math.sqrt(1+4*r*t)-r&3){case 0:n+=e;break;case 1:i+=4;break;case 2:n-=e;break;default:i-=4}return[n,i]}}},i=2048;function r(t){return t.text}function o(){return"serif"}function s(){return"normal"}function a(t){return Math.sqrt(t.value)}function l(){return 30*(~~(6*random())-3)}function c(){return 1}function u(t,n,r,o){if(!n.sprite){var s=t.context,a=t.ratio;s.clearRect(0,0,2048/a,i/a);var l=0,c=0,u=0,h=r.length;for(--o;++o<h;){n=r[o],s.save(),s.font=n.style+" "+n.weight+" "+~~((n.size+1)/a)+"px "+n.font;const t=s.measureText(n.text),h=-Math.floor(t.width/2);let v=(t.width+1)*a,_=n.size<<1;if(n.rotate){var d=Math.sin(n.rotate*e),f=Math.cos(n.rotate*e),p=v*f,g=v*d,m=_*f,y=_*d;v=Math.max(Math.abs(p+y),Math.abs(p-y))+31>>5<<5,_=~~Math.max(Math.abs(g+m),Math.abs(g-m))}else v=v+31>>5<<5;if(_>u&&(u=_),l+v>=2048&&(l=0,c+=u,u=0),c+_>=i)break;s.translate((l+(v>>1))/a,(c+(_>>1))/a),n.rotate&&s.rotate(n.rotate*e),s.fillText(n.text,h,0),n.padding&&(s.lineWidth=2*n.padding,s.strokeText(n.text,h,0)),s.restore(),n.width=v,n.height=_,n.xoff=l,n.yoff=c,n.x1=v>>1,n.y1=_>>1,n.x0=-n.x1,n.y0=-n.y1,n.hasText=!0,l+=v}for(var v=s.getImageData(0,0,2048/a,i/a).data,_=[];--o>=0;)if((n=r[o]).hasText){for(var b=n.width,x=b>>5,w=n.y1-n.y0,E=0;E<w*x;E++)_[E]=0;if(null==(l=n.xoff))return;c=n.yoff;for(var T=0,S=-1,O=0;O<w;O++){for(E=0;E<b;E++){var M=x*O+(E>>5),A=v[2048*(c+O)+(l+E)<<2]?1<<31-E%32:0;_[M]|=A,T|=A}T?S=O:(n.y0++,w--,O--,c++)}n.y1=n.y0+S,n.sprite=_.slice(0,(n.y1-n.y0)*x)}}}function h(t,e,n){n>>=5;for(var i,r=t.sprite,o=t.width>>5,s=t.x-(o<<4),a=127&s,l=32-a,c=t.y1-t.y0,u=(t.y+t.y0)*n+(s>>5),h=0;h<c;h++){i=0;for(var d=0;d<=o;d++)if((i<<l|(d<o?(i=r[h*o+d])>>>a:0))&e[u+d])return!0;u+=n}return!1}function d(t,e){var n=t[0],i=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function f(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function p(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function g(){return document.createElement("canvas")}function m(t){return"function"==typeof t?t:function(){return t}}Ey=function(){var e=[256,256],y=r,v=o,_=a,b=s,x=s,w=l,E=c,T=p,S=[],O=1/0,M=t("word","end"),A=null,C=Math.random,D={},k=g;function L(t,n,i){e[0],e[1];for(var r,o,s,a=n.x,l=n.y,c=Math.sqrt(e[0]*e[0]+e[1]*e[1]),u=T(e),d=C()<.5?1:-1,p=-d;(r=u(p+=d))&&(o=~~r[0],s=~~r[1],!(Math.min(Math.abs(o),Math.abs(s))>=c));)if(n.x=a+o,n.y=l+s,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>e[0]||n.y+n.y1>e[1])&&(!i||f(n,i))&&!h(n,t,e[0])){for(var g,m=n.sprite,y=n.width>>5,v=e[0]>>5,_=n.x-(y<<4),b=127&_,x=32-b,w=n.y1-n.y0,E=(n.y+n.y0)*v+(_>>5),S=0;S<w;S++){g=0;for(var O=0;O<=y;O++)t[E+O]|=g<<x|(O<y?(g=m[S*y+O])>>>b:0);E+=v}return!0}return!1}return D.canvas=function(t){return arguments.length?(k=m(t),D):k},D.start=function(){var t=function(t){const e=t.getContext("2d",{willReadFrequently:!0});t.width=t.height=1;const n=Math.sqrt(e.getImageData(0,0,1,1).data.length>>2);return t.width=2048/n,t.height=i/n,e.fillStyle=e.strokeStyle="red",{context:e,ratio:n}}(k()),n=function(t){for(var e=[],n=-1;++n<t;)e[n]=0;return e}((e[0]>>5)*e[1]),r=null,o=S.length,s=-1,a=[],l=S.map(function(t,e){return t.text=y.call(this,t,e),t.font=v.call(this,t,e),t.style=b.call(this,t,e),t.weight=x.call(this,t,e),t.rotate=w.call(this,t,e),t.size=~~_.call(this,t,e),t.padding=E.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return A&&clearInterval(A),A=setInterval(c,0),c(),D;function c(){for(var i=Date.now();Date.now()-i<O&&++s<o&&A;){var c=l[s];c.x=e[0]*(C()+.5)>>1,c.y=e[1]*(C()+.5)>>1,u(t,c,l,s),c.hasText&&L(n,c,r)&&(a.push(c),M.call("word",D,c),r?d(r,c):r=[{x:c.x+c.x0,y:c.y+c.y0},{x:c.x+c.x1,y:c.y+c.y1}],c.x-=e[0]>>1,c.y-=e[1]>>1)}s>=o&&(D.stop(),M.call("end",D,a,r))}},D.stop=function(){A&&(clearInterval(A),A=null);for(const t of S)delete t.sprite;return D},D.timeInterval=function(t){return arguments.length?(O=t??1/0,D):O},D.words=function(t){return arguments.length?(S=t,D):S},D.size=function(t){return arguments.length?(e=[+t[0],+t[1]],D):e},D.font=function(t){return arguments.length?(v=m(t),D):v},D.fontStyle=function(t){return arguments.length?(b=m(t),D):b},D.fontWeight=function(t){return arguments.length?(x=m(t),D):x},D.rotate=function(t){return arguments.length?(w=m(t),D):w},D.text=function(t){return arguments.length?(y=m(t),D):y},D.spiral=function(t){return arguments.length?(T=n[t]||t,D):T},D.fontSize=function(t){return arguments.length?(_=m(t),D):_},D.padding=function(t){return arguments.length?(E=m(t),D):E},D.random=function(t){return arguments.length?(C=t,D):C},D.on=function(){var t=M.on.apply(M,arguments);return t===M?D:t},D}}();var Cy=function(t){return le(_e(t,void 0,Sy),t+"")}(function(t,e){var n={};if(null==t)return n;var i=!1;e=Nt(e,function(e){return e=vn(e,t),i||(i=e.length>1),e}),ye(t,Wn(t),n),i&&(n=Ei(n,7,Ay));for(var r=e.length;r--;)My(n,e[r]);return n});function Dy(t){return Math.log(t)}function ky(t){return Math.exp(t)}function Ly(t){return-Math.log(-t)}function Ry(t){return-Math.exp(-t)}function Iy(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Ny(t){return(e,n)=>-t(-e,n)}function Py(){const t=function(t){const e=t(Dy,ky),n=e.domain;let i,r,o=10;function s(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),r=function(t){return 10===t?Iy:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(i=Ny(i),r=Ny(r),t(Ly,Ry)):t(Dy,ky),e}return e.base=function(t){return arguments.length?(o=+t,s()):o},e.domain=function(t){return arguments.length?(n(t),s()):n()},e.ticks=t=>{const e=n();let s=e[0],a=e[e.length-1];const l=a<s;l&&([s,a]=[a,s]);let c,u,h=i(s),d=i(a);const f=null==t?10:+t;let p=[];if(!(o%1)&&d-h<f){if(h=Math.floor(h),d=Math.ceil(d),s>0){for(;h<=d;++h)for(c=1;c<o;++c)if(u=h<0?c/r(-h):c*r(h),!(u<s)){if(u>a)break;p.push(u)}}else for(;h<=d;++h)for(c=o-1;c>=1;--c)if(u=h>0?c/r(-h):c*r(h),!(u<s)){if(u>a)break;p.push(u)}2*p.length<f&&(p=pr(s,a,f))}else p=pr(h,d,Math.min(d-h,f)).map(r);return l?p.reverse():p},e.tickFormat=(t,n)=>{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(!(o%1)&&null==(n=Pa(n)).precision&&(n.trim=!0),n=za(n)),t===1/0)return n;const s=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/r(Math.round(i(t)));return e*o<o-.5&&(e*=o),e<=s?n(t):""}},e.nice=()=>n(Eu(n(),{floor:t=>r(Math.floor(i(t))),ceil:t=>r(Math.ceil(i(t)))})),e}(nl()).domain([1,10]);return t.copy=()=>el(t,Py()).base(t.base()),Wa.apply(t,arguments),t}function Uy(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function By(t){this._context=t}function Fy(t){return new By(t)}function Hy(t){this._context=t}function $y(t){return new Hy(t)}function zy(t){this._context=t}function Gy(t){return new zy(t)}function jy(t,e){this._basis=new By(t),this._beta=e}By.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:Uy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Uy(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Hy.prototype={areaStart:Kd,areaEnd:Kd,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Uy(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},zy.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Uy(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},jy.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],s=t[n]-r,a=e[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*s),this._beta*e[l]+(1-this._beta)*(o+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Vy=function t(e){function n(t){return 1===e?new By(t):new jy(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Wy(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Yy(t,e){this._context=t,this._k=(1-e)/6}Yy.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:Wy(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Wy(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Zy=function t(e){function n(t){return new Yy(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Xy(t,e){this._context=t,this._k=(1-e)/6}Xy.prototype={areaStart:Kd,areaEnd:Kd,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wy(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const qy=function t(e){function n(t){return new Xy(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ky(t,e){this._context=t,this._k=(1-e)/6}Ky.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Wy(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Qy=function t(e){function n(t){return new Ky(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Jy(t,e,n){var i=t._x1,r=t._y1,o=t._x2,s=t._y2;if(t._l01_a>jd){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>jd){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,s,t._x2,t._y2)}function tv(t,e){this._context=t,this._alpha=e}tv.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)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Jy(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ev=function t(e){function n(t){return e?new tv(t,e):new Yy(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function nv(t,e){this._context=t,this._alpha=e}nv.prototype={areaStart:Kd,areaEnd:Kd,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)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Jy(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const iv=function t(e){function n(t){return e?new nv(t,e):new Xy(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function rv(t,e){this._context=t,this._alpha=e}rv.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Jy(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ov=function t(e){function n(t){return e?new rv(t,e):new Ky(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function sv(t){return t<0?-1:1}function av(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),s=(n-t._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(sv(o)+sv(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function lv(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function cv(t,e,n){var i=t._x0,r=t._y0,o=t._x1,s=t._y1,a=(o-i)/3;t._context.bezierCurveTo(i+a,r+a*e,o-a,s-a*n,o,s)}function uv(t){this._context=t}function hv(t){this._context=new dv(t)}function dv(t){this._context=t}function fv(t){return new uv(t)}function pv(t){return new hv(t)}function gv(t){this._context=t}function mv(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,s[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,s[e]-=n*s[e-1];for(r[i-1]=s[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(s[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function yv(t){return new gv(t)}function vv(t,e){this._context=t,this._t=e}function _v(t){return new vv(t,.5)}function bv(t){return new vv(t,0)}function xv(t){return new vv(t,1)}uv.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:cv(this,this._t0,lv(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,cv(this,lv(this,n=av(this,t,e)),n);break;default:cv(this,this._t0,n=av(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(hv.prototype=Object.create(uv.prototype)).point=function(t,e){uv.prototype.point.call(this,e,t)},dv.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},gv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=mv(t),r=mv(e),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[s],e[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},vv.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&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};class wv extends Rf{zoomIn(t,e,n){let i,r,o;const s=n||fl;t&&(i=t.x,r=t.y,o=2);const{width:a,height:l}=If.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});e.transition().duration(s.duration).ease(s.ease).attr("transform",`translate(${a/2}, ${l/2}) scale(${o}) translate(${-i},${-r})`),this.services.events.dispatchEvent(k.CanvasZoom.CANVAS_ZOOM_IN,{element:xu(t)})}zoomOut(t,e){const n=e||fl;t.transition().duration(n.duration).ease(n.ease).attr("transform",""),this.services.events.dispatchEvent(k.CanvasZoom.CANVAS_ZOOM_OUT)}}class Ev extends Rf{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,e){this.documentFragment.addEventListener(t,e)}removeEventListener(t,e){this.documentFragment.removeEventListener(t,e)}dispatchEvent(t,e){let n;e?n=new CustomEvent(t,{detail:e}):(n=document.createEvent("Event"),n.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(n)}}class Tv extends Rf{constructor(t,e){super(t,e)}downloadCSV(t,e){const n=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),e);else if(URL&&"download"in n){const r=URL.createObjectURL(new Blob([t],{type:i}));n.href=r,n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,e){const n=document.createElement("a");n.download=e,n.href=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}}class Sv extends Rf{constructor(){super(...arguments),this.pendingTransitions={}}init(){this.services.events?.addEventListener(k.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:e,animate:n}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),!1===this.model.getOptions().animations||!1===n?t.duration(0):t.duration(lc(_l,e,"duration")||_l.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Ov(t,e){const n=+pt(t)-+pt(e);return n<0?-1:n>0?1:n}function Mv(t,e,n){const i=pt(t,n?.in);if(isNaN(e))return ut(t,NaN);if(!e)return i;const r=i.getDate(),o=ut(t,i.getTime());return o.setMonth(i.getMonth()+e+1,0),r>=o.getDate()?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}function Av(t,e,n){return Mv(t,12*e,n)}function Cv(t,e,n){return Av(t,-e,n)}function Dv(t,e,n){const[i,r,o]=ht(0,t,t,e),s=Ov(r,o),a=Math.abs(function(t,e){const[n,i]=ht(0,t,e);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}(r,o));if(a<1)return 0;1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-s*a);let l=Ov(r,o)===-s;(function(t,e){const n=pt(t,e?.in);return+function(t,e){const n=pt(t,e?.in);return n.setHours(23,59,59,999),n}(n,e)==+function(t,e){const n=pt(t,e?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}(n,e)})(i)&&1===a&&1===Ov(i,o)&&(l=!1);const c=s*(a-+l);return 0===c?0:c}function kv(t,e,n){return Mv(t,-e,n)}function Lv(t,e){const n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function Rv(t,e,n){const i=pt(t,n?.in);return isNaN(e)?ut(t,NaN):(e&&i.setDate(i.getDate()+e),i)}function Iv(t,e,n){return Rv(t,-e,n)}function Nv(t){return t=>{const e=(0,Math.trunc)(t);return 0===e?0:e}}function Pv(t,e,n){return ut(t,+pt(t)+e)}function Uv(t,e,n){return Pv(t,e*lt)}function Bv(t,e,n){return Uv(t,-e)}function Fv(t,e){return+pt(t)-+pt(e)}function Hv(t,e,n){const i=Fv(t,e)/6e4;return Nv()(i)}function $v(t,e,n){const i=pt(t,n?.in);return i.setTime(i.getTime()+6e4*e),i}function zv(t,e,n){return $v(t,-e,n)}function Gv(t,e,n){const i=Fv(t,e)/1e3;return Nv()(i)}function jv(t,e,n){return Pv(t,1e3*e)}function Vv(t,e,n){return jv(t,-e)}class Wv extends Rf{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 e=this.model.getOptions(),{groupMapsTo:n}=e.data,i=lc(e,"axes",this.secondaryDomainAxisPosition),r=t[n];if(i?.correspondingDatasets&&i.correspondingDatasets.includes(r))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:e=null}={}){if(this.dualAxes){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=lc(n,"axes",this.secondaryRangeAxisPosition);let o;if(null!==t?o=t[i]:e&&e.length>0&&(o=e[0]),r?.correspondingDatasets&&r.correspondingDatasets.includes(o))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return lc(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===N.BOTTOM||t===N.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(N).map(t=>N[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),e=this.findHorizontalAxesPositions(),n=this.findDomainAndRangeAxesPositions(t,e);this.domainAxisPosition=n.primaryDomainAxisPosition,this.rangeAxisPosition=n.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=n.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=n.secondaryRangeAxisPosition)}determineOrientation(){this.rangeAxisPosition!==N.LEFT&&this.rangeAxisPosition!==N.RIGHT||this.domainAxisPosition!==N.BOTTOM&&this.domainAxisPosition!==N.TOP?this.orientation=B.HORIZONTAL:this.orientation=B.VERTICAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),e=lc(t,"axes");(e[N.LEFT]?.correspondingDatasets&&e[N.RIGHT]||e[N.RIGHT]?.correspondingDatasets&&e[N.LEFT]||e[N.TOP]?.correspondingDatasets&&e[N.BOTTOM]||e[N.BOTTOM]?.correspondingDatasets&&e[N.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const e=lc(this.model.getOptions(),"axes",t,"domain");if(e&&!Array.isArray(e))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(e)&&(this.scaleTypes[t]===F.LINEAR||this.scaleTypes[t]===F.TIME)&&2!==e.length)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return e}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=[N.BOTTOM,N.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(e=>t.indexOf(e)>-1)}getMainYAxisPosition(){const t=[N.LEFT,N.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(e=>t.indexOf(e)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,e,n,i){const r=this.model.getOptions(),o=lc(r,"axes")[n],{mapsTo:s}=o,a=null!==lc(i,s)?i[s]:i;let l;switch(e){case F.LABELS:l=t(a)+t.step()/2;break;case F.TIME:l=t(new Date(a));break;default:l=t(a)}return l}getBoundedScaledValues(t){const{bounds:e}=this.model.getOptions(),n=this.getRangeAxisPosition({datum:t}),i=this.scales[n],r=this.model.getOptions(),o=lc(r,"axes")[n],{mapsTo:s}=o,a=void 0!==t[s]?t[s]:t;return[i(null!==lc(t,e.upperBoundMapsTo)?t[e.upperBoundMapsTo]:a),i(null!==lc(t,e.lowerBoundMapsTo)?t[e.lowerBoundMapsTo]:a)]}getValueThroughAxisPosition(t,e){const n=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,n,t,e)}getDomainValue(t){const e=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(e,t)}getRangeValue(t){const e=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(e,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const e=this.model.getOptions();return lc(e,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const e=this.model.getOptions();return lc(e,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,e){const n=this.model.getOptions(),i=lc(n,"axes",t);return i.scaleType===F.TIME?function(t,e){const n=new Date(t[0]),i=new Date(t[1]);return function(t,e){const[n,i]=ht(0,t,e),r=Ov(n,i),o=Math.abs(function(t,e){const[n,i]=ht(0,t,e);return n.getFullYear()-i.getFullYear()}(n,i));n.setFullYear(1584),i.setFullYear(1584);const s=r*(o-+(Ov(n,i)===-r));return 0===s?0:s}(i,n)>1?[Cv(n,e),Av(i,e)]:Dv(i,n)>1?[kv(n,e),Mv(i,e)]:function(t,e){const[n,i]=ht(0,t,e),r=Lv(n,i),o=Math.abs(pc(n,i));n.setDate(n.getDate()-r*o);const s=r*(o-+(Lv(n,i)===-r));return 0===s?0:s}(i,n)>1?[Iv(n,e),Rv(i,e)]:function(t,e){const[n,i]=ht(0,t,e),r=(+n-+i)/lt;return Nv()(r)}(i,n)>1?[Bv(n,e),Uv(i,e)]:Hv(i,n)>30?[zv(n,30*e),$v(i,30*e)]:Hv(i,n)>1?[zv(n,e),$v(i,e)]:Gv(i,n)>15?[Vv(n,15*e),jv(i,15*e)]:Gv(i,n)>1?[Vv(n,e),jv(i,e)]:[n,i]}(e,lc(n,"timeScale","addSpaceOnEdges")):function([t,e],n,i){const r=(e-t)*n,o=e<=0&&e+r>0?0:e+r;let s=t>=0&&t-r<0?0:t-r;if(i===F.LOG&&s<=0){if(t<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=t}return[s,o]}(e,.1,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),e=lc(t,"axes"),n=this.isDualAxes();return null===lc(e,N.LEFT)&&null!==lc(e,N.RIGHT)||!0===lc(e,N.RIGHT,"main")||n&&lc(e,N.LEFT,"correspondingDatasets")?{primary:N.RIGHT,secondary:N.LEFT}:{primary:N.LEFT,secondary:N.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),e=lc(t,"axes"),n=this.isDualAxes();return null===lc(e,N.BOTTOM)&&null!==lc(e,N.TOP)||!0===lc(e,N.TOP,"main")||n&&lc(e,N.BOTTOM,"correspondingDatasets")?{primary:N.TOP,secondary:N.BOTTOM}:{primary:N.BOTTOM,secondary:N.TOP}}findDomainAndRangeAxesPositions(t,e){const n=this.model.getOptions(),i=lc(n,"axes",t.primary),r=lc(n,"axes",e.primary),o=i.scaleType||F.LINEAR,s=r.scaleType||F.LINEAR,a={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return a.primaryDomainAxisPosition=e.primary,a.primaryRangeAxisPosition=t.primary,a.secondaryDomainAxisPosition=e.secondary,a.secondaryRangeAxisPosition=t.secondary,(!(s===F.LABELS||s===F.TIME)&&o===F.LABELS||o===F.TIME)&&(a.primaryDomainAxisPosition=t.primary,a.primaryRangeAxisPosition=e.primary,a.secondaryDomainAxisPosition=t.secondary,a.secondaryRangeAxisPosition=e.secondary),a}getScaleDomain(t){const e=this.model.getOptions(),n=lc(e,"axes",t),i=lc(e,"bounds"),{includeZero:r}=n,o=lc(n,"scaleType")||F.LINEAR;if(this.model.isDataEmpty())return[];if(n.binned){const{bins:t}=this.model.getBinConfigurations();return[0,yr(t,t=>t.length)]}if(n.limitDomainToBins){const{bins:t}=this.model.getBinConfigurations(),e=this.model.getStackKeys({bins:t});return[e[0].split(":")[0],e[e.length-1].split(":")[1]]}const s=this.model.getDisplayData(),{extendLinearDomainBy:a,mapsTo:l,percentage:c,thresholds:u}=n,{reference:h,compareTo:d}=hl;if(n.domain)return o===F.LABELS?n.domain:(o===F.TIME&&(n.domain=n.domain.map(t=>void 0===t.getTime?new Date(t):t)),this.extendsDomain(t,n.domain));if(c)return[0,100];if(n&&o===F.LABELS)return tr(s.map(t=>t[l]));let f,p;const g=this.model.getDataGroupNames();if(o===F.LABELS_RATIO)return s.map(t=>`${t[h]}/${t[d]}`);if(o===F.TIME)p=s.map(t=>+new Date(t[l]));else if(i&&e.axes)p=[],s.forEach(t=>{p.push(t[l]),t[i.upperBoundMapsTo]&&p.push(t[i.upperBoundMapsTo]),t[i.lowerBoundMapsTo]&&p.push(t[i.lowerBoundMapsTo])});else if(!0===n.stacked&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:t}=e.data,n=this.model.getDataValuesGroupedByKeys({groups:g}),i=s.filter(e=>!g.includes(e[t])),r=[];n.forEach(t=>{const{...e}=t;let n=0,i=0;Object.values(Cy(e,"sharedStackKey")).forEach(t=>{isNaN(t)||(t<0?i+=t:n+=t)}),r.push([i,n])}),p=[...Sy(r),...i.map(t=>t[l])]}else p=[],s.forEach(t=>{const e=t[l];Array.isArray(e)&&2===e.length?(p.push(e[0]),p.push(e[1])):(a&&p.push(Math.max(t[l],t[a])),p.push(e))});return o!==F.TIME&&o!==F.LOG&&r&&p.push(0),u&&u.length>0&&u.forEach(t=>{const e=lc(t,"value");null!==e&&p.push(e)}),f=sr(p),f=this.extendsDomain(t,f),f}createScale(t){const e=this.model.getOptions(),n=lc(e,"axes",t);if(!n)return null;const i=lc(n,"scaleType")||F.LINEAR;let r;return this.scaleTypes[t]=i,r=i===F.TIME?Pd():i===F.LOG?Py().base(n.base||10):i===F.LABELS||i===F.LABELS_RATIO?wu():ol(),r.domain(this.getScaleDomain(t)),r}getDomainLowerBound(t){let e,n=0;return e=this.getOrientation()===B.VERTICAL?this.getMainYScale().domain():this.getMainXScale().domain(),!1===lc(this.model.getOptions(),"axes",t,"includeZero")&&e[0]>0&&e[1]>0&&(n=e[0]),n}getHighestDomainThreshold(){const t=lc(this.model.getOptions(),"axes"),e=this.getDomainAxisPosition(),{thresholds:n}=t[e];if(!Array.isArray(n)||Array.isArray(n)&&!n.length)return null;const i=this.getDomainScale(),r=n.sort((t,e)=>e.value-t.value)[0];return this.getScaleTypeByPosition(e)===F.TIME&&("string"==typeof r.value||void 0===r.value.getTime)&&(r.value=new Date(r.value)),{threshold:r,scaleValue:i(r.value)}}getHighestRangeThreshold(){const t=lc(this.model.getOptions(),"axes"),e=this.getRangeAxisPosition(),{thresholds:n}=t[e];if(!Array.isArray(n)||Array.isArray(n)&&!n.length)return null;const i=this.getRangeScale(),r=n.sort((t,e)=>e.value-t.value)[0];return{threshold:r,scaleValue:i(r.value)}}}class Yv extends Rf{constructor(){super(...arguments),this.curveTypes={curveLinear:qd,curveLinearClosed:Jd,curveBasis:Fy,curveBasisClosed:$y,curveBasisOpen:Gy,curveBundle:Vy,curveCardinal:Zy,curveCardinalClosed:qy,curveCardinalOpen:Qy,curveCatmullRom:ev,curveCatmullRomClosed:iv,curveCatmullRomOpen:ov,curveMonotoneX:fv,curveMonotoneY:pv,curveNatural:yv,curveStep:_v,curveStepAfter:xv,curveStepBefore:bv}}getD3Curve(){let t="curveLinear";const e=this.model.getOptions().curve;if(e&&(t="string"==typeof e?e:e.name),this.curveTypes[t]){let n=this.curveTypes[t];return e&&Object.keys(e).forEach(t=>{n[t]&&(n=n[t](e[t]))}),n}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Zv extends Rf{isZoomBarEnabled(){if(!this.services.cartesianScales||!lc(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),e=lc(this.model.getOptions(),"axes",t,"scaleType");return t===N.BOTTOM&&e===F.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 e=t||this.services.zoom.getZoomBarData(),{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales undefined");const i=n.getMainXAxisPosition(),r=n.getDomainIdentifier(),o=lc(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(o)&&2===o.length)return o;if(!i)throw new Error("Not defined: mainXAxisPosition");return n.extendsDomain(i,sr(e,t=>t[r]))}handleDomainChange(t,e={dispatchEvent:!0}){this.model.set({zoomDomain:t},{animate:!1}),e.dispatchEvent&&this.services.events?.dispatchEvent(k.ZoomDomain.CHANGE,{newDomain:t})}getZoomRatio(){return lc(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,e){const n=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},e),r=lc(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&r&&n){const e=i.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),r=t.filter(t=>new Date(t[e])>=n[0]&&new Date(t[e])<=n[1]);if(r.length>0)return r}return t}zoomIn(t=this.getZoomRatio()){const e=this.model.get("zoomDomain"),n=bl.handleWidth,i=this.services.cartesianScales?.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(e[0]),o=i(e[1]);if(o-r<n+1)return;const s=i.range(),a=o-r,l=Math.min((s[1]-s[0])/2*(t/2),a/2);let c=r+l,u=o-l;c>=u&&(c=r+a/2-n/2,u=o-a/2+n/2);const h=[i.invert(c),i.invert(u)];(e[0].valueOf()!==h[0].valueOf()||e[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(t=this.getZoomRatio()){const e=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const n=this.services.cartesianScales.getMainXScale().copy();n.domain(this.getDefaultZoomBarDomain());const i=n(e[0]),r=n(e[1]),o=n.range(),s=(o[1]-o[0])/2*(t/2),a=Math.max(i-s,o[0]),l=Math.min(r+s,o[1]),c=[n.invert(a),n.invert(l)];(e[0].valueOf()!==c[0].valueOf()||e[1].valueOf()!==c[1].valueOf())&&this.handleDomainChange(c)}resetZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();(t[0].valueOf()!==e[0].valueOf()||t[1].valueOf()!==e[1].valueOf())&&this.handleDomainChange(e)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();return!(!t||!e)&&(t[1].valueOf()-t[0].valueOf())/(e[1].valueOf()-e[0].valueOf())<lc(this.model.getOptions(),"zoomBar","minZoomRatio")}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();return!(!t||!e||t[0].valueOf()!==e[0].valueOf()||t[1].valueOf()!==e[1].valueOf())}isEmptyState(){return 0===this.getZoomBarData().length}isZoomBarLoading(t){return lc(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return lc(this.model.getOptions(),"zoomBar",t,"locked")}}var Xv=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function qv(t){return Xv.test(t)}var Kv="\\ud800-\\udfff",Qv="["+Kv+"]",Jv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",t_="\\ud83c[\\udffb-\\udfff]",e_="[^"+Kv+"]",n_="(?:\\ud83c[\\udde6-\\uddff]){2}",i_="[\\ud800-\\udbff][\\udc00-\\udfff]",r_="(?:"+Jv+"|"+t_+")?",o_="[\\ufe0e\\ufe0f]?",s_=o_+r_+"(?:\\u200d(?:"+[e_,n_,i_].join("|")+")"+o_+r_+")*",a_="(?:"+[e_+Jv+"?",Jv,n_,i_,Qv].join("|")+")",l_=RegExp(t_+"(?="+t_+")|"+a_+s_,"g");var c_=function(t){var e=qv(t=yn(t))?function(t){return qv(t)?function(t){return t.match(l_)||[]}(t):function(t){return t.split("")}(t)}(t):void 0,n=e?e[0]:t.charAt(0),i=e?function(t,e,n){var i=t.length;return Oy(t,1,n=void 0===n?i:n)}(e).join(""):t.slice(1);return n.toUpperCase()+i};up(function(t,e,n){return e=e.toLowerCase(),t+(n?function(t){return c_(yn(t).toLowerCase())}(e):e)});class u_{constructor(t,e){this.components=[],this.services={canvasZoom:wv,domUtils:If,events:Ev,files:Tv,gradientUtils:Nf,transitions:Sv},this.model=new cu(this.services)}init(t,e){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(t=>{const e=this.services[t];this.services[t]=new e(this.model,this.services)}),this.services.events.addEventListener(k.Model.UPDATE,t=>{const e=!!lc(t,"detail","animate");this.update(e)}),this.model.setData(e.data),this.services.events.addEventListener(k.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(t=>{this.services[t].update()}),this.components.forEach(e=>e.render(t));const e=this.services.transitions.getPendingTransitions(),n=Object.keys(e).map(t=>e[t].end().catch(t=>t));Promise.all(n).then(()=>this.services.events.dispatchEvent(k.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,e){const n=this.model.getOptions(),i=lc(n,"toolbar","enabled"),r={id:"legend",components:[new zm(this.model,this.services)],growth:V.PREFERRED},o=lc(n,"canvasZoom","enabled");o&&!0===o&&t.push(new jm(this.model,this.services));const s=!!this.model.getOptions().title,a={id:"title",components:[new $m(this.model,this.services)],growth:V.STRETCH},l={id:"toolbar",components:[new Pm(this.model,this.services)],growth:V.PREFERRED},c={id:"header",components:[new Bm(this.model,this.services,[a,...i?[l]:[]],{direction:j.ROW,alignItems:W.CENTER})],growth:V.PREFERRED},u={id:"graph-frame",components:t,growth:V.STRETCH,renderType:lc(e,"graphFrameRenderType")||L.SVG},h=!0!==lc(e,"excludeLegend")&&!1!==n.legend.enabled;let d=j.COLUMN;if(h){const t=lc(n,"legend","position");"left"===t?(d=j.ROW,n.legend.orientation||(n.legend.orientation=z.VERTICAL)):"right"===t?(d=j.ROW_REVERSE,n.legend.orientation||(n.legend.orientation=z.VERTICAL)):"bottom"===t&&(d=j.COLUMN_REVERSE)}const f={id:"spacer",components:[new Fm(this.model,this.services)],growth:V.PREFERRED},p={id:"full-frame",components:[new Bm(this.model,this.services,[...h?[r]:[],...h?[f]:[],u],{direction:d})],growth:V.STRETCH},g=[];if(s||i){g.push(c);const t={id:"spacer",components:[new Fm(this.model,this.services,i?{size:15}:void 0)],growth:V.PREFERRED};g.push(t)}return g.push(p),[new qm(this.model,this.services),new Hm(this.model,this.services),new Bm(this.model,this.services,g,{direction:j.COLUMN})]}}class h_ extends u_{constructor(t,e){super(t,e),this.services=Object.assign(this.services,{cartesianScales:Wv,curves:Yv,zoom:Zv}),this.model=new uu(this.services)}getAxisChartComponents(t,e){const n=this.model.getOptions(),i=lc(n,"zoomBar",N.TOP,"enabled"),r=lc(n,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const o=this.services.cartesianScales.getMainXAxisPosition(),s=lc(n,"axes",o,"scaleType"),a=i&&o===N.BOTTOM&&s===F.TIME,l=this.services.zoom.isZoomBarLocked(N.TOP),c=!!this.model.getOptions().title,u={id:"title",components:[new $m(this.model,this.services)],growth:V.STRETCH},h={id:"toolbar",components:[new Pm(this.model,this.services)],growth:V.PREFERRED},d={id:"header",components:[new Bm(this.model,this.services,[u,...r?[h]:[]],{direction:j.ROW,alignItems:W.CENTER})],growth:V.PREFERRED},f={id:"legend",components:[new zm(this.model,this.services)],growth:V.PREFERRED};a&&!l&&t.push(new Gm(this.model,this.services),new Qm(this.model,this.services)),t.push(new ty(this.model,this.services)),t.push(new ey(this.model,this.services));const p={id:"graph-frame",components:t,growth:V.STRETCH,renderType:L.SVG},g=!1!==lc(e,"legend","enabled")&&!1!==this.model.getOptions().legend.enabled;let m=j.COLUMN;if(g){const t=lc(this.model.getOptions(),"legend","position");t===H.LEFT?(m=j.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=z.VERTICAL)):t===H.RIGHT?(m=j.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=z.VERTICAL)):t===H.BOTTOM&&(m=j.COLUMN_REVERSE)}const y={id:"spacer",components:[new Fm(this.model,this.services)],growth:V.PREFERRED},v={id:"full-frame",components:[new Bm(this.model,this.services,[...g?[f]:[],...g?[y]:[],p],{direction:m})],growth:V.STRETCH},_={id:"zoom-bar",components:[new Jm(this.model,this.services)],growth:V.PREFERRED,renderType:L.SVG},b=[];if(c||r){b.push(d);const t={id:"spacer",components:[new Fm(this.model,this.services,r?{size:15}:void 0)],growth:V.PREFERRED};b.push(t)}return a&&b.push(_),b.push(v),[new ny(this.model,this.services),new Hm(this.model,this.services),new Bm(this.model,this.services,b,{direction:j.COLUMN})]}}q.LINE,q.SCATTER,q.AREA,q.STACKED_AREA,q.SIMPLE_BAR,q.GROUPED_BAR,q.STACKED_BAR;class d_ extends h_{constructor(t,e){super(t,e),this.model.setOptions(function(t,e){const n=Ti(t),i=Object.keys(e.axes||{});e?.toolbar?.controls&&delete n.toolbar.controls,0===i.length&&delete n.axes;for(const t in n.axes)if(i.includes(t)){const n=e.axes[t];if((n.primary||n.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),null==n.mapsTo){const t=n.scaleType;null==t?n.mapsTo="value":t===F.TIME?n.mapsTo="date":t===F.LABELS&&(n.mapsTo="key")}}else delete n.axes[t];return ac(n,e),qi(n,e)}(rc.groupedBarChart,e.options)),this.init(t,e)}getComponents(){const t=[new hy(this.model,this.services),new ly(this.model,this.services),new gy(this.model,this.services),new fy(this.model,this.services),new dy(this.model,this.services,{skeleton:Y.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class f_ extends i.PureComponent{chart;chartRef=i.createRef();createChart(t,e,n){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(t){this.props.data!==t.data&&this.chart?.model.setData(this.props.data),this.props.options!==t.options&&this.chart?.model.setOptions(this.props.options)}render(){return i.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class p_ extends f_{createChart(t,e,n){return new d_(t,{data:e,options:n})}}var g_;g_||(g_=1,function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=r(t,i(n)))}return t}function i(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var i="";for(var o in t)e.call(t,o)&&t[o]&&(i=r(i,o));return i}function r(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}({exports:{}}))},1895:(t,e,n)=>{n.d(e,{aZ:()=>l});var i,r,o=n(380),s=n.n(o),a=n(9247);const l=s().forwardRef(function({children:t,size:e=16,...n},o){return s().createElement(a.A,{width:e,height:e,ref:o,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},i||(i=s().createElement("path",{d:"M16,18a5,5,0,1,1,5-5A5.0057,5.0057,0,0,1,16,18Zm0-8a3,3,0,1,0,3,3A3.0033,3.0033,0,0,0,16,10Z"})),r||(r=s().createElement("path",{d:"M16,30,7.5645,20.0513c-.0479-.0571-.3482-.4515-.3482-.4515A10.8888,10.8888,0,0,1,5,13a11,11,0,0,1,22,0,10.8844,10.8844,0,0,1-2.2148,6.5973l-.0015.0025s-.3.3944-.3447.4474ZM8.8125,18.395c.001.0007.2334.3082.2866.3744L16,26.9079l6.91-8.15c.0439-.0552.2783-.3649.2788-.3657A8.901,8.901,0,0,0,25,13,9,9,0,1,0,7,13a8.9054,8.9054,0,0,0,1.8125,5.395Z"})),t)})}}]);