@carbon/charts 1.11.1 → 1.11.3

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 (53) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{_baseEach-81f85d61.mjs → _baseEach-05847c57.mjs} +2 -2
  3. package/dist/{_baseEach-81f85d61.mjs.map → _baseEach-05847c57.mjs.map} +1 -1
  4. package/dist/{_baseEach-97abc473.js → _baseEach-477c04db.js} +2 -2
  5. package/dist/{_baseEach-97abc473.js.map → _baseEach-477c04db.js.map} +1 -1
  6. package/dist/{angle-utils-95c96b71.js → angle-utils-512bc5cd.js} +2 -2
  7. package/dist/{angle-utils-95c96b71.js.map → angle-utils-512bc5cd.js.map} +1 -1
  8. package/dist/{angle-utils-a4fbf1b8.mjs → angle-utils-7255d1d9.mjs} +2 -2
  9. package/dist/{angle-utils-a4fbf1b8.mjs.map → angle-utils-7255d1d9.mjs.map} +1 -1
  10. package/dist/chart.d.ts +1 -1
  11. package/dist/{choropleth-91db5841.mjs → choropleth-449cf25e.mjs} +711 -709
  12. package/dist/choropleth-449cf25e.mjs.map +1 -0
  13. package/dist/{choropleth-f46a0864.js → choropleth-db3ae9eb.js} +9 -9
  14. package/dist/choropleth-db3ae9eb.js.map +1 -0
  15. package/dist/{color-scale-utils-38aedd61.mjs → color-scale-utils-222feda6.mjs} +16 -16
  16. package/dist/{color-scale-utils-38aedd61.mjs.map → color-scale-utils-222feda6.mjs.map} +1 -1
  17. package/dist/{color-scale-utils-eaad59b6.js → color-scale-utils-79786095.js} +2 -2
  18. package/dist/{color-scale-utils-eaad59b6.js.map → color-scale-utils-79786095.js.map} +1 -1
  19. package/dist/components/index.js +1 -1
  20. package/dist/components/index.mjs +4 -4
  21. package/dist/demo/charts/index.d.ts +9 -6
  22. package/dist/demo/index.js +197 -193
  23. package/dist/demo/index.js.map +1 -1
  24. package/dist/demo/index.mjs +2118 -1591
  25. package/dist/demo/index.mjs.map +1 -1
  26. package/dist/demo/utils/index.d.ts +1 -1
  27. package/dist/demo/utils/package-versions.d.ts +20 -0
  28. package/dist/demo/utils/stackblitz/angular.d.ts +3 -0
  29. package/dist/demo/utils/stackblitz/index.d.ts +5 -0
  30. package/dist/demo/utils/stackblitz/react.d.ts +3 -0
  31. package/dist/demo/utils/stackblitz/svelte.d.ts +3 -0
  32. package/dist/demo/utils/stackblitz/vanilla-js.d.ts +3 -0
  33. package/dist/demo/utils/stackblitz/vue.d.ts +3 -0
  34. package/dist/{index-c98febf2.js → index-4203ca23.js} +2 -2
  35. package/dist/index-4203ca23.js.map +1 -0
  36. package/dist/{index-fcba6cd5.mjs → index-e425a7b5.mjs} +3 -3
  37. package/dist/index-e425a7b5.mjs.map +1 -0
  38. package/dist/index.js +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/index.mjs +100 -99
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/model/index.js +1 -1
  43. package/dist/model/index.js.map +1 -1
  44. package/dist/model/index.mjs +13 -13
  45. package/dist/model/index.mjs.map +1 -1
  46. package/dist/services/index.js +1 -1
  47. package/dist/services/index.mjs +3 -3
  48. package/package.json +4 -4
  49. package/dist/choropleth-91db5841.mjs.map +0 -1
  50. package/dist/choropleth-f46a0864.js.map +0 -1
  51. package/dist/demo/utils/sandbox.d.ts +0 -36
  52. package/dist/index-c98febf2.js.map +0 -1
  53. package/dist/index-fcba6cd5.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const y=require("d3"),c=require("./color-scale-utils-eaad59b6.js"),r=require("./enums-aa2efd99.js"),N=require("./a11y-c7c9d087.js"),O=require("./angle-utils-95c96b71.js"),ae=require("d3-sankey"),it=require("./_baseEach-97abc473.js"),Bt=require("d3-cloud");function Nt(o,e,t,s){var n=-1,a=o==null?0:o.length;for(s&&a&&(t=o[++n]);++n<a;)t=e(t,o[n],n,o);return t}function Gt(o){return function(e){return o==null?void 0:o[e]}}var $t={À:"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"},Ht=Gt($t);const zt=Ht;var Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wt="\\u0300-\\u036f",jt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Xt=Wt+jt+Zt,qt="["+Xt+"]",Yt=RegExp(qt,"g");function Kt(o){return o=c.toString(o),o&&o.replace(Ft,zt).replace(Yt,"")}var Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Qt(o){return o.match(Jt)||[]}var es=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ts(o){return es.test(o)}var rt="\\ud800-\\udfff",ss="\\u0300-\\u036f",ns="\\ufe20-\\ufe2f",as="\\u20d0-\\u20ff",is=ss+ns+as,ot="\\u2700-\\u27bf",lt="a-z\\xdf-\\xf6\\xf8-\\xff",rs="\\xac\\xb1\\xd7\\xf7",os="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ls="\\u2000-\\u206f",cs=" \\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",ct="A-Z\\xc0-\\xd6\\xd8-\\xde",ds="\\ufe0e\\ufe0f",dt=rs+os+ls+cs,ht="['’]",Ne="["+dt+"]",hs="["+is+"]",ut="\\d+",us="["+ot+"]",pt="["+lt+"]",gt="[^"+rt+dt+ut+ot+lt+ct+"]",ps="\\ud83c[\\udffb-\\udfff]",gs="(?:"+hs+"|"+ps+")",ms="[^"+rt+"]",mt="(?:\\ud83c[\\udde6-\\uddff]){2}",vt="[\\ud800-\\udbff][\\udc00-\\udfff]",te="["+ct+"]",vs="\\u200d",Ge="(?:"+pt+"|"+gt+")",fs="(?:"+te+"|"+gt+")",$e="(?:"+ht+"(?:d|ll|m|re|s|t|ve))?",He="(?:"+ht+"(?:D|LL|M|RE|S|T|VE))?",ft=gs+"?",yt="["+ds+"]?",ys="(?:"+vs+"(?:"+[ms,mt,vt].join("|")+")"+yt+ft+")*",Es="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Os="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bs=yt+ft+ys,Ss="(?:"+[us,mt,vt].join("|")+")"+bs,xs=RegExp([te+"?"+pt+"+"+$e+"(?="+[Ne,te,"$"].join("|")+")",fs+"+"+He+"(?="+[Ne,te+Ge,"$"].join("|")+")",te+"?"+Ge+"+"+$e,te+"+"+He,Os,Es,ut,Ss].join("|"),"g");function Ts(o){return o.match(xs)||[]}function Ms(o,e,t){return o=c.toString(o),e=t?void 0:e,e===void 0?ts(o)?Ts(o):Qt(o):o.match(e)||[]}var Cs="['’]",Ls=RegExp(Cs,"g");function Et(o){return function(e){return Nt(Ms(Kt(e).replace(Ls,"")),o,"")}}function As(o,e,t){return o===o&&(t!==void 0&&(o=o<=t?o:t),e!==void 0&&(o=o>=e?o:e)),o}function Ot(o,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=O.toNumber(t),t=t===t?t:0),e!==void 0&&(e=O.toNumber(e),e=e===e?e:0),As(O.toNumber(o),e,t)}function Ds(o,e){var t=-1,s=c.isArrayLike(o)?Array(o.length):[];return it.baseEach(o,function(n,a,i){s[++t]=e(n,a,i)}),s}function ws(o,e){var t=c.isArray(o)?c.arrayMap:Ds;return t(o,c.baseIteratee(e))}var Ps=1/0;function Rs(o,e){return c.baseFlatten(ws(o,e),Ps)}function bt(o,e){return c.baseIsEqual(o,e)}var ks=Et(function(o,e,t){return o+(t?"-":"")+e.toLowerCase()});const J=ks;function Is(o,e){var t;return it.baseEach(o,function(s,n,a){return t=e(s,n,a),!t}),!!t}function _s(o,e,t){var s=c.isArray(o)?c.arraySome:Is;return t&&c.isIterateeCall(o,e,t)&&(e=void 0),s(o,c.baseIteratee(e))}class G{constructor(e,t,s){if(this.type="",this.renderType=r.RenderTypes.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=t,s&&(this.configs=s,this.configs.id)){const n=c.getProperty(this.model.getOptions(),"style","prefix");this.id=`${n}--${this.configs.id}`}this.parent||this.setParent(y.select(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var s;const t=this.parent;if(this.parent=e,!(t&&t.node()===e.node())&&this.type){const n=c.getProperty(this.model.getOptions(),"style","prefix");(s=this.parent)==null||s.classed(`${c.carbonPrefix}--${n}--${this.type}`,!0),t&&t.classed(`${c.carbonPrefix}--${n}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const t=c.getProperty(this.model.getOptions(),"style","prefix"),s=this.id?`#${this.id}`:"",n=O.DOMUtils.appendOrSelect(this.parent,`${this.renderType===r.RenderTypes.SVG?"svg":"div"}${s}.${c.carbonPrefix}--${t}--${this.type}`);if(e.withinChartClip){const a=this.model.get("chartClipId");if(a){const l=y.select(`#${a}`).select("rect");l.size()!==0&&parseFloat(l.attr("height"))>0&&n.attr("clip-path",`url(#${a})`)}}return n.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?c.merge({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const St=class extends G{constructor(){super(...arguments),this.type="toolbar",this.renderType=r.RenderTypes.HTML}init(){const o=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(r.Events.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",o)}),this.services.events.addEventListener(r.Events.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",o)})}render(o=!0){const e=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(c.getProperty(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:s,overflowMenuItemList:n}=this.getControlConfigs();n&&s.push(this.getOverflowButtonConfig());const a=e.selectAll("div.toolbar-control").data(s,d=>d.id);a.exit().remove();const i=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),l=this;i.merge(a).classed("disabled",d=>d.shouldBeDisabled()).attr("aria-disabled",d=>d.shouldBeDisabled()).attr("aria-label",d=>d.title).html(d=>`
1
+ "use strict";const y=require("d3"),c=require("./color-scale-utils-79786095.js"),r=require("./enums-aa2efd99.js"),N=require("./a11y-c7c9d087.js"),O=require("./angle-utils-512bc5cd.js"),ae=require("d3-sankey"),it=require("./_baseEach-477c04db.js"),Bt=require("d3-cloud");function Nt(o,e,t,s){var n=-1,a=o==null?0:o.length;for(s&&a&&(t=o[++n]);++n<a;)t=e(t,o[n],n,o);return t}function Gt(o){return function(e){return o==null?void 0:o[e]}}var $t={À:"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"},Ht=Gt($t);const zt=Ht;var Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wt="\\u0300-\\u036f",jt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Xt=Wt+jt+Zt,qt="["+Xt+"]",Yt=RegExp(qt,"g");function Kt(o){return o=c.toString(o),o&&o.replace(Ft,zt).replace(Yt,"")}var Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Qt(o){return o.match(Jt)||[]}var es=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ts(o){return es.test(o)}var rt="\\ud800-\\udfff",ss="\\u0300-\\u036f",ns="\\ufe20-\\ufe2f",as="\\u20d0-\\u20ff",is=ss+ns+as,ot="\\u2700-\\u27bf",lt="a-z\\xdf-\\xf6\\xf8-\\xff",rs="\\xac\\xb1\\xd7\\xf7",os="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ls="\\u2000-\\u206f",cs=" \\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",ct="A-Z\\xc0-\\xd6\\xd8-\\xde",ds="\\ufe0e\\ufe0f",dt=rs+os+ls+cs,ht="['’]",Ne="["+dt+"]",hs="["+is+"]",ut="\\d+",us="["+ot+"]",pt="["+lt+"]",gt="[^"+rt+dt+ut+ot+lt+ct+"]",ps="\\ud83c[\\udffb-\\udfff]",gs="(?:"+hs+"|"+ps+")",ms="[^"+rt+"]",mt="(?:\\ud83c[\\udde6-\\uddff]){2}",vt="[\\ud800-\\udbff][\\udc00-\\udfff]",te="["+ct+"]",vs="\\u200d",Ge="(?:"+pt+"|"+gt+")",fs="(?:"+te+"|"+gt+")",$e="(?:"+ht+"(?:d|ll|m|re|s|t|ve))?",He="(?:"+ht+"(?:D|LL|M|RE|S|T|VE))?",ft=gs+"?",yt="["+ds+"]?",ys="(?:"+vs+"(?:"+[ms,mt,vt].join("|")+")"+yt+ft+")*",Es="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Os="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bs=yt+ft+ys,Ss="(?:"+[us,mt,vt].join("|")+")"+bs,xs=RegExp([te+"?"+pt+"+"+$e+"(?="+[Ne,te,"$"].join("|")+")",fs+"+"+He+"(?="+[Ne,te+Ge,"$"].join("|")+")",te+"?"+Ge+"+"+$e,te+"+"+He,Os,Es,ut,Ss].join("|"),"g");function Ts(o){return o.match(xs)||[]}function Ms(o,e,t){return o=c.toString(o),e=t?void 0:e,e===void 0?ts(o)?Ts(o):Qt(o):o.match(e)||[]}var Cs="['’]",Ls=RegExp(Cs,"g");function Et(o){return function(e){return Nt(Ms(Kt(e).replace(Ls,"")),o,"")}}function As(o,e,t){return o===o&&(t!==void 0&&(o=o<=t?o:t),e!==void 0&&(o=o>=e?o:e)),o}function Ot(o,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=O.toNumber(t),t=t===t?t:0),e!==void 0&&(e=O.toNumber(e),e=e===e?e:0),As(O.toNumber(o),e,t)}function Ds(o,e){var t=-1,s=c.isArrayLike(o)?Array(o.length):[];return it.baseEach(o,function(n,a,i){s[++t]=e(n,a,i)}),s}function ws(o,e){var t=c.isArray(o)?c.arrayMap:Ds;return t(o,c.baseIteratee(e))}var Ps=1/0;function Rs(o,e){return c.baseFlatten(ws(o,e),Ps)}function bt(o,e){return c.baseIsEqual(o,e)}var ks=Et(function(o,e,t){return o+(t?"-":"")+e.toLowerCase()});const J=ks;function Is(o,e){var t;return it.baseEach(o,function(s,n,a){return t=e(s,n,a),!t}),!!t}function _s(o,e,t){var s=c.isArray(o)?c.arraySome:Is;return t&&c.isIterateeCall(o,e,t)&&(e=void 0),s(o,c.baseIteratee(e))}class G{constructor(e,t,s){if(this.type="",this.renderType=r.RenderTypes.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=t,s&&(this.configs=s,this.configs.id)){const n=c.getProperty(this.model.getOptions(),"style","prefix");this.id=`${n}--${this.configs.id}`}this.parent||this.setParent(y.select(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var s;const t=this.parent;if(this.parent=e,!(t&&t.node()===e.node())&&this.type){const n=c.getProperty(this.model.getOptions(),"style","prefix");(s=this.parent)==null||s.classed(`${c.carbonPrefix}--${n}--${this.type}`,!0),t&&t.classed(`${c.carbonPrefix}--${n}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const t=c.getProperty(this.model.getOptions(),"style","prefix"),s=this.id?`#${this.id}`:"",n=O.DOMUtils.appendOrSelect(this.parent,`${this.renderType===r.RenderTypes.SVG?"svg":"div"}${s}.${c.carbonPrefix}--${t}--${this.type}`);if(e.withinChartClip){const a=this.model.get("chartClipId");if(a){const l=y.select(`#${a}`).select("rect");l.size()!==0&&parseFloat(l.attr("height"))>0&&n.attr("clip-path",`url(#${a})`)}}return n.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?c.merge({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const St=class extends G{constructor(){super(...arguments),this.type="toolbar",this.renderType=r.RenderTypes.HTML}init(){const o=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(r.Events.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",o)}),this.services.events.addEventListener(r.Events.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",o)})}render(o=!0){const e=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(c.getProperty(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:s,overflowMenuItemList:n}=this.getControlConfigs();n&&s.push(this.getOverflowButtonConfig());const a=e.selectAll("div.toolbar-control").data(s,d=>d.id);a.exit().remove();const i=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),l=this;i.merge(a).classed("disabled",d=>d.shouldBeDisabled()).attr("aria-disabled",d=>d.shouldBeDisabled()).attr("aria-label",d=>d.title).html(d=>`
2
2
  <button
3
3
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
4
4
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${d.id}`)}" aria-label="${d.title}">
@@ -9,7 +9,7 @@
9
9
  <circle cx="16" cy="16" r="2"></circle>
10
10
  <circle cx="16" cy="24" r="2"></circle>`},clickFunction:o=>this.toggleOverflowMenu(o)}}getControlConfigByType(o){const e=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),t=this.model.getDisplayData();let s;switch(o){case r.ToolbarControlTypes.ZOOM_IN:e&&(s={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(o)},clickFunction:()=>this.services.zoom.zoomIn()});break;case r.ToolbarControlTypes.ZOOM_OUT:e&&(s={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(o)},clickFunction:()=>this.services.zoom.zoomOut()});break;case r.ToolbarControlTypes.RESET_ZOOM:e&&(s={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(o)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case r.ToolbarControlTypes.MAKE_FULLSCREEN:s={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(o),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case r.ToolbarControlTypes.SHOW_AS_DATATABLE:s={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(o)},title:"Show as table",shouldBeDisabled:()=>t.length===0,clickFunction:()=>this.services.events.dispatchEvent(r.Events.Modal.SHOW)};break;case r.ToolbarControlTypes.EXPORT_CSV:s={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(o)},clickFunction:()=>this.model.exportToCSV()};break;case r.ToolbarControlTypes.EXPORT_PNG:s={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(o)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case r.ToolbarControlTypes.EXPORT_JPG:s={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(o)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+o)}return s}getControlIconByType(o){switch(o){case r.ToolbarControlTypes.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"/>
11
11
  <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 r.ToolbarControlTypes.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
12
- <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 r.ToolbarControlTypes.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 r.ToolbarControlTypes.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 r.ToolbarControlTypes.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 r.ToolbarControlTypes.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.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: "+o)}}};let xt=St;xt.buttonID=0;const Tt=class extends G{constructor(o,e,t,s){super(o,e,s),this.type="layout",this.configs=s,this.children=t,this._instanceID=Tt.instanceID++,this.init()}init(){this.children.forEach(o=>{o.components.forEach(e=>{e.init()})})}getPreferedAndFixedSizeSum(){const o=this.parent;let e=0;return o.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>{const s=c.getProperty(t,"growth");return s===r.LayoutGrowth.PREFERRED||s===r.LayoutGrowth.FIXED}).each(function(t){e+=t.size}),e}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(e=>c.getProperty(e,"growth")===r.LayoutGrowth.STRETCH).size()}render(o=!0){const e=this.parent,{width:t,height:s}=O.DOMUtils.getHTMLElementSize(e.node()),n=this.configs.direction===r.LayoutDirection.ROW||this.configs.direction===r.LayoutDirection.ROW_REVERSE,a=c.getProperty(this.model.getOptions(),"style","prefix"),i=e.classed(`${c.carbonPrefix}--${a}--layout-row`,this.configs.direction===r.LayoutDirection.ROW).classed(`${c.carbonPrefix}--${a}--layout-row-reverse`,this.configs.direction===r.LayoutDirection.ROW_REVERSE).classed(`${c.carbonPrefix}--${a}--layout-column`,this.configs.direction===r.LayoutDirection.COLUMN).classed(`${c.carbonPrefix}--${a}--layout-column-reverse`,this.configs.direction===r.LayoutDirection.COLUMN_REVERSE).classed(`${c.carbonPrefix}--${a}--layout-alignitems-center`,this.configs.alignItems===r.LayoutAlignItems.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,h=>h.id);i.enter().append("div").merge(e.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",h=>`layout-child layout-child-${this._instanceID} ${h.id}`).each(function(h){h.components.forEach(u=>{const m=y.select(this),g=c.getProperty(h,"renderType")===r.RenderTypes.SVG;u.setParent(g?O.DOMUtils.appendOrSelect(m,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):m);const v=c.getProperty(h,"growth");(v===r.LayoutGrowth.PREFERRED||v===r.LayoutGrowth.FIXED)&&u.render(o)})}),e.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(h){const u=c.getProperty(h,"growth"),p=c.getProperty(h,"renderType")===r.RenderTypes.SVG?O.DOMUtils.getSVGElementSize(y.select(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):O.DOMUtils.getHTMLElementSize(this);if(u===r.LayoutGrowth.PREFERRED){const g=n?p.width:p.height,v=n?t:s;h.size=g/v*100}}),i.exit().remove(),this.children.filter(h=>c.getProperty(h,"growth")===r.LayoutGrowth.STRETCH).forEach(h=>{h.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const d=e.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,h=>h.id);n?d.style("width",h=>`${h.size/100*t}px`).style("height","100%"):d.style("height",h=>`${h.size/100*s}px`).style("width","100%"),d.each(function(h){h.components.forEach(u=>{c.getProperty(h,"growth")===r.LayoutGrowth.STRETCH&&u.render(o)})})}setModel(o){super.setModel(o),this.children.forEach(e=>{e.components.forEach(t=>t.setModel(o))})}setServices(o){super.setServices(o),this.children.forEach(e=>{e.components.forEach(t=>t.setServices(o))})}destroy(){this.children.forEach(o=>{o.components.forEach(e=>e.destroy())})}};let Mt=Tt;Mt.instanceID=Math.floor(Math.random()*99999999999);class Us extends G{constructor(){super(...arguments),this.type="spacer"}render(e=!0){this.getComponentContainer().style("width",`${this.configs.size||c.spacers.default.size}px`).style("height",`${this.configs.size||c.spacers.default.size}px`).attr("opacity",0)}}var Vs={prefix:"bx",selectorTabbable:`
12
+ <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 r.ToolbarControlTypes.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 r.ToolbarControlTypes.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 r.ToolbarControlTypes.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 r.ToolbarControlTypes.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.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: "+o)}}};let xt=St;xt.buttonID=0;const Tt=class extends G{constructor(o,e,t,s){super(o,e,s),this.type="layout",this.configs=s,this.children=t,this._instanceID=Tt.instanceID++,this.init()}init(){this.children.forEach(o=>{o.components.forEach(e=>{e.init()})})}getPreferedAndFixedSizeSum(){const o=this.parent;let e=0;return o.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>{const s=c.getProperty(t,"growth");return s===r.LayoutGrowth.PREFERRED||s===r.LayoutGrowth.FIXED}).each(function(t){e+=t.size}),e}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(e=>c.getProperty(e,"growth")===r.LayoutGrowth.STRETCH).size()}render(o=!0){const e=this.parent,{width:t,height:s}=O.DOMUtils.getHTMLElementSize(e.node()),n=this.configs.direction===r.LayoutDirection.ROW||this.configs.direction===r.LayoutDirection.ROW_REVERSE,a=c.getProperty(this.model.getOptions(),"style","prefix"),i=e.classed(`${c.carbonPrefix}--${a}--layout-row`,this.configs.direction===r.LayoutDirection.ROW).classed(`${c.carbonPrefix}--${a}--layout-row-reverse`,this.configs.direction===r.LayoutDirection.ROW_REVERSE).classed(`${c.carbonPrefix}--${a}--layout-column`,this.configs.direction===r.LayoutDirection.COLUMN).classed(`${c.carbonPrefix}--${a}--layout-column-reverse`,this.configs.direction===r.LayoutDirection.COLUMN_REVERSE).classed(`${c.carbonPrefix}--${a}--layout-alignitems-center`,this.configs.alignItems===r.LayoutAlignItems.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,h=>h.id);i.enter().append("div").merge(e.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",h=>`layout-child layout-child-${this._instanceID} ${h.id}`).each(function(h){h.components.forEach(u=>{const m=y.select(this),g=c.getProperty(h,"renderType")===r.RenderTypes.SVG;u.setParent(g?O.DOMUtils.appendOrSelect(m,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):m);const v=c.getProperty(h,"growth");(v===r.LayoutGrowth.PREFERRED||v===r.LayoutGrowth.FIXED)&&u.render(o)})}),e.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(h){const u=c.getProperty(h,"growth"),p=c.getProperty(h,"renderType")===r.RenderTypes.SVG?O.DOMUtils.getSVGElementSize(y.select(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):O.DOMUtils.getHTMLElementSize(this);if(u===r.LayoutGrowth.PREFERRED){const g=n?p.width:p.height,v=n?t:s;h.size=g/v*100}}),i.exit().remove(),this.children.filter(h=>c.getProperty(h,"growth")===r.LayoutGrowth.STRETCH).forEach(h=>{h.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const d=e.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,h=>h.id);n?d.style("width",h=>`${h.size/100*t}px`).style("height","100%"):d.style("height",h=>`${h.size/100*s}px`).style("width","100%"),d.each(function(h){h.components.forEach(u=>{c.getProperty(h,"growth")===r.LayoutGrowth.STRETCH&&u.render(o)})})}setModel(o){super.setModel(o),this.children.forEach(e=>{e.components.forEach(t=>t.setModel(o))})}setServices(o){super.setServices(o),this.children.forEach(e=>{e.components.forEach(t=>t.setServices(o))})}destroy(){this.children.forEach(o=>{o.components.forEach(e=>e.destroy())})}};let Mt=Tt;Mt.instanceID=Math.floor(Math.random()*99999999999);class Us extends G{constructor(){super(...arguments),this.type="spacer"}render(e=!1){this.getComponentContainer().style("width",`${this.configs.size||c.spacers.default.size}px`).style("height",`${this.configs.size||c.spacers.default.size}px`).attr("opacity",0)}}var Vs={prefix:"bx",selectorTabbable:`
13
13
  a[href], area[href], input:not([disabled]):not([tabindex='-1']),
14
14
  button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),
15
15
  textarea:not([disabled]):not([tabindex='-1']),
@@ -21,7 +21,7 @@
21
21
  iframe, object, embed, *[tabindex], *[contenteditable=true]
22
22
  `},Ee=Vs;function ze(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function Bs(o,e,t){return e&&ze(o.prototype,e),t&&ze(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Ns(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Gs(o){return Fs(o)||zs(o)||Hs(o)||$s()}function $s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
23
23
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hs(o,e){if(o){if(typeof o=="string")return Oe(o,e);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(o);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Oe(o,e)}}function zs(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function Fs(o){if(Array.isArray(o))return Oe(o)}function Oe(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=o[t];return s}function Ct(o){return o.reduce(function(e,t){return Array.isArray(t)?e.push.apply(e,Gs(Ct(t))):e.push(t),e},[])}function Ws(){for(var o=arguments.length,e=new Array(o),t=0;t<o;t++)e[t]=arguments[t];return Ct(e).reduce(function(s,n){return n(s)},function(){function s(){Ns(this,s)}return Bs(s)}())}function be(o){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(o)}function js(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Fe(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function Zs(o,e,t){return e&&Fe(o.prototype,e),t&&Fe(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Xs(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Se(o,e)}function Se(o,e){return Se=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Se(o,e)}function qs(o){var e=Ks();return function(){var s=ce(o),n;if(e){var a=ce(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Ys(this,n)}}function Ys(o,e){if(e&&(be(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lt(o)}function Lt(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function Ks(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ce(o){return ce=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ce(o)}function Js(o){var e=function(t){Xs(n,t);var s=qs(n);function n(a){var i,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(js(this,n),i=s.call(this,a,l),i.children=[],!a||a.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return i.element=a,i.options=Object.assign(Object.create(i.constructor.options),l),i.constructor.components.set(i.element,Lt(i)),i}return Zs(n,[{key:"release",value:function(){for(var i=this.children.pop();i;i=this.children.pop())i.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(i,l){return this.components.get(i)||new this(i,l)}}]),n}(o);return e}function xe(o){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xe(o)}function Qs(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function We(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function en(o,e,t){return e&&We(o.prototype,e),t&&We(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function oe(){return typeof Reflect<"u"&&Reflect.get?oe=Reflect.get:oe=function(e,t,s){var n=tn(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:s):a.value}},oe.apply(this,arguments)}function tn(o,e){for(;!Object.prototype.hasOwnProperty.call(o,e)&&(o=se(o),o!==null););return o}function sn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Te(o,e)}function Te(o,e){return Te=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Te(o,e)}function nn(o){var e=on();return function(){var s=se(o),n;if(e){var a=se(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return an(this,n)}}function an(o,e){if(e&&(xe(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rn(o)}function rn(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function on(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function se(o){return se=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},se(o)}function ln(o){var e=function(t){sn(n,t);var s=nn(n);function n(){var a;Qs(this,n);for(var i=arguments.length,l=new Array(i),d=0;d<i;d++)l[d]=arguments[d];return a=s.call.apply(s,[this].concat(l)),a.handles=new Set,a}return en(n,[{key:"manage",value:function(i){return this.handles.add(i),i}},{key:"unmanage",value:function(i){return this.handles.delete(i),i}},{key:"release",value:function(){var i=this;return this.handles.forEach(function(l){l.release(),i.handles.delete(l)}),oe(se(n.prototype),"release",this).call(this)}}]),n}(o);return e}function ie(o){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return o.addEventListener.apply(o,t),{release:function(){return o.removeEventListener.apply(o,t),null}}}function Me(o){"@babel/helpers - typeof";return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(o)}function cn(o){return pn(o)||un(o)||hn(o)||dn()}function dn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
24
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hn(o,e){if(o){if(typeof o=="string")return Ce(o,e);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(o);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ce(o,e)}}function un(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function pn(o){if(Array.isArray(o))return Ce(o)}function Ce(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=o[t];return s}function gn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function je(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function mn(o,e,t){return e&&je(o.prototype,e),t&&je(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function vn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Le(o,e)}function Le(o,e){return Le=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Le(o,e)}function fn(o){var e=On();return function(){var s=de(o),n;if(e){var a=de(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return yn(this,n)}}function yn(o,e){if(e&&(Me(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return En(o)}function En(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function On(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function de(o){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},de(o)}function bn(o){var e=function(t){vn(n,t);var s=fn(n);function n(){return gn(this,n),s.apply(this,arguments)}return mn(n,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var i=this,l=arguments.length,d=new Array(l),h=0;h<l;h++)d[h]=arguments[h];var u=typeof d[0]=="string"?d.shift():void 0,m=Object(d[0])===d[0]&&typeof d[0]!="function"?d.shift():void 0,p=typeof d[0]=="function"?d.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(u,m)){p&&p(null,!0);return}var g={group:m&&m.group,state:u},v=[g.group,u].filter(Boolean).join("-").split("-").map(function(M){return M[0].toUpperCase()+M.substr(1)}).join(""),f=new CustomEvent(this.options["eventBefore".concat(v)],{bubbles:!0,cancelable:!0,detail:m}),b=m&&m.delegatorNode||this.element,E=!b.dispatchEvent(f);if(E){if(p){var S=new Error("Changing state (".concat(JSON.stringify(g),") has been canceled."));S.canceled=!0,p(S)}}else{var x=[u,m].filter(Boolean);this._changeState.apply(this,cn(x).concat([function(){b.dispatchEvent(new CustomEvent(i.options["eventAfter".concat(v)],{bubbles:!0,cancelable:!0,detail:m})),p&&p()}]))}}}]),n}(o);return e}function Ae(o,e){var t=o.target,s=o.currentTarget;if(typeof t.matches=="function"){if(t.matches(e))return t;if(t.matches("".concat(e," *"))){var n=t.closest(e);if((s.nodeType===Node.DOCUMENT_NODE?s.documentElement:s).contains(n))return n}}}function Ze(o){if(!o||typeof o=="function")return{launchingElement:null,launchingEvent:null};var e=o.delegateTarget||o.currentTarget||o,t=o.currentTarget&&o;if(e&&!e.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(t&&!t.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:e,launchingEvent:t}}function De(o){"@babel/helpers - typeof";return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(o)}function Sn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function xn(o,e,t){return e&&Xe(o.prototype,e),t&&Xe(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Tn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&we(o,e)}function we(o,e){return we=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},we(o,e)}function Mn(o){var e=An();return function(){var s=he(o),n;if(e){var a=he(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Cn(this,n)}}function Cn(o,e){if(e&&(De(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ln(o)}function Ln(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function An(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function he(o){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},he(o)}function Dn(o){var e=function(t){Tn(n,t);var s=Mn(n);function n(){return Sn(this,n),s.apply(this,arguments)}return xn(n,[{key:"show",value:function(i,l){(!i||typeof i=="function")&&(l=i),this.changeState("shown",Ze(i),l)}},{key:"hide",value:function(i,l){(!i||typeof i=="function")&&(l=i),this.changeState("hidden",Ze(i),l)}}]),n}(o);return e}var wn=[bn,Dn];const Pn=wn;var At=function(){};process.env.NODE_ENV!=="production"&&(At=function(o,e,t){var s=arguments.length;t=new Array(s>2?s-2:0);for(var n=2;n<s;n++)t[n-2]=arguments[n];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(!o){var a=0,i="Warning: "+e.replace(/%s/g,function(){return t[a++]});typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}});var Rn=At;const kn=c.getDefaultExportFromCjs(Rn);function Pe(o){"@babel/helpers - typeof";return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(o)}function In(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function qe(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function _n(o,e,t){return e&&qe(o.prototype,e),t&&qe(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Un(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Re(o,e)}function Re(o,e){return Re=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Re(o,e)}function Vn(o){var e=Gn();return function(){var s=ue(o),n;if(e){var a=ue(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Bn(this,n)}}function Bn(o,e){if(e&&(Pe(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nn(o)}function Nn(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function Gn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ue(o){return ue=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(o)}function $n(o){var e=function(t){Un(n,t);var s=Vn(n);function n(){return In(this,n),s.apply(this,arguments)}return _n(n,null,[{key:"init",value:function(){var i=this,l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=Object.assign(Object.create(this.options),d);if(!l||l.nodeType!==Node.ELEMENT_NODE&&l.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(l.nodeType===Node.ELEMENT_NODE&&l.matches(h.selectorInit))this.create(l,d);else{var u=h.initEventNames.map(function(m){return ie(l,m,function(p){var g=Ae(p,"[".concat(h.attribInitTarget,"]"));if(g){p.delegateTarget=g;var v=g.ownerDocument.querySelectorAll(g.getAttribute(h.attribInitTarget));if(v.length>1)throw new Error("Target widget must be unique.");if(v.length===1){g.tagName==="A"&&p.preventDefault();var f=i.create(v[0],d);typeof f.createdByLauncher=="function"&&f.createdByLauncher(p)}}})});return{release:function(){for(var p=u.pop();p;p=u.pop())p.release()}}}return""}}]),n.forLazyInit=!0,n}(o);return e}function ke(o){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(o)}function Hn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Ye(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function zn(o,e,t){return e&&Ye(o.prototype,e),t&&Ye(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Fn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Ie(o,e)}function Ie(o,e){return Ie=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ie(o,e)}function Wn(o){var e=Xn();return function(){var s=pe(o),n;if(e){var a=pe(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return jn(this,n)}}function jn(o,e){if(e&&(ke(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zn(o)}function Zn(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function Xn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pe(o){return pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},pe(o)}var qn=function(o){Fn(t,o);var e=Wn(t);function t(s,n){var a;return Hn(this,t),a=e.call(this,s,n),a._handleFocusinListener=void 0,a._handleKeydownListener=void 0,a._handleFocusin=function(i){var l=a.element.querySelector(a.options.selectorModalContainer)||a.element;a.element.classList.contains(a.options.classVisible)&&!l.contains(i.target)&&a.options.selectorsFloatingMenus.every(function(d){return!Ae(i,d)})&&a.element.querySelector(Ee.selectorTabbable).focus()},a._hookCloseActions(),a}return zn(t,[{key:"createdByLauncher",value:function(n){this.show(n)}},{key:"shouldStateBeChanged",value:function(n){return n==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(n,a,i){var l=this,d,h=function(){if(d&&(d=l.unmanage(d).release()),n==="shown"&&l.element.offsetWidth>0&&l.element.offsetHeight>0){l.previouslyFocusedNode=l.element.ownerDocument.activeElement;var g=l.element.querySelector(l.options.selectorPrimaryFocus)||l.element.querySelector(Ee.selectorTabbable);g.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&kn(g,"Modals need to contain a focusable element by either using "+"`".concat(l.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}i()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),n==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,m=u?"focusin":"focus";this._handleFocusinListener=this.manage(ie(this.element.ownerDocument,m,this._handleFocusin,!u))}n==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):n==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),d=this.manage(ie(this.element,"transitionend",h))}},{key:"_hookCloseActions",value:function(){var n=this;this.manage(ie(this.element,"click",function(a){var i=Ae(a,n.options.selectorModalClose);i&&(a.delegateTarget=i),(i||a.target===n.element)&&n.hide(a)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(ie(this.element.ownerDocument.body,"keydown",function(a){a.which===27&&n.shouldStateBeChanged("hidden")&&(a.stopPropagation(),n.hide(a))}))}}],[{key:"options",get:function(){var n=Ee.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(n,"--overflow-menu-options"),".".concat(n,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(n,"--modal-container"),classVisible:"is-visible",classBody:"".concat(n,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),t.components=new WeakMap,t}(Ws(Js,$n,Pn,ln));const Yn=qn;class Kn extends G{constructor(e,t,s){super(e,t,s),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),Yn.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(r.Events.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(r.Events.Modal.SHOW,this.handleShowModal)}getModalHTML(){const e=this.model.getOptions(),t=c.getProperty(e,"style","prefix"),s=this.model.getTabularDataArray();return`
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hn(o,e){if(o){if(typeof o=="string")return Ce(o,e);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(o);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ce(o,e)}}function un(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function pn(o){if(Array.isArray(o))return Ce(o)}function Ce(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=o[t];return s}function gn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function je(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function mn(o,e,t){return e&&je(o.prototype,e),t&&je(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function vn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Le(o,e)}function Le(o,e){return Le=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Le(o,e)}function fn(o){var e=On();return function(){var s=de(o),n;if(e){var a=de(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return yn(this,n)}}function yn(o,e){if(e&&(Me(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return En(o)}function En(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function On(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function de(o){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},de(o)}function bn(o){var e=function(t){vn(n,t);var s=fn(n);function n(){return gn(this,n),s.apply(this,arguments)}return mn(n,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var i=this,l=arguments.length,d=new Array(l),h=0;h<l;h++)d[h]=arguments[h];var u=typeof d[0]=="string"?d.shift():void 0,m=Object(d[0])===d[0]&&typeof d[0]!="function"?d.shift():void 0,p=typeof d[0]=="function"?d.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(u,m)){p&&p(null,!0);return}var g={group:m&&m.group,state:u},v=[g.group,u].filter(Boolean).join("-").split("-").map(function(M){return M[0].toUpperCase()+M.substr(1)}).join(""),f=new CustomEvent(this.options["eventBefore".concat(v)],{bubbles:!0,cancelable:!0,detail:m}),b=m&&m.delegatorNode||this.element,E=!b.dispatchEvent(f);if(E){if(p){var S=new Error("Changing state (".concat(JSON.stringify(g),") has been canceled."));S.canceled=!0,p(S)}}else{var T=[u,m].filter(Boolean);this._changeState.apply(this,cn(T).concat([function(){b.dispatchEvent(new CustomEvent(i.options["eventAfter".concat(v)],{bubbles:!0,cancelable:!0,detail:m})),p&&p()}]))}}}]),n}(o);return e}function Ae(o,e){var t=o.target,s=o.currentTarget;if(typeof t.matches=="function"){if(t.matches(e))return t;if(t.matches("".concat(e," *"))){var n=t.closest(e);if((s.nodeType===Node.DOCUMENT_NODE?s.documentElement:s).contains(n))return n}}}function Ze(o){if(!o||typeof o=="function")return{launchingElement:null,launchingEvent:null};var e=o.delegateTarget||o.currentTarget||o,t=o.currentTarget&&o;if(e&&!e.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(t&&!t.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:e,launchingEvent:t}}function De(o){"@babel/helpers - typeof";return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(o)}function Sn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function xn(o,e,t){return e&&Xe(o.prototype,e),t&&Xe(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Tn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&we(o,e)}function we(o,e){return we=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},we(o,e)}function Mn(o){var e=An();return function(){var s=he(o),n;if(e){var a=he(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Cn(this,n)}}function Cn(o,e){if(e&&(De(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ln(o)}function Ln(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function An(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function he(o){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},he(o)}function Dn(o){var e=function(t){Tn(n,t);var s=Mn(n);function n(){return Sn(this,n),s.apply(this,arguments)}return xn(n,[{key:"show",value:function(i,l){(!i||typeof i=="function")&&(l=i),this.changeState("shown",Ze(i),l)}},{key:"hide",value:function(i,l){(!i||typeof i=="function")&&(l=i),this.changeState("hidden",Ze(i),l)}}]),n}(o);return e}var wn=[bn,Dn];const Pn=wn;var At=function(){};process.env.NODE_ENV!=="production"&&(At=function(o,e,t){var s=arguments.length;t=new Array(s>2?s-2:0);for(var n=2;n<s;n++)t[n-2]=arguments[n];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(!o){var a=0,i="Warning: "+e.replace(/%s/g,function(){return t[a++]});typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}});var Rn=At;const kn=c.getDefaultExportFromCjs(Rn);function Pe(o){"@babel/helpers - typeof";return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(o)}function In(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function qe(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function _n(o,e,t){return e&&qe(o.prototype,e),t&&qe(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Un(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Re(o,e)}function Re(o,e){return Re=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Re(o,e)}function Vn(o){var e=Gn();return function(){var s=ue(o),n;if(e){var a=ue(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Bn(this,n)}}function Bn(o,e){if(e&&(Pe(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nn(o)}function Nn(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function Gn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ue(o){return ue=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(o)}function $n(o){var e=function(t){Un(n,t);var s=Vn(n);function n(){return In(this,n),s.apply(this,arguments)}return _n(n,null,[{key:"init",value:function(){var i=this,l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=Object.assign(Object.create(this.options),d);if(!l||l.nodeType!==Node.ELEMENT_NODE&&l.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(l.nodeType===Node.ELEMENT_NODE&&l.matches(h.selectorInit))this.create(l,d);else{var u=h.initEventNames.map(function(m){return ie(l,m,function(p){var g=Ae(p,"[".concat(h.attribInitTarget,"]"));if(g){p.delegateTarget=g;var v=g.ownerDocument.querySelectorAll(g.getAttribute(h.attribInitTarget));if(v.length>1)throw new Error("Target widget must be unique.");if(v.length===1){g.tagName==="A"&&p.preventDefault();var f=i.create(v[0],d);typeof f.createdByLauncher=="function"&&f.createdByLauncher(p)}}})});return{release:function(){for(var p=u.pop();p;p=u.pop())p.release()}}}return""}}]),n.forLazyInit=!0,n}(o);return e}function ke(o){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(o)}function Hn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Ye(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function zn(o,e,t){return e&&Ye(o.prototype,e),t&&Ye(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Fn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Ie(o,e)}function Ie(o,e){return Ie=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ie(o,e)}function Wn(o){var e=Xn();return function(){var s=pe(o),n;if(e){var a=pe(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return jn(this,n)}}function jn(o,e){if(e&&(ke(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zn(o)}function Zn(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function Xn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pe(o){return pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},pe(o)}var qn=function(o){Fn(t,o);var e=Wn(t);function t(s,n){var a;return Hn(this,t),a=e.call(this,s,n),a._handleFocusinListener=void 0,a._handleKeydownListener=void 0,a._handleFocusin=function(i){var l=a.element.querySelector(a.options.selectorModalContainer)||a.element;a.element.classList.contains(a.options.classVisible)&&!l.contains(i.target)&&a.options.selectorsFloatingMenus.every(function(d){return!Ae(i,d)})&&a.element.querySelector(Ee.selectorTabbable).focus()},a._hookCloseActions(),a}return zn(t,[{key:"createdByLauncher",value:function(n){this.show(n)}},{key:"shouldStateBeChanged",value:function(n){return n==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(n,a,i){var l=this,d,h=function(){if(d&&(d=l.unmanage(d).release()),n==="shown"&&l.element.offsetWidth>0&&l.element.offsetHeight>0){l.previouslyFocusedNode=l.element.ownerDocument.activeElement;var g=l.element.querySelector(l.options.selectorPrimaryFocus)||l.element.querySelector(Ee.selectorTabbable);g.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&kn(g,"Modals need to contain a focusable element by either using "+"`".concat(l.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}i()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),n==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,m=u?"focusin":"focus";this._handleFocusinListener=this.manage(ie(this.element.ownerDocument,m,this._handleFocusin,!u))}n==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):n==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),d=this.manage(ie(this.element,"transitionend",h))}},{key:"_hookCloseActions",value:function(){var n=this;this.manage(ie(this.element,"click",function(a){var i=Ae(a,n.options.selectorModalClose);i&&(a.delegateTarget=i),(i||a.target===n.element)&&n.hide(a)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(ie(this.element.ownerDocument.body,"keydown",function(a){a.which===27&&n.shouldStateBeChanged("hidden")&&(a.stopPropagation(),n.hide(a))}))}}],[{key:"options",get:function(){var n=Ee.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(n,"--overflow-menu-options"),".".concat(n,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(n,"--modal-container"),classVisible:"is-visible",classBody:"".concat(n,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),t.components=new WeakMap,t}(Ws(Js,$n,Pn,ln));const Yn=qn;class Kn extends G{constructor(e,t,s){super(e,t,s),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),Yn.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(r.Events.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(r.Events.Modal.SHOW,this.handleShowModal)}getModalHTML(){const e=this.model.getOptions(),t=c.getProperty(e,"style","prefix"),s=this.model.getTabularDataArray();return`
25
25
  <div class="cds--modal-container cds--modal-container">
26
26
  <div class="cds--modal-header cds--modal-header">
27
27
  <p class="cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta" id="modal-title">Tabular representation</p>
@@ -57,7 +57,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
57
57
  <div class="${c.carbonPrefix}--${t}-modal-footer-spacer"></div>
58
58
  <button class="cds--btn cds--btn--primary cds--btn cds--btn--primary" type="button" data-modal-primary-focus>Download as CSV</button>
59
59
  </div>
60
- </div>`}render(e=!0){const t=this.model.getOptions();if(!this.isEventListenerAdded){const s=y.select(this.services.domUtils.getHolder()),n=c.getProperty(t,"style","prefix");this.modal=O.DOMUtils.appendOrSelect(s,`div.${c.carbonPrefix}--${n}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Dt extends G{constructor(){super(...arguments),this.type="title",this.renderType=r.RenderTypes.HTML}render(e=!0){const t=this.getComponentContainer(),s=c.getProperty(this.getOptions(),"title"),n=t.selectAll("p.title").data([s]);if(n.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(n).html(a=>a),n.node()&&n.node().offsetWidth<n.node().scrollWidth){const a=this;n.on("mouseover",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:n,content:n.text()})}).on("mousemove",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("mouseout",function(){a.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}n.exit().remove()}truncateTitle(e,t){if(t<=0)return;const s=e.text();if(e.node().getComputedTextLength()>t){e.append("tspan").text("...");const n=O.DOMUtils.appendOrSelect(e,"tspan").node().getComputedTextLength(),a=e.text(),i=this.getSubstringIndex(e.node(),0,a.length-1,t-n);e.html(a.substring(0,i-1)).append("tspan").text("...");const l=this;e.on("mouseover",function(d){l.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:d,hoveredElement:e,content:s})}).on("mousemove",function(d){l.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:d})}).on("mouseout",function(){l.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}getMaxTitleWidth(){return O.DOMUtils.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,t,s,n){const a=Math.floor((s+t)/2);return e.getSubStringLength(0,a)>n?this.getSubstringIndex(e,t,a,n):e.getSubStringLength(0,a)<n?e.getSubStringLength(0,a+1)>n?a:this.getSubstringIndex(e,a,s,n):a}}class wt extends G{constructor(){super(...arguments),this.type="legend",this.renderType=r.RenderTypes.HTML}render(e=!0){const t=this.getOptions(),s=c.getProperty(t,"legend"),n=c.getProperty(s,"alignment"),a=c.getProperty(t,"legend","orientation");let i=this.model.getDataGroups();const{DISABLED:l}=c.legend.items.status,d=i.some(S=>S.status===l),h=c.getProperty(s,"order"),u=this.getComponentContainer().classed("center-aligned",n===r.Alignments.CENTER).classed("right-aligned",n===r.Alignments.RIGHT).classed(a,!0).classed("has-deactivated-items",d).attr("role",N.Roles.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");h&&(i=this.sortDataGroups(i,h));const m=u.selectAll("div.legend-item").data(i,S=>S.name),p=m.enter().append("div").attr("class","legend-item");p.merge(u.selectAll("div.legend-item")).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});const g=c.getProperty(this.getOptions(),"legend","clickable");u.classed("clickable",g&&i.length>1);const v=c.legend.checkbox.radius,f=p.append("div").classed("checkbox",!0),b=f.merge(m.select("div.checkbox")).attr("role",N.Roles.CHECKBOX).attr("tabindex",g?0:-1).attr("aria-labelledby",(S,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:S})=>S===c.legend.items.status.ACTIVE).attr("width",v*2).attr("height",v*2).attr("class",S=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.BACKGROUND],dataGroupName:S.name,originalClassName:"checkbox"})).style("background",S=>S.status===c.legend.items.status.ACTIVE?this.model.getFillColor(S.name)||this.model.getStrokeColor(S.name):null).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});f.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"),p.append("p").merge(m.select("p"));const E=c.getProperty(t,"legend","additionalItems");if(E&&i.length){const S=this,x=u.selectAll("div.additional-item").data(E);x.exit().remove();const M=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(w,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b.size()+I}-title`));M.selectAll("*").remove();let C,T=1;M.append("svg").classed("icon",!0).each(function(w){const I=y.select(this);!C||C!=w.type?(C=w.type,T=1):T++,S.addAdditionalItem(I,w,T)}),M.append("p").merge(M.select("p")),this.truncateLegendText()}m.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),g&&p.size()>1&&this.addEventListeners()}sortDataGroups(e,t){if(e.sort((s,n)=>t.indexOf(s.name)-t.indexOf(n.name)),t.length<e.length){const s=e.length-t.length;return e.slice(s).concat(e.slice(0,s))}return e}addAdditionalItem(e,t,s){const{width:n,height:a}=c.legend.area;if(t.type===r.LegendItemType.RADIUS?e.style("width",`${a}px`).style("height",`${a}px`):e.style("width",`${n}px`).style("height",`${a}px`),t.type===r.LegendItemType.RADIUS){const{iconData:i,fill:l,stroke:d}=c.legend.radius;e.attr("fill","none").selectAll("circle").data(i).enter().append("circle").classed("radius",!0).attr("role",N.Roles.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",t.fill?t.fill:l).style("stroke",t.stroke?t.stroke:d)}else if(t.type===r.LegendItemType.LINE){const i=c.legend.line;e.select("line.line").empty()&&e.append("line").classed(`line-${s}`,!0).attr("role",N.Roles.IMG).attr("aria-label","line").attr("x1",0).attr("y1",i.yPosition).attr("x2",n).attr("y2",i.yPosition).style("stroke",t.stroke?t.stroke:i.stroke).style("stroke-width",i.strokeWidth)}else if(t.type===r.LegendItemType.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${s}`,!0).attr("role",N.Roles.IMG).attr("aria-label","area").attr("width",n).attr("height",a).style("fill",s>3&&!t.fill?c.legend.area.fill:t.fill).style("stroke",t.stroke);else if(t.type===r.LegendItemType.SIZE){const{iconData:i,fill:l,stroke:d}=c.legend.size;e.attr("fill","none").attr("role",N.Roles.IMG).attr("aria-label","size").selectAll("rect").data(i).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",t.fill?t.fill:l).style("stroke",t.stroke?t.stroke:d).style("stroke-width",1)}else if(t.type===r.LegendItemType.QUARTILE){const{iconData:i}=c.legend.quartile;e.selectAll("rect").attr("role",N.Roles.IMG).attr("aria-label","quartile").data(i).enter().append("rect").attr("class",(d,h)=>`quartile-${h===0?"wrapper":"line"}`).attr("x",d=>d.x).attr("y",d=>d.y).attr("width",d=>d.width).attr("height",d=>d.height)}else if(t.type===r.LegendItemType.ZOOM){const{iconData:i,color:l}=c.getProperty(c.Configuration,"legend","zoom"),d=e.attr("role",N.Roles.IMG).attr("aria-label","zoom").selectAll("g.icon").data(i).enter();d.append("g").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.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",()=>t.color?t.color:l),d.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",()=>t.color?t.color:l)}}truncateLegendText(){const e=this.getComponentContainer(),t=c.getProperty(this.getOptions(),"legend","truncation"),s=c.getProperty(t,"type"),n=c.getProperty(t,"threshold"),a=c.getProperty(t,"numCharacter"),i=e.selectAll("div.legend-item p");i.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),s!==r.TruncationTypes.NONE?i.html(function(l){return l.name.length>n?c.truncateLabel(l.name,s,a):l.name}):i.html(l=>l.name)}addEventListeners(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=c.getProperty(s,"legend"),a=c.getProperty(n,"truncation");t.selectAll("div.legend-item").on("mouseover",function(i){e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)});const l=y.select(this);l.select("div.checkbox").classed("hovered",!0);const d=l.datum();d.name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:l,content:d.name})}).on("mousemove",function(i){y.select(this).datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("click",function(){e.services.events.dispatchEvent(r.Events.Legend.ITEM_CLICK,{clickedElement:y.select(this)});const l=y.select(this).datum();e.model.toggleDataLabel(l.name)}).on("mouseout",function(){const i=y.select(this);i.select("div.checkbox").classed("hovered",!1),i.datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.HIDE),e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:i})}),t.selectAll("div.legend-item div.checkbox").on("keyup",function(i){i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)})}),t.selectAll("div.legend-item div.checkbox").on("keydown",function(i,l){i.key&&i.key===" "?(i.preventDefault(),e.model.toggleDataLabel(l.name)):i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:y.select(this)})}),t.selectAll("g.additional-item").on("mouseover",function(i){const l=y.select(this),d=l.datum();d.name.length>a.threshold&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:l,content:d.name})})}}class Pt extends G{constructor(e,t,s){super(e,t,s),this.type="chart-clip",this.renderType=r.RenderTypes.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:t}=this.services;if(!t)throw new Error("Service cartesianScales was undefined");const s=t.getMainXScale(),n=t.getMainYScale(),[a,i]=s.range(),[l,d]=n.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const h=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i-a>0&&h.attr("x",a).attr("y",d).attr("width",i-a).attr("height",l-d),this.chartClipPath.merge(h).lower()}}class Jn extends Pt{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:t,height:s}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const n=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);n.attr("x",0).attr("y",0).attr("width",t).attr("height",s),this.chartClipPath.merge(n).lower()}}var Q,Z;(function(o){o.LEFT="left",o.RIGHT="right",o.TOP="top",o.BOTTOM="bottom"})(Z||(Z={}));var Ke=(Q={},Q[Z.LEFT]=function(o,e,t){return{top:o.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(o.left-e.offsetWidth)}},Q[Z.RIGHT]=function(o,e,t){return{top:o.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(o.left+t.width)}},Q[Z.TOP]=function(o,e,t){return{top:Math.round(o.top-e.offsetHeight),left:o.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q[Z.BOTTOM]=function(o,e,t){return{top:Math.round(o.top+t.height),left:o.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q),Je=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},ge=function(){function o(e){e===void 0&&(e={}),this.positions=Ke,this.positions=Object.assign({},Ke,e)}return o.prototype.getRelativeOffset=function(e){for(var t={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)t.left+=e.offsetLeft,t.top+=e.offsetTop,e=e.offsetParent;return t},o.prototype.getAbsoluteOffset=function(e){for(var t=e,s={top:0,left:0};t.offsetParent;){var n=getComputedStyle(t.offsetParent);n.position==="static"&&n.marginLeft&&n.marginTop&&(parseInt(n.marginTop,10)&&(s.top+=parseInt(n.marginTop,10)),parseInt(n.marginLeft,10)&&(s.left+=parseInt(n.marginLeft,10))),t=t.offsetParent}var a=e.getBoundingClientRect(),i=document.body.getBoundingClientRect();return{top:a.top-i.top+s.top,left:a.left-i.left+s.left}},o.prototype.findRelative=function(e,t,s){var n=this.getRelativeOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},o.prototype.findAbsolute=function(e,t,s){var n=this.getAbsoluteOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},o.prototype.findPosition=function(e,t,s,n){n===void 0&&(n=this.getAbsoluteOffset.bind(this));var a=n(e),i=e.getBoundingClientRect();return this.calculatePosition(a,i,t,s)},o.prototype.findPositionAt=function(e,t,s){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},t,s)},o.prototype.getPlacementBox=function(e,t){var s=e.offsetHeight+t.top,n=e.offsetWidth+t.left;return{top:t.top,bottom:s,left:t.left,right:n}},o.prototype.addOffset=function(e,t,s){return t===void 0&&(t=0),s===void 0&&(s=0),Object.assign({},e,{top:e.top+t,left:e.left+s})},o.prototype.setElement=function(e,t){e.style.top=t.top+"px",e.style.left=t.left+"px"},o.prototype.findBestPlacement=function(e,t,s,n,a){var i=this;n===void 0&&(n=this.defaultContainerFunction.bind(this)),a===void 0&&(a=this.findPosition.bind(this));var l=s.map(function(d){var h=a(e,t,d),u=i.getPlacementBox(t,h),m=0,p=0,g=n();u.top<g.top?m=g.top-u.top:u.bottom>g.height&&(m=u.bottom-g.height),u.left<g.left?p=g.left-u.left:u.right>g.width&&(p=u.right-g.width),m&&!p?p=1:p&&!m&&(m=1);var v=t.offsetHeight*t.offsetWidth,f=m*p,b=v-f,E=b/v;return{placement:d,weight:E}});return l.sort(function(d,h){return h.weight-d.weight}),l[0].placement},o.prototype.findBestPlacementAt=function(e,t,s,n){var a=this;n===void 0&&(n=this.defaultContainerFunction.bind(this));var i=function(l,d,h){return a.findPositionAt(e,d,h)};return this.findBestPlacement(null,t,s,n,i)},o.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Je.innerHeight,width:Je.innerWidth}},o.prototype.calculatePosition=function(e,t,s,n){return this.positions[n]?this.positions[n](e,s,t):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},o}();new ge;class Rt extends G{constructor(e,t,s){super(e,t,s),this.type="tooltip",this.renderType=r.RenderTypes.HTML,this.isEventListenerAdded=!1,this.positionService=new ge,this.handleShowTooltip=n=>{const a=n.detail.data||n.detail.items;let i;const l=this.formatItems(this.getItems(n));n.detail.content?i=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`:i=this.getTooltipHTML(l);const d=O.DOMUtils.appendOrSelect(this.tooltip,"div.content-box");if(c.getProperty(this.getOptions(),"tooltip","customHTML"))if(n.detail.content){const h=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`;d.html(h)}else d.html(this.model.getOptions().tooltip.customHTML(a,i));else d.html(i);d.selectAll(".datapoint-tooltip").each(function(h,u){const m=l[u];l[u]&&l[u].color&&y.select(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",m.color)}),this.positionTooltip(n),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(r.Events.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(r.Events.Tooltip.MOVE,null),this.services.events.removeEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const t=this.getOptions(),s=c.getProperty(t,"tooltip","truncation","type"),n=c.getProperty(t,"tooltip","truncation","threshold"),a=c.getProperty(t,"tooltip","truncation","numCharacter");return s!==r.TruncationTypes.NONE?e.map(i=>{const l=i.labelIcon?12:0;return i.value=i.value?this.valueFormatter(i.value,i.label):i.value,i.label&&i.label.length+l>n&&(i.label=c.truncateLabel(i.label,s,a)),i.value&&i.value.length>n&&(i.value=c.truncateLabel(i.value,s,a)),i}):e}getTooltipHTML(e){return'<ul class="multi-tooltip">'+e.map(t=>`<li>
60
+ </div>`}render(e=!1){const t=this.model.getOptions();if(!this.isEventListenerAdded){const s=y.select(this.services.domUtils.getHolder()),n=c.getProperty(t,"style","prefix");this.modal=O.DOMUtils.appendOrSelect(s,`div.${c.carbonPrefix}--${n}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Dt extends G{constructor(){super(...arguments),this.type="title",this.renderType=r.RenderTypes.HTML}render(e=!1){const t=this.getComponentContainer(),s=c.getProperty(this.getOptions(),"title"),n=t.selectAll("p.title").data([s]);if(n.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(n).html(a=>a),n.node()&&n.node().offsetWidth<n.node().scrollWidth){const a=this;n.on("mouseover",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:n,content:n.text()})}).on("mousemove",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("mouseout",function(){a.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}n.exit().remove()}truncateTitle(e,t){if(t<=0)return;const s=e.text();if(e.node().getComputedTextLength()>t){e.append("tspan").text("...");const n=O.DOMUtils.appendOrSelect(e,"tspan").node().getComputedTextLength(),a=e.text(),i=this.getSubstringIndex(e.node(),0,a.length-1,t-n);e.html(a.substring(0,i-1)).append("tspan").text("...");const l=this;e.on("mouseover",function(d){l.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:d,hoveredElement:e,content:s})}).on("mousemove",function(d){l.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:d})}).on("mouseout",function(){l.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}getMaxTitleWidth(){return O.DOMUtils.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,t,s,n){const a=Math.floor((s+t)/2);return e.getSubStringLength(0,a)>n?this.getSubstringIndex(e,t,a,n):e.getSubStringLength(0,a)<n?e.getSubStringLength(0,a+1)>n?a:this.getSubstringIndex(e,a,s,n):a}}class wt extends G{constructor(){super(...arguments),this.type="legend",this.renderType=r.RenderTypes.HTML}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"legend"),n=c.getProperty(s,"alignment"),a=c.getProperty(t,"legend","orientation");let i=this.model.getDataGroups();const{DISABLED:l}=c.legend.items.status,d=i.some(S=>S.status===l),h=c.getProperty(s,"order"),u=this.getComponentContainer().classed("center-aligned",n===r.Alignments.CENTER).classed("right-aligned",n===r.Alignments.RIGHT).classed(a,!0).classed("has-deactivated-items",d).attr("role",N.Roles.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");h&&(i=this.sortDataGroups(i,h));const m=u.selectAll("div.legend-item").data(i,S=>S.name),p=m.enter().append("div").attr("class","legend-item");p.merge(u.selectAll("div.legend-item")).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});const g=c.getProperty(this.getOptions(),"legend","clickable");u.classed("clickable",g&&i.length>1);const v=c.legend.checkbox.radius,f=p.append("div").classed("checkbox",!0),b=f.merge(m.select("div.checkbox")).attr("role",N.Roles.CHECKBOX).attr("tabindex",g?0:-1).attr("aria-labelledby",(S,T)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${T}-title`)).attr("aria-checked",({status:S})=>S===c.legend.items.status.ACTIVE).attr("width",v*2).attr("height",v*2).attr("class",S=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.BACKGROUND],dataGroupName:S.name,originalClassName:"checkbox"})).style("background",S=>S.status===c.legend.items.status.ACTIVE?this.model.getFillColor(S.name)||this.model.getStrokeColor(S.name):null).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});f.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"),p.append("p").merge(m.select("p"));const E=c.getProperty(t,"legend","additionalItems");if(E&&i.length){const S=this,T=u.selectAll("div.additional-item").data(E);T.exit().remove();const M=T.enter().append("div").merge(T).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(w,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b.size()+I}-title`));M.selectAll("*").remove();let C,x=1;M.append("svg").classed("icon",!0).each(function(w){const I=y.select(this);!C||C!=w.type?(C=w.type,x=1):x++,S.addAdditionalItem(I,w,x)}),M.append("p").merge(M.select("p")),this.truncateLegendText()}m.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),g&&p.size()>1&&this.addEventListeners()}sortDataGroups(e,t){if(e.sort((s,n)=>t.indexOf(s.name)-t.indexOf(n.name)),t.length<e.length){const s=e.length-t.length;return e.slice(s).concat(e.slice(0,s))}return e}addAdditionalItem(e,t,s){const{width:n,height:a}=c.legend.area;if(t.type===r.LegendItemType.RADIUS?e.style("width",`${a}px`).style("height",`${a}px`):e.style("width",`${n}px`).style("height",`${a}px`),t.type===r.LegendItemType.RADIUS){const{iconData:i,fill:l,stroke:d}=c.legend.radius;e.attr("fill","none").selectAll("circle").data(i).enter().append("circle").classed("radius",!0).attr("role",N.Roles.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",t.fill?t.fill:l).style("stroke",t.stroke?t.stroke:d)}else if(t.type===r.LegendItemType.LINE){const i=c.legend.line;e.select("line.line").empty()&&e.append("line").classed(`line-${s}`,!0).attr("role",N.Roles.IMG).attr("aria-label","line").attr("x1",0).attr("y1",i.yPosition).attr("x2",n).attr("y2",i.yPosition).style("stroke",t.stroke?t.stroke:i.stroke).style("stroke-width",i.strokeWidth)}else if(t.type===r.LegendItemType.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${s}`,!0).attr("role",N.Roles.IMG).attr("aria-label","area").attr("width",n).attr("height",a).style("fill",s>3&&!t.fill?c.legend.area.fill:t.fill).style("stroke",t.stroke);else if(t.type===r.LegendItemType.SIZE){const{iconData:i,fill:l,stroke:d}=c.legend.size;e.attr("fill","none").attr("role",N.Roles.IMG).attr("aria-label","size").selectAll("rect").data(i).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",t.fill?t.fill:l).style("stroke",t.stroke?t.stroke:d).style("stroke-width",1)}else if(t.type===r.LegendItemType.QUARTILE){const{iconData:i}=c.legend.quartile;e.selectAll("rect").attr("role",N.Roles.IMG).attr("aria-label","quartile").data(i).enter().append("rect").attr("class",(d,h)=>`quartile-${h===0?"wrapper":"line"}`).attr("x",d=>d.x).attr("y",d=>d.y).attr("width",d=>d.width).attr("height",d=>d.height)}else if(t.type===r.LegendItemType.ZOOM){const{iconData:i,color:l}=c.getProperty(c.legend,"zoom"),d=e.attr("role",N.Roles.IMG).attr("aria-label","zoom").selectAll("g.icon").data(i).enter();d.append("g").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.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",()=>t.color?t.color:l),d.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",()=>t.color?t.color:l)}}truncateLegendText(){const e=this.getComponentContainer(),t=c.getProperty(this.getOptions(),"legend","truncation"),s=c.getProperty(t,"type"),n=c.getProperty(t,"threshold"),a=c.getProperty(t,"numCharacter"),i=e.selectAll("div.legend-item p");i.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),s!==r.TruncationTypes.NONE?i.html(function(l){return l.name.length>n?c.truncateLabel(l.name,s,a):l.name}):i.html(l=>l.name)}addEventListeners(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=c.getProperty(s,"legend"),a=c.getProperty(n,"truncation");t.selectAll("div.legend-item").on("mouseover",function(i){e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)});const l=y.select(this);l.select("div.checkbox").classed("hovered",!0);const d=l.datum();d.name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:l,content:d.name})}).on("mousemove",function(i){y.select(this).datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("click",function(){e.services.events.dispatchEvent(r.Events.Legend.ITEM_CLICK,{clickedElement:y.select(this)});const l=y.select(this).datum();e.model.toggleDataLabel(l.name)}).on("mouseout",function(){const i=y.select(this);i.select("div.checkbox").classed("hovered",!1),i.datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.HIDE),e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:i})}),t.selectAll("div.legend-item div.checkbox").on("keyup",function(i){i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)})}),t.selectAll("div.legend-item div.checkbox").on("keydown",function(i,l){i.key&&i.key===" "?(i.preventDefault(),e.model.toggleDataLabel(l.name)):i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:y.select(this)})}),t.selectAll("g.additional-item").on("mouseover",function(i){const l=y.select(this),d=l.datum();d.name.length>a.threshold&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:l,content:d.name})})}}class Pt extends G{constructor(e,t,s){super(e,t,s),this.type="chart-clip",this.renderType=r.RenderTypes.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:t}=this.services;if(!t)throw new Error("Service cartesianScales was undefined");const s=t.getMainXScale(),n=t.getMainYScale(),[a,i]=s.range(),[l,d]=n.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const h=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i-a>0&&h.attr("x",a).attr("y",d).attr("width",i-a).attr("height",l-d),this.chartClipPath.merge(h).lower()}}class Jn extends Pt{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:t,height:s}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const n=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);n.attr("x",0).attr("y",0).attr("width",t).attr("height",s),this.chartClipPath.merge(n).lower()}}var Q,Z;(function(o){o.LEFT="left",o.RIGHT="right",o.TOP="top",o.BOTTOM="bottom"})(Z||(Z={}));var Ke=(Q={},Q[Z.LEFT]=function(o,e,t){return{top:o.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(o.left-e.offsetWidth)}},Q[Z.RIGHT]=function(o,e,t){return{top:o.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(o.left+t.width)}},Q[Z.TOP]=function(o,e,t){return{top:Math.round(o.top-e.offsetHeight),left:o.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q[Z.BOTTOM]=function(o,e,t){return{top:Math.round(o.top+t.height),left:o.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q),Je=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},ge=function(){function o(e){e===void 0&&(e={}),this.positions=Ke,this.positions=Object.assign({},Ke,e)}return o.prototype.getRelativeOffset=function(e){for(var t={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)t.left+=e.offsetLeft,t.top+=e.offsetTop,e=e.offsetParent;return t},o.prototype.getAbsoluteOffset=function(e){for(var t=e,s={top:0,left:0};t.offsetParent;){var n=getComputedStyle(t.offsetParent);n.position==="static"&&n.marginLeft&&n.marginTop&&(parseInt(n.marginTop,10)&&(s.top+=parseInt(n.marginTop,10)),parseInt(n.marginLeft,10)&&(s.left+=parseInt(n.marginLeft,10))),t=t.offsetParent}var a=e.getBoundingClientRect(),i=document.body.getBoundingClientRect();return{top:a.top-i.top+s.top,left:a.left-i.left+s.left}},o.prototype.findRelative=function(e,t,s){var n=this.getRelativeOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},o.prototype.findAbsolute=function(e,t,s){var n=this.getAbsoluteOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},o.prototype.findPosition=function(e,t,s,n){n===void 0&&(n=this.getAbsoluteOffset.bind(this));var a=n(e),i=e.getBoundingClientRect();return this.calculatePosition(a,i,t,s)},o.prototype.findPositionAt=function(e,t,s){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},t,s)},o.prototype.getPlacementBox=function(e,t){var s=e.offsetHeight+t.top,n=e.offsetWidth+t.left;return{top:t.top,bottom:s,left:t.left,right:n}},o.prototype.addOffset=function(e,t,s){return t===void 0&&(t=0),s===void 0&&(s=0),Object.assign({},e,{top:e.top+t,left:e.left+s})},o.prototype.setElement=function(e,t){e.style.top=t.top+"px",e.style.left=t.left+"px"},o.prototype.findBestPlacement=function(e,t,s,n,a){var i=this;n===void 0&&(n=this.defaultContainerFunction.bind(this)),a===void 0&&(a=this.findPosition.bind(this));var l=s.map(function(d){var h=a(e,t,d),u=i.getPlacementBox(t,h),m=0,p=0,g=n();u.top<g.top?m=g.top-u.top:u.bottom>g.height&&(m=u.bottom-g.height),u.left<g.left?p=g.left-u.left:u.right>g.width&&(p=u.right-g.width),m&&!p?p=1:p&&!m&&(m=1);var v=t.offsetHeight*t.offsetWidth,f=m*p,b=v-f,E=b/v;return{placement:d,weight:E}});return l.sort(function(d,h){return h.weight-d.weight}),l[0].placement},o.prototype.findBestPlacementAt=function(e,t,s,n){var a=this;n===void 0&&(n=this.defaultContainerFunction.bind(this));var i=function(l,d,h){return a.findPositionAt(e,d,h)};return this.findBestPlacement(null,t,s,n,i)},o.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Je.innerHeight,width:Je.innerWidth}},o.prototype.calculatePosition=function(e,t,s,n){return this.positions[n]?this.positions[n](e,s,t):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},o}();new ge;class Rt extends G{constructor(e,t,s){super(e,t,s),this.type="tooltip",this.renderType=r.RenderTypes.HTML,this.isEventListenerAdded=!1,this.positionService=new ge,this.handleShowTooltip=n=>{const a=n.detail.data||n.detail.items;let i;const l=this.formatItems(this.getItems(n));n.detail.content?i=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`:i=this.getTooltipHTML(l);const d=O.DOMUtils.appendOrSelect(this.tooltip,"div.content-box");if(c.getProperty(this.getOptions(),"tooltip","customHTML"))if(n.detail.content){const h=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`;d.html(h)}else d.html(this.model.getOptions().tooltip.customHTML(a,i));else d.html(i);d.selectAll(".datapoint-tooltip").each(function(h,u){const m=l[u];l[u]&&l[u].color&&y.select(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",m.color)}),this.positionTooltip(n),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(r.Events.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(r.Events.Tooltip.MOVE,null),this.services.events.removeEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const t=this.getOptions(),s=c.getProperty(t,"tooltip","truncation","type"),n=c.getProperty(t,"tooltip","truncation","threshold"),a=c.getProperty(t,"tooltip","truncation","numCharacter");return s!==r.TruncationTypes.NONE?e.map(i=>{const l=i.labelIcon?12:0;return i.value=i.value?this.valueFormatter(i.value,i.label):i.value,i.label&&i.label.length+l>n&&(i.label=c.truncateLabel(i.label,s,a)),i.value&&i.value.length>n&&(i.value=c.truncateLabel(i.value,s,a)),i}):e}getTooltipHTML(e){return'<ul class="multi-tooltip">'+e.map(t=>`<li>
61
61
  <div class="datapoint-tooltip${t.bold?" bold":""}">
62
62
  ${t.class||t.color?`<div class="tooltip-color ${t.class}"></div>`:""}
63
63
  <div class="label">
@@ -66,17 +66,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
66
66
  </div>
67
67
  ${t.value===void 0||t.value===null?"":`<p class="value"/>${t.value}</p>`}
68
68
  </div>
69
- </li>`).join("")+"</ul>"}valueFormatter(e,t){const s=this.getOptions(),n=c.getProperty(s,"tooltip","valueFormatter");if(n)return n(e,t);if(typeof e.getTime=="function")return c.format(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return c.format(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!0){const t=this.getOptions(),s=c.getProperty(t,"tooltip","enabled");if(s){const n=y.select(this.services.domUtils.getHolder()),a=c.getProperty(t,"style","prefix");this.tooltip=O.DOMUtils.appendOrSelect(n,`div.${c.carbonPrefix}--${a}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!s&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const t=this.services.domUtils.getHolder(),s=this.tooltip.node(),n=this.getOptions(),a=c.getProperty(n,"zoomBar","top","enabled");let i=c.getProperty(e,"detail","mousePosition");if(!i)i=y.pointer(c.getProperty(e,"detail","event"),t);else{const p=c.getProperty(n,"zoomBar","top","type"),g=c.zoomBar.height[p];a&&(i[1]+=g+c.zoomBar.spacerHeight)}const l=t.offsetWidth,d=t.offsetHeight;let h;i[0]/l>.9?h=Z.LEFT:i[0]/l<.1?h=Z.RIGHT:h=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:l,height:d}));let{horizontalOffset:u}=c.tooltips;h===Z.LEFT&&(u*=-1);const m=this.positionService.findPositionAt({left:i[0]+u,top:i[1]},s,h);this.positionService.setElement(s,m)}}const le=class extends G{constructor(){super(...arguments),this.type="grid-brush",this.renderType=r.RenderTypes.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(o=!0){const e=this.parent,t=this.getComponentContainer();if(!e)throw new Error("SVG was not defined");const s=O.DOMUtils.appendOrSelect(e,"svg.chart-grid-backdrop"),n=O.DOMUtils.appendOrSelect(s,`g.${this.type}`),a=O.DOMUtils.appendOrSelect(n,this.selectionSelector),{width:i,height:l}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{cartesianScales:d}=this.services,h=d.getMainXScaleType(),u=d.getMainXScale(),[m]=u.range();t.attr("transform",`translate(${m},0)`);const p=O.DOMUtils.appendOrSelect(t,this.frontSelectionSelector);if(u&&h===r.ScaleTypes.TIME){let g=this.model.get("zoomDomain");g===void 0&&(g=this.services.zoom.getDefaultZoomBarDomain(),g&&this.model.set({zoomDomain:g},{animate:!1}));const v=M=>{const C=M[1]-M[0];let T="0,"+C.toString();const w=Math.floor(l/le.DASH_LENGTH),I=w*le.DASH_LENGTH;for(let $=0;$<w;$++)T+=","+le.DASH_LENGTH;T+=","+(l-I),w%2===1&&(T+=",0"),T+=","+C.toString(),T+=","+l.toString(),p.attr("stroke-dasharray",T)},f=M=>{const C=M.selection;C===null||C[0]===C[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(s.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),v(C))},b=(M,C)=>{const T=y.scaleTime().range([0,i]).domain(g);let w=[T.invert(M),T.invert(C)];w[0].valueOf()===w[1].valueOf()&&(w=this.services.zoom.getDefaultZoomBarDomain()),(g[0].valueOf()!==w[0].valueOf()||g[1].valueOf()!==w[1].valueOf())&&this.services.zoom.handleDomainChange(w)};let E;const S=M=>{const C=M.selection;C!==null&&(b(C[0],C[1]),n.call(E.move,null),p.style("display","none"))};l!=0&&i!=0&&(E=y.brushX().extent([[0,0],[i-1,l]]).on("start brush end",f).on("end.brushed",S),n.call(E));const x=this.services.zoom.getZoomRatio();s.on("click",function(M){if(M.shiftKey){const C=this.services.domUtils.getHolder(),T=y.pointer(n.node(),C)[0];let w=T-i*x/2;w<0&&(w=0);let I=T+i*x/2;I>i&&(I=i),b(w,I)}})}}};let kt=le;kt.DASH_LENGTH=4;class Qn extends G{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=r.RenderTypes.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=y.brushX(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this));const e=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const t=this.getComponentContainer(),s=this.services.zoom.isZoomBarLoading(r.AxisPositions.TOP),n=this.services.zoom.isZoomBarLocked(r.AxisPositions.TOP),a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.getProperty(this.getOptions(),"axes",r.AxisPositions.BOTTOM,"highlights"),l=c.zoomBar.height[a],{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(d===0)return;let h=0;const u=this.model.get("axesMargins");u&&u.left&&(h=u.left);const m=O.DOMUtils.appendOrSelect(t,"svg.zoom-container").attr("width","100%").attr("height",l).attr("opacity",1);if(O.DOMUtils.appendOrSelect(t,"rect.zoom-spacer").attr("x",0).attr("y",l).attr("width","100%").attr("height",c.zoomBar.spacerHeight).attr("opacity",1).attr("fill","none"),a===r.ZoomBarTypes.GRAPH_VIEW?O.DOMUtils.appendOrSelect(m,"rect.zoom-bg").attr("x",h).attr("y",0).attr("width",d-h).attr("height","100%").classed("zoom-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):a===r.ZoomBarTypes.SLIDER_VIEW&&O.DOMUtils.appendOrSelect(m,"rect.zoom-slider-bg").attr("x",h).attr("y",l/2-1).attr("width",d-h).attr("height",2).classed("zoom-slider-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),s){this.renderSkeleton(m,h,d);return}const{cartesianScales:p}=this.services,g=p.getMainXScale(),v=p.getMainYScale(),f=p.getMainXScaleType();if(g&&f===r.ScaleTypes.TIME){let b=this.services.zoom.getZoomBarData();if(c.isEmpty(b)||b.length===1)return;this.xScale=g.copy(),this.yScale=v.copy();const E=this.services.zoom.getDefaultZoomBarDomain(b);b=this.compensateDataForDefaultDomain(b,E);const S=this.model.get("initialZoomDomain"),x=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(S&&S[0].valueOf()===x[0].valueOf()&&S[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:c.merge([],x),zoomDomain:x?c.merge([],x):E},{skipUpdate:!0}):x===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:c.merge([],E)},{skipUpdate:!0}),this.xScale.range([h,d]).domain(E),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,l-6]).domain(y.extent(b,T=>T.value));const M=this.model.get("zoomDomain");if(a===r.ZoomBarTypes.GRAPH_VIEW&&(this.renderZoomBarArea(m,"path.zoom-graph-area-unselected",b,null),this.updateClipPath(t,this.clipId,0,0,0,0),this.renderZoomBarArea(m,"path.zoom-graph-area",b,this.clipId),this.renderZoomBarBaseline(m,h,d),i)){const T=i.highlightStartMapsTo,w=i.highlightEndMapsTo,I=i.color,$=i.labelMapsTo;i.data.forEach((_,A)=>{O.DOMUtils.appendOrSelect(m,`rect.highlight-${A}`).attr("height",l-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(_[T])).attr("width",this.xScale(_[w])-this.xScale(_[T])).style("fill",I&&I.scale[_[$]]?I.scale[_[$]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[_[$]]?I.scale[_[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(M,h,d);const C=O.DOMUtils.appendOrSelect(t,this.brushSelector).call(this.brush);if(M!==void 0)if(M[0].valueOf()===M[1].valueOf())C.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const T=M.map(w=>this.xScale(w));T[1]-T[0]<this.MIN_SELECTION_DIFF||(C.call(this.brush.move,T),this.updateBrushHandle(this.getComponentContainer(),T))}n&&(this.brush.filter(()=>!1),C.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,t,s){const n=l=>{const d=l.selection;d===null?this.handleBrushedEvent(l,e,this.xScale,this.xScale.range()):d[0]===d[1]||this.handleBrushedEvent(l,e,this.xScale,d)},a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a];this.brush.extent([[t,0],[s,i]]).on("start brush end",null).on("start brush end",n)}handleBrushedEvent(e,t,s,n){const a=[s.invert(n[0]),s.invert(n[1])];if(this.updateBrushHandle(this.getComponentContainer(),n),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(t===void 0||t[0]!==a[0]||t[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let i;e.type==="start"?i=r.Events.ZoomBar.SELECTION_START:e.type==="brush"?i=r.Events.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(i=r.Events.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(r.Events.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(i,{selection:n,newDomain:a})}}updateBrushHandle(e,t){const s=this,n=c.zoomBar.handleWidth,a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],l=-n/2,d=c.zoomBar.handleBarWidth,h=a===r.ZoomBarTypes.GRAPH_VIEW?c.zoomBar.handleBarHeight:6,u=-d/2,m=(i-h)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(g){if(g.type==="w")return Math.max(t[0]+l,s.maxSelectionRange[0]);if(g.type==="e")return Math.min(t[1]+l,s.maxSelectionRange[1]-n)}).attr("y",0).attr("width",n).attr("height",i).attr("cursor","ew-resize").style("display",null);const p=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);p.enter().append("rect").attr("class",function(g){return"handle-bar handle-bar--"+g.type}),p.attr("x",function(g){if(g.type==="w")return Math.max(t[0]+u,s.maxSelectionRange[0]-l+u);if(g.type==="e")return Math.min(t[1]+u,s.maxSelectionRange[1]+l+u)}).attr("y",m).attr("width",d).attr("height",h).attr("cursor","ew-resize"),a===r.ZoomBarTypes.SLIDER_VIEW&&this.updateSliderSelectedArea(t),this.updateClipPath(e,this.clipId,t[0],0,t[1]-t[0],i)}updateSliderSelectedArea(e){const t=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),s=c.zoomBar.height[t],a=this.getComponentContainer().select("svg.zoom-container");O.DOMUtils.appendOrSelect(a,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",s/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,t,s,n){const{cartesianScales:a}=this.services,i=a.getMainXAxisPosition(),l=a.getMainYAxisPosition(),d=a.getMainXScaleType(),h=a.getMainYScaleType(),u=(E,S,x)=>M=>a.getValueFromScale(E,S,x,M),m=u(this.xScale,d,i),p=u(this.yScale,h,l),g=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),v=c.zoomBar.height[g],f=y.area().x(E=>m(E)).y0(v).y1(E=>v-p(E)),b=O.DOMUtils.appendOrSelect(e,t).datum(s).attr("d",f);n&&b.attr("clip-path",`url(#${n})`)}updateClipPath(e,t,s,n,a,i){const l=O.DOMUtils.appendOrSelect(e,"clipPath").attr("id",t);O.DOMUtils.appendOrSelect(l,"rect").attr("x",s).attr("y",n).attr("width",a).attr("height",i)}compensateDataForDefaultDomain(e,t){if(!e||e.length<2)return;const s=c.clone(e),n=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(t[0])<Number(s[0][n])){const i={};i[n]=t[0],i[a]=0,s.unshift(i)}if(Number(t[1])>Number(s[s.length-1][n])){const i={};i[n]=t[1],i[a]=0,s.push(i)}return s}renderZoomBarBaseline(e,t,s,n=!1){const a=c.getProperty(this.model.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],l=y.line()([[t,i],[s,i]]);O.DOMUtils.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",l).classed("zoom-bg-baseline-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,t,s){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),O.DOMUtils.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type")===r.ZoomBarTypes.GRAPH_VIEW&&this.renderZoomBarBaseline(e,t,s,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this))}}class ea extends G{constructor(e,t){super(e,t),this.type="threshold",this.renderType=r.RenderTypes.SVG,this.positionService=new ge}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.thresholds&&g.thresholds.length>0&&s.push({axisPosition:p,thresholds:g.thresholds,correspondingDatasets:g==null?void 0:g.correspondingDatasets,mapsTo:g==null?void 0:g.mapsTo})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const l=a.enter().append("g").merge(a);l.attr("class",p=>`axis-thresholds ${p.axisPosition}`);const d=l.selectAll("g.threshold-group").data(p=>p.thresholds.map(g=>(g.axisPosition=p.axisPosition,g.datum=this.constructDatumObj(p,g),g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("line").attr("class","threshold-line"),h.append("rect").attr("class","threshold-hoverable-area"),h.merge(d).attr("class","threshold-group");const m=this;l.each(function({axisPosition:p}){const g=m.services.cartesianScales.getScaleByPosition(p),v=m.services.cartesianScales.getScaleTypeByPosition(p);let f=null,b=null;p===r.AxisPositions.LEFT||p===r.AxisPositions.RIGHT?(b=g,f=m.services.cartesianScales.getMainXScale()):(f=g,b=m.services.cartesianScales.getMainYScale());const E=v===r.ScaleTypes.LABELS,[S,x]=f.range(),[M,C]=b.range(),{cartesianScales:T}=m.services,w=T.getOrientation(),I=V=>T.getDomainValue(V),$=V=>T.getRangeValue(V),[_,A]=c.flipDomainAndRangeBasedOnOrientation(I,$,w),L=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("y1",C).attr("y2",M).attr("x1",({datum:V})=>_(V)+(E?g.step()/2:0)).attr("x2",({datum:V})=>_(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:V})=>-_(V)).attr("width",Math.abs(M-C)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("x1",S).attr("x2",x).attr("y1",({datum:V})=>A(V)+(E?g.step()/2:0)).attr("y2",({datum:V})=>A(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:V})=>A(V)).attr("width",Math.abs(x-S)).classed("rotate",!1))}),this.services.events.addEventListener(r.Events.Threshold.SHOW,p=>{this.setThresholdLabelPosition(p.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(r.Events.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:t,axisPosition:s}=e,n=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(s)===r.ScaleTypes.TIME){const i=[r.AxisPositions.LEFT,r.AxisPositions.RIGHT].includes(s),l=this.services.cartesianScales.getMainXScale(),d=this.services.cartesianScales.getMainYScale(),h=i?d:l,u=c.getProperty(n,"timeScale"),m=c.computeTimeIntervalName(h.ticks(),c.getProperty(u,"timeInterval"));return c.formatTick(t,0,h.ticks(),m,u)}return t.toLocaleString("en")}appendThresholdLabel(){const e=y.select(this.services.domUtils.getHolder()),t=c.getProperty(this.getOptions(),"style","prefix");this.label=O.DOMUtils.appendOrSelect(e,`div.${c.carbonPrefix}--${t}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:t}){const s=this.services.domUtils.getHolder(),n=y.pointer(e,s),a=t.valueFormatter?t.valueFormatter(t.value):this.getFormattedValue(t);this.label.html(`${t.label||"Threshold"}: ${a}`).style("background-color",t.fillColor);const i=this.label.node(),l=this.positionService.findBestPlacementAt({left:n[0],top:n[1]},i,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:s.offsetWidth,height:s.offsetHeight})),d=this.positionService.findPositionAt({left:n[0],top:n[1]},i,l);this.positionService.setElement(i,d)}constructDatumObj(e,t){const s={};return e.correspondingDatasets&&(s.group=c.getProperty(e,"correspondingDatasets",0)),s[e.mapsTo]=t.value,s}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(r.Events.Threshold.SHOW,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})}).on("mouseout",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(r.Events.Threshold.HIDE,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})})}}class ta extends G{constructor(e,t){super(e,t),this.type="highlight",this.renderType=r.RenderTypes.SVG,this.positionService=new ge,this.highlightStrokeWidth=1}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.highlights&&g.highlights.data.length>0&&s.push({axisPosition:p,highlightStartMapsTo:g.highlights.highlightStartMapsTo,highlightEndMapsTo:g.highlights.highlightEndMapsTo,labelMapsTo:g.highlights.labelMapsTo,highlight:g.highlights.data,color:g.highlights.color})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const l=a.enter().append("g").merge(a);l.attr("class",p=>`axis-highlight ${p.axisPosition}`);const d=l.selectAll("g.highlight-group").data(p=>p.highlight.map(g=>(g.axisPosition=p.axisPosition,g.highlightStartMapsTo=p.highlightStartMapsTo,g.labelMapsTo=p.labelMapsTo,g.color=p.color,g.highlightEndMapsTo=p.highlightEndMapsTo,g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("rect").attr("class","highlight-bar"),h.append("line").attr("class","highlight-line"),h.merge(d).attr("class","highlight-group");const m=this;l.each(function({axisPosition:p}){const g=m.services.cartesianScales.getMainXScale(),v=m.services.cartesianScales.getMainYScale(),[f,b]=g.range(),[E,S]=v.range(),{cartesianScales:x}=m.services,M=x.getOrientation(),C=_=>x.getDomainValue(_),T=_=>x.getRangeValue(_),[w,I]=c.flipDomainAndRangeBasedOnOrientation(C,T,M),$=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("y",Math.max(S+m.highlightStrokeWidth,0)).attr("height",Math.max(E-2*m.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:_,...A})=>w(A[_])).attr("width",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(w(L[A])-w(L[_]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null):$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("x",f).attr("width",Math.max(b-f,0)).attr("y",({highlightEndMapsTo:_,...A})=>I(A[_])).attr("height",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(I(L[_])-I(L[A]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null)})}}class sa extends Rt{getItems(e){if(e.detail.items)return e.detail.items;const t=e.detail.data;if(!t.length||!t[0])return[];const s=this.getOptions(),{cartesianScales:n}=this.services,a=n.getDomainIdentifier(),i=n.isDualAxes(),{groupMapsTo:l}=s.data,d=n.getDomainLabel();let h=n.getRangeLabel();const u=t[0][a];let m;if(t.length===1){const p=t[0],g=n.getRangeIdentifier(p);if(i){const f=n.getRangeAxisPosition({datum:p,groups:[p[l]]});h=n.getScaleLabel(f)}const v=p[g];m=[{label:d,value:u},...Array.isArray(v)&&v.length===2?[{label:"Start",value:v[0]},{label:"End",value:v[1]}]:[{label:h,value:p[g]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(f=>m.push({label:f.label,value:f.value})),m.push({label:s.tooltip.groupLabel,value:p[l],color:this.model.getFillColor(p[l]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[l]})})}else if(t.length>1&&(m=[{label:d,value:u}],m=m.concat(t.map(p=>{const g=p[n.getRangeIdentifier(p)];return{label:p[l],value:Array.isArray(g)&&g.length===2?`${g[0]} - ${g[1]}`:g,color:this.model.getFillColor(p[l]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[l]})}}).sort((p,g)=>g.value-p.value)),!i&&c.getProperty(s,"tooltip","showTotal")===!0)){const p=n.getRangeIdentifier();m.push({label:c.get(s,"tooltip.totalLabel")||"Total",value:t.reduce((g,v)=>g+v[p],0),bold:!0})}return m}}class na extends G{constructor(){super(...arguments),this.type="alluvial",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),l=c.getProperty(this.getOptions(),"color","gradient","enabled");let d=c.alluvial.minNodePadding;a.alluvial.nodePadding>c.alluvial.minNodePadding&&(d=a.alluvial.nodePadding);const h=c.getProperty(a,"alluvial","nodeAlignment");let u=ae.sankeyJustify;h===r.Alignments.LEFT?u=ae.sankeyLeft:h===r.Alignments.RIGHT&&(u=ae.sankeyRight);const m=ae.sankey().nodeId(E=>E.name).nodeWidth(c.alluvial.nodeWidth).nodePadding(d).nodeAlign(u).extent([[2,30],[s-2,n]]);this.graph=m({nodes:a.alluvial.nodes.map(E=>Object.assign({},E)),links:i.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const p={};this.graph.nodes.forEach(E=>{const S=E.x0;E.category&&(p[S]=E==null?void 0:E.category)}),t.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(p)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,S)=>this.services.domUtils.generateElementIDString(`alluvial-category-${S}`)).style("font-size","14px").text(E=>p[E]?p[E]:"").attr("y",20).attr("x",(E,S)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-category-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${x}`),{useBBox:!0});let C=0;return E+C>=M&&(C=-M+4),C});const v=t.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(v.exit().remove(),l){const E=c.getProperty(this.getOptions(),"color","scale");E&&v.enter().append("linearGradient").attr("id",S=>`${this.gradient_id}-link-${S.index}`).attr("gradientUnits","userSpaceOnUse").call(S=>S.append("stop").attr("offset","0%").attr("stop-color",x=>E[x.source.name])).call(S=>S.append("stop").attr("offset","100%").attr("stop-color",x=>E[x.target.name])),v.exit().remove()}v.enter().append("path").classed("link",!0).attr("d",ae.sankeyLinkHorizontal()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>l?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name)).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",c.alluvial.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=t.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);f.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const b=f.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`));b.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${E.value})`).attr("aria-label",E=>`${E.name} (${E.value})`),b.append("rect").classed("node-text-bg",!0).attr("width",(E,S)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${x}`),{useBBox:!0});return M+8}).attr("height",18).attr("stroke-width",2).lower(),b.attr("transform",(E,S)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${x}`),{useBBox:!0}),C=(E.y1-E.y0)/2-9;let T=E.x1-E.x0;return E.x1>=M?T=T-(M+16):T+=4,`translate(${T}, ${C})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const e=this.getOptions(),t=this,s=O.debounce((n,a="mouseover")=>{const i=t.parent.selectAll("path.link").transition().call(l=>t.services.transitions.setupTransition({transition:l,name:"alluvial-links-mouse-highlight"}));a==="mouseout"?(y.select(n).lower(),i.style("stroke-opacity",c.alluvial.opacity.default)):i.style("stroke-opacity",function(){return n===this?(y.select(this).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(n,a){const i=y.select(this);s(this,"mouseover"),i.classed("link-hovered",!0);const l=getComputedStyle(this).getPropertyValue("stroke");t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOVER,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:a.target.name,value:a.value+(e.alluvial.units?` ${e.alluvial.units}`:""),color:l,labelIcon:t.getRightArrowIcon()}]})}).on("mousemove",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEMOVE,{event:n,element:y.select(this),datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);s(this,"mouseout"),i.classed("link-hovered",!1),t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOUT,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:n,hoveredElement:i})})}addNodeEventListener(){const e=this,t=O.debounce((s=[],n="mouseover")=>{if(n==="mouseout"||s.length===0){e.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,i=>i.index).order().style("stroke-opacity",c.alluvial.opacity.default);return}e.parent.selectAll("path.link").transition().call(i=>this.services.transitions.setupTransition({transition:i,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(i){return s.some(l=>l===i.index)?(y.select(this).classed("link-hovered",!0).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},66);e.parent.selectAll(".node-group").on("mouseover",function(s,n){const a=y.select(this),i=[];if(e.traverse({link:"sourceLinks",node:"target"},n,i),e.traverse({link:"targetLinks",node:"source"},n,i),i.length){const l=c.getTransformOffsets(a.attr("transform"));if(a.attr("transform",`translate(${l.x-2}, ${l.y})`),a.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),n.x0-2===0){const h=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),u=e.parent.select(`g#${h}`),m=c.getTransformOffsets(u.attr("transform"));u.attr("transform",`translate(${m.x+4},${m.y})`)}const d=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${d}`).style("font-weight","bold"),t(i,"mouseover"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOVER,{event:s,element:a,datum:n})}}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEMOVE,{event:s,element:y.select(this),datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=c.getTransformOffsets(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${i.x+2}, ${i.y})`).select("rect.node").attr("width",c.alluvial.nodeWidth),n.x0-2===0){const d=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),h=e.parent.select(`g#${d}`),u=c.getTransformOffsets(h.attr("transform"));h.attr("transform",`translate(${u.x-4},${u.y})`)}const l=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${l}`).style("font-weight","normal"),t([],"mouseout"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}traverse(e,t,s=[]){t[e.link].map(a=>(s.push(a.index),a[e.node])).forEach(a=>this.traverse(e,a,s))}getRightArrowIcon(){return`
69
+ </li>`).join("")+"</ul>"}valueFormatter(e,t){const s=this.getOptions(),n=c.getProperty(s,"tooltip","valueFormatter");if(n)return n(e,t);if(typeof e.getTime=="function")return c.format(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return c.format(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"tooltip","enabled");if(s){const n=y.select(this.services.domUtils.getHolder()),a=c.getProperty(t,"style","prefix");this.tooltip=O.DOMUtils.appendOrSelect(n,`div.${c.carbonPrefix}--${a}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!s&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const t=this.services.domUtils.getHolder(),s=this.tooltip.node(),n=this.getOptions(),a=c.getProperty(n,"zoomBar","top","enabled");let i=c.getProperty(e,"detail","mousePosition");if(!i)i=y.pointer(c.getProperty(e,"detail","event"),t);else{const p=c.getProperty(n,"zoomBar","top","type"),g=c.zoomBar.height[p];a&&(i[1]+=g+c.zoomBar.spacerHeight)}const l=t.offsetWidth,d=t.offsetHeight;let h;i[0]/l>.9?h=Z.LEFT:i[0]/l<.1?h=Z.RIGHT:h=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:l,height:d}));let{horizontalOffset:u}=c.tooltips;h===Z.LEFT&&(u*=-1);const m=this.positionService.findPositionAt({left:i[0]+u,top:i[1]},s,h);this.positionService.setElement(s,m)}}const le=class extends G{constructor(){super(...arguments),this.type="grid-brush",this.renderType=r.RenderTypes.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(o=!0){const e=this.parent,t=this.getComponentContainer();if(!e)throw new Error("SVG was not defined");const s=O.DOMUtils.appendOrSelect(e,"svg.chart-grid-backdrop"),n=O.DOMUtils.appendOrSelect(s,`g.${this.type}`),a=O.DOMUtils.appendOrSelect(n,this.selectionSelector),{width:i,height:l}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{cartesianScales:d}=this.services,h=d.getMainXScaleType(),u=d.getMainXScale(),[m]=u.range();t.attr("transform",`translate(${m},0)`);const p=O.DOMUtils.appendOrSelect(t,this.frontSelectionSelector);if(u&&h===r.ScaleTypes.TIME){let g=this.model.get("zoomDomain");g===void 0&&(g=this.services.zoom.getDefaultZoomBarDomain(),g&&this.model.set({zoomDomain:g},{animate:!1}));const v=M=>{const C=M[1]-M[0];let x="0,"+C.toString();const w=Math.floor(l/le.DASH_LENGTH),I=w*le.DASH_LENGTH;for(let $=0;$<w;$++)x+=","+le.DASH_LENGTH;x+=","+(l-I),w%2===1&&(x+=",0"),x+=","+C.toString(),x+=","+l.toString(),p.attr("stroke-dasharray",x)},f=M=>{const C=M.selection;C===null||C[0]===C[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(s.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),v(C))},b=(M,C)=>{const x=y.scaleTime().range([0,i]).domain(g);let w=[x.invert(M),x.invert(C)];w[0].valueOf()===w[1].valueOf()&&(w=this.services.zoom.getDefaultZoomBarDomain()),(g[0].valueOf()!==w[0].valueOf()||g[1].valueOf()!==w[1].valueOf())&&this.services.zoom.handleDomainChange(w)};let E;const S=M=>{const C=M.selection;C!==null&&(b(C[0],C[1]),n.call(E.move,null),p.style("display","none"))};l!=0&&i!=0&&(E=y.brushX().extent([[0,0],[i-1,l]]).on("start brush end",f).on("end.brushed",S),n.call(E));const T=this.services.zoom.getZoomRatio();s.on("click",function(M){if(M.shiftKey){const C=this.services.domUtils.getHolder(),x=y.pointer(n.node(),C)[0];let w=x-i*T/2;w<0&&(w=0);let I=x+i*T/2;I>i&&(I=i),b(w,I)}})}}};let kt=le;kt.DASH_LENGTH=4;class Qn extends G{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=r.RenderTypes.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=y.brushX(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this));const e=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const t=this.getComponentContainer(),s=this.services.zoom.isZoomBarLoading(r.AxisPositions.TOP),n=this.services.zoom.isZoomBarLocked(r.AxisPositions.TOP),a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.getProperty(this.getOptions(),"axes",r.AxisPositions.BOTTOM,"highlights"),l=c.zoomBar.height[a],{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(d===0)return;let h=0;const u=this.model.get("axesMargins");u&&u.left&&(h=u.left);const m=O.DOMUtils.appendOrSelect(t,"svg.zoom-container").attr("width","100%").attr("height",l).attr("opacity",1);if(O.DOMUtils.appendOrSelect(t,"rect.zoom-spacer").attr("x",0).attr("y",l).attr("width","100%").attr("height",c.zoomBar.spacerHeight).attr("opacity",1).attr("fill","none"),a===r.ZoomBarTypes.GRAPH_VIEW?O.DOMUtils.appendOrSelect(m,"rect.zoom-bg").attr("x",h).attr("y",0).attr("width",d-h).attr("height","100%").classed("zoom-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):a===r.ZoomBarTypes.SLIDER_VIEW&&O.DOMUtils.appendOrSelect(m,"rect.zoom-slider-bg").attr("x",h).attr("y",l/2-1).attr("width",d-h).attr("height",2).classed("zoom-slider-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),s){this.renderSkeleton(m,h,d);return}const{cartesianScales:p}=this.services,g=p.getMainXScale(),v=p.getMainYScale(),f=p.getMainXScaleType();if(g&&f===r.ScaleTypes.TIME){let b=this.services.zoom.getZoomBarData();if(c.isEmpty(b)||b.length===1)return;this.xScale=g.copy(),this.yScale=v.copy();const E=this.services.zoom.getDefaultZoomBarDomain(b);b=this.compensateDataForDefaultDomain(b,E);const S=this.model.get("initialZoomDomain"),T=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"initialZoomDomain");T&&T[0]&&T[1]&&(T[0]=new Date(T[0]),T[1]=new Date(T[1])),T&&!(S&&S[0].valueOf()===T[0].valueOf()&&S[1].valueOf()===T[1].valueOf())?this.model.set({initialZoomDomain:c.merge([],T),zoomDomain:T?c.merge([],T):E},{skipUpdate:!0}):T===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:c.merge([],E)},{skipUpdate:!0}),this.xScale.range([h,d]).domain(E),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,l-6]).domain(y.extent(b,x=>x.value));const M=this.model.get("zoomDomain");if(a===r.ZoomBarTypes.GRAPH_VIEW&&(this.renderZoomBarArea(m,"path.zoom-graph-area-unselected",b,null),this.updateClipPath(t,this.clipId,0,0,0,0),this.renderZoomBarArea(m,"path.zoom-graph-area",b,this.clipId),this.renderZoomBarBaseline(m,h,d),i)){const x=i.highlightStartMapsTo,w=i.highlightEndMapsTo,I=i.color,$=i.labelMapsTo;i.data.forEach((_,A)=>{O.DOMUtils.appendOrSelect(m,`rect.highlight-${A}`).attr("height",l-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(_[x])).attr("width",this.xScale(_[w])-this.xScale(_[x])).style("fill",I&&I.scale[_[$]]?I.scale[_[$]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[_[$]]?I.scale[_[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(M,h,d);const C=O.DOMUtils.appendOrSelect(t,this.brushSelector).call(this.brush);if(M!==void 0)if(M[0].valueOf()===M[1].valueOf())C.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const x=M.map(w=>this.xScale(w));x[1]-x[0]<this.MIN_SELECTION_DIFF||(C.call(this.brush.move,x),this.updateBrushHandle(this.getComponentContainer(),x))}n&&(this.brush.filter(()=>!1),C.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,t,s){const n=l=>{const d=l.selection;d===null?this.handleBrushedEvent(l,e,this.xScale,this.xScale.range()):d[0]===d[1]||this.handleBrushedEvent(l,e,this.xScale,d)},a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a];this.brush.extent([[t,0],[s,i]]).on("start brush end",null).on("start brush end",n)}handleBrushedEvent(e,t,s,n){const a=[s.invert(n[0]),s.invert(n[1])];if(this.updateBrushHandle(this.getComponentContainer(),n),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(t===void 0||t[0]!==a[0]||t[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let i;e.type==="start"?i=r.Events.ZoomBar.SELECTION_START:e.type==="brush"?i=r.Events.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(i=r.Events.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(r.Events.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(i,{selection:n,newDomain:a})}}updateBrushHandle(e,t){const s=this,n=c.zoomBar.handleWidth,a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],l=-n/2,d=c.zoomBar.handleBarWidth,h=a===r.ZoomBarTypes.GRAPH_VIEW?c.zoomBar.handleBarHeight:6,u=-d/2,m=(i-h)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(g){if(g.type==="w")return Math.max(t[0]+l,s.maxSelectionRange[0]);if(g.type==="e")return Math.min(t[1]+l,s.maxSelectionRange[1]-n)}).attr("y",0).attr("width",n).attr("height",i).attr("cursor","ew-resize").style("display",null);const p=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);p.enter().append("rect").attr("class",function(g){return"handle-bar handle-bar--"+g.type}),p.attr("x",function(g){if(g.type==="w")return Math.max(t[0]+u,s.maxSelectionRange[0]-l+u);if(g.type==="e")return Math.min(t[1]+u,s.maxSelectionRange[1]+l+u)}).attr("y",m).attr("width",d).attr("height",h).attr("cursor","ew-resize"),a===r.ZoomBarTypes.SLIDER_VIEW&&this.updateSliderSelectedArea(t),this.updateClipPath(e,this.clipId,t[0],0,t[1]-t[0],i)}updateSliderSelectedArea(e){const t=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),s=c.zoomBar.height[t],a=this.getComponentContainer().select("svg.zoom-container");O.DOMUtils.appendOrSelect(a,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",s/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,t,s,n){const{cartesianScales:a}=this.services,i=a.getMainXAxisPosition(),l=a.getMainYAxisPosition(),d=a.getMainXScaleType(),h=a.getMainYScaleType(),u=(E,S,T)=>M=>a.getValueFromScale(E,S,T,M),m=u(this.xScale,d,i),p=u(this.yScale,h,l),g=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),v=c.zoomBar.height[g],f=y.area().x(E=>m(E)).y0(v).y1(E=>v-p(E)),b=O.DOMUtils.appendOrSelect(e,t).datum(s).attr("d",f);n&&b.attr("clip-path",`url(#${n})`)}updateClipPath(e,t,s,n,a,i){const l=O.DOMUtils.appendOrSelect(e,"clipPath").attr("id",t);O.DOMUtils.appendOrSelect(l,"rect").attr("x",s).attr("y",n).attr("width",a).attr("height",i)}compensateDataForDefaultDomain(e,t){if(!e||e.length<2)return;const s=c.clone(e),n=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(t[0])<Number(s[0][n])){const i={};i[n]=t[0],i[a]=0,s.unshift(i)}if(Number(t[1])>Number(s[s.length-1][n])){const i={};i[n]=t[1],i[a]=0,s.push(i)}return s}renderZoomBarBaseline(e,t,s,n=!1){const a=c.getProperty(this.model.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],l=y.line()([[t,i],[s,i]]);O.DOMUtils.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",l).classed("zoom-bg-baseline-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,t,s){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),O.DOMUtils.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type")===r.ZoomBarTypes.GRAPH_VIEW&&this.renderZoomBarBaseline(e,t,s,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this))}}class ea extends G{constructor(e,t){super(e,t),this.type="threshold",this.renderType=r.RenderTypes.SVG,this.positionService=new ge}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.thresholds&&g.thresholds.length>0&&s.push({axisPosition:p,thresholds:g.thresholds,correspondingDatasets:g==null?void 0:g.correspondingDatasets,mapsTo:g==null?void 0:g.mapsTo})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const l=a.enter().append("g").merge(a);l.attr("class",p=>`axis-thresholds ${p.axisPosition}`);const d=l.selectAll("g.threshold-group").data(p=>p.thresholds.map(g=>(g.axisPosition=p.axisPosition,g.datum=this.constructDatumObj(p,g),g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("line").attr("class","threshold-line"),h.append("rect").attr("class","threshold-hoverable-area"),h.merge(d).attr("class","threshold-group");const m=this;l.each(function({axisPosition:p}){const g=m.services.cartesianScales.getScaleByPosition(p),v=m.services.cartesianScales.getScaleTypeByPosition(p);let f=null,b=null;p===r.AxisPositions.LEFT||p===r.AxisPositions.RIGHT?(b=g,f=m.services.cartesianScales.getMainXScale()):(f=g,b=m.services.cartesianScales.getMainYScale());const E=v===r.ScaleTypes.LABELS,[S,T]=f.range(),[M,C]=b.range(),{cartesianScales:x}=m.services,w=x.getOrientation(),I=V=>x.getDomainValue(V),$=V=>x.getRangeValue(V),[_,A]=c.flipDomainAndRangeBasedOnOrientation(I,$,w),L=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("y1",C).attr("y2",M).attr("x1",({datum:V})=>_(V)+(E?g.step()/2:0)).attr("x2",({datum:V})=>_(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:V})=>-_(V)).attr("width",Math.abs(M-C)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("x1",S).attr("x2",T).attr("y1",({datum:V})=>A(V)+(E?g.step()/2:0)).attr("y2",({datum:V})=>A(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:V})=>A(V)).attr("width",Math.abs(T-S)).classed("rotate",!1))}),this.services.events.addEventListener(r.Events.Threshold.SHOW,p=>{this.setThresholdLabelPosition(p.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(r.Events.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:t,axisPosition:s}=e,n=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(s)===r.ScaleTypes.TIME){const i=[r.AxisPositions.LEFT,r.AxisPositions.RIGHT].includes(s),l=this.services.cartesianScales.getMainXScale(),d=this.services.cartesianScales.getMainYScale(),h=i?d:l,u=c.getProperty(n,"timeScale"),m=c.computeTimeIntervalName(h.ticks(),c.getProperty(u,"timeInterval"));return c.formatTick(t,0,h.ticks(),m,u)}return t.toLocaleString("en")}appendThresholdLabel(){const e=y.select(this.services.domUtils.getHolder()),t=c.getProperty(this.getOptions(),"style","prefix");this.label=O.DOMUtils.appendOrSelect(e,`div.${c.carbonPrefix}--${t}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:t}){const s=this.services.domUtils.getHolder(),n=y.pointer(e,s),a=t.valueFormatter?t.valueFormatter(t.value):this.getFormattedValue(t);this.label.html(`${t.label||"Threshold"}: ${a}`).style("background-color",t.fillColor);const i=this.label.node(),l=this.positionService.findBestPlacementAt({left:n[0],top:n[1]},i,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:s.offsetWidth,height:s.offsetHeight})),d=this.positionService.findPositionAt({left:n[0],top:n[1]},i,l);this.positionService.setElement(i,d)}constructDatumObj(e,t){const s={};return e.correspondingDatasets&&(s.group=c.getProperty(e,"correspondingDatasets",0)),s[e.mapsTo]=t.value,s}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(r.Events.Threshold.SHOW,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})}).on("mouseout",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(r.Events.Threshold.HIDE,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})})}}class ta extends G{constructor(e,t){super(e,t),this.type="highlight",this.renderType=r.RenderTypes.SVG,this.positionService=new ge,this.highlightStrokeWidth=1}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.highlights&&g.highlights.data.length>0&&s.push({axisPosition:p,highlightStartMapsTo:g.highlights.highlightStartMapsTo,highlightEndMapsTo:g.highlights.highlightEndMapsTo,labelMapsTo:g.highlights.labelMapsTo,highlight:g.highlights.data,color:g.highlights.color})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const l=a.enter().append("g").merge(a);l.attr("class",p=>`axis-highlight ${p.axisPosition}`);const d=l.selectAll("g.highlight-group").data(p=>p.highlight.map(g=>(g.axisPosition=p.axisPosition,g.highlightStartMapsTo=p.highlightStartMapsTo,g.labelMapsTo=p.labelMapsTo,g.color=p.color,g.highlightEndMapsTo=p.highlightEndMapsTo,g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("rect").attr("class","highlight-bar"),h.append("line").attr("class","highlight-line"),h.merge(d).attr("class","highlight-group");const m=this;l.each(function({axisPosition:p}){const g=m.services.cartesianScales.getMainXScale(),v=m.services.cartesianScales.getMainYScale(),[f,b]=g.range(),[E,S]=v.range(),{cartesianScales:T}=m.services,M=T.getOrientation(),C=_=>T.getDomainValue(_),x=_=>T.getRangeValue(_),[w,I]=c.flipDomainAndRangeBasedOnOrientation(C,x,M),$=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("y",Math.max(S+m.highlightStrokeWidth,0)).attr("height",Math.max(E-2*m.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:_,...A})=>w(A[_])).attr("width",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(w(L[A])-w(L[_]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null):$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("x",f).attr("width",Math.max(b-f,0)).attr("y",({highlightEndMapsTo:_,...A})=>I(A[_])).attr("height",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(I(L[_])-I(L[A]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null)})}}class sa extends Rt{getItems(e){if(e.detail.items)return e.detail.items;const t=e.detail.data;if(!t.length||!t[0])return[];const s=this.getOptions(),{cartesianScales:n}=this.services,a=n.getDomainIdentifier(),i=n.isDualAxes(),{groupMapsTo:l}=s.data,d=n.getDomainLabel();let h=n.getRangeLabel();const u=t[0][a];let m;if(t.length===1){const p=t[0],g=n.getRangeIdentifier(p);if(i){const f=n.getRangeAxisPosition({datum:p,groups:[p[l]]});h=n.getScaleLabel(f)}const v=p[g];m=[{label:d,value:u},...Array.isArray(v)&&v.length===2?[{label:"Start",value:v[0]},{label:"End",value:v[1]}]:[{label:h,value:p[g]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(f=>m.push({label:f.label,value:f.value})),m.push({label:s.tooltip.groupLabel,value:p[l],color:this.model.getFillColor(p[l]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[l]})})}else if(t.length>1&&(m=[{label:d,value:u}],m=m.concat(t.map(p=>{const g=p[n.getRangeIdentifier(p)];return{label:p[l],value:Array.isArray(g)&&g.length===2?`${g[0]} - ${g[1]}`:g,color:this.model.getFillColor(p[l]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[l]})}}).sort((p,g)=>g.value-p.value)),!i&&c.getProperty(s,"tooltip","showTotal")===!0)){const p=n.getRangeIdentifier();m.push({label:c.get(s,"tooltip.totalLabel")||"Total",value:t.reduce((g,v)=>g+v[p],0),bold:!0})}return m}}class na extends G{constructor(){super(...arguments),this.type="alluvial",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),l=c.getProperty(this.getOptions(),"color","gradient","enabled");let d=c.alluvial.minNodePadding;a.alluvial.nodePadding>c.alluvial.minNodePadding&&(d=a.alluvial.nodePadding);const h=c.getProperty(a,"alluvial","nodeAlignment");let u=ae.sankeyJustify;h===r.Alignments.LEFT?u=ae.sankeyLeft:h===r.Alignments.RIGHT&&(u=ae.sankeyRight);const m=ae.sankey().nodeId(E=>E.name).nodeWidth(c.alluvial.nodeWidth).nodePadding(d).nodeAlign(u).extent([[2,30],[s-2,n]]);this.graph=m({nodes:a.alluvial.nodes.map(E=>Object.assign({},E)),links:i.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const p={};this.graph.nodes.forEach(E=>{const S=E.x0;E.category&&(p[S]=E==null?void 0:E.category)}),t.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(p)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,S)=>this.services.domUtils.generateElementIDString(`alluvial-category-${S}`)).style("font-size","14px").text(E=>p[E]?p[E]:"").attr("y",20).attr("x",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-category-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});let C=0;return E+C>=M&&(C=-M+4),C});const v=t.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(v.exit().remove(),l){const E=c.getProperty(this.getOptions(),"color","scale");E&&v.enter().append("linearGradient").attr("id",S=>`${this.gradient_id}-link-${S.index}`).attr("gradientUnits","userSpaceOnUse").call(S=>S.append("stop").attr("offset","0%").attr("stop-color",T=>E[T.source.name])).call(S=>S.append("stop").attr("offset","100%").attr("stop-color",T=>E[T.target.name])),v.exit().remove()}v.enter().append("path").classed("link",!0).attr("d",ae.sankeyLinkHorizontal()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>l?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name)).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",c.alluvial.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=t.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);f.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const b=f.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`));b.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${E.value})`).attr("aria-label",E=>`${E.name} (${E.value})`),b.append("rect").classed("node-text-bg",!0).attr("width",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});return M+8}).attr("height",18).attr("stroke-width",2).lower(),b.attr("transform",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0}),C=(E.y1-E.y0)/2-9;let x=E.x1-E.x0;return E.x1>=M?x=x-(M+16):x+=4,`translate(${x}, ${C})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const e=this.getOptions(),t=this,s=O.debounce((n,a="mouseover")=>{const i=t.parent.selectAll("path.link").transition().call(l=>t.services.transitions.setupTransition({transition:l,name:"alluvial-links-mouse-highlight"}));a==="mouseout"?(y.select(n).lower(),i.style("stroke-opacity",c.alluvial.opacity.default)):i.style("stroke-opacity",function(){return n===this?(y.select(this).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(n,a){const i=y.select(this);s(this,"mouseover"),i.classed("link-hovered",!0);const l=getComputedStyle(this).getPropertyValue("stroke");t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOVER,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:a.target.name,value:a.value+(e.alluvial.units?` ${e.alluvial.units}`:""),color:l,labelIcon:t.getRightArrowIcon()}]})}).on("mousemove",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEMOVE,{event:n,element:y.select(this),datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);s(this,"mouseout"),i.classed("link-hovered",!1),t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOUT,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:n,hoveredElement:i})})}addNodeEventListener(){const e=this,t=O.debounce((s=[],n="mouseover")=>{if(n==="mouseout"||s.length===0){e.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,i=>i.index).order().style("stroke-opacity",c.alluvial.opacity.default);return}e.parent.selectAll("path.link").transition().call(i=>this.services.transitions.setupTransition({transition:i,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(i){return s.some(l=>l===i.index)?(y.select(this).classed("link-hovered",!0).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},66);e.parent.selectAll(".node-group").on("mouseover",function(s,n){const a=y.select(this),i=[];if(e.traverse({link:"sourceLinks",node:"target"},n,i),e.traverse({link:"targetLinks",node:"source"},n,i),i.length){const l=c.getTransformOffsets(a.attr("transform"));if(a.attr("transform",`translate(${l.x-2}, ${l.y})`),a.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),n.x0-2===0){const h=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),u=e.parent.select(`g#${h}`),m=c.getTransformOffsets(u.attr("transform"));u.attr("transform",`translate(${m.x+4},${m.y})`)}const d=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${d}`).style("font-weight","bold"),t(i,"mouseover"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOVER,{event:s,element:a,datum:n})}}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEMOVE,{event:s,element:y.select(this),datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=c.getTransformOffsets(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${i.x+2}, ${i.y})`).select("rect.node").attr("width",c.alluvial.nodeWidth),n.x0-2===0){const d=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),h=e.parent.select(`g#${d}`),u=c.getTransformOffsets(h.attr("transform"));h.attr("transform",`translate(${u.x-4},${u.y})`)}const l=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${l}`).style("font-weight","normal"),t([],"mouseout"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}traverse(e,t,s=[]){t[e.link].map(a=>(s.push(a.index),a[e.node])).forEach(a=>this.traverse(e,a,s))}getRightArrowIcon(){return`
70
70
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
71
71
  <polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
72
72
  <rect width="32" height="32"/>
73
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class aa extends G{constructor(){super(...arguments),this.type="grid",this.renderType=r.RenderTypes.SVG}render(e=!0){const t=c.getProperty(this.getOptions(),"grid","x","enabled"),s=c.getProperty(this.getOptions(),"grid","y","enabled");this.drawBackdrop(t,s),!(!t&&!s)&&(t&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),s&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const t=this.parent,s=this.backdrop.attr("height"),n=this.services.cartesianScales.getMainXScale(),a=y.axisBottom(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","x","alignWithAxisTicks")){const d=this.services.cartesianScales.getDomainAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","x","numberOfTicks");a.ticks(d)}const l=t.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${s})`);e?l.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):l.call(a),this.cleanGrid(l)}drawYGrid(e){const t=this.parent,s=this.backdrop.attr("width"),n=this.services.cartesianScales.getMainYScale(),a=y.axisLeft(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","y","alignWithAxisTicks")){const d=this.services.cartesianScales.getRangeAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","y","numberOfTicks");a.ticks(d)}const l=t.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?l.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):l.call(a),this.cleanGrid(l)}getGridlineThreshold(e){const t=this.parent,s=t.selectAll(".x.grid .tick").nodes().sort((u,m)=>Number(c.getTranslationValues(u).tx)-Number(c.getTranslationValues(m).tx));let n=-1;if(!s.length)return;s.forEach(u=>{e[0]>=+c.getTranslationValues(u).tx&&n++});const a=n+1<s.length?n+1:s.length,i=s[n],l=s[a];let d;if(!i)d=+c.getTranslationValues(l).tx;else if(l)d=+c.getTranslationValues(l).tx-+c.getTranslationValues(i).tx;else{const u=t.select("rect.chart-grid-backdrop").node();d=O.DOMUtils.getSVGElementSize(u).width-+c.getTranslationValues(i).tx}const{threshold:h}=this.getOptions().tooltip.gridline;return d*h}getActiveGridline(e){const t=c.getProperty(this.getOptions,"tooltip","gridline","threshold"),s=t||this.getGridlineThreshold(e);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=c.getTranslationValues(this),l={min:Number(i.tx)-s,max:Number(i.tx)+s};return l.min<=e[0]&&e[0]<=l.max})}drawBackdrop(e,t){const s=this.parent,n=this.services.cartesianScales.getMainXScale(),a=this.services.cartesianScales.getMainYScale(),[i,l]=n.range(),[d,h]=a.range();this.backdrop=O.DOMUtils.appendOrSelect(s,"svg.chart-grid-backdrop");const u=O.DOMUtils.appendOrSelect(this.backdrop,e||t?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",i).attr("y",h).attr("width",Math.abs(l-i)).attr("height",Math.abs(d-h)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(e){e.selectAll("text").remove(),e.select(".domain").remove()}}class ia extends G{constructor(){super(...arguments),this.type="area",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>s.name!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions();let n=[0,0];const{cartesianScales:a}=this.services,i=a.getOrientation(),l=y.area().curve(this.services.curves.getD3Curve()).defined(C=>{const T=a.getRangeIdentifier(),w=C[T];return w!=null}),d=this.model.getGroupedData(this.configs.groups),h=c.getProperty(s,"bounds"),u=h&&d&&d.length===1;!u&&h&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${d.length}`);let m=0;const p=(C,T)=>{c.getProperty(s,"axes",C,"includeZero")===!1&&T[0]>0&&T[1]>0&&(m=T[0])},g=C=>u?a.getBoundedScaledValues(C)[0]:a.getRangeValue(m),v=C=>u?a.getBoundedScaledValues(C)[1]:a.getRangeValue(C);i===r.CartesianOrientations.VERTICAL?(n=a.getMainYScale().domain(),p(a.getMainYAxisPosition(),n),l.x(C=>a.getDomainValue(C)).y0(C=>g(C)).y1(C=>v(C))):(n=a.getMainXScale().domain(),p(a.getMainXAxisPosition(),n),l.x0(C=>g(C)).x1(C=>v(C)).y(C=>a.getDomainValue(C)));const f=c.getProperty(s,"color","gradient","enabled"),b=d&&d.length===1&&f;d.length>1&&f&&console.error("Gradients can only be enabled when having 1 single dataset");const E=t.selectAll("path.area").data(d,C=>C.name),S=y.select(this.services.domUtils.getMainContainer());if(E.exit().attr("opacity",0).remove(),!d.length)return;if(b){const C=S.select(`path.${this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:d[0].name})}`).node();let T;if(C)T=getComputedStyle(C,null).getPropertyValue("stroke");else{const w=c.getProperty(this.model.getOptions(),"color","scale");if(w!==null){const I=Object.keys(w);T=w[I[0]]}}O.GradientUtils.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${d[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:O.GradientUtils.getStops(n,T)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,M=E.enter().append("path");b?M.merge(E).style("fill",C=>`url(#${this.services.domUtils.generateElementIDString(`${C.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:C.name,originalClassName:"area"})).attr("d",C=>{const{data:T}=C;return l(T)}):(M.attr("opacity",0).merge(E).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:C.name,originalClassName:"area"})).style("fill",C=>x.model.getFillColor(C.name)).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"area-update-enter",animate:e})).attr("opacity",u?1:c.area.opacity.selected).attr("d",C=>{const{data:T}=C;return l(T)}),u&&M.attr("fill-opacity",c.area.opacity.selected).style("stroke",C=>x.model.getStrokeColor(C.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ra extends G{constructor(){super(...arguments),this.type="line",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s.name!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:s,curves:n}=this.services,a=v=>s.getDomainValue(v),i=v=>s.getRangeValue(v),[l,d]=c.flipDomainAndRangeBasedOnOrientation(a,i,s.getOrientation()),h=this.getOptions(),u=y.line().x(l).y(d).curve(n.getD3Curve()).defined(v=>{const f=s.getRangeIdentifier(v),b=v[f];return b!=null});let m=[];if(this.configs.stacked){const v=Object.keys(h.axes).some(E=>h.axes[E].percentage),{groupMapsTo:f}=h.data;m=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(E=>{const S=this.services.cartesianScales.getDomainIdentifier(E),x=this.services.cartesianScales.getRangeIdentifier(E);return{name:c.getProperty(E,0,f),data:E.map(M=>({[S]:M.data.sharedStackKey,[f]:M[f],[x]:M[1]})),hidden:!_s(E,M=>M[0]!==M[1])}})}else m=this.model.getGroupedData(this.configs.groups);const p=t.selectAll("path.line").data(m,v=>v.name);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(m,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name)).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:f}=v;return f.map(b=>{const E=this.services.cartesianScales.getRangeIdentifier(b);return b[E]}).join(",")}).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:e})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:f}=v;return u(f)})}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Qe=5;function oa(o,e){return o>e-Qe&&o<e+Qe}class _e extends G{constructor(){super(...arguments),this.type="ruler",this.renderType=r.RenderTypes.SVG,this.isXGridEnabled=c.getProperty(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=c.getProperty(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(e=!0){const t=c.getProperty(this.getOptions(),"ruler","enabled");this.drawBackdrop(),t&&!this.isEventListenerAdded?this.addBackdropEventListeners():!t&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(e){return e}showRuler(e,[t,s]){const n=this.parent,a=this.services.cartesianScales.getOrientation(),i=this.model.getDisplayData(),l=this.services.cartesianScales.getRangeScale(),[d,h]=l.range(),u=a===r.CartesianOrientations.HORIZONTAL?s:t,m=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),p=O.DOMUtils.appendOrSelect(m,"line.ruler-line"),g=n.selectAll("[role=graphics-symbol]"),v=i.map(b=>({domainValue:this.services.cartesianScales.getDomainValue(b),originalData:b})).filter(b=>oa(b.domainValue,u));if(this.pointsWithinLine&&v.length===this.pointsWithinLine.length&&v.map(b=>b.domainValue).join()===this.pointsWithinLine.map(b=>b.domainValue).join())return this.pointsWithinLine=v,this.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{mousePosition:[t,s]});this.pointsWithinLine=v;const f=this.pointsWithinLine.reduce((b,E)=>{if(b.length===0)return b.push(E),b;const S=b[0].domainValue,x=Math.abs(u-E.domainValue),M=Math.abs(u-S);return x>M||(x<M?b=[E]:b.push(E)),b},[]);if(f.length>0){const b=f.map(M=>M.originalData).filter(M=>{const C=this.services.cartesianScales.getRangeIdentifier(M),T=M[C];return T!=null}),E=f.map(M=>M.domainValue),S=g.filter(M=>{const C=this.services.cartesianScales.getDomainValue(M);return E.includes(C)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!bt(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:p,data:this.formatTooltipData(b)}),m.attr("opacity",1);const x=f[0];a==="horizontal"?p.attr("x1",h).attr("x2",d).attr("y1",x.domainValue).attr("y2",x.domainValue):p.attr("y1",h).attr("y2",d).attr("x1",x.domainValue).attr("x2",x.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,t=O.DOMUtils.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE),t.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,t=this.services.domUtils.getHolder(),s=this.model.getDisplayData();let n=function(a){const i=y.pointer(a,e.parent.node());e.showRuler(a,i)};if(s.length>100){const a=s.length%50*12.5;n=c.debounceWithD3MousePosition(function(i){const{mousePosition:l}=this;e.showRuler(i,l)},a,t)}this.backdrop.on("mousemove mouseover",n).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-grid-backdrop")}}class me extends G{constructor(){super(...arguments),this.type="scatter",this.renderType=r.RenderTypes.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(n=>{var a;return(a=this.services.transitions)==null?void 0:a.setupTransition({transition:n,name:"legend-hover-scatter"})}).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:t}=this.configs;t&&(e.addEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:t}=this.services;if(!t)throw new Error("Services cartesianScales are undefined.");const s=t.getDomainIdentifier(e),n=this.model.get("zoomDomain");return n!==void 0?e.filter(a=>a[s].getTime()>=n[0].getTime()&&a[s].getTime()<=n[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:t}=this.configs;let s;if(t){const n=Object.keys(e.axes).some(a=>e.axes[a].percentage);s=this.model.getStackedData({groups:this.configs.groups,percentage:n})}else{const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");s=this.model.getDisplayData(this.configs.groups).filter(a=>{const i=n.getRangeIdentifier(a);return a[i]!==void 0&&a[i]!==null})}return this.filterBasedOnZoomDomain(s)}render(e){if(!(c.getProperty(this.getOptions(),"points","enabled")||c.getProperty(this.getOptions(),"bubble","enabled")))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");const l=i.getDomainIdentifier(),d=s.selectAll("circle.dot").data(this.getScatterData(),m=>`${m[a]}-${m[l]}`);d.exit().attr("opacity",0).remove();const u=d.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(d);this.styleCircles(u,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:t}=this.configs;if(!t)return!1;const{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const n=s.getOrientation(),[a,i]=c.flipDomainAndRangeBasedOnOrientation(s.getHighestDomainThreshold(),s.getHighestRangeThreshold(),n),[l,d]=c.flipDomainAndRangeBasedOnOrientation(m=>s.getDomainValue(m),m=>s.getRangeValue(m),n),h=l(e),u=d(e);return i&&a?u<=i.scaleValue&&h>=a.scaleValue:i?u<=i.scaleValue:a?h>=a.scaleValue:!1}styleCircles(e,t){const s=this.getOptions(),{filled:n,fillOpacity:a}=s.points,{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:l}=s.data,d=g=>i.getDomainValue(g),h=g=>i.getRangeValue(g),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,i.getOrientation()),{fadeInOnChartHolderMouseover:p}=this.configs;e.raise().classed("dot",!0).attr("class",g=>{const v=i.getDomainIdentifier(g),b=this.model.getIsFilled(g[l],g[v],g,n)?[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE]:[r.ColorClassNameTypes.STROKE];return this.model.getColorClassName({classNameTypes:b,dataGroupName:g[l],originalClassName:"dot"})||""}).classed("threshold-anomaly",g=>this.isDatapointThresholdAnomaly(g)).classed("filled",g=>{const v=i.getDomainIdentifier(g);return this.model.getIsFilled(g[l],g[v],g,n)}).classed("unfilled",g=>{const v=i.getDomainIdentifier(g);return!this.model.getIsFilled(g[l],g[v],g,n)}).transition().call(g=>{var v;return(v=this.services.transitions)==null?void 0:v.setupTransition({transition:g,name:"scatter-update-enter",animate:t})}).attr("cx",u).attr("cy",m).attr("r",s.points.radius).style("fill",g=>{const v=i.getDomainIdentifier(g);if(this.model.getIsFilled(g[l],g[v],g,n))return this.model.getFillColor(g[l],g[v],g)}).style("stroke",g=>{const v=i.getDomainIdentifier(g);return this.model.getStrokeColor(g[l],g[v],g)}).attr("fill-opacity",n?a:1).attr("opacity",p?0:1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",g=>{const v=i.getRangeIdentifier(g);return g[v]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:t}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(s,n){var i,l;const a=y.select(this);a.classed("hovered",!0).attr("class",d=>e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:d[t],originalClassName:a.attr("class")})).style("fill",d=>{var u;const h=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(d);return e.model.getFillColor(d[t],d[h],d)}).classed("unfilled",!1),(i=e.services.events)==null||i.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,data:[n],additionalItems:e.getTooltipAdditionalItems(n)}),(l=e.services.events)==null||l.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOVER,{event:s,element:a,datum:n})}).on("mousemove",function(s,n){var i,l;const a=y.select(this);(i=e.services.events)==null||i.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEMOVE,{event:s,element:a,datum:n}),(l=e.services.events)==null||l.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){var a;(a=e.services.events)==null||a.dispatchEvent(r.Events.Scatter.SCATTER_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){var i,l,d;const a=y.select(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:h}=e.getOptions().points,u=(i=e.services.cartesianScales)==null?void 0:i.getDomainIdentifier(n),m=e.model.getIsFilled(n[t],n[u],n,h);a.classed("unfilled",!m).style("fill",p=>m||h?e.model.getFillColor(p[t],p[u],p):null)}(l=e.services.events)==null||l.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOUT,{event:s,element:a,datum:n}),(d=e.services.events)==null||d.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:e}=this.services;if(!e)throw new Error("Services events undefined");e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Ue extends G{constructor(e,t,s){super(e,t,s),this.type="axes",this.renderType=r.RenderTypes.SVG,this.truncation={[r.AxisPositions.LEFT]:!1,[r.AxisPositions.RIGHT]:!1,[r.AxisPositions.TOP]:!1,[r.AxisPositions.BOTTOM]:!1},s&&(this.configs=s),this.margins=this.configs.margins}render(e=!0){const{position:t}=this.configs,s=this.getOptions(),n=c.getProperty(s,"axes",t,"visible"),a=this.getComponentContainer(),{width:i,height:l}=O.DOMUtils.getSVGElementSize(a,{useAttrs:!0}),d=O.DOMUtils.appendOrSelect(a,`g.axis.${t}`);let h,u;if(t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP?(h=this.configs.axes[r.AxisPositions.LEFT]?this.margins.left:0,u=this.configs.axes[r.AxisPositions.RIGHT]?i-this.margins.right:i):(h=l-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefineds");const m=this.services.cartesianScales.getScaleByPosition(t);this.scaleType===r.ScaleTypes.LABELS||this.scaleType===r.ScaleTypes.LABELS_RATIO?m.rangeRound([h,u]):m.range([h,u]);let p;switch(t){case r.AxisPositions.LEFT:p=y.axisLeft;break;case r.AxisPositions.BOTTOM:p=y.axisBottom;break;case r.AxisPositions.RIGHT:p=y.axisRight;break;case r.AxisPositions.TOP:p=y.axisTop;break}d.attr("aria-label",`${t} axis`);const g=!d.select("g.ticks").empty();let v=O.DOMUtils.appendOrSelect(d,"g.ticks");g||(v.attr("role",`${N.Roles.GRAPHICS_OBJECT} ${N.Roles.GROUP}`),v.attr("aria-label",`${t} ticks`));const f=O.DOMUtils.appendOrSelect(d,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${t} ticks`),b=c.getProperty(s,"axes",t),E=this.scaleType===r.ScaleTypes.TIME||b.scaleType===r.ScaleTypes.TIME,S=t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT,x=this.model.get("zoomDomain");if(x&&E&&!S&&m.domain(x),!n){v.attr("aria-hidden",!0);return}const M=c.getProperty(b,"scaleType"),C=c.getProperty(s,"data","loading"),T=c.getProperty(b,"ticks","number"),w=c.getProperty(b,"ticks","values"),I=c.getProperty(b,"truncation","type"),$=c.getProperty(b,"truncation","threshold"),_=c.getProperty(b,"truncation","numCharacter"),A=T!==null,L=c.getProperty(s,"timeScale"),V=O.DOMUtils.appendOrSelect(f,"g.tick"),R=O.DOMUtils.appendOrSelect(V,"text").text("0"),F=O.DOMUtils.getSVGElementSize(R.node(),{useBBox:!0}).height;V.remove();const q=this.scaleType||b.scaleType||r.ScaleTypes.LINEAR,H=p(m).tickSizeOuter(0);if(m.ticks){let U;if(A?U=T:(U=H.ticks.number,S&&(U=this.getNumberOfFittingTicks(l,F,H.ticks.verticalSpaceRatio))),m.ticks().length===1&&m.ticks()[0]===0&&(U=0),H.ticks(U),E)if(!m.ticks(U).length)H.tickValues([]);else{const z=c.getProperty(s,"timeScale","addSpaceOnEdges"),W=c.getProperty(s,"axes",t,"domain"),j=m.copy();z&&!W&&j.nice(U);const Y=j.ticks(U);z&&Y.length>2&&!W&&(Y.splice(Y.length-1,1),Y.splice(0,1)),H.tickValues(Y)}}let B;const X=c.getProperty(b,"ticks","formatter");if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval"));X===null?B=(z,W)=>c.formatTick(z,W,H.tickValues(),U,L):B=(z,W)=>{const j=c.formatTick(z,W,H.tickValues(),U,L);return X(z,W,j)}}else X===null?q===r.ScaleTypes.LINEAR&&(B=U=>U.toLocaleString()):B=X;H.tickFormat(B);const[fe,ye]=this.services.cartesianScales.getScaleByPosition(t).domain();let ne;if(w){if(E)w.forEach((U,z)=>{U.getTime===void 0&&(w[z]=new Date(U))}),ne=w.filter(U=>{const z=U.getTime();return z>=new Date(fe).getTime()&&z<=new Date(ye).getTime()});else if(M===r.ScaleTypes.LABELS){const U=this.services.cartesianScales.getScaleByPosition(t).domain();ne=w.filter(z=>U.includes(z))}else ne=w.filter(U=>U>=fe&&U<=ye);H.tickValues(ne)}switch(t){case r.AxisPositions.LEFT:v.attr("transform",`translate(${this.margins.left}, 0)`);break;case r.AxisPositions.BOTTOM:v.attr("transform",`translate(0, ${l-this.margins.bottom})`);break;case r.AxisPositions.RIGHT:v.attr("transform",`translate(${i-this.margins.right}, 0)`);break;case r.AxisPositions.TOP:v.attr("transform",`translate(0, ${this.margins.top})`);break}const Be=this.model.isDataEmpty();if(b.title){const U=O.DOMUtils.appendOrSelect(d,"text.axis-title").html(Be||C?"":b.title),z=c.getProperty(b,"titleOrientation");let W;switch(t){case r.AxisPositions.LEFT:z===r.AxisTitleOrientations.RIGHT?U.attr("transform","rotate(90)").attr("y",0).attr("x",m.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):U.attr("transform","rotate(-90)").attr("y",0).attr("x",-(m.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.BOTTOM:U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${l+4})`).style("text-anchor","middle");break;case r.AxisPositions.RIGHT:z===r.AxisTitleOrientations.LEFT?U.attr("transform","rotate(-90)").attr("y",i).attr("x",-(m.range()[0]/2)).style("text-anchor","middle"):U.attr("transform","rotate(90)").attr("y",-i).attr("x",m.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.TOP:({height:W}=O.DOMUtils.getSVGElementSize(U,{useBBox:!0})),U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${W/2})`).style("text-anchor","middle");break}}if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval")),z=L.showDayName,W=v;e&&(v=v.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:e}))),v=v.call(H),W.selectAll(".tick").data(H.tickValues(),m).order().select("text").style("font-weight",(Y,re)=>c.isTickPrimary(Y,re,H.tickValues(),U,z)?"bold":"normal")}else!e||!g?v=v.call(H):v=v.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"axis-update",animate:e})).call(H);if(f.call(H),t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP){let U=!1;const z=c.getProperty(b,"ticks","rotation");if(z===r.TickRotations.ALWAYS)U=!0;else if(z===r.TickRotations.NEVER)U=!1;else if(!z||z===r.TickRotations.AUTO)if(m.step)U=f.selectAll("g.tick text").nodes().some(j=>O.DOMUtils.getSVGElementSize(j,{useBBox:!0}).width>=m.step());else{U=!1;const W=f.append("text").text("A"),j=O.DOMUtils.getSVGElementSize(W.node(),{useBBox:!0}).width;let Y;f.selectAll("g.tick").each(function(){const re=y.select(this),D=parseFloat(c.getProperty(c.getTranslationValues(this),"tx"));D!==null&&Y+re.text().length*j*.8>=D&&(U=!0),Y=D}),W.remove()}U?(A||(H.ticks(this.getNumberOfFittingTicks(i,F,H.ticks.horizontalSpaceRatio)),f.call(H),v.call(H)),d.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",t===r.AxisPositions.TOP?"start":"end")):d.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(C?d.attr("opacity",0):d.attr("opacity",1),v.selectAll("g.tick").attr("aria-label",U=>U),f.selectAll("g.tick").attr("aria-label",U=>U),I!==r.TruncationTypes.NONE&&M===r.ScaleTypes.LABELS&&!w){const U=this.services.cartesianScales.getScaleDomain(t);if(U.length>0){const z=a.select(`g.axis.${t} g.ticks g.tick`).html();d.selectAll("g.ticks g.tick").html(z);const W=this;d.selectAll("g.tick text").data(U).text(function(j){return j.length>$?(W.truncation[t]=!0,c.truncateLabel(j,I,_)):j}),this.getInvisibleAxisRef().selectAll("g.tick text").data(U).text(function(j){return j.length>$?c.truncateLabel(j,I,_):j}),d.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),d.selectAll("g.tick text").data(U)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),l=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick text").on("mouseover",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,hoveredElement:y.select(this),content:u})}).on("mousemove",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,t,s){const n=Math.floor(e/(t*s));return Ot(n,2,c.axis.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class It extends Ue{constructor(e,t,s){super(e,t,s)}render(e=!0){super.render(e),super.destroy();const t=this.configs.position,s=this.getComponentContainer(),n=O.DOMUtils.appendOrSelect(s,`g.axis.${t}`),a=this;n.selectAll("g.tick").each(function(i,l){const d=y.select(this);d.classed("tick-hover",!0).attr("tabindex",l===0?0:-1);const h=d.select("text"),{width:u,height:m}=O.DOMUtils.getSVGElementSize(h,{useBBox:!0}),p=O.DOMUtils.appendOrSelect(d,"rect.axis-holder");let g=0,v=0;switch(t){case r.AxisPositions.LEFT:g=-u+Number(h.attr("x")),v=-(m/2);break;case r.AxisPositions.RIGHT:g=Math.abs(Number(h.attr("x"))),v=-(m/2);break;case r.AxisPositions.TOP:g=-(u/2),v=-m+Number(h.attr("y"))/2,a.truncation[t]&&(g=0,p.attr("transform","rotate(-45)"));break;case r.AxisPositions.BOTTOM:g=-(u/2),v=m/2-2,a.truncation[t]&&(g=-u,p.attr("transform","rotate(-45)"));break}p.attr("x",g-c.axis.hover.rectanglePadding).attr("y",v).attr("width",u+c.axis.hover.rectanglePadding*2).attr("height",m).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),l=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick.tick-hover").on("mouseover",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:u,datum:m}),i===r.ScaleTypes.LABELS&&m.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,element:u,datum:m})}).on("mousemove",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:u,datum:m}),d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()})}).on("mouseout",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)}).on("focus",function(h){const u={clientX:0,clientY:0};if(h.target){h.target.focus();const m=h.target.getBoundingClientRect();u.clientX=m.x,u.clientY=m.y}d.services.events.dispatchEvent(r.Events.Axis.LABEL_FOCUS,{event:{...h,...u},element:y.select(this),datum:y.select(this).select("text").datum()})}).on("blur",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})}).on("keydown",function(h){h.key&&h.key==="Escape"&&(d.services.events.dispatchEvent(r.Events.Tooltip.HIDE),d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})),t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT?h.key&&h.key==="ArrowUp"?d.goNext(this,h):h.key&&h.key==="ArrowDown"&&d.goPrevious(this,h):h.key&&h.key==="ArrowLeft"?d.goPrevious(this,h):h.key&&h.key==="ArrowRight"&&d.goNext(this,h)})}goNext(e,t){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}goPrevious(e,t){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class la extends G{constructor(){super(...arguments),this.type="2D-axes",this.renderType=r.RenderTypes.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const t={},s=Object.keys(r.AxisPositions),n=c.getProperty(this.getOptions(),"axes");s.forEach(l=>{n[r.AxisPositions[l]]&&(t[r.AxisPositions[l]]=!0)}),this.configs.axes=t,s.forEach(l=>{const d=r.AxisPositions[l];if(this.configs.axes[d]&&!this.children[d]){const h={position:d,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===r.AxisFlavor.DEFAULT?new Ue(this.model,this.services,h):new It(this.model,this.services,h);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[d]=u}}),Object.keys(this.children).forEach(l=>{this.children[l].render(e)});const a={};Object.keys(this.children).forEach(l=>{const d=this.children[l],h=d.configs.position,u=d.getInvisibleAxisRef(),{width:m,height:p}=O.DOMUtils.getSVGElementSize(u,{useBBox:!0});let g;switch(d.getTitleRef().empty()?g=0:(g=O.DOMUtils.getSVGElementSize(d.getTitleRef(),{useBBox:!0}).height,(h===r.AxisPositions.LEFT||h===r.AxisPositions.RIGHT)&&(g+=5)),h){case r.AxisPositions.TOP:a.top=p+g;break;case r.AxisPositions.BOTTOM:a.bottom=p+g;break;case r.AxisPositions.LEFT:a.left=m+g;break;case r.AxisPositions.RIGHT:a.right=m+g;break}}),this.services.events.dispatchEvent(r.Events.Axis.RENDER_COMPLETE),Object.keys(a).some(l=>this.margins[l]!==a[l])&&(this.margins=Object.assign(this.margins,a),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(r.Events.ZoomBar.UPDATE),Object.keys(this.children).forEach(l=>{const d=this.children[l];d.margins=this.margins}),this.render(!0))}}class _t extends G{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading");t?this.renderSkeleton(t):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===r.Skeletons.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===r.Skeletons.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===r.Skeletons.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===r.Skeletons.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const t=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),t===r.CartesianOrientations.VERTICAL&&this.drawYGrid(e),t===r.CartesianOrientations.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const t=this.computeOuterRadius(),s=0;this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const t=this.computeOuterRadius(),s=this.computeInnerRadius();this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),t=this.services.cartesianScales.getMainYScale().range();this.xScale=y.scaleLinear().domain([0,1]).range(e),this.yScale=y.scaleLinear().domain([0,1]).range(t)}drawBackdrop(e){const t=this.parent,{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});this.backdrop=O.DOMUtils.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("width",s).attr("height",n);const a=O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");a.attr("width","100%").attr("height","100%");const[i]=this.xScale.range(),[,l]=this.yScale.range();this.backdrop.merge(a).attr("x",i).attr("y",l),a.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const t=+this.backdrop.attr("width"),s=c.getProperty(this.getOptions(),"grid","x","numberOfTicks"),n=this.xScale.ticks(s).map(l=>l*t),a=O.DOMUtils.appendOrSelect(this.backdrop,"g.x.skeleton"),i=a.selectAll("line").data(n);i.enter().append("line").merge(i).attr("x1",l=>l).attr("x2",l=>l).attr("y1",0).attr("y2","100%"),a.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const t=+this.backdrop.attr("height"),s=this.backdrop.attr("width"),n=c.getProperty(this.getOptions(),"grid","y","numberOfTicks"),a=this.xScale.ticks(n).map(d=>d*t),i=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),l=i.selectAll("line").data(a);l.enter().append("line").merge(l).attr("x1",0).attr("x2",s).attr("y1",d=>d).attr("y2",d=>d),i.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,t,s=!0){const n=this.parent,{width:a,height:i}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),l=O.DOMUtils.appendOrSelect(n,"svg.chart-skeleton").attr("width",a).attr("height",i),d=t===0?"pie":"donut",h=c.getProperty(this.getOptions(),d,"alignment");O.DOMUtils.appendOrSelect(l,"rect.chart-skeleton-area-container").attr("width",a).attr("height",i).attr("fill","none");const u=y.arc().innerRadius(t).outerRadius(e).startAngle(0).endAngle(Math.PI*2),m=e+Math.abs(c.pie.radiusOffset),p=e+(Math.min(a,i)-e*2)/2,g=O.DOMUtils.appendOrSelect(l,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${m}, ${p})`).attr("d",u).classed("shimmer-effect-areas",s).classed("empty-state-areas",!s).style("fill",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let v=e+c.pie.xOffset;h===r.Alignments.CENTER?v=a/2:h===r.Alignments.RIGHT&&(v=a-e-c.pie.xOffset);const f=e+c.pie.yOffset;g.attr("transform",`translate(${v}, ${f})`)}computeOuterRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,t)/2+c.pie.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const a="stop-bg-shimmer",i="stop-shimmer",l=this.parent.select(".chart-skeleton"),{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),h=0,u=d,m=O.DOMUtils.appendOrSelect(l,"defs").lower(),p=O.DOMUtils.appendOrSelect(m,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",h-3*.2*d).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),g=`
73
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class aa extends G{constructor(){super(...arguments),this.type="grid",this.renderType=r.RenderTypes.SVG}render(e=!0){const t=c.getProperty(this.getOptions(),"grid","x","enabled"),s=c.getProperty(this.getOptions(),"grid","y","enabled");this.drawBackdrop(t,s),!(!t&&!s)&&(t&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),s&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const t=this.parent,s=this.backdrop.attr("height"),n=this.services.cartesianScales.getMainXScale(),a=y.axisBottom(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","x","alignWithAxisTicks")){const d=this.services.cartesianScales.getDomainAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","x","numberOfTicks");a.ticks(d)}const l=t.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${s})`);e?l.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):l.call(a),this.cleanGrid(l)}drawYGrid(e){const t=this.parent,s=this.backdrop.attr("width"),n=this.services.cartesianScales.getMainYScale(),a=y.axisLeft(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","y","alignWithAxisTicks")){const d=this.services.cartesianScales.getRangeAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","y","numberOfTicks");a.ticks(d)}const l=t.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?l.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):l.call(a),this.cleanGrid(l)}getGridlineThreshold(e){const t=this.parent,s=t.selectAll(".x.grid .tick").nodes().sort((u,m)=>Number(c.getTranslationValues(u).tx)-Number(c.getTranslationValues(m).tx));let n=-1;if(!s.length)return;s.forEach(u=>{e[0]>=+c.getTranslationValues(u).tx&&n++});const a=n+1<s.length?n+1:s.length,i=s[n],l=s[a];let d;if(!i)d=+c.getTranslationValues(l).tx;else if(l)d=+c.getTranslationValues(l).tx-+c.getTranslationValues(i).tx;else{const u=t.select("rect.chart-grid-backdrop").node();d=O.DOMUtils.getSVGElementSize(u).width-+c.getTranslationValues(i).tx}const{threshold:h}=this.getOptions().tooltip.gridline;return d*h}getActiveGridline(e){const t=c.getProperty(this.getOptions,"tooltip","gridline","threshold"),s=t||this.getGridlineThreshold(e);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=c.getTranslationValues(this),l={min:Number(i.tx)-s,max:Number(i.tx)+s};return l.min<=e[0]&&e[0]<=l.max})}drawBackdrop(e,t){const s=this.parent,n=this.services.cartesianScales.getMainXScale(),a=this.services.cartesianScales.getMainYScale(),[i,l]=n.range(),[d,h]=a.range();this.backdrop=O.DOMUtils.appendOrSelect(s,"svg.chart-grid-backdrop");const u=O.DOMUtils.appendOrSelect(this.backdrop,e||t?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",i).attr("y",h).attr("width",Math.abs(l-i)).attr("height",Math.abs(d-h)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(e){e.selectAll("text").remove(),e.select(".domain").remove()}}class ia extends G{constructor(){super(...arguments),this.type="area",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>s.name!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions();let n=[0,0];const{cartesianScales:a}=this.services,i=a.getOrientation(),l=y.area().curve(this.services.curves.getD3Curve()).defined(C=>{const x=a.getRangeIdentifier(),w=C[x];return w!=null}),d=this.model.getGroupedData(this.configs.groups),h=c.getProperty(s,"bounds"),u=h&&d&&d.length===1;!u&&h&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${d.length}`);let m=0;const p=(C,x)=>{c.getProperty(s,"axes",C,"includeZero")===!1&&x[0]>0&&x[1]>0&&(m=x[0])},g=C=>u?a.getBoundedScaledValues(C)[0]:a.getRangeValue(m),v=C=>u?a.getBoundedScaledValues(C)[1]:a.getRangeValue(C);i===r.CartesianOrientations.VERTICAL?(n=a.getMainYScale().domain(),p(a.getMainYAxisPosition(),n),l.x(C=>a.getDomainValue(C)).y0(C=>g(C)).y1(C=>v(C))):(n=a.getMainXScale().domain(),p(a.getMainXAxisPosition(),n),l.x0(C=>g(C)).x1(C=>v(C)).y(C=>a.getDomainValue(C)));const f=c.getProperty(s,"color","gradient","enabled"),b=d&&d.length===1&&f;d.length>1&&f&&console.error("Gradients can only be enabled when having 1 single dataset");const E=t.selectAll("path.area").data(d,C=>C.name),S=y.select(this.services.domUtils.getMainContainer());if(E.exit().attr("opacity",0).remove(),!d.length)return;if(b){const C=S.select(`path.${this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:d[0].name})}`).node();let x;if(C)x=getComputedStyle(C,null).getPropertyValue("stroke");else{const w=c.getProperty(this.model.getOptions(),"color","scale");if(w!==null){const I=Object.keys(w);x=w[I[0]]}}O.GradientUtils.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${d[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:O.GradientUtils.getStops(n,x)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const T=this,M=E.enter().append("path");b?M.merge(E).style("fill",C=>`url(#${this.services.domUtils.generateElementIDString(`${C.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:C.name,originalClassName:"area"})).attr("d",C=>{const{data:x}=C;return l(x)}):(M.attr("opacity",0).merge(E).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:C.name,originalClassName:"area"})).style("fill",C=>T.model.getFillColor(C.name)).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"area-update-enter",animate:e})).attr("opacity",u?1:c.area.opacity.selected).attr("d",C=>{const{data:x}=C;return l(x)}),u&&M.attr("fill-opacity",c.area.opacity.selected).style("stroke",C=>T.model.getStrokeColor(C.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ra extends G{constructor(){super(...arguments),this.type="line",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s.name!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:s,curves:n}=this.services,a=v=>s.getDomainValue(v),i=v=>s.getRangeValue(v),[l,d]=c.flipDomainAndRangeBasedOnOrientation(a,i,s.getOrientation()),h=this.getOptions(),u=y.line().x(l).y(d).curve(n.getD3Curve()).defined(v=>{const f=s.getRangeIdentifier(v),b=v[f];return b!=null});let m=[];if(this.configs.stacked){const v=Object.keys(h.axes).some(E=>h.axes[E].percentage),{groupMapsTo:f}=h.data;m=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(E=>{const S=this.services.cartesianScales.getDomainIdentifier(E),T=this.services.cartesianScales.getRangeIdentifier(E);return{name:c.getProperty(E,0,f),data:E.map(M=>({[S]:M.data.sharedStackKey,[f]:M[f],[T]:M[1]})),hidden:!_s(E,M=>M[0]!==M[1])}})}else m=this.model.getGroupedData(this.configs.groups);const p=t.selectAll("path.line").data(m,v=>v.name);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(m,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name)).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:f}=v;return f.map(b=>{const E=this.services.cartesianScales.getRangeIdentifier(b);return b[E]}).join(",")}).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:e})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:f}=v;return u(f)})}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Qe=5;function oa(o,e){return o>e-Qe&&o<e+Qe}class _e extends G{constructor(){super(...arguments),this.type="ruler",this.renderType=r.RenderTypes.SVG,this.isXGridEnabled=c.getProperty(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=c.getProperty(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(e=!1){const t=c.getProperty(this.getOptions(),"ruler","enabled");this.drawBackdrop(),t&&!this.isEventListenerAdded?this.addBackdropEventListeners():!t&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(e){return e}showRuler(e,[t,s]){const n=this.parent,a=this.services.cartesianScales.getOrientation(),i=this.model.getDisplayData(),l=this.services.cartesianScales.getRangeScale(),[d,h]=l.range(),u=a===r.CartesianOrientations.HORIZONTAL?s:t,m=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),p=O.DOMUtils.appendOrSelect(m,"line.ruler-line"),g=n.selectAll("[role=graphics-symbol]"),v=i.map(b=>({domainValue:this.services.cartesianScales.getDomainValue(b),originalData:b})).filter(b=>oa(b.domainValue,u));if(this.pointsWithinLine&&v.length===this.pointsWithinLine.length&&v.map(b=>b.domainValue).join()===this.pointsWithinLine.map(b=>b.domainValue).join())return this.pointsWithinLine=v,this.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{mousePosition:[t,s]});this.pointsWithinLine=v;const f=this.pointsWithinLine.reduce((b,E)=>{if(b.length===0)return b.push(E),b;const S=b[0].domainValue,T=Math.abs(u-E.domainValue),M=Math.abs(u-S);return T>M||(T<M?b=[E]:b.push(E)),b},[]);if(f.length>0){const b=f.map(M=>M.originalData).filter(M=>{const C=this.services.cartesianScales.getRangeIdentifier(M),x=M[C];return x!=null}),E=f.map(M=>M.domainValue),S=g.filter(M=>{const C=this.services.cartesianScales.getDomainValue(M);return E.includes(C)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!bt(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:p,data:this.formatTooltipData(b)}),m.attr("opacity",1);const T=f[0];a==="horizontal"?p.attr("x1",h).attr("x2",d).attr("y1",T.domainValue).attr("y2",T.domainValue):p.attr("y1",h).attr("y2",d).attr("x1",T.domainValue).attr("x2",T.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,t=O.DOMUtils.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE),t.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,t=this.services.domUtils.getHolder(),s=this.model.getDisplayData();let n=function(a){const i=y.pointer(a,e.parent.node());e.showRuler(a,i)};if(s.length>100){const a=s.length%50*12.5;n=c.debounceWithD3MousePosition(function(i){const{mousePosition:l}=this;e.showRuler(i,l)},a,t)}this.backdrop.on("mousemove mouseover",n).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-grid-backdrop")}}class me extends G{constructor(){super(...arguments),this.type="scatter",this.renderType=r.RenderTypes.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(n=>{var a;return(a=this.services.transitions)==null?void 0:a.setupTransition({transition:n,name:"legend-hover-scatter"})}).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:t}=this.configs;t&&(e.addEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:t}=this.services;if(!t)throw new Error("Services cartesianScales are undefined.");const s=t.getDomainIdentifier(e),n=this.model.get("zoomDomain");return n!==void 0?e.filter(a=>a[s].getTime()>=n[0].getTime()&&a[s].getTime()<=n[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:t}=this.configs;let s;if(t){const n=Object.keys(e.axes).some(a=>e.axes[a].percentage);s=this.model.getStackedData({groups:this.configs.groups,percentage:n})}else{const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");s=this.model.getDisplayData(this.configs.groups).filter(a=>{const i=n.getRangeIdentifier(a);return a[i]!==void 0&&a[i]!==null})}return this.filterBasedOnZoomDomain(s)}render(e){if(!(c.getProperty(this.getOptions(),"points","enabled")||c.getProperty(this.getOptions(),"bubble","enabled")))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");const l=i.getDomainIdentifier(),d=s.selectAll("circle.dot").data(this.getScatterData(),m=>`${m[a]}-${m[l]}`);d.exit().attr("opacity",0).remove();const u=d.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(d);this.styleCircles(u,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:t}=this.configs;if(!t)return!1;const{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const n=s.getOrientation(),[a,i]=c.flipDomainAndRangeBasedOnOrientation(s.getHighestDomainThreshold(),s.getHighestRangeThreshold(),n),[l,d]=c.flipDomainAndRangeBasedOnOrientation(m=>s.getDomainValue(m),m=>s.getRangeValue(m),n),h=l(e),u=d(e);return i&&a?u<=i.scaleValue&&h>=a.scaleValue:i?u<=i.scaleValue:a?h>=a.scaleValue:!1}styleCircles(e,t){const s=this.getOptions(),{filled:n,fillOpacity:a}=s.points,{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:l}=s.data,d=g=>i.getDomainValue(g),h=g=>i.getRangeValue(g),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,i.getOrientation()),{fadeInOnChartHolderMouseover:p}=this.configs;e.raise().classed("dot",!0).attr("class",g=>{const v=i.getDomainIdentifier(g),b=this.model.getIsFilled(g[l],g[v],g,n)?[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE]:[r.ColorClassNameTypes.STROKE];return this.model.getColorClassName({classNameTypes:b,dataGroupName:g[l],originalClassName:"dot"})||""}).classed("threshold-anomaly",g=>this.isDatapointThresholdAnomaly(g)).classed("filled",g=>{const v=i.getDomainIdentifier(g);return this.model.getIsFilled(g[l],g[v],g,n)}).classed("unfilled",g=>{const v=i.getDomainIdentifier(g);return!this.model.getIsFilled(g[l],g[v],g,n)}).transition().call(g=>{var v;return(v=this.services.transitions)==null?void 0:v.setupTransition({transition:g,name:"scatter-update-enter",animate:t})}).attr("cx",u).attr("cy",m).attr("r",s.points.radius).style("fill",g=>{const v=i.getDomainIdentifier(g);if(this.model.getIsFilled(g[l],g[v],g,n))return this.model.getFillColor(g[l],g[v],g)}).style("stroke",g=>{const v=i.getDomainIdentifier(g);return this.model.getStrokeColor(g[l],g[v],g)}).attr("fill-opacity",n?a:1).attr("opacity",p?0:1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",g=>{const v=i.getRangeIdentifier(g);return g[v]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:t}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(s,n){var i,l;const a=y.select(this);a.classed("hovered",!0).attr("class",d=>e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:d[t],originalClassName:a.attr("class")})).style("fill",d=>{var u;const h=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(d);return e.model.getFillColor(d[t],d[h],d)}).classed("unfilled",!1),(i=e.services.events)==null||i.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,data:[n],additionalItems:e.getTooltipAdditionalItems(n)}),(l=e.services.events)==null||l.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOVER,{event:s,element:a,datum:n})}).on("mousemove",function(s,n){var i,l;const a=y.select(this);(i=e.services.events)==null||i.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEMOVE,{event:s,element:a,datum:n}),(l=e.services.events)==null||l.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){var a;(a=e.services.events)==null||a.dispatchEvent(r.Events.Scatter.SCATTER_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){var i,l,d;const a=y.select(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:h}=e.getOptions().points,u=(i=e.services.cartesianScales)==null?void 0:i.getDomainIdentifier(n),m=e.model.getIsFilled(n[t],n[u],n,h);a.classed("unfilled",!m).style("fill",p=>m||h?e.model.getFillColor(p[t],p[u],p):null)}(l=e.services.events)==null||l.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOUT,{event:s,element:a,datum:n}),(d=e.services.events)==null||d.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:e}=this.services;if(!e)throw new Error("Services events undefined");e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Ue extends G{constructor(e,t,s){super(e,t,s),this.type="axes",this.renderType=r.RenderTypes.SVG,this.truncation={[r.AxisPositions.LEFT]:!1,[r.AxisPositions.RIGHT]:!1,[r.AxisPositions.TOP]:!1,[r.AxisPositions.BOTTOM]:!1},s&&(this.configs=s),this.margins=this.configs.margins}render(e=!0){const{position:t}=this.configs,s=this.getOptions(),n=c.getProperty(s,"axes",t,"visible"),a=this.getComponentContainer(),{width:i,height:l}=O.DOMUtils.getSVGElementSize(a,{useAttrs:!0}),d=O.DOMUtils.appendOrSelect(a,`g.axis.${t}`);let h,u;if(t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP?(h=this.configs.axes[r.AxisPositions.LEFT]?this.margins.left:0,u=this.configs.axes[r.AxisPositions.RIGHT]?i-this.margins.right:i):(h=l-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const m=this.services.cartesianScales.getScaleByPosition(t);this.scaleType===r.ScaleTypes.LABELS||this.scaleType===r.ScaleTypes.LABELS_RATIO?m.rangeRound([h,u]):m.range([h,u]);let p;switch(t){case r.AxisPositions.LEFT:p=y.axisLeft;break;case r.AxisPositions.BOTTOM:p=y.axisBottom;break;case r.AxisPositions.RIGHT:p=y.axisRight;break;case r.AxisPositions.TOP:p=y.axisTop;break}d.attr("aria-label",`${t} axis`);const g=!d.select("g.ticks").empty();let v=O.DOMUtils.appendOrSelect(d,"g.ticks");g||(v.attr("role",`${N.Roles.GRAPHICS_OBJECT} ${N.Roles.GROUP}`),v.attr("aria-label",`${t} ticks`));const f=O.DOMUtils.appendOrSelect(d,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${t} ticks`),b=c.getProperty(s,"axes",t),E=this.scaleType===r.ScaleTypes.TIME||b.scaleType===r.ScaleTypes.TIME,S=t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT,T=this.model.get("zoomDomain");if(T&&E&&!S&&m.domain(T),!n){v.attr("aria-hidden",!0);return}const M=c.getProperty(b,"scaleType"),C=c.getProperty(s,"data","loading"),x=c.getProperty(b,"ticks","number"),w=c.getProperty(b,"ticks","values"),I=c.getProperty(b,"truncation","type"),$=c.getProperty(b,"truncation","threshold"),_=c.getProperty(b,"truncation","numCharacter"),A=x!==null,L=c.getProperty(s,"timeScale"),V=O.DOMUtils.appendOrSelect(f,"g.tick"),R=O.DOMUtils.appendOrSelect(V,"text").text("0"),F=O.DOMUtils.getSVGElementSize(R.node(),{useBBox:!0}).height;V.remove();const q=this.scaleType||b.scaleType||r.ScaleTypes.LINEAR,H=p(m).tickSizeOuter(0);if(m.ticks){let U;if(A?U=x:(U=c.axis.ticks.number,S&&(U=this.getNumberOfFittingTicks(l,F,c.axis.ticks.verticalSpaceRatio))),m.ticks().length===1&&m.ticks()[0]===0&&(U=0),H.ticks(U),E)if(!m.ticks(U).length)H.tickValues([]);else{const z=c.getProperty(s,"timeScale","addSpaceOnEdges"),W=c.getProperty(s,"axes",t,"domain"),j=m.copy();z&&!W&&j.nice(U);const Y=j.ticks(U);z&&Y.length>2&&!W&&(Y.splice(Y.length-1,1),Y.splice(0,1)),H.tickValues(Y)}}let B;const X=c.getProperty(b,"ticks","formatter");if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval"));X===null?B=(z,W)=>c.formatTick(z,W,H.tickValues(),U,L):B=(z,W)=>{const j=c.formatTick(z,W,H.tickValues(),U,L);return X(z,W,j)}}else X===null?q===r.ScaleTypes.LINEAR&&(B=U=>U.toLocaleString()):B=X;H.tickFormat(B);const[fe,ye]=this.services.cartesianScales.getScaleByPosition(t).domain();let ne;if(w){if(E)w.forEach((U,z)=>{U.getTime===void 0&&(w[z]=new Date(U))}),ne=w.filter(U=>{const z=U.getTime();return z>=new Date(fe).getTime()&&z<=new Date(ye).getTime()});else if(M===r.ScaleTypes.LABELS){const U=this.services.cartesianScales.getScaleByPosition(t).domain();ne=w.filter(z=>U.includes(z))}else ne=w.filter(U=>U>=fe&&U<=ye);H.tickValues(ne)}switch(t){case r.AxisPositions.LEFT:v.attr("transform",`translate(${this.margins.left}, 0)`);break;case r.AxisPositions.BOTTOM:v.attr("transform",`translate(0, ${l-this.margins.bottom})`);break;case r.AxisPositions.RIGHT:v.attr("transform",`translate(${i-this.margins.right}, 0)`);break;case r.AxisPositions.TOP:v.attr("transform",`translate(0, ${this.margins.top})`);break}const Be=this.model.isDataEmpty();if(b.title){const U=O.DOMUtils.appendOrSelect(d,"text.axis-title").html(Be||C?"":b.title),z=c.getProperty(b,"titleOrientation");let W;switch(t){case r.AxisPositions.LEFT:z===r.AxisTitleOrientations.RIGHT?U.attr("transform","rotate(90)").attr("y",0).attr("x",m.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):U.attr("transform","rotate(-90)").attr("y",0).attr("x",-(m.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.BOTTOM:U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${l+4})`).style("text-anchor","middle");break;case r.AxisPositions.RIGHT:z===r.AxisTitleOrientations.LEFT?U.attr("transform","rotate(-90)").attr("y",i).attr("x",-(m.range()[0]/2)).style("text-anchor","middle"):U.attr("transform","rotate(90)").attr("y",-i).attr("x",m.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.TOP:W=O.DOMUtils.getSVGElementSize(U,{useBBox:!0}).height,U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${W/2})`).style("text-anchor","middle");break}}if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval")),z=L.showDayName,W=v;e&&(v=v.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:e}))),v=v.call(H),W.selectAll(".tick").data(H.tickValues(),m).order().select("text").style("font-weight",(Y,re)=>c.isTickPrimary(Y,re,H.tickValues(),U,z)?"bold":"normal")}else!e||!g?v=v.call(H):v=v.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"axis-update",animate:e})).call(H);if(f.call(H),t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP){let U=!1;const z=c.getProperty(b,"ticks","rotation");if(z===r.TickRotations.ALWAYS)U=!0;else if(z===r.TickRotations.NEVER)U=!1;else if(!z||z===r.TickRotations.AUTO)if(m.step)U=f.selectAll("g.tick text").nodes().some(j=>O.DOMUtils.getSVGElementSize(j,{useBBox:!0}).width>=m.step());else{U=!1;const W=f.append("text").text("A"),j=O.DOMUtils.getSVGElementSize(W.node(),{useBBox:!0}).width;let Y;f.selectAll("g.tick").each(function(){const re=y.select(this),D=parseFloat(c.getProperty(c.getTranslationValues(this),"tx"));D!==null&&Y+re.text().length*j*.8>=D&&(U=!0),Y=D}),W.remove()}U?(A||(H.ticks(this.getNumberOfFittingTicks(i,F,c.axis.ticks.horizontalSpaceRatio)),f.call(H),v.call(H)),d.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",t===r.AxisPositions.TOP?"start":"end")):d.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(C?d.attr("opacity",0):d.attr("opacity",1),v.selectAll("g.tick").attr("aria-label",U=>U),f.selectAll("g.tick").attr("aria-label",U=>U),I!==r.TruncationTypes.NONE&&M===r.ScaleTypes.LABELS&&!w){const U=this.services.cartesianScales.getScaleDomain(t);if(U.length>0){const z=a.select(`g.axis.${t} g.ticks g.tick`).html();d.selectAll("g.ticks g.tick").html(z);const W=this;d.selectAll("g.tick text").data(U).text(function(j){return j.length>$?(W.truncation[t]=!0,c.truncateLabel(j,I,_)):j}),this.getInvisibleAxisRef().selectAll("g.tick text").data(U).text(function(j){return j.length>$?c.truncateLabel(j,I,_):j}),d.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),d.selectAll("g.tick text").data(U)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),l=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick text").on("mouseover",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,hoveredElement:y.select(this),content:u})}).on("mousemove",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,t,s){const n=Math.floor(e/(t*s));return Ot(n,2,c.axis.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class It extends Ue{constructor(e,t,s){super(e,t,s)}render(e=!0){super.render(e),super.destroy();const t=this.configs.position,s=this.getComponentContainer(),n=O.DOMUtils.appendOrSelect(s,`g.axis.${t}`),a=this;n.selectAll("g.tick").each(function(i,l){const d=y.select(this);d.classed("tick-hover",!0).attr("tabindex",l===0?0:-1);const h=d.select("text"),{width:u,height:m}=O.DOMUtils.getSVGElementSize(h,{useBBox:!0}),p=O.DOMUtils.appendOrSelect(d,"rect.axis-holder");let g=0,v=0;switch(t){case r.AxisPositions.LEFT:g=-u+Number(h.attr("x")),v=-(m/2);break;case r.AxisPositions.RIGHT:g=Math.abs(Number(h.attr("x"))),v=-(m/2);break;case r.AxisPositions.TOP:g=-(u/2),v=-m+Number(h.attr("y"))/2,a.truncation[t]&&(g=0,p.attr("transform","rotate(-45)"));break;case r.AxisPositions.BOTTOM:g=-(u/2),v=m/2-2,a.truncation[t]&&(g=-u,p.attr("transform","rotate(-45)"));break}p.attr("x",g-c.axis.hover.rectanglePadding).attr("y",v).attr("width",u+c.axis.hover.rectanglePadding*2).attr("height",m).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),l=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick.tick-hover").on("mouseover",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:u,datum:m}),i===r.ScaleTypes.LABELS&&m.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,element:u,datum:m})}).on("mousemove",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:u,datum:m}),d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()})}).on("mouseout",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)}).on("focus",function(h){const u={clientX:0,clientY:0};if(h.target){h.target.focus();const m=h.target.getBoundingClientRect();u.clientX=m.x,u.clientY=m.y}d.services.events.dispatchEvent(r.Events.Axis.LABEL_FOCUS,{event:{...h,...u},element:y.select(this),datum:y.select(this).select("text").datum()})}).on("blur",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})}).on("keydown",function(h){h.key&&h.key==="Escape"&&(d.services.events.dispatchEvent(r.Events.Tooltip.HIDE),d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})),t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT?h.key&&h.key==="ArrowUp"?d.goNext(this,h):h.key&&h.key==="ArrowDown"&&d.goPrevious(this,h):h.key&&h.key==="ArrowLeft"?d.goPrevious(this,h):h.key&&h.key==="ArrowRight"&&d.goNext(this,h)})}goNext(e,t){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}goPrevious(e,t){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class la extends G{constructor(){super(...arguments),this.type="2D-axes",this.renderType=r.RenderTypes.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const t={},s=Object.keys(r.AxisPositions),n=c.getProperty(this.getOptions(),"axes");s.forEach(l=>{n[r.AxisPositions[l]]&&(t[r.AxisPositions[l]]=!0)}),this.configs.axes=t,s.forEach(l=>{const d=r.AxisPositions[l];if(this.configs.axes[d]&&!this.children[d]){const h={position:d,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===r.AxisFlavor.DEFAULT?new Ue(this.model,this.services,h):new It(this.model,this.services,h);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[d]=u}}),Object.keys(this.children).forEach(l=>{this.children[l].render(e)});const a={};Object.keys(this.children).forEach(l=>{const d=this.children[l],h=d.configs.position,u=d.getInvisibleAxisRef(),{width:m,height:p}=O.DOMUtils.getSVGElementSize(u,{useBBox:!0});let g;switch(d.getTitleRef().empty()?g=0:(g=O.DOMUtils.getSVGElementSize(d.getTitleRef(),{useBBox:!0}).height,(h===r.AxisPositions.LEFT||h===r.AxisPositions.RIGHT)&&(g+=5)),h){case r.AxisPositions.TOP:a.top=p+g;break;case r.AxisPositions.BOTTOM:a.bottom=p+g;break;case r.AxisPositions.LEFT:a.left=m+g;break;case r.AxisPositions.RIGHT:a.right=m+g;break}}),this.services.events.dispatchEvent(r.Events.Axis.RENDER_COMPLETE),Object.keys(a).some(l=>this.margins[l]!==a[l])&&(this.margins=Object.assign(this.margins,a),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(r.Events.ZoomBar.UPDATE),Object.keys(this.children).forEach(l=>{const d=this.children[l];d.margins=this.margins}),this.render(!0))}}class _t extends G{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading");t?this.renderSkeleton(t):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===r.Skeletons.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===r.Skeletons.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===r.Skeletons.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===r.Skeletons.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const t=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),t===r.CartesianOrientations.VERTICAL&&this.drawYGrid(e),t===r.CartesianOrientations.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const t=this.computeOuterRadius(),s=0;this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const t=this.computeOuterRadius(),s=this.computeInnerRadius();this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),t=this.services.cartesianScales.getMainYScale().range();this.xScale=y.scaleLinear().domain([0,1]).range(e),this.yScale=y.scaleLinear().domain([0,1]).range(t)}drawBackdrop(e){const t=this.parent,{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});this.backdrop=O.DOMUtils.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("width",s).attr("height",n);const a=O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");a.attr("width","100%").attr("height","100%");const[i]=this.xScale.range(),[,l]=this.yScale.range();this.backdrop.merge(a).attr("x",i).attr("y",l),a.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const t=+this.backdrop.attr("width"),s=c.getProperty(this.getOptions(),"grid","x","numberOfTicks"),n=this.xScale.ticks(s).map(l=>l*t),a=O.DOMUtils.appendOrSelect(this.backdrop,"g.x.skeleton"),i=a.selectAll("line").data(n);i.enter().append("line").merge(i).attr("x1",l=>l).attr("x2",l=>l).attr("y1",0).attr("y2","100%"),a.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const t=+this.backdrop.attr("height"),s=this.backdrop.attr("width"),n=c.getProperty(this.getOptions(),"grid","y","numberOfTicks"),a=this.xScale.ticks(n).map(d=>d*t),i=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),l=i.selectAll("line").data(a);l.enter().append("line").merge(l).attr("x1",0).attr("x2",s).attr("y1",d=>d).attr("y2",d=>d),i.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,t,s=!0){const n=this.parent,{width:a,height:i}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),l=O.DOMUtils.appendOrSelect(n,"svg.chart-skeleton").attr("width",a).attr("height",i),d=t===0?"pie":"donut",h=c.getProperty(this.getOptions(),d,"alignment");O.DOMUtils.appendOrSelect(l,"rect.chart-skeleton-area-container").attr("width",a).attr("height",i).attr("fill","none");const u=y.arc().innerRadius(t).outerRadius(e).startAngle(0).endAngle(Math.PI*2),m=e+Math.abs(c.pie.radiusOffset),p=e+(Math.min(a,i)-e*2)/2,g=O.DOMUtils.appendOrSelect(l,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${m}, ${p})`).attr("d",u).classed("shimmer-effect-areas",s).classed("empty-state-areas",!s).style("fill",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let v=e+c.pie.xOffset;h===r.Alignments.CENTER?v=a/2:h===r.Alignments.RIGHT&&(v=a-e-c.pie.xOffset);const f=e+c.pie.yOffset;g.attr("transform",`translate(${v}, ${f})`)}computeOuterRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,t)/2+c.pie.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const a="stop-bg-shimmer",i="stop-shimmer",l=this.parent.select(".chart-skeleton"),{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),h=0,u=d,m=O.DOMUtils.appendOrSelect(l,"defs").lower(),p=O.DOMUtils.appendOrSelect(m,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",h-3*.2*d).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),g=`
74
74
  <stop class="${a}" offset="${h}"></stop>
75
75
  <stop class="${i}" offset="${h+.2}"></stop>
76
76
  <stop class="${a}" offset="${h+2*.2}"></stop>
77
- `;p.html(g),v();function v(){p.attr("gradientTransform",`translate(${h-3*.2*d}, 0)`).transition().duration(2e3).delay(1e3).ease(y.easeLinear).attr("gradientTransform",`translate(${u+3*.2*d}, 0)`).on("end",v)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class ca extends G{constructor(){super(...arguments),this.type="boxplot",this.renderType=r.RenderTypes.SVG}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getDataGroupNames(),i=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale(),[d,h]=i.range(),[u,m]=l.range(),p=h-d,g=u-m;if(p===0)return;const{cartesianScales:v}=this.services,f=v.getOrientation(),b=f===r.CartesianOrientations.VERTICAL,[E,S]=c.flipDomainAndRangeBasedOnOrientation(A=>this.services.cartesianScales.getDomainValue(A),A=>this.services.cartesianScales.getRangeValue(A),f),x=Math.floor((b?p:g)/a.length),M=Math.min(x/2,16),C=this.model.getBoxplotData(),T=t.selectAll(".box-group").data(C);T.exit().remove();const w=T.enter().append("g").attr("class","box-group"),I=T.merge(w);w.append("path").merge(T.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalstartline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.quartiles.q_25);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(T.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalendline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,R=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.quartiles.q_75);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(T.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"box"})).attr("fill-opacity",c.boxplot.box.opacity.default).attr("stroke-width",c.boxplot.strokeWidth.default).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",A=>A[n]).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-quartiles",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(Math[b?"max":"min"](A.quartiles.q_75,A.quartiles.q_25)),F=R+Math.abs(v.getRangeValue(A.quartiles.q_75)-v.getRangeValue(A.quartiles.q_25));return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(T.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(T.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker start"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-startingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/4,V=L+M/2,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.min);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(T.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-median",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(A.quartiles.q_50),F=R;return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(T.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker end"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-endingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/4,V=L+M/2,R=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)});const $=I.selectAll("circle.outlier").data(A=>A.outliers.map(L=>({min:A.whiskers.min,max:A.whiskers.max,[n]:A[n],value:L})));$.exit().remove();const _=$.enter().append("circle");$.merge(_).attr("r",c.boxplot.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"outlier"})).attr("fill-opacity",c.boxplot.circle.opacity.default).attr("cx",E).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-circles",animate:e})).attr("cy",S),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",c.boxplot.box.opacity.hovered),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:t.tooltip.groupLabel,value:a[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Minimum",value:a.whiskers.min},{label:"Q1",value:a.quartiles.q_25},{label:"Median",value:a.quartiles.q_50},{label:"Q3",value:a.quartiles.q_75},{label:"Maximum",value:a.whiskers.max},{label:"IQR",value:a.quartiles.q_75-a.quartiles.q_25}]}),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOVER,{event:n,element:i,datum:a})}).on("mousemove",function(n,a){const i=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEMOVE,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){e.services.events.dispatchEvent(r.Events.Boxplot.BOX_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",c.boxplot.box.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOUT,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}addCircleEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(a,i){const l=y.select(this);l.classed("hovered",!0).attr("fill-opacity",c.boxplot.circle.opacity.hovered).classed("unfilled",!1),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:t.tooltip.groupLabel,value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Outlier",value:i[n]}]}),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOVER,{event:a,element:l,datum:i})}).on("mousemove",function(a,i){const l=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEMOVE,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);l.classed("hovered",!1).attr("fill-opacity",c.boxplot.circle.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOUT,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}}class da extends G{constructor(){super(...arguments),this.type="zero-line",this.renderType=r.RenderTypes.SVG}render(e){const t=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),s=this.services.cartesianScales.getScaleByPosition(t),[n,a]=s.domain(),i=n>0&&a<0||n<0&&a>0,l=this.getComponentContainer();if(!i){l.selectAll("line.domain").remove();return}const[d,h]=this.services.cartesianScales.getDomainScale().range();let u=+s(0)+.5;u||(u=s.range()[0]);const m=c.flipSVGCoordinatesBasedOnOrientation({x0:d,x1:h,y0:u,y1:u},this.services.cartesianScales.getOrientation());O.DOMUtils.appendOrSelect(l,"line.domain").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"zero-line-update",animate:e})).attr("y1",m.y0).attr("y2",m.y1).attr("x1",m.x0).attr("x2",m.x1)}}class ha extends me{constructor(){super(...arguments),this.type="bubble",this.renderType=r.RenderTypes.SVG}getRadiusScale(e){const t=this.getOptions(),{radiusMapsTo:s}=t.bubble,n=e.data(),a=n.map(h=>h[s]).filter(h=>h),i=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),l=a.length>0,d=l?y.extent(a):[1,1];return y.scaleLinear().domain(d).range(l?t.bubble.radiusRange(i,n):[4,4])}styleCircles(e,t){const s=this.getOptions(),{radiusMapsTo:n}=s.bubble,a=this.getRadiusScale(e),{groupMapsTo:i}=s.data,{cartesianScales:l}=this.services,d=p=>l.getDomainValue(p),h=p=>l.getRangeValue(p),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,l.getOrientation());e.raise().classed("dot",!0).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",p=>{const g=l.getRangeIdentifier(p);return p[g]}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bubble-update-enter",animate:t})).attr("cx",u).attr("cy",m).attr("r",p=>a(p[n]||1)).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:p[i],originalClassName:"dot"})).style("fill",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getFillColor(p[i],p[g],p)}).style("stroke",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getStrokeColor(p[i],p[g],p)}).attr("fill-opacity",s.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(e){const t=c.getProperty(this.getOptions(),"bubble");return[{label:c.getProperty(t,"radiusLabel"),value:e[c.getProperty(t,"radiusMapsTo")]}]}}class ua extends G{constructor(){super(...arguments),this.type="bullet",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getRangeScale(),l=this.services.cartesianScales.getRangeIdentifier(),[d,h]=i.range(),[,u]=i.domain(),m=()=>{const f=[];a.forEach(S=>{S.ranges?S.ranges.forEach((x,M)=>{x!=null&&x<u&&f.push({datum:S,value:x,order:M+1})}):f.push({datum:S,order:1})});const b=O.DOMUtils.appendOrSelect(n,"g.range-boxes").selectAll("path.range-box").data(f,S=>`${S[s]}-${S.order}`);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`range-box order-${S.order}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-range-box-update-enter",animate:e})).attr("d",S=>{let M,C,T,w;return S.order===1?(M=this.services.cartesianScales.getDomainValue(S.datum)-16/2,C=M+16,T=h-2,w=d+1):(M=this.services.cartesianScales.getDomainValue(S.datum)-16/2,C=M+16,T=this.services.cartesianScales.getRangeValue(S.value),w=h),c.generateSVGPathString({x0:M,x1:C,y0:T,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.bars").selectAll("path.bar").data(a,E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("bar",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-bar-update-enter",animate:e})).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:E[s],originalClassName:"bar"})).style("fill",E=>this.model.getFillColor(E[s])).attr("d",E=>{const x=this.services.cartesianScales.getDomainValue(E)-4,M=x+8,C=this.services.cartesianScales.getRangeValue(0)+1,T=this.services.cartesianScales.getRangeValue(E);return c.generateSVGPathString({x0:x,x1:M,y0:C,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",E=>E.value)},g=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.markers").selectAll("path.marker").data(a.filter(E=>c.getProperty(E,"marker")!==null),E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("marker",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-marker-update-enter",animate:e})).attr("d",E=>{const x=this.services.cartesianScales.getDomainValue(E)-12,M=x+24,C=this.services.cartesianScales.getRangeValue(E.marker),T=C;return c.generateSVGPathString({x0:x,x1:M,y0:C,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},v=()=>{let f=[];a.filter(S=>c.getProperty(S,"marker")!==null).forEach(S=>{const x=S.marker,M=S[l];f=f.concat([{datum:S,value:x*.25,barValue:M},{datum:S,value:x*.5,barValue:M},{datum:S,value:x*.75,barValue:M}])});const b=O.DOMUtils.appendOrSelect(n,"g.quartiles").selectAll("path.quartile").data(f,S=>S[s]);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`quartile ${S.value<=S.barValue?"over-bar":""}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-quartile-update-enter",animate:e})).attr("d",({datum:S,value:x})=>{let M=4;S.ranges&&S.ranges.indexOf(x)!==-1&&(M=8);const C=this.services.cartesianScales.getDomainValue(S)-M/2,T=C+M,w=this.services.cartesianScales.getRangeValue(x),I=w;return c.generateSVGPathString({x0:C,x1:T,y0:w,y1:I},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};m(),p(),g(),v(),this.addEventListeners()}addEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(a,i){const l=y.select(this);l.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:i});const d=c.getProperty(t,"bullet","performanceAreaTitles"),h=e.model.getMatchingRangeIndexForDatapoint(i);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:t.tooltip.groupLabel||"Group",value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[s]})},{label:"Value",value:i[n]},{label:"Target",value:i.marker},{label:"Percentage",value:`${Math.floor(i[n]/i.marker*100)}%`},{label:"Performance",value:d[h]}]})}).on("mousemove",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:a,element:y.select(this),datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);l.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function pa(o){return o}function ga(o){if(o==null)return pa;var e,t,s=o.scale[0],n=o.scale[1],a=o.translate[0],i=o.translate[1];return function(l,d){d||(e=t=0);var h=2,u=l.length,m=new Array(u);for(m[0]=(e+=l[0])*s+a,m[1]=(t+=l[1])*n+i;h<u;)m[h]=l[h],++h;return m}}function ma(o,e){for(var t,s=o.length,n=s-e;n<--s;)t=o[n],o[n++]=o[s],o[s]=t}function va(o,e){return typeof e=="string"&&(e=o.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return et(o,t)})}:et(o,e)}function et(o,e){var t=e.id,s=e.bbox,n=e.properties==null?{}:e.properties,a=Ve(o,e);return t==null&&s==null?{type:"Feature",properties:n,geometry:a}:s==null?{type:"Feature",id:t,properties:n,geometry:a}:{type:"Feature",id:t,bbox:s,properties:n,geometry:a}}function Ve(o,e){var t=ga(o.transform),s=o.arcs;function n(u,m){m.length&&m.pop();for(var p=s[u<0?~u:u],g=0,v=p.length;g<v;++g)m.push(t(p[g],g));u<0&&ma(m,v)}function a(u){return t(u)}function i(u){for(var m=[],p=0,g=u.length;p<g;++p)n(u[p],m);return m.length<2&&m.push(m[0]),m}function l(u){for(var m=i(u);m.length<4;)m.push(m[0]);return m}function d(u){return u.map(l)}function h(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(h)};case"Point":p=a(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(a);break;case"LineString":p=i(u.arcs);break;case"MultiLineString":p=u.arcs.map(i);break;case"Polygon":p=d(u.arcs);break;case"MultiPolygon":p=u.arcs.map(d);break;default:return null}return{type:m,coordinates:p}}return h(e)}function fa(o,e){var t={},s={},n={},a=[],i=-1;e.forEach(function(h,u){var m=o.arcs[h<0?~h:h],p;m.length<3&&!m[1][0]&&!m[1][1]&&(p=e[++i],e[i]=h,e[u]=p)}),e.forEach(function(h){var u=l(h),m=u[0],p=u[1],g,v;if(g=n[m])if(delete n[g.end],g.push(h),g.end=p,v=s[p]){delete s[v.start];var f=v===g?g:g.concat(v);s[f.start=g.start]=n[f.end=v.end]=f}else s[g.start]=n[g.end]=g;else if(g=s[p])if(delete s[g.start],g.unshift(h),g.start=m,v=n[m]){delete n[v.end];var b=v===g?g:v.concat(g);s[b.start=v.start]=n[b.end=g.end]=b}else s[g.start]=n[g.end]=g;else g=[h],s[g.start=m]=n[g.end=p]=g});function l(h){var u=o.arcs[h<0?~h:h],m=u[0],p;return o.transform?(p=[0,0],u.forEach(function(g){p[0]+=g[0],p[1]+=g[1]})):p=u[u.length-1],h<0?[p,m]:[m,p]}function d(h,u){for(var m in h){var p=h[m];delete u[p.start],delete p.start,delete p.end,p.forEach(function(g){t[g<0?~g:g]=1}),a.push(p)}}return d(n,s),d(s,n),e.forEach(function(h){t[h<0?~h:h]||a.push([h])}),a}function ya(o){for(var e=-1,t=o.length,s,n=o[t-1],a=0;++e<t;)s=n,n=o[e],a+=s[0]*n[1]-s[1]*n[0];return Math.abs(a)}function Ea(o){return Ve(o,Oa.apply(this,arguments))}function Oa(o,e){var t={},s=[],n=[];e.forEach(a);function a(d){switch(d.type){case"GeometryCollection":d.geometries.forEach(a);break;case"Polygon":i(d.arcs);break;case"MultiPolygon":d.arcs.forEach(i);break}}function i(d){d.forEach(function(h){h.forEach(function(u){(t[u=u<0?~u:u]||(t[u]=[])).push(d)})}),s.push(d)}function l(d){return ya(Ve(o,{type:"Polygon",arcs:[d]}).coordinates[0])}return s.forEach(function(d){if(!d._){var h=[],u=[d];for(d._=1,n.push(h);d=u.pop();)h.push(d),d.forEach(function(m){m.forEach(function(p){t[p<0?~p:p].forEach(function(g){g._||(g._=1,u.push(g))})})})}}),s.forEach(function(d){delete d._}),{type:"MultiPolygon",arcs:n.map(function(d){var h=[],u;if(d.forEach(function(f){f.forEach(function(b){b.forEach(function(E){t[E<0?~E:E].length<2&&h.push(E)})})}),h=fa(o,h),(u=h.length)>1)for(var m=1,p=l(h[0]),g,v;m<u;++m)(g=l(h[m]))>p&&(v=h[0],h[0]=h[m],h[m]=v,p=g);return h}).filter(function(d){return d.length>0})}}class ba extends _e{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=r.RenderTypes.SVG}showRuler(e,[t,s]){const n=this.parent,a=this.model.getOptions(),{cartesianScales:i}=this.services,l=i.getOrientation(),d=i.getRangeScale(),[h,u]=d.range(),m=i.getDomainScale(),p=m.invert(l===r.CartesianOrientations.VERTICAL?t:s),g=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),v=O.DOMUtils.appendOrSelect(g,"line.ruler-line"),b=n.selectAll("[role=graphics-symbol]").filter(E=>{if(parseFloat(c.get(E,"data.x0"))<=p&&parseFloat(c.get(E,"data.x1"))>=p)return!0});if(b.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!bt(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b;const E=y.select(b.nodes()[0]).datum(),S=parseFloat(c.get(E,"data.x0")),x=parseFloat(c.get(E,"data.x1")),M=this.model.getActiveDataGroupNames(),C=M.reverse().map(w=>({label:w,value:c.get(E,`data.${w}`),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:w})})).filter(w=>w.value!==0);if(C.length>0){this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:v,items:[{label:c.get(a,"bins.rangeLabel")||"Range",value:`${S} – ${x}`},...C,...c.getProperty(a,"tooltip","showTotal")===!0?[{label:c.get(a,"tooltip.totalLabel")||"Total",value:M.reduce((I,$)=>I+parseFloat(c.get(E,`data.${$}`)),0)}]:[]]}),g.attr("opacity",1);const w=m((S+x)/2);l==="horizontal"?v.attr("x1",u).attr("x2",h).attr("y1",w).attr("y2",w):v.attr("y1",u).attr("y2",h).attr("x1",w).attr("x2",w)}else this.hideRuler()}else this.hideRuler()}}class Sa extends _e{formatTooltipData(e){return e.reverse()}}const xa=(o,e)=>{const t=o.x,s=o.y,n=e.x,a=e.y,i=y.path();return i.moveTo(t,s),i.lineTo(n,a),i.toString()},Ta=(o,e,t=.5)=>{const s=o.x,n=o.y,a=e.x,i=e.y,l=y.path();return l.moveTo(s,n),l.lineTo(s+(a-s)*t,n),l.lineTo(s+(a-s)*t,i),l.lineTo(a,i),l.toString()},Ma=(o,e,t,s,n,a)=>{const i=o.x,l=o.y,d=e.x,h=e.y,u=y.path();return u.moveTo(i,l),u.bezierCurveTo(t,s,n,a,d,h),u.toString()},Ca={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},La={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},Aa={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},Da={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},wa={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},Pa={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class Ra extends wt{constructor(e,t,s){super(e,t,s),this.type="color-legend",this.renderType=r.RenderTypes.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const n=this.getComponentContainer(),{width:a}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),i=c.getProperty(this.getOptions(),"data","loading");if(a>c.legend.color.barWidth&&!i){const l=c.getProperty(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:d}=this.services,u=d.getMainXScale().range();if(u[0]>1&&(n.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),l)){const{width:m}=O.DOMUtils.getSVGElementSize(n.select("g.legend-title").select("text"),{useBBox:!0}),p=u[0]-m-9;p>1?n.select("g.legend-title").attr("transform",`translate(${p}, 0)`):(n.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),n.select("g.legend-title").attr("transform",`translate(${u[0]}, 0)`))}}else n.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=s.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(e=!0){const t=this.getOptions(),s=this.getComponentContainer(),{width:n}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),a=c.getProperty(t,"color","gradient","colors"),i=c.getProperty(t,this.chartType,"colorLegend","type");let l=c.getProperty(t,"color","pairing","option");const d=c.getProperty(t,"heatmap","colorLegend","title");if(c.getProperty(this.getOptions(),"data","loading")){s.html("");return}const u=!c.isEmpty(a),m=c.getDomain(this.model.getDisplayData()),p=!(n<=c.legend.color.barWidth),g=p?c.legend.color.barWidth:n,v=O.DOMUtils.appendOrSelect(s,"g.legend"),f=O.DOMUtils.appendOrSelect(v,"g.legend-axis");if(d){const I=O.DOMUtils.appendOrSelect(s,"g.legend-title");O.DOMUtils.appendOrSelect(I,"text").text(d).attr("dy","0.7em"),v.attr("transform","translate(0, 16)")}const b=m[0]<0&&m[1]>0?"diverge":"mono";(l<1&&l>4&&b==="mono"||l<1&&l>2&&b==="diverge")&&(l=1);let E=[];const S=b==="diverge"?17:11;if(u)E=a;else for(let I=1;I<S+1;I++)E.push(i===r.ColorLegendType.LINEAR?`stop-color-${b}-${l}-${I}`:`fill-${b}-${l}-${I}`);const x=y.interpolateNumber(m[0],m[1]),M=y.quantize(x,3),C=y.scaleLinear().domain(m).range([0,g]),T=y.axisBottom(C).tickSize(0).tickValues(M);let w;switch(i){case r.ColorLegendType.LINEAR:this.drawLinear(E,v,g);break;case r.ColorLegendType.QUANTIZE:w=this.drawQuantize(E,b,u,v,g),C.range([w,g]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${c.legend.color.axisYTranslation})`).call(T),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",p?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",p&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(e,t,s){const n=100/(e.length-1);O.DOMUtils.appendOrSelect(t,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(e).enter().append("stop").attr("offset",(l,d)=>`${d*n}%`).attr("class",(l,d)=>e[d]).attr("stop-color",l=>l),O.DOMUtils.appendOrSelect(t,"rect").attr("width",s).attr("height",c.legend.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(e,t,s,n,a){!s&&t==="diverge"&&e.splice(e.length/2,1);const i=y.scaleBand().domain(e).range([0,a]);return O.DOMUtils.appendOrSelect(n,"g.quantized-rect").selectAll("rect").data(i.domain()).join("rect").attr("x",d=>i(d)).attr("y",0).attr("width",Math.max(0,i.bandwidth()-1)).attr("height",c.legend.color.barHeight).attr("class",d=>d).attr("fill",d=>d),(!s&&t)==="mono"?i.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class ka extends Dt{constructor(){super(...arguments),this.type="meter-title",this.renderType=r.RenderTypes.SVG}render(e=!0){const t=c.getProperty(this.model.getDisplayData(),0),s=this.getOptions(),n=this.getComponentContainer(),{groupMapsTo:a}=s.data;if(c.getProperty(s,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const h=n.selectAll("text.meter-title").data([t[a]]);h.enter().append("text").classed("meter-title",!0).merge(h).attr("x",0).attr("y","1em").text(u=>u),h.exit().remove(),this.appendPercentage()}this.displayStatus();const l=this.getMaxTitleWidth(),d=O.DOMUtils.appendOrSelect(n,"text.meter-title");l>0&&d.node().getComputedTextLength()>l&&this.truncateTitle(d,l)}displayBreakdownTitle(){const e=this.getComponentContainer(),t=this.getOptions(),s=this.model.getMaximumDomain(this.model.getDisplayData()),n=c.getProperty(t,"meter","proportional","total"),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"";let i;if(s===n)i=null;else{const u=n!==null?n-s:s,m=c.getProperty(t,"meter","proportional","breakdownFormatter");i=m!==null?m({datasetsTotal:s,total:n}):`${s} ${a} used (${u} ${a} available)`}const l=e.selectAll("text.proportional-meter-title").data([i]);l.enter().append("text").classed("proportional-meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(u=>u),l.exit().remove();const d=this.getMaxTitleWidth(),h=O.DOMUtils.appendOrSelect(e,"text.proportional-meter-title");d>0&&h.node().getComputedTextLength()>d&&this.truncateTitle(h,d)}displayTotal(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"meter","proportional","total"),n=s?c.getProperty(t,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"",i=c.getProperty(t,"meter","proportional","totalFormatter"),l=i!==null?i(n):`${s} ${a} total`,d=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),h=d.width?d.width:this.parent.node().getAttribute("width"),u=e.selectAll("text.proportional-meter-total").data([l]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof h!="string"?h-c.meter.total.paddingRight:h).attr("y","1em").attr("text-anchor","end").text(m=>m),u.exit().remove()}displayStatus(){const e=this,t=this.getComponentContainer(),s=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=s.width?s.width:0,a=this.model.getStatus(),i=c.meter.status.indicatorSize/2,l=O.DOMUtils.appendOrSelect(t,"g.status-indicator").attr("class",a!==null?`status-indicator status--${a}`:"").attr("transform",`translate(${n-i}, 0)`),d=a?[a]:[],h=l.selectAll("circle.status").data(d);h.enter().append("circle").merge(h).attr("class","status").attr("r",i).attr("cx",0).attr("cy",8);const u=l.selectAll("path.innerFill").data(d);u.enter().append("path").merge(u).attr("d",e.getStatusIconPathString(a)).attr("transform",`translate(-${i}, 0)`).attr("class","innerFill"),u.exit().remove(),h.exit().remove()}appendPercentage(){const e=c.getProperty(this.model.getDisplayData(),0,"value"),t=this.getComponentContainer(),s=O.DOMUtils.appendOrSelect(t,"text.meter-title"),n=c.getProperty(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[e]:[],a=t.selectAll("text.percent-value").data(n),i=c.meter.statusBar.paddingRight;a.enter().append("text").classed("percent-value",!0).merge(a).text(l=>`${l}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+i).attr("y",s.attr("y")),a.exit().remove()}truncateTitle(e,t){super.truncateTitle(e,t);const s=O.DOMUtils.appendOrSelect(this.parent,"tspan"),n=c.meter.statusBar.paddingRight,a=Math.ceil(s.node().getComputedTextLength());O.DOMUtils.appendOrSelect(this.parent,"text.percent-value").attr("x",+e.attr("x")+e.node().getComputedTextLength()+a+n)}getMaxTitleWidth(){const e=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),t=c.getProperty(this.getOptions(),"meter","proportional"),s=e.width?e.width:this.parent.node().getBoundingClientRect().width;if(t!==null){const n=O.DOMUtils.appendOrSelect(this.parent,"text.proportional-meter-total").node(),a=O.DOMUtils.getSVGElementSize(n,{useBBox:!0}).width;return s-a-c.meter.total.paddingLeft}else{const n=O.DOMUtils.appendOrSelect(this.parent,"text.percent-value"),a=c.meter.statusBar.paddingRight,i=n.node().getComputedTextLength(),l=O.DOMUtils.appendOrSelect(this.parent,"g.status-indicator").node(),d=O.DOMUtils.getSVGElementSize(l,{useBBox:!0}).width+c.meter.status.paddingLeft;return s-i-a-d}}getStatusIconPathString(e){switch(e){case r.Statuses.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case r.Statuses.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case r.Statuses.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class ve extends G{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const t=this.model.getDisplayData().length,s=this.services.cartesianScales.getMainXScale(),n=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!s.step){const a=c.getProperty(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,n*a/t)}return Math.min(e.bars.maxWidth,s.step()/2)}isOutsideZoomedDomain(e,t){if(this.model.getDisplayData().length<=1)return!1;const n=this.model.get("zoomDomain");if(n!==void 0){const a=this.services.cartesianScales.getDomainScale();return e<a(n[0])||t>a(n[1])}return!1}}class Ia extends G{constructor(){super(...arguments),this.type="circle-pack",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-circlepack"})).attr("opacity",s=>s.data.dataGroupName===t.datum().name?1:c.circlePack.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;let a=this.model.getDisplayData();const i=this.model.hasParentNode(),l=this.model.getHierarchyLevel(),d=this.getOptions(),h=c.getProperty(d,"canvasZoom","enabled");i&&c.getProperty(a,0,"children")&&(a=c.getProperty(a,0,"children"));const u=y.hierarchy({children:a}).sum(f=>f.value).sort((f,b)=>b.value-f.value),p=y.pack().size([s,n]).padding(f=>f.depth>=1?c.circlePack.padding.children+3:c.circlePack.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=l),g=t.selectAll("circle.node").data(p);g.exit().attr("width",0).attr("height",0).remove();const v=g.enter().append("circle").classed("node",!0);v.merge(g).attr("class",f=>{const b=h&&l===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${b}`:`node node-leaf ${b}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",c.circlePack.circles.fillOpacity),h===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,v,c.canvasZoomSettings),this.setBackgroundListeners()),i||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",s=>this.model.getFillColor(s.data.dataGroupName))}highlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",c.circlePack.circles.hover.stroke)}getZoomClass(e){return this.model.getHierarchyLevel()===3&&this.focal&&(e.data===this.focal.data||this.focal.children.some(t=>t.data===e.data))?"focal":"non-focal"}addLegendListeners(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){y.select(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const e=y.select(this.services.domUtils.getMainContainer()),t=this,s=this.parent.selectAll("circle.node"),n=c.getProperty(c.Configuration,"canvasZoomSettings");e.on("click",()=>{t.focal=null,t.model.updateHierarchyLevel(2),e.classed("zoomed-in",!1),t.services.canvasZoom.zoomOut(s,n)})}getZoomIcon(){return`
77
+ `;p.html(g),v();function v(){p.attr("gradientTransform",`translate(${h-3*.2*d}, 0)`).transition().duration(2e3).delay(1e3).ease(y.easeLinear).attr("gradientTransform",`translate(${u+3*.2*d}, 0)`).on("end",v)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class ca extends G{constructor(){super(...arguments),this.type="boxplot",this.renderType=r.RenderTypes.SVG}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getDataGroupNames(),i=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale(),[d,h]=i.range(),[u,m]=l.range(),p=h-d,g=u-m;if(p===0)return;const{cartesianScales:v}=this.services,f=v.getOrientation(),b=f===r.CartesianOrientations.VERTICAL,[E,S]=c.flipDomainAndRangeBasedOnOrientation(A=>this.services.cartesianScales.getDomainValue(A),A=>this.services.cartesianScales.getRangeValue(A),f),T=Math.floor((b?p:g)/a.length),M=Math.min(T/2,16),C=this.model.getBoxplotData(),x=t.selectAll(".box-group").data(C);x.exit().remove();const w=x.enter().append("g").attr("class","box-group"),I=x.merge(w);w.append("path").merge(x.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalstartline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.quartiles.q_25);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalendline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,R=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.quartiles.q_75);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"box"})).attr("fill-opacity",c.boxplot.box.opacity.default).attr("stroke-width",c.boxplot.strokeWidth.default).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",A=>A[n]).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-quartiles",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(Math[b?"max":"min"](A.quartiles.q_75,A.quartiles.q_25)),F=R+Math.abs(v.getRangeValue(A.quartiles.q_75)-v.getRangeValue(A.quartiles.q_25));return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker start"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-startingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/4,V=L+M/2,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.min);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-median",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(A.quartiles.q_50),F=R;return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker end"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-endingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/4,V=L+M/2,R=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)});const $=I.selectAll("circle.outlier").data(A=>A.outliers.map(L=>({min:A.whiskers.min,max:A.whiskers.max,[n]:A[n],value:L})));$.exit().remove();const _=$.enter().append("circle");$.merge(_).attr("r",c.boxplot.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"outlier"})).attr("fill-opacity",c.boxplot.circle.opacity.default).attr("cx",E).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-circles",animate:e})).attr("cy",S),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",c.boxplot.box.opacity.hovered),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:t.tooltip.groupLabel,value:a[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Minimum",value:a.whiskers.min},{label:"Q1",value:a.quartiles.q_25},{label:"Median",value:a.quartiles.q_50},{label:"Q3",value:a.quartiles.q_75},{label:"Maximum",value:a.whiskers.max},{label:"IQR",value:a.quartiles.q_75-a.quartiles.q_25}]}),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOVER,{event:n,element:i,datum:a})}).on("mousemove",function(n,a){const i=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEMOVE,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){e.services.events.dispatchEvent(r.Events.Boxplot.BOX_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",c.boxplot.box.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOUT,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}addCircleEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(a,i){const l=y.select(this);l.classed("hovered",!0).attr("fill-opacity",c.boxplot.circle.opacity.hovered).classed("unfilled",!1),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:t.tooltip.groupLabel,value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Outlier",value:i[n]}]}),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOVER,{event:a,element:l,datum:i})}).on("mousemove",function(a,i){const l=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEMOVE,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);l.classed("hovered",!1).attr("fill-opacity",c.boxplot.circle.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOUT,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}}class da extends G{constructor(){super(...arguments),this.type="zero-line",this.renderType=r.RenderTypes.SVG}render(e){const t=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),s=this.services.cartesianScales.getScaleByPosition(t),[n,a]=s.domain(),i=n>0&&a<0||n<0&&a>0,l=this.getComponentContainer();if(!i){l.selectAll("line.domain").remove();return}const[d,h]=this.services.cartesianScales.getDomainScale().range();let u=+s(0)+.5;u||(u=s.range()[0]);const m=c.flipSVGCoordinatesBasedOnOrientation({x0:d,x1:h,y0:u,y1:u},this.services.cartesianScales.getOrientation());O.DOMUtils.appendOrSelect(l,"line.domain").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"zero-line-update",animate:e})).attr("y1",m.y0).attr("y2",m.y1).attr("x1",m.x0).attr("x2",m.x1)}}class ha extends me{constructor(){super(...arguments),this.type="bubble",this.renderType=r.RenderTypes.SVG}getRadiusScale(e){const t=this.getOptions(),{radiusMapsTo:s}=t.bubble,n=e.data(),a=n.map(h=>h[s]).filter(h=>h),i=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),l=a.length>0,d=l?y.extent(a):[1,1];return y.scaleLinear().domain(d).range(l?t.bubble.radiusRange(i,n):[4,4])}styleCircles(e,t){const s=this.getOptions(),{radiusMapsTo:n}=s.bubble,a=this.getRadiusScale(e),{groupMapsTo:i}=s.data,{cartesianScales:l}=this.services,d=p=>l.getDomainValue(p),h=p=>l.getRangeValue(p),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,l.getOrientation());e.raise().classed("dot",!0).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",p=>{const g=l.getRangeIdentifier(p);return p[g]}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bubble-update-enter",animate:t})).attr("cx",u).attr("cy",m).attr("r",p=>a(p[n]||1)).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:p[i],originalClassName:"dot"})).style("fill",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getFillColor(p[i],p[g],p)}).style("stroke",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getStrokeColor(p[i],p[g],p)}).attr("fill-opacity",s.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(e){const t=c.getProperty(this.getOptions(),"bubble");return[{label:c.getProperty(t,"radiusLabel"),value:e[c.getProperty(t,"radiusMapsTo")]}]}}class ua extends G{constructor(){super(...arguments),this.type="bullet",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getRangeScale(),l=this.services.cartesianScales.getRangeIdentifier(),[d,h]=i.range(),[,u]=i.domain(),m=()=>{const f=[];a.forEach(S=>{S.ranges?S.ranges.forEach((T,M)=>{T!=null&&T<u&&f.push({datum:S,value:T,order:M+1})}):f.push({datum:S,order:1})});const b=O.DOMUtils.appendOrSelect(n,"g.range-boxes").selectAll("path.range-box").data(f,S=>`${S[s]}-${S.order}`);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`range-box order-${S.order}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-range-box-update-enter",animate:e})).attr("d",S=>{let M,C,x,w;return S.order===1?(M=this.services.cartesianScales.getDomainValue(S.datum)-16/2,C=M+16,x=h-2,w=d+1):(M=this.services.cartesianScales.getDomainValue(S.datum)-16/2,C=M+16,x=this.services.cartesianScales.getRangeValue(S.value),w=h),c.generateSVGPathString({x0:M,x1:C,y0:x,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.bars").selectAll("path.bar").data(a,E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("bar",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-bar-update-enter",animate:e})).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:E[s],originalClassName:"bar"})).style("fill",E=>this.model.getFillColor(E[s])).attr("d",E=>{const T=this.services.cartesianScales.getDomainValue(E)-4,M=T+8,C=this.services.cartesianScales.getRangeValue(0)+1,x=this.services.cartesianScales.getRangeValue(E);return c.generateSVGPathString({x0:T,x1:M,y0:C,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",E=>E.value)},g=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.markers").selectAll("path.marker").data(a.filter(E=>c.getProperty(E,"marker")!==null),E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("marker",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-marker-update-enter",animate:e})).attr("d",E=>{const T=this.services.cartesianScales.getDomainValue(E)-12,M=T+24,C=this.services.cartesianScales.getRangeValue(E.marker),x=C;return c.generateSVGPathString({x0:T,x1:M,y0:C,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},v=()=>{let f=[];a.filter(S=>c.getProperty(S,"marker")!==null).forEach(S=>{const T=S.marker,M=S[l];f=f.concat([{datum:S,value:T*.25,barValue:M},{datum:S,value:T*.5,barValue:M},{datum:S,value:T*.75,barValue:M}])});const b=O.DOMUtils.appendOrSelect(n,"g.quartiles").selectAll("path.quartile").data(f,S=>S[s]);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`quartile ${S.value<=S.barValue?"over-bar":""}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-quartile-update-enter",animate:e})).attr("d",({datum:S,value:T})=>{let M=4;S.ranges&&S.ranges.indexOf(T)!==-1&&(M=8);const C=this.services.cartesianScales.getDomainValue(S)-M/2,x=C+M,w=this.services.cartesianScales.getRangeValue(T),I=w;return c.generateSVGPathString({x0:C,x1:x,y0:w,y1:I},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};m(),p(),g(),v(),this.addEventListeners()}addEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(a,i){const l=y.select(this);l.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:i});const d=c.getProperty(t,"bullet","performanceAreaTitles"),h=e.model.getMatchingRangeIndexForDatapoint(i);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:t.tooltip.groupLabel||"Group",value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[s]})},{label:"Value",value:i[n]},{label:"Target",value:i.marker},{label:"Percentage",value:`${Math.floor(i[n]/i.marker*100)}%`},{label:"Performance",value:d[h]}]})}).on("mousemove",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:a,element:y.select(this),datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);l.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function pa(o){return o}function ga(o){if(o==null)return pa;var e,t,s=o.scale[0],n=o.scale[1],a=o.translate[0],i=o.translate[1];return function(l,d){d||(e=t=0);var h=2,u=l.length,m=new Array(u);for(m[0]=(e+=l[0])*s+a,m[1]=(t+=l[1])*n+i;h<u;)m[h]=l[h],++h;return m}}function ma(o,e){for(var t,s=o.length,n=s-e;n<--s;)t=o[n],o[n++]=o[s],o[s]=t}function va(o,e){return typeof e=="string"&&(e=o.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return et(o,t)})}:et(o,e)}function et(o,e){var t=e.id,s=e.bbox,n=e.properties==null?{}:e.properties,a=Ve(o,e);return t==null&&s==null?{type:"Feature",properties:n,geometry:a}:s==null?{type:"Feature",id:t,properties:n,geometry:a}:{type:"Feature",id:t,bbox:s,properties:n,geometry:a}}function Ve(o,e){var t=ga(o.transform),s=o.arcs;function n(u,m){m.length&&m.pop();for(var p=s[u<0?~u:u],g=0,v=p.length;g<v;++g)m.push(t(p[g],g));u<0&&ma(m,v)}function a(u){return t(u)}function i(u){for(var m=[],p=0,g=u.length;p<g;++p)n(u[p],m);return m.length<2&&m.push(m[0]),m}function l(u){for(var m=i(u);m.length<4;)m.push(m[0]);return m}function d(u){return u.map(l)}function h(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(h)};case"Point":p=a(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(a);break;case"LineString":p=i(u.arcs);break;case"MultiLineString":p=u.arcs.map(i);break;case"Polygon":p=d(u.arcs);break;case"MultiPolygon":p=u.arcs.map(d);break;default:return null}return{type:m,coordinates:p}}return h(e)}function fa(o,e){var t={},s={},n={},a=[],i=-1;e.forEach(function(h,u){var m=o.arcs[h<0?~h:h],p;m.length<3&&!m[1][0]&&!m[1][1]&&(p=e[++i],e[i]=h,e[u]=p)}),e.forEach(function(h){var u=l(h),m=u[0],p=u[1],g,v;if(g=n[m])if(delete n[g.end],g.push(h),g.end=p,v=s[p]){delete s[v.start];var f=v===g?g:g.concat(v);s[f.start=g.start]=n[f.end=v.end]=f}else s[g.start]=n[g.end]=g;else if(g=s[p])if(delete s[g.start],g.unshift(h),g.start=m,v=n[m]){delete n[v.end];var b=v===g?g:v.concat(g);s[b.start=v.start]=n[b.end=g.end]=b}else s[g.start]=n[g.end]=g;else g=[h],s[g.start=m]=n[g.end=p]=g});function l(h){var u=o.arcs[h<0?~h:h],m=u[0],p;return o.transform?(p=[0,0],u.forEach(function(g){p[0]+=g[0],p[1]+=g[1]})):p=u[u.length-1],h<0?[p,m]:[m,p]}function d(h,u){for(var m in h){var p=h[m];delete u[p.start],delete p.start,delete p.end,p.forEach(function(g){t[g<0?~g:g]=1}),a.push(p)}}return d(n,s),d(s,n),e.forEach(function(h){t[h<0?~h:h]||a.push([h])}),a}function ya(o){for(var e=-1,t=o.length,s,n=o[t-1],a=0;++e<t;)s=n,n=o[e],a+=s[0]*n[1]-s[1]*n[0];return Math.abs(a)}function Ea(o){return Ve(o,Oa.apply(this,arguments))}function Oa(o,e){var t={},s=[],n=[];e.forEach(a);function a(d){switch(d.type){case"GeometryCollection":d.geometries.forEach(a);break;case"Polygon":i(d.arcs);break;case"MultiPolygon":d.arcs.forEach(i);break}}function i(d){d.forEach(function(h){h.forEach(function(u){(t[u=u<0?~u:u]||(t[u]=[])).push(d)})}),s.push(d)}function l(d){return ya(Ve(o,{type:"Polygon",arcs:[d]}).coordinates[0])}return s.forEach(function(d){if(!d._){var h=[],u=[d];for(d._=1,n.push(h);d=u.pop();)h.push(d),d.forEach(function(m){m.forEach(function(p){t[p<0?~p:p].forEach(function(g){g._||(g._=1,u.push(g))})})})}}),s.forEach(function(d){delete d._}),{type:"MultiPolygon",arcs:n.map(function(d){var h=[],u;if(d.forEach(function(f){f.forEach(function(b){b.forEach(function(E){t[E<0?~E:E].length<2&&h.push(E)})})}),h=fa(o,h),(u=h.length)>1)for(var m=1,p=l(h[0]),g,v;m<u;++m)(g=l(h[m]))>p&&(v=h[0],h[0]=h[m],h[m]=v,p=g);return h}).filter(function(d){return d.length>0})}}class ba extends _e{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=r.RenderTypes.SVG}showRuler(e,[t,s]){const n=this.parent,a=this.model.getOptions(),{cartesianScales:i}=this.services,l=i.getOrientation(),d=i.getRangeScale(),[h,u]=d.range(),m=i.getDomainScale(),p=m.invert(l===r.CartesianOrientations.VERTICAL?t:s),g=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),v=O.DOMUtils.appendOrSelect(g,"line.ruler-line"),b=n.selectAll("[role=graphics-symbol]").filter(E=>{if(parseFloat(c.get(E,"data.x0"))<=p&&parseFloat(c.get(E,"data.x1"))>=p)return!0});if(b.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!bt(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b;const E=y.select(b.nodes()[0]).datum(),S=parseFloat(c.get(E,"data.x0")),T=parseFloat(c.get(E,"data.x1")),M=this.model.getActiveDataGroupNames(),C=M.reverse().map(w=>({label:w,value:c.get(E,`data.${w}`),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:w})})).filter(w=>w.value!==0);if(C.length>0){this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:v,items:[{label:c.get(a,"bins.rangeLabel")||"Range",value:`${S} – ${T}`},...C,...c.getProperty(a,"tooltip","showTotal")===!0?[{label:c.get(a,"tooltip.totalLabel")||"Total",value:M.reduce((I,$)=>I+parseFloat(c.get(E,`data.${$}`)),0)}]:[]]}),g.attr("opacity",1);const w=m((S+T)/2);l==="horizontal"?v.attr("x1",u).attr("x2",h).attr("y1",w).attr("y2",w):v.attr("y1",u).attr("y2",h).attr("x1",w).attr("x2",w)}else this.hideRuler()}else this.hideRuler()}}class Sa extends _e{formatTooltipData(e){return e.reverse()}}const xa=(o,e)=>{const t=o.x,s=o.y,n=e.x,a=e.y,i=y.path();return i.moveTo(t,s),i.lineTo(n,a),i.toString()},Ta=(o,e,t=.5)=>{const s=o.x,n=o.y,a=e.x,i=e.y,l=y.path();return l.moveTo(s,n),l.lineTo(s+(a-s)*t,n),l.lineTo(s+(a-s)*t,i),l.lineTo(a,i),l.toString()},Ma=(o,e,t,s,n,a)=>{const i=o.x,l=o.y,d=e.x,h=e.y,u=y.path();return u.moveTo(i,l),u.bezierCurveTo(t,s,n,a,d,h),u.toString()},Ca={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},La={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},Aa={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},Da={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},wa={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},Pa={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class Ra extends wt{constructor(e,t,s){super(e,t,s),this.type="color-legend",this.renderType=r.RenderTypes.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const n=this.getComponentContainer(),{width:a}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),i=c.getProperty(this.getOptions(),"data","loading");if(a>c.legend.color.barWidth&&!i){const l=c.getProperty(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:d}=this.services,u=d.getMainXScale().range();if(u[0]>1&&(n.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),l)){const{width:m}=O.DOMUtils.getSVGElementSize(n.select("g.legend-title").select("text"),{useBBox:!0}),p=u[0]-m-9;p>1?n.select("g.legend-title").attr("transform",`translate(${p}, 0)`):(n.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),n.select("g.legend-title").attr("transform",`translate(${u[0]}, 0)`))}}else n.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=s.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(e=!1){const t=this.getOptions(),s=this.getComponentContainer(),{width:n}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),a=c.getProperty(t,"color","gradient","colors"),i=c.getProperty(t,this.chartType,"colorLegend","type");let l=c.getProperty(t,"color","pairing","option");const d=c.getProperty(t,"heatmap","colorLegend","title");if(c.getProperty(this.getOptions(),"data","loading")){s.html("");return}const u=!c.isEmpty(a),m=c.getDomain(this.model.getDisplayData()),p=!(n<=c.legend.color.barWidth),g=p?c.legend.color.barWidth:n,v=O.DOMUtils.appendOrSelect(s,"g.legend"),f=O.DOMUtils.appendOrSelect(v,"g.legend-axis");if(d){const I=O.DOMUtils.appendOrSelect(s,"g.legend-title");O.DOMUtils.appendOrSelect(I,"text").text(d).attr("dy","0.7em"),v.attr("transform","translate(0, 16)")}const b=m[0]<0&&m[1]>0?"diverge":"mono";(l<1&&l>4&&b==="mono"||l<1&&l>2&&b==="diverge")&&(l=1);let E=[];const S=b==="diverge"?17:11;if(u)E=a;else for(let I=1;I<S+1;I++)E.push(i===r.ColorLegendType.LINEAR?`stop-color-${b}-${l}-${I}`:`fill-${b}-${l}-${I}`);const T=y.interpolateNumber(m[0],m[1]),M=y.quantize(T,3),C=y.scaleLinear().domain(m).range([0,g]),x=y.axisBottom(C).tickSize(0).tickValues(M);let w;switch(i){case r.ColorLegendType.LINEAR:this.drawLinear(E,v,g);break;case r.ColorLegendType.QUANTIZE:w=this.drawQuantize(E,b,u,v,g),C.range([w,g]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${c.legend.color.axisYTranslation})`).call(x),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",p?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",p&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(e,t,s){const n=100/(e.length-1);O.DOMUtils.appendOrSelect(t,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(e).enter().append("stop").attr("offset",(l,d)=>`${d*n}%`).attr("class",(l,d)=>e[d]).attr("stop-color",l=>l),O.DOMUtils.appendOrSelect(t,"rect").attr("width",s).attr("height",c.legend.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(e,t,s,n,a){!s&&t==="diverge"&&e.splice(e.length/2,1);const i=y.scaleBand().domain(e).range([0,a]);return O.DOMUtils.appendOrSelect(n,"g.quantized-rect").selectAll("rect").data(i.domain()).join("rect").attr("x",d=>i(d)).attr("y",0).attr("width",Math.max(0,i.bandwidth()-1)).attr("height",c.legend.color.barHeight).attr("class",d=>d).attr("fill",d=>d),(!s&&t)==="mono"?i.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class ka extends Dt{constructor(){super(...arguments),this.type="meter-title",this.renderType=r.RenderTypes.SVG}render(e=!1){const t=c.getProperty(this.model.getDisplayData(),0),s=this.getOptions(),n=this.getComponentContainer(),{groupMapsTo:a}=s.data;if(c.getProperty(s,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const h=n.selectAll("text.meter-title").data([t[a]]);h.enter().append("text").classed("meter-title",!0).merge(h).attr("x",0).attr("y","1em").text(u=>u),h.exit().remove(),this.appendPercentage()}this.displayStatus();const l=this.getMaxTitleWidth(),d=O.DOMUtils.appendOrSelect(n,"text.meter-title");l>0&&d.node().getComputedTextLength()>l&&this.truncateTitle(d,l)}displayBreakdownTitle(){const e=this.getComponentContainer(),t=this.getOptions(),s=this.model.getMaximumDomain(this.model.getDisplayData()),n=c.getProperty(t,"meter","proportional","total"),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"";let i;if(s===n)i=null;else{const u=n!==null?n-s:s,m=c.getProperty(t,"meter","proportional","breakdownFormatter");i=m!==null?m({datasetsTotal:s,total:n}):`${s} ${a} used (${u} ${a} available)`}const l=e.selectAll("text.proportional-meter-title").data([i]);l.enter().append("text").classed("proportional-meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(u=>u),l.exit().remove();const d=this.getMaxTitleWidth(),h=O.DOMUtils.appendOrSelect(e,"text.proportional-meter-title");d>0&&h.node().getComputedTextLength()>d&&this.truncateTitle(h,d)}displayTotal(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"meter","proportional","total"),n=s?c.getProperty(t,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"",i=c.getProperty(t,"meter","proportional","totalFormatter"),l=i!==null?i(n):`${s} ${a} total`,d=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),h=d.width?d.width:this.parent.node().getAttribute("width"),u=e.selectAll("text.proportional-meter-total").data([l]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof h!="string"?h-c.meter.total.paddingRight:h).attr("y","1em").attr("text-anchor","end").text(m=>m),u.exit().remove()}displayStatus(){const e=this,t=this.getComponentContainer(),s=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=s.width?s.width:0,a=this.model.getStatus(),i=c.meter.status.indicatorSize/2,l=O.DOMUtils.appendOrSelect(t,"g.status-indicator").attr("class",a!==null?`status-indicator status--${a}`:"").attr("transform",`translate(${n-i}, 0)`),d=a?[a]:[],h=l.selectAll("circle.status").data(d);h.enter().append("circle").merge(h).attr("class","status").attr("r",i).attr("cx",0).attr("cy",8);const u=l.selectAll("path.innerFill").data(d);u.enter().append("path").merge(u).attr("d",e.getStatusIconPathString(a)).attr("transform",`translate(-${i}, 0)`).attr("class","innerFill"),u.exit().remove(),h.exit().remove()}appendPercentage(){const e=c.getProperty(this.model.getDisplayData(),0,"value"),t=this.getComponentContainer(),s=O.DOMUtils.appendOrSelect(t,"text.meter-title"),n=c.getProperty(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[e]:[],a=t.selectAll("text.percent-value").data(n),i=c.meter.statusBar.paddingRight;a.enter().append("text").classed("percent-value",!0).merge(a).text(l=>`${l}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+i).attr("y",s.attr("y")),a.exit().remove()}truncateTitle(e,t){super.truncateTitle(e,t);const s=O.DOMUtils.appendOrSelect(this.parent,"tspan"),n=c.meter.statusBar.paddingRight,a=Math.ceil(s.node().getComputedTextLength());O.DOMUtils.appendOrSelect(this.parent,"text.percent-value").attr("x",+e.attr("x")+e.node().getComputedTextLength()+a+n)}getMaxTitleWidth(){const e=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),t=c.getProperty(this.getOptions(),"meter","proportional"),s=e.width?e.width:this.parent.node().getBoundingClientRect().width;if(t!==null){const n=O.DOMUtils.appendOrSelect(this.parent,"text.proportional-meter-total").node(),a=O.DOMUtils.getSVGElementSize(n,{useBBox:!0}).width;return s-a-c.meter.total.paddingLeft}else{const n=O.DOMUtils.appendOrSelect(this.parent,"text.percent-value"),a=c.meter.statusBar.paddingRight,i=n.node().getComputedTextLength(),l=O.DOMUtils.appendOrSelect(this.parent,"g.status-indicator").node(),d=O.DOMUtils.getSVGElementSize(l,{useBBox:!0}).width+c.meter.status.paddingLeft;return s-i-a-d}}getStatusIconPathString(e){switch(e){case r.Statuses.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case r.Statuses.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case r.Statuses.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class ve extends G{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const t=this.model.getDisplayData().length,s=this.services.cartesianScales.getMainXScale(),n=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!s.step){const a=c.getProperty(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,n*a/t)}return Math.min(e.bars.maxWidth,s.step()/2)}isOutsideZoomedDomain(e,t){if(this.model.getDisplayData().length<=1)return!1;const n=this.model.get("zoomDomain");if(n!==void 0){const a=this.services.cartesianScales.getDomainScale();return e<a(n[0])||t>a(n[1])}return!1}}class Ia extends G{constructor(){super(...arguments),this.type="circle-pack",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-circlepack"})).attr("opacity",s=>s.data.dataGroupName===t.datum().name?1:c.circlePack.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;let a=this.model.getDisplayData();const i=this.model.hasParentNode(),l=this.model.getHierarchyLevel(),d=this.getOptions(),h=c.getProperty(d,"canvasZoom","enabled");i&&c.getProperty(a,0,"children")&&(a=c.getProperty(a,0,"children"));const u=y.hierarchy({children:a}).sum(f=>f.value).sort((f,b)=>b.value-f.value),p=y.pack().size([s,n]).padding(f=>f.depth>=1?c.circlePack.padding.children+3:c.circlePack.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=l),g=t.selectAll("circle.node").data(p);g.exit().attr("width",0).attr("height",0).remove();const v=g.enter().append("circle").classed("node",!0);v.merge(g).attr("class",f=>{const b=h&&l===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${b}`:`node node-leaf ${b}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",c.circlePack.circles.fillOpacity),h===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,v,c.canvasZoomSettings),this.setBackgroundListeners()),i||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",s=>this.model.getFillColor(s.data.dataGroupName))}highlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",c.circlePack.circles.hover.stroke)}getZoomClass(e){return this.model.getHierarchyLevel()===3&&this.focal&&(e.data===this.focal.data||this.focal.children.some(t=>t.data===e.data))?"focal":"non-focal"}addLegendListeners(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){y.select(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const e=y.select(this.services.domUtils.getMainContainer()),t=this,s=this.parent.selectAll("circle.node");e.on("click",()=>{t.focal=null,t.model.updateHierarchyLevel(2),e.classed("zoomed-in",!1),t.services.canvasZoom.zoomOut(s,c.canvasZoomSettings)})}getZoomIcon(){return`
78
78
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
79
79
  <polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
80
80
  <path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
81
- </svg>`}addEventListeners(){const e=this;this.parent.selectAll("circle.node").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0);const a=e.model.getHierarchyLevel(),i=a>2&&!n.classed("focal"),l=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");let d=!1;if(!i){let h=[],u=[],m=null;if(s.children){s.depth>1&&l&&(d=!0,n.classed("clickable",!0)),h=s.children.map(v=>{if(v!==null)return typeof v.data.value=="number"?{label:v.data.name,value:v.data.value}:{label:v.data.name,labelIcon:l&&a<=2?e.getZoomIcon():null,value:v.value}});const g=e.model.getOptions();u=[{label:c.get(g,"tooltip.totalLabel")||"Total",value:s.value,bold:!0}],e.highlightChildren(s.children)}else m=s.value;const p=getComputedStyle(this,null).getPropertyValue("fill");e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:p,label:s.data.name,labelIcon:d&&l&&a<=2?e.getZoomIcon():null,value:m},...h,...u]})}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),s.children&&e.unhighlightChildren(s.children),e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})}).on("click",function(t,s){const n=y.select(this),a=n.classed("non-focal"),i=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");if(i&&e.model.getHierarchyLevel()>2){const l=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!1),e.focal=null,e.model.updateHierarchyLevel(2),e.services.canvasZoom.zoomOut(l,c.canvasZoomSettings)}else if(s.depth===2&&s.children&&!a&&i){const l=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!0),e.focal=s,e.model.updateHierarchyLevel(3),e.services.canvasZoom.zoomIn(s,l,c.canvasZoomSettings),t.stopPropagation()}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_CLICK,{event:t,element:n,datum:s})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function _a(o,e){const t=y.interpolate(this._current,o);return s=>(this._current=t(s),e(this._current))}class Ut extends G{constructor(){super(...arguments),this.type="pie",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n.data[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return c.pie.innerRadius}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),{groupMapsTo:a}=n.data,{valueMapsTo:i}=n.pie,l=this.model.getDisplayData().filter(L=>L[i]>0),d=this.computeRadius();this.arc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d),this.hoverArc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d+c.pie.hoverArc.outerRadiusOffset);const u=y.pie().value(L=>L[i]).sort(c.getProperty(n,"pie","sortFunction")).padAngle(c.pie.padAngle)(l),p=O.DOMUtils.appendOrSelect(s,"g.slices").attr("role",N.Roles.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[a]);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("slice",!0).attr("opacity",0).merge(p).attr("class",L=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:L.data[a],originalClassName:"slice"})).style("fill",L=>t.model.getFillColor(L.data[a])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:e})).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[i]}, ${c.convertValueToPercentage(L.data[i],l,i)+"%"}`).attrTween("d",function(L){return _a.bind(this)(L,t.arc)});const f=n.pie.labels.enabled,b=f?u.filter(L=>L.data[i]>0):[],S=O.DOMUtils.appendOrSelect(s,"g.labels").attr("role",N.Roles.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(b,L=>L.data[a]);S.exit().attr("opacity",0).remove();const x=S.enter().append("text").classed("pie-label",!0),M=[];x.merge(S).style("text-anchor","middle").text(L=>n.pie.labels.formatter?n.pie.labels.formatter(L):c.convertValueToPercentage(L.data[i],l,i)+"%").datum(function(L){const V=d+7,R=(L.endAngle-L.startAngle)/2+L.startAngle,F=R/Math.PI*180,q=this.getComputedTextLength();return L.textOffsetX=q/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+V)*Math.sin(R),L.yPosition=(L.textOffsetY+V)*-Math.cos(R),L}).attr("transform",function(L,V){const R=b.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(V>=R-2&&F<c.pie.callout.minSliceDegree){let q,H;return L.index===R-1?(q=L.xPosition+c.pie.callout.offsetX+c.pie.callout.textMargin+L.textOffsetX,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.RIGHT,M.push(L)):(q=L.xPosition-c.pie.callout.offsetX-L.textOffsetX-c.pie.callout.textMargin,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.LEFT,M.push(L)),`translate(${q}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(M);const C=c.getProperty(n,"donut")?"donut":"pie",T=c.getProperty(n,C,"alignment"),{width:w}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0}),I=f?c.pie.xOffset:0,$=f?c.pie.yOffset:0;let _=d+I;T===r.Alignments.CENTER?_=w/2:T===r.Alignments.RIGHT&&(_=w-d-c.pie.xOffset);let A=d+$;M.length>0&&(A+=c.pie.yOffsetCallout),s.attr("x",_+7).attr("y",A),this.addEventListeners()}renderCallouts(e){const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",N.Roles.GROUP).attr("data-name","callouts"),s=t.selectAll("g.callout").data(e);s.exit().remove();const n=s.enter().append("g").classed("callout",!0).attr("role",N.Roles.GROUP).attr("aria-roledescription","label callout");n.merge(s).datum(function(l){const{xPosition:d,yPosition:h,direction:u}=l;return u===r.CalloutDirections.RIGHT?(l.startPos={x:d,y:h+l.textOffsetY},l.endPos={x:d+c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+l.textOffsetY},l.intersectPointX=l.endPos.x-c.pie.callout.horizontalLineLength):(l.startPos={x:d,y:h+l.textOffsetY},l.endPos={x:d-c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+l.textOffsetY},l.intersectPointX=l.endPos.x+c.pie.callout.horizontalLineLength),l}),n.append("line").classed("vertical-line",!0).merge(t.selectAll("line.vertical-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",l=>l.startPos.x).attr("y1",l=>l.startPos.y).attr("x2",l=>l.intersectPointX).attr("y2",l=>l.endPos.y),n.append("line").classed("horizontal-line",!0).merge(t.selectAll("line.horizontal-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",l=>l.intersectPointX).attr("y1",l=>l.endPos.y).attr("x2",l=>l.endPos.x).attr("y2",l=>l.endPos.y)}addEventListeners(){const e=this;this.parent.selectAll("path.slice").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0).transition("pie_slice_mouseover").call(l=>e.services.transitions.setupTransition({transition:l,name:"pie_slice_mouseover"})).attr("d",e.hoverArc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOVER,{event:t,element:y.select(this),datum:s});const{groupMapsTo:a}=e.getOptions().data,{valueMapsTo:i}=e.getOptions().pie;e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{label:s.data[a],value:s.data[i]}]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Pie.SLICE_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>e.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",e.arc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}computeRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),s=this.getOptions(),n=Math.min(e,t)/2;return s.pie.labels.enabled?n+c.pie.radiusOffset:n}}class Ua extends Ut{constructor(){super(...arguments),this.type="donut",this.renderType=r.RenderTypes.SVG}render(e=!0){super.render(e);const t=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const s=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.center"),n=this.getOptions(),a=this.computeRadius(),i=c.getProperty(n,"donut","center","label");O.DOMUtils.appendOrSelect(s,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>i===null||i===""?"central":"initial").style("font-size",()=>n.donut.center.numberFontSize(a)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"donut-figure-enter-update",animate:e})).tween("text",function(){return t.centerNumberTween(y.select(this))}),i!==null&&i!==""&&O.DOMUtils.appendOrSelect(s,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>n.donut.center.titleFontSize(a)).attr("y",n.donut.center.titleYPosition(a)).text(i)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(e){const t=this.getOptions();let s=c.getProperty(t,"donut","center","number");s===null&&(s=this.model.getDisplayData().reduce((l,d)=>l+d[t.pie.valueMapsTo],0));const n=parseInt(e.text().replace(/[, ]+/g,""),10)||0;let a;n%1===0&&s%1===0?a=y.interpolateRound:a=y.interpolateNumber;const i=a(n,s);return l=>{const{numberFormatter:d}=t.donut.center;e.text(d(i(l)))}}}const tt="4,10 8,6 12,10",st="12,6 8,10 4,6";class Va extends G{constructor(){super(...arguments),this.type="gauge",this.renderType=r.RenderTypes.SVG}getValue(){var s;return((s=this.model.getData().find(n=>n.group==="value"))==null?void 0:s.value)??null}getValueRatio(){return Ot(this.getValue(),0,100)/100}getDelta(){var s;return((s=this.model.getData().find(n=>n.group==="delta"))==null?void 0:s.value)??null}getArcRatio(){const e=this.getOptions();return c.getProperty(e,"gauge","type")===r.GaugeTypes.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const e=this.getArcSize();return e===2*Math.PI?0:-e/2}getArrow(e){const t=this.getOptions();switch(c.getProperty(t,"gauge","deltaArrow","direction")){case r.ArrowDirections.UP:return tt;case r.ArrowDirections.DOWN:return st;default:return e>0?tt:st}}render(e=!0){const t=this.getComponentContainer().attr("width","100%").attr("height","100%"),s=this.getOptions(),n=this.getValue(),a=this.getValueRatio(),i=this.getArcSize(),l=this.getStartAngle(),d=a*i,h=l+d,u=l+i,m=this.computeRadius(),p=this.getInnerRadius();this.backgroundArc=y.arc().innerRadius(p).outerRadius(m).startAngle(h).endAngle(u),this.arc=y.arc().innerRadius(p).outerRadius(m).startAngle(l).endAngle(h),O.DOMUtils.appendOrSelect(t,"path.arc-background").attr("d",this.backgroundArc);const g=t.selectAll("path.arc-foreground").data([n]);g.enter().append("path").merge(g).attr("class",this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>c.getProperty(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),g.exit().remove();const f=c.getProperty(s,"gauge","alignment"),{width:b}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0});let E=m;f===r.Alignments.CENTER?E=b/2:f===r.Alignments.RIGHT&&(E=b-m),t.attr("x",E).attr("y",m),this.addEventListeners()}drawValueNumber(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"gauge","type"),n=this.getValue(),a=this.getDelta(),i=this.computeRadius(),l=c.getProperty(t,"gauge","valueFontSize"),d=c.getProperty(t,"gauge","deltaFontSize"),h=c.getProperty(t,"gauge","numberSpacing"),u=c.getProperty(t,"gauge","showPercentageSymbol");let m=0;s===r.GaugeTypes.FULL&&!a?m=d(i):s===r.GaugeTypes.SEMI&&a&&(m=-(d(i)+h));const p=O.DOMUtils.appendOrSelect(e,"g.gauge-numbers").attr("transform",`translate(0, ${m})`),g=l(i),v=O.DOMUtils.appendOrSelect(p,"g.gauge-value-number"),f=c.getProperty(t,"gauge","numberFormatter"),b=v.selectAll("text.gauge-value-number").data([n]);b.enter().append("text").attr("class","gauge-value-number").merge(b).style("font-size",`${g}px`).attr("text-anchor","middle").text(w=>f(w));const{width:E}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(e,"text.gauge-value-number"),{useBBox:!0}),S=g/2,x=u?"%":"",M=O.DOMUtils.appendOrSelect(v,"text.gauge-value-symbol").style("font-size",`${S}px`).attr("x",E/2).text(x),{width:C,height:T}=O.DOMUtils.getSVGElementSize(M,{useBBox:!0});M.attr("y",`-${T/2}px`),v.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=this.getDelta();if(n){const a=this.computeRadius(),i=n?c.getProperty(s,"gauge","deltaFontSize"):()=>0,l=n?c.getProperty(s,"gauge","numberFormatter"):()=>null,d=c.getProperty(s,"gauge","deltaArrow","size"),h=c.getProperty(s,"gauge","numberSpacing"),u=c.getProperty(s,"gauge","showPercentageSymbol"),m=O.DOMUtils.appendOrSelect(t,"g.gauge-numbers"),p=O.DOMUtils.appendOrSelect(m,"g.gauge-delta").attr("transform",`translate(0, ${i(a)+h})`),g=O.DOMUtils.appendOrSelect(p,"text.gauge-delta-number"),v=u?"%":"";g.data(n===null?[]:[n]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${i(a)}px`).text(S=>`${l(S)}${v}`);const{width:f}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(t,".gauge-delta-number"),{useBBox:!0}),b=c.getProperty(s,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(n!==null&&b?[n]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-d(a)-f/2).attr("y",-d(a)/2-i(a)*.35).attr("width",d(a)).attr("height",d(a)).attr("viewBox","0 0 16 16").each(function(){const S=y.select(this);O.DOMUtils.appendOrSelect(S,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=c.getProperty(s,"gauge","status");O.DOMUtils.appendOrSelect(S,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",e.getArrow(n))}),E.exit().remove(),g.exit().remove()}else{const a=t.select("g.gauge-delta");a.empty()||a.remove()}}getInnerRadius(){const e=this.computeRadius(),t=c.getProperty(this.getOptions(),"gauge","arcWidth");return e-t}addEventListeners(){const e=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOVER,{event:t,element:y.select(this),datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEMOVE,{event:t,element:n,datum:s})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOUT,{event:t,element:n,datum:s})})}computeRadius(){const e=this.getOptions(),t=c.getProperty(e,"gauge","type"),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return t===r.GaugeTypes.SEMI?Math.min(s/2,n):Math.min(s/2,n/2)}}class Ba extends ve{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=r.RenderTypes.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.model.getDisplayData(this.configs.groups),s=this.getOptions(),{groupMapsTo:n}=s.data;this.setGroupScale();const a=this.getComponentContainer({withinChartClip:!0}),i=c.removeArrayDuplicates(t.map(p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return p[g]&&typeof p[g].toString=="function"?p[g].toString():p[g]})),l=a.selectAll("g.bars").data(i,p=>p);l.exit().attr("opacity",0).remove();const h=l.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP).attr("data-name","bars").merge(l);h.transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-group-update-enter",animate:e})).attr("transform",p=>{const v=this.services.cartesianScales.getDomainValue(p)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?`translate(${v}, 0)`:`translate(0, ${v})`});const u=h.selectAll("path.bar").data(p=>this.getDataCorrespondingToLabel(p),p=>p[n]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-update-enter",animate:e})).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:p[n],originalClassName:"bar"})).style("fill",p=>this.model.getFillColor(p[n])).attr("d",p=>{const g=this.groupScale(p[n]),v=this.getBarWidth(),f=g,b=g+v,E=this.services.cartesianScales.getRangeAxisPosition({datum:p}),S=this.services.cartesianScales.getValueThroughAxisPosition(E,0),x=this.services.cartesianScales.getRangeValue(p),M=this.services.cartesianScales.getDomainValue(p)-v/2,C=M+v;if(!this.isOutsideZoomedDomain(M,C))return c.generateSVGPathString({x0:f,x1:b,y0:S,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",p=>p.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(s=>{const n=this.services.cartesianScales.getDomainIdentifier(s);return s[n].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),t=this.getTotalGroupPadding();return this.getBarWidth()*e.length+t}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),t=this.model.getGroupedData(this.configs.groups);let s=this.defaultStepFactor;if(typeof e.step=="function")s=e.step();else if(t.length>0){const n=t.find(a=>{var i;return((i=a.data)==null?void 0:i.length)>1});if(n){const a=this.services.cartesianScales.getDomainIdentifier(n.data[0]);s=Math.abs(e(n.data[1][a])-e(n.data[0][a]))}}return s}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),t=c.getProperty(e,"bars","width"),s=c.getProperty(e,"bars","maxWidth");if(t!==null&&(s===null||t<=s))return t;const a=this.model.getGroupedData(this.configs.groups).length,i=this.getTotalGroupPadding();return Math.min(s,(this.getDomainScaleStep()-i)/a)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=y.scaleBand().domain(e).rangeRound([0,this.getGroupWidth()])}}class Na extends G{constructor(){super(...arguments),this.type="heatmap",this.renderType=r.RenderTypes.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=e=>{const{detail:t}=e,{datum:s}=t,n=this.model.getUniqueRanges(),a=this.model.getUniqueDomain(),i=this.services.cartesianScales.getDomainLabel(),l=this.services.cartesianScales.getRangeLabel(),d=this.services.cartesianScales.getMainXScale(),h=this.services.cartesianScales.getMainYScale();let u="",m=null,p=null,g=null;this.matrix[s]!==void 0?(u=i,n.forEach(v=>{if(typeof this.matrix[s][v].value=="number"){const f=this.matrix[s][v].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})):(u=l,a.forEach(v=>{if(typeof this.matrix[v][s].value=="number"){const f=this.matrix[v][s].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})),d(s)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${d(s)}, ${y.min(h.range())})`):h(s)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${y.min(d.range())},${h(s)})`),this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t.event,hoveredElement:y.select(e.detail.element),items:[{label:u,value:s,bold:!0},{label:"Min",value:p!==null?p:"-"},{label:"Max",value:g!==null?g:"-"},{label:"Average",value:m!==null?m/a.length:"-"}]})},this.handleAxisMouseOut=e=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:e})}}init(){const e=this.services.events;e.addEventListener(r.Events.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),e.addEventListener(r.Events.Axis.LABEL_FOCUS,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.lower();const{cartesianScales:s}=this.services;if(this.matrix=this.model.getMatrix(),t.html(""),c.getProperty(this.getOptions(),"data","loading"))return;const n=s.getMainXScale(),a=s.getMainYScale(),i=s.getDomainIdentifier(),l=s.getRangeIdentifier(),d=this.model.getUniqueDomain(),h=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),m=n.range(),p=a.range();this.xBandwidth=Math.abs((m[1]-m[0])/d.length),this.yBandwidth=Math.abs((p[1]-p[0])/h.length);const g=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");t.append("defs").append("pattern").attr("id",g).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const v=t.selectAll().data(u).enter().append("g").attr("class",f=>`heat-${f.index}`).classed("cell",!0).attr("transform",f=>`translate(${n(f[i])}, ${a(f[l])})`).append("rect").attr("class",f=>this.model.getColorClassName({value:f.value,originalClassName:`heat-${f.index}`})).classed("heat",!0).classed("null-state",f=>f.index===-1||f.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",f=>f.index===-1||f.value===null?`url(#${g})`:this.model.getFillColor(Number(f.value))).attr("aria-label",f=>f.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(p[1]-p[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(m[1]-m[0]),this.yBandwidth),this.determineDividerStatus()&&(v.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(e,t,s){const n=O.DOMUtils.appendOrSelect(this.parent,e).classed("shadows",!0).classed("highlighter-hidden",!0);O.DOMUtils.appendOrSelect(n,"line.top").attr("x1",-1).attr("x2",t+1),O.DOMUtils.appendOrSelect(n,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",s+1),O.DOMUtils.appendOrSelect(n,"line.down").attr("x1",-1).attr("x2",t+1).attr("y1",s).attr("y2",s),O.DOMUtils.appendOrSelect(n,"line.right").attr("x1",t).attr("x2",t).attr("y1",-1).attr("y2",s+1)}determineDividerStatus(){const e=c.getProperty(this.getOptions(),"heatmap","divider","state");return e!==r.DividerStatus.OFF&&(e===r.DividerStatus.AUTO&&c.heatmap.minCellDividerDimension<=this.xBandwidth&&c.heatmap.minCellDividerDimension<=this.yBandwidth||e===r.DividerStatus.ON)}addEventListener(){const e=this,{cartesianScales:t}=this.services,s=this.getOptions(),n=c.get(s,"tooltip.totalLabel"),a=t.getDomainIdentifier(),i=t.getRangeIdentifier(),l=t.getDomainLabel(),d=t.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(h,u){const m=y.select(this),p=m.select("rect.heat");if(!p.classed("null-state")){const v=c.getTransformOffsets(m.attr("transform"));e.parent.select("g.cell-highlight").attr("transform",`translate(${v.x+e.translationUnits.x}, ${v.y+e.translationUnits.y})`).classed("highlighter-hidden",!1),e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOVER,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,items:[{label:l,value:u[a]},{label:d,value:u[i]},{label:n||"Total",value:u.value,color:p.style("fill")}]})}}).on("mousemove",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){const p=y.select(this).select("rect.heat"),g=p.classed("null-state");e.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),g||(e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOUT,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:h,hoveredElement:p}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleAxisOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class Ga extends G{constructor(){super(...arguments),this.type="histogram",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[n]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer(),s=this.model.getOptions(),{groupIdentifier:n}=s,{groupMapsTo:a}=s.data,i=this.model.getBinnedStackedData(),l=this.services.cartesianScales.getMainXScale(),d=t.selectAll("g.bars").data(i,u=>c.get(u,`0.${a}`));d.exit().attr("opacity",0).remove(),d.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP);const h=t.selectAll("g.bars").selectAll("path.bar").data(u=>u);h.exit().remove(),h.enter().append("path").merge(h).classed("bar",!0).attr(n,(u,m)=>m).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:u[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a])).attr("d",u=>{const m=c.get(u,"data");if(!m)return;const p=l(m.x1)-l(m.x0)-1,g=this.services.cartesianScales.getDomainValue(m.x0),v=g+p,f=this.services.cartesianScales.getRangeValue(u[0]);let b=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(b-f)>0&&Math.abs(b-f)>s.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?b+=1:b-=1),c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>c.getProperty(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const e=this.model.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0);const l=parseFloat(c.get(a,"data.x0")),d=parseFloat(c.get(a,"data.x1")),h=s.services.cartesianScales.getRangeAxisPosition(),u=s.services.cartesianScales.getScaleLabel(h);s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:c.get(e,"bins.rangeLabel")||"Range",value:`${l} – ${d}`},{label:e.tooltip.groupLabel||"Group",value:a[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:a[t]})},{label:u,value:c.get(a,`data.${a[t]}`)}]})}).on("mousemove",function(n){s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("mouseout",function(){y.select(this).classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class $a extends me{constructor(){super(...arguments),this.type="lollipop",this.renderType=r.RenderTypes.SVG,this.handleScatterOnHover=e=>{const t=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[n]!==t.datum[n]?c.lines.weight.unselected:c.lines.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",c.lines.weight.unselected)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[n]!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.model.getOptions(),{groupMapsTo:n}=s.data,{cartesianScales:a}=this.services,i=a.getMainXScale(),l=a.getMainYScale(),d=a.getDomainIdentifier(),h=E=>a.getDomainValue(E),u=E=>a.getRangeValue(E),m=a.getOrientation(),[p,g]=c.flipDomainAndRangeBasedOnOrientation(h,u,m),v=t.selectAll("line.line").data(this.getScatterData(),E=>`${E[n]}-${E[d]}`);v.exit().attr("opacity",0).remove();const b=v.enter().append("line").attr("opacity",0).merge(v).classed("line",!0).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E[n],originalClassName:"line"})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"lollipop-line-update-enter",animate:e})).style("stroke",E=>this.model.getFillColor(E[n],E[d],E)).attr("opacity",1);m===r.CartesianOrientations.HORIZONTAL?b.attr("y1",g).attr("y2",g).attr("x1",i.range()[0]).attr("x2",E=>p(E)-s.points.radius):b.attr("x1",p).attr("x2",p).attr("y1",l.range()[0]).attr("y2",E=>g(E)+s.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class Ha extends G{constructor(){super(...arguments),this.type="meter",this.renderType=r.RenderTypes.SVG}getStackedBounds(e,t){let s=0;return e.map((a,i)=>i!==0?(s+=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:s-t(a.value)}):(s=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:0}))}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),a=c.getProperty(n,"meter","proportional"),i=this.model.getDisplayData(),l=this.model.getStatus(),{width:d}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{groupMapsTo:h}=n.data;let u;if(c.getProperty(n,"meter","proportional")===null)u=100;else{const x=c.getProperty(n,"meter","proportional","total");u=x||this.model.getMaximumDomain(this.model.getDisplayData())}const m=y.scaleLinear().domain([0,u]).range([0,d]),p=this.getStackedBounds(i,m),g=c.getProperty(n,"meter","height");O.DOMUtils.appendOrSelect(s,"rect.container").attr("x",0).attr("y",0).attr("width",d).attr("height",g||(a?c.meter.height.proportional:c.meter.height.default)),O.DOMUtils.appendOrSelect(s,"line.rangeIndicator").attr("x1",d).attr("x2",d).attr("y1",0).attr("y2",g||(a?c.meter.height.proportional:c.meter.height.default));const v=s.selectAll("rect.value").data(p),f=l!=null&&!t.model.isUserProvidedColorScaleValid()&&!a?`value status--${l}`:"value";v.enter().append("rect").classed("value",!0).merge(v).attr("x",x=>x.x).attr("y",0).attr("height",()=>{const x=c.getProperty(n,"meter","height");return x||(a?c.meter.height.proportional:c.meter.height.default)}).attr("class",x=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:x[h],originalClassName:f})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:e})).attr("width",x=>x.value>u?m(u):x.width).style("fill",x=>t.model.getFillColor(x[h])).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),v.exit().remove();const b=c.getProperty(n,"meter","peak");let E=b;b!==null&&(b>u?E=u:b<i[0].value&&(E=i[0].value>u?u:i[0].value));const S=s.selectAll("line.peak").data(E==null?[]:[E]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>{const x=c.getProperty(n,"meter","height");return x||(a?c.meter.height.proportional:c.meter.height.default)}).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:e})).attr("x1",x=>m(x)).attr("x2",x=>m(x)).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=c.getProperty(e,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOVER,{event:a,element:l,datum:i}),n&&(l.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:i[t],value:i.value}]}))}).on("mousemove",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEMOVE,{event:a,element:l,datum:i}),n&&s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.Meter.METER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOUT,{event:a,element:l,datum:i}),n&&(l.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class za extends G{constructor(){super(...arguments),this.type="radar",this.renderType=r.RenderTypes.SVG,this.getLabelDimensions=e=>{const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),s=O.DOMUtils.appendOrSelect(t,"text").text(e),{width:n,height:a}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return t.remove(),{width:n,height:a}},this.normalizeFlatData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo"),i=Rs(this.uniqueKeys.map(l=>this.uniqueGroups.map(d=>({[s]:l,[a]:d,[n]:null}))));return c.merge(i,e)},this.normalizeGroupedData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo");return e.map(({name:i,data:l})=>{const d=this.uniqueKeys.map(h=>({[a]:i,[s]:h,[n]:null}));return{name:i,data:c.merge(d,l)}})},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-blob"})).style("fill-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:c.radar.opacity.selected).style("stroke-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-blob"})).style("fill-opacity",c.radar.opacity.selected).style("stroke-opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer(),{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),a=this.model.getData(),i=this.model.getGroupedData(),l=this.getOptions(),d=c.getProperty(l,"data","groupMapsTo"),h=c.getProperty(l,"radar","axes","value"),{angle:u,value:m}=c.getProperty(l,"radar","axes"),{xLabelPadding:p,yLabelPadding:g,yTicksNumber:v,minRange:f,xAxisRectHeight:b}=c.radar;this.uniqueKeys=Array.from(new Set(a.map(D=>D[u]))),this.uniqueGroups=Array.from(new Set(a.map(D=>D[d]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(i);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+g),C=(Math.min(s,n)-S)/2;if(C<=0)return;const T=y.scaleBand().domain(this.fullDataNormalized.map(D=>D[u])).range([0,2*Math.PI].map(D=>D-Math.PI/2)),w=y.min(this.fullDataNormalized.map(D=>D[m])),I=y.scaleLinear().domain([w>=0?0:w,y.max(this.fullDataNormalized.map(D=>D[m]))]).range([f,C]).nice(v),$=I.ticks(v),_=D=>this.model.getFillColor(D),A=y.lineRadial().angle(D=>T(D[u])+Math.PI/2).radius(D=>I(D[m])).curve(y.curveLinearClosed),L=this.uniqueKeys.map(D=>{const P=this.getLabelDimensions(D).width,k=O.distanceBetweenPointOnCircAndVerticalDiameter(T(D),C);return P+k}),R={x:y.max(L)+p,y:n/2},q=O.DOMUtils.appendOrSelect(t,"g.y-axes").attr("role",N.Roles.GROUP).selectAll("path").data($,D=>D),H=D=>this.uniqueKeys.map(P=>({[u]:P,[m]:D}));q.join(D=>D.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:e})).attr("opacity",1).attr("d",k=>A(H(k)))),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:e})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>A(H(k)))),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:e})).attr("d",k=>A(H(k))).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-axes").attr("role",N.Roles.GROUP).selectAll("line").data(this.uniqueKeys,D=>D).join(D=>D.append("line").attr("opacity",0).attr("class",P=>`x-axis-${J(P)}`).attr("stroke-dasharray","0").attr("x1",P=>O.polarToCartesianCoords(T(P),0,R).x).attr("y1",P=>O.polarToCartesianCoords(T(P),0,R).y).attr("x2",P=>O.polarToCartesianCoords(T(P),0,R).x).attr("y2",P=>O.polarToCartesianCoords(T(P),0,R).y).call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:e})).attr("opacity",1).attr("x1",k=>O.polarToCartesianCoords(T(k),I.range()[0],R).x).attr("y1",k=>O.polarToCartesianCoords(T(k),I.range()[0],R).y).attr("x2",k=>O.polarToCartesianCoords(T(k),I.range()[1],R).x).attr("y2",k=>O.polarToCartesianCoords(T(k),I.range()[1],R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:e})).attr("opacity",1).attr("x1",k=>O.polarToCartesianCoords(T(k),I.range()[0],R).x).attr("y1",k=>O.polarToCartesianCoords(T(k),I.range()[0],R).y).attr("x2",k=>O.polarToCartesianCoords(T(k),I.range()[1],R).x).attr("y2",k=>O.polarToCartesianCoords(T(k),I.range()[1],R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-labels").attr("role",N.Roles.GROUP).selectAll("text").data(this.uniqueKeys).join(D=>D.append("text").text(P=>P).attr("opacity",0).attr("x",P=>O.polarToCartesianCoords(T(P),I.range()[1]+p,R).x).attr("y",P=>O.polarToCartesianCoords(T(P),I.range()[1]+p,R).y).style("text-anchor",P=>O.radialLabelPlacement(T(P)).textAnchor).style("dominant-baseline",P=>O.radialLabelPlacement(T(P)).dominantBaseline).call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:e})).attr("opacity",1).attr("x",k=>O.polarToCartesianCoords(T(k),I.range()[1]+p,R).x).attr("y",k=>O.polarToCartesianCoords(T(k),I.range()[1]+p,R).y).end().finally(()=>{const k=c.getProperty(l,"radar","alignment"),K=this.getAlignmentXOffset(k,t,this.getParent());t.attr("x",K)})),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.blobs").attr("role",N.Roles.GROUP).selectAll("path").data(this.groupedDataNormalized,D=>D.name).join(D=>D.append("path").attr("class",P=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:P.name,originalClassName:"blob"})).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",P=>P.name).attr("opacity",0).attr("transform",e?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",P=>_(P.name)).style("fill-opacity",c.radar.opacity.selected).style("stroke",P=>_(P.name)).call(P=>{const k=P.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_enter",animate:e}));e&&k.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),k.attr("opacity",1).attr("d",K=>A(K.data))}),D=>(D.attr("class",P=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:P.name,originalClassName:"blob"})).style("fill",P=>_(P.name)).style("stroke",P=>_(P.name)),D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:e})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>A(k.data))),D),D=>D.call(P=>{const k=P.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_exit",animate:e}));e&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),O.DOMUtils.appendOrSelect(t,"g.dots").attr("role",N.Roles.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(D=>c.getProperty(D,m)!==null)).join(D=>D.append("circle").attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",P=>P[h]),D=>D,D=>D.remove()).attr("class",D=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:D[d],originalClassName:J(D[u])})).attr("cx",D=>O.polarToCartesianCoords(T(D[u]),I(D[m]),R).x).attr("cy",D=>O.polarToCartesianCoords(T(D[u]),I(D[m]),R).y).attr("r",0).attr("opacity",0).style("fill",D=>_(D[d])),O.DOMUtils.appendOrSelect(t,"g.x-axes-rect").attr("role",N.Roles.GROUP).selectAll("rect").data(this.uniqueKeys).join(D=>D.append("rect"),D=>D,D=>D.remove()).attr("x",R.x).attr("y",R.y-b/2).attr("width",I.range()[1]).attr("height",b).style("fill","red").style("fill-opacity",0).attr("transform",D=>`rotate(${O.radToDeg(T(D))}, ${R.x}, ${R.y})`),O.DOMUtils.appendOrSelect(t,"g.y-labels").attr("role",N.Roles.GROUP).selectAll("text").data(y.extent($)).join(D=>D.append("text").attr("opacity",0).text(P=>P).attr("x",P=>O.polarToCartesianCoords(-Math.PI/2,I(P),R).x+g).attr("y",P=>O.polarToCartesianCoords(-Math.PI/2,I(P),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:e})).text(k=>k).attr("opacity",1).attr("x",k=>O.polarToCartesianCoords(-Math.PI/2,I(k),R).x+g).attr("y",k=>O.polarToCartesianCoords(-Math.PI/2,I(k),R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_exit",animate:e})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(e,t,s){const n=O.DOMUtils.getSVGElementSize(t,{useBBox:!0}),{width:a}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});let i=0;return e===r.Alignments.CENTER?i=Math.floor((a-n.width)/2):e===r.Alignments.RIGHT&&(i=a-n.width),i}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const e=this,{axes:{angle:t}}=c.getProperty(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOVER,{event:s,element:a,datum:n});const i=e.parent.select(`.x-axes .x-axis-${J(n)}`),l=e.parent.selectAll(`.dots circle.${J(n)}`),d=e.model.getActiveDataGroupNames(),h=e.getOptions(),{groupMapsTo:u}=h.data,m=c.getProperty(h,"radar","axes","value");i.classed("hovered",!0).attr("stroke-dasharray","4 4"),l.classed("hovered",!0).attr("opacity",g=>d.indexOf(g[u])!==-1?1:0).attr("r",c.radar.dotsRadius);const p=e.fullDataNormalized.filter(g=>g[t]===n&&d.indexOf(g[u])!==-1);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,items:p.filter(g=>typeof g[m]=="number").map(g=>({label:g[u],value:g[m],color:e.model.getFillColor(g[u]),class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:g[u]})}))})}).on("mousemove",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEMOVE,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=e.parent.select(`.x-axes .x-axis-${J(n)}`),l=e.parent.selectAll(`.dots circle.${J(n)}`);i.classed("hovered",!1).attr("stroke-dasharray","0"),l.classed("hovered",!1).attr("opacity",0).attr("r",0),e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}class Fa extends ve{constructor(){super(...arguments),this.type="simple-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getOrientation(),l=n.selectAll("path.bar").data(a,h=>h[s]);l.exit().attr("opacity",0).remove(),l.enter().append("path").attr("opacity",0).merge(l).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[s],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[s])).attr("d",h=>{const u=this.services.cartesianScales.getRangeIdentifier(),m=this.getBarWidth(),p=h[u],g=this.services.cartesianScales.getDomainValue(h)-m/2,v=g+m;let f,b;if(Array.isArray(p)&&p.length===2)f=this.services.cartesianScales.getRangeValue(p[0]),b=this.services.cartesianScales.getRangeValue(p[1]);else{const x=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,x)),b=this.services.cartesianScales.getRangeValue(h)}const E=Math.abs(b-f);if(E!==0&&E<2&&(p>0&&i===r.CartesianOrientations.VERTICAL||p<0&&i===r.CartesianOrientations.HORIZONTAL?b=f-2:b=f+2),!this.isOutsideZoomedDomain(g,v))return c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},i)}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:y.select(this),datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Wa extends _t{constructor(){super(...arguments),this.type="skeleton-lines"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading"),s=!c.getProperty(this.getOptions(),"grid","x","enabled")&&!c.getProperty(this.getOptions(),"grid","y","enabled")&&!c.getProperty(this.getOptions(),"axes","bottom","visible")&&!c.getProperty(this.getOptions(),"axes","left","visible");t&&!s?super.renderGridSkeleton(t):t&&s?this.renderSparklineSkeleton(t):this.removeSkeleton()}renderSparklineSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawSparkline(e),this.updateBackdropStyle(),e&&this.setShimmerEffect("shimmer-lines")}drawSparkline(e){const t=this.backdrop.attr("width"),s=[100],n=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),a=n.selectAll("line").data(s);a.enter().append("line").merge(a).attr("x1",0).attr("x2",t).attr("y1",i=>i).attr("y2",i=>i),n.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-skeleton.DAII"),O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class ja extends G{constructor(){super(...arguments),this.type="area-stacked",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>c.getProperty(a,0,n)!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this,n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(v=>n.axes[v].percentage),l=this.model.getStackedData({percentage:i,groups:this.configs.groups}),d=c.getProperty(l,0,0),h=this.services.cartesianScales.getDomainAxisPosition({datum:d}),u=this.services.cartesianScales.getRangeAxisPosition({datum:d}),m=this.services.cartesianScales.getScaleByPosition(u),p=t.selectAll("path.area").data(l,v=>c.getProperty(v,0,a));this.areaGenerator=y.area().x(v=>this.services.cartesianScales.getValueThroughAxisPosition(h,v.data.sharedStackKey)).y0(v=>m(v[0])).y1(v=>m(v[1])).curve(this.services.curves.getD3Curve()),p.exit().attr("opacity",0).remove(),p.enter().append("path").attr("opacity",0).merge(p).data(l,v=>c.getProperty(v,0,a)).attr("class","area").attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:c.getProperty(v,0,a),originalClassName:"area"})).style("fill",v=>s.model.getFillColor(c.getProperty(v,0,a))).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",v=>c.getProperty(v,0,a)).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"area-update-enter",animate:e})).attr("opacity",c.area.opacity.selected).attr("d",this.areaGenerator)}}class Za extends ve{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),i=this.model.getActiveDataGroupNames(),l=t.selectAll("g.bars").data(a,h=>c.getProperty(h,0,n));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP).attr("data-name","bars");const d=t.selectAll("g.bars").selectAll("path.bar").data(h=>h,h=>h.data.sharedStackKey);d.exit().remove(),d.enter().append("path").merge(d).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[n],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[n])).attr("d",h=>{const u=h.data.sharedStackKey,m=this.getBarWidth(),p=this.services.cartesianScales.getDomainValue(u)-m/2,g=p+m,v=this.services.cartesianScales.getRangeValue(h[0]);let f=this.services.cartesianScales.getRangeValue(h[1]);if(!this.isOutsideZoomedDomain(p,g)){if(Math.abs(f-v)>0&&Math.abs(f-v)>s.bars.dividerSize){const b=h[0]<0&&h[1]<=0;b&&i.length>1?this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=h[1]===0?2:1:f-=1:b||(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=1:f-=1)}return c.generateSVGPathString({x0:p,x1:g,y0:v,y1:f},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h[1]-h[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:a});let d=s.model.getDisplayData(s.configs.groups).find(h=>{const u=s.services.cartesianScales.getDomainIdentifier(h),m=s.services.cartesianScales.getRangeIdentifier(h);return h[m]===a.data[a[t]]&&h[u].toString()===a.data.sharedStackKey&&h[t]===a[t]});if(d===void 0){const h=s.services.cartesianScales.getDomainIdentifier(),u=s.services.cartesianScales.getRangeIdentifier();d={[h]:a.data.sharedStackKey,[u]:a.data[a[t]],[t]:a[t]}}s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,data:[d]})}).on("mousemove",function(n,a){const i=y.select(this);s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){s.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);i.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}getBarWidth(){const e=this.getOptions();if(c.getProperty(e,"bars","width"))return e.bars.width;const t=this.services.cartesianScales.getMainXScale(),s=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width,n=this.model.getStackKeys().length,a=c.getProperty(e,"bars","spacingFactor");return t.step?Math.min(e.bars.maxWidth,t.step()/2):Math.min(e.bars.maxWidth,s*a/n)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Xa extends me{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=r.RenderTypes.SVG}render(e){if(!c.getProperty(this.getOptions(),"points","enabled"))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(g=>n.axes[g].percentage),l=this.model.getStackedData({groups:this.configs.groups,percentage:i}),d=s.selectAll("g.dots").data(l,g=>c.getProperty(g,0,a));d.exit().attr("opacity",0).remove();const u=d.enter().append("g").classed("dots",!0).attr("role",N.Roles.GROUP).merge(d).selectAll("circle.dot").data(g=>g);u.exit().attr("opacity",0).remove();const p=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(g=>{const v=g[a],f=this.services.cartesianScales.getDomainIdentifier(g),b=this.services.cartesianScales.getRangeIdentifier(g);return{[a]:v,[f]:g.data.sharedStackKey,[b]:g[1]}});this.styleCircles(p,e),this.addEventListeners()}getTooltipData(e,t){const s=this.getOptions(),{groupMapsTo:n}=s.data,a=Object.keys(s.axes).some(d=>s.axes[d].percentage),i=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=[];return i.forEach((d,h)=>{d.forEach((u,m)=>{const p=u[n],g=u.data.sharedStackKey;let v=u.data[p];const f=u[1],b=this.services.cartesianScales.getDomainIdentifier(u),E=this.services.cartesianScales.getRangeIdentifier(u);v!=null&&e===this.services.cartesianScales.getDomainValue(g)&&t===this.services.cartesianScales.getRangeValue(f)&&(a&&(v=this.model.getStackedData({groups:this.configs.groups})[h][m].data[p]),v!==null&&l.push({[n]:p,[b]:g,[E]:v}))})}),this.model.getDisplayData(this.configs.groups).filter(d=>{const h=this.services.cartesianScales.getDomainIdentifier(d),u=this.services.cartesianScales.getRangeIdentifier(d);return l.find(m=>m[n]==d[n]&&m[h]==d[h]&&m[u]==d[u])!==void 0})}}const ee=6;class qa extends G{constructor(){super(...arguments),this.type="tree",this.renderType=r.RenderTypes.SVG}getLongestLabel(e){let t="";return e.forEach(s=>{const n=s.children?this.getLongestLabel(s.children):"";(n.length>t.length||s.name.length>t.length)&&(t=n.length>s.name.length?n:s.name)}),t}getMockLabelWidth(e,t){const s=e.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(t),{width:n}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return s.remove(),n}render(e=!0){const t=this.getComponentContainer();t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),l=c.getProperty(a,"tree","rootTitle")||"Tree",d=this.getMockLabelWidth(t,l),h=this.getLongestLabel(i),u=this.getMockLabelWidth(t,h),m={top:0,right:0,bottom:0,left:d>0?d+ee:30-ee},p=y.hierarchy({name:l,children:i}),g=10,v=s/6,f=T=>{const w=p.descendants().reverse(),I=p.links();let $=p,_=p;p.eachBefore(B=>{B.x<$.x&&($=B),B.x>_.x&&(_=B)});const A=_.x-$.x,L=t.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-m.left,$.x,s,A].join(" ")),V=C.selectAll("g").data(w,B=>B.id),R=this,F=V.enter().append("g").attr("transform",()=>`translate(${T.y0},${T.x0})`).attr("class",B=>B.depth!==0&&B.children&&B.children.length>0?"clickable":null).on("mouseover",function(B,X){R.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOVER,{event:B,element:y.select(this),datum:X})}).on("click",function(B,X){X.depth!==0&&(X.children=X.children?null:X._children,f(X)),R.services.events.dispatchEvent(r.Events.Tree.NODE_CLICK,{event:B,element:y.select(this),datum:X})}).on("mouseout",function(B,X){R.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOUT,{event:B,element:y.select(this),datum:X})});F.append("circle").attr("r",2.5).attr("class",B=>B._children?"parent":"child").attr("stroke-width",10),F.append("text").attr("dy","0.31em").attr("x",B=>B._children?-ee:ee).attr("text-anchor",B=>B._children?"end":"start").text(B=>B.data.name).clone(!0).attr("class","text-stroke").lower(),V.merge(F).transition(L).attr("transform",B=>`translate(${B.y},${B.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),V.exit().transition(L).remove().attr("transform",()=>`translate(${T.y},${T.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const q=M.selectAll("path").data(I,B=>B.target.id),H=q.enter().append("path").attr("d",()=>{const B={x:T.x0,y:T.y0};return x({source:B,target:B})});q.merge(H).transition(L).attr("d",x),q.exit().transition(L).remove().attr("d",()=>{const B={x:T.x,y:T.y};return x({source:B,target:B})}),p.eachBefore(B=>{B.x0=B.x,B.y0=B.y})},b=p.descendants(),E=b[b.length-1].depth,S=c.getProperty(a,"tree","type")===r.TreeTypes.DENDROGRAM?y.cluster().size([n,s-u-E*ee-d]):y.tree().nodeSize([g,v]).size([n,s-u-E*ee-d]),x=y.linkHorizontal().x(T=>T.y).y(T=>T.x);p.x0=v/2,p.y0=0,p.descendants().forEach((T,w)=>{T.id=w,T._children=T.children}),S(p),t.attr("viewBox",[-m.left,-m.top,s,g]).style("user-select","none");const M=t.append("g").attr("class","links"),C=t.append("g").attr("class","nodes");f(p)}}var Ya="#000000",Ka="#ffffff",Ja="#fcf4d6",Qa="#fddc69",ei="#f1c21b",ti="#d2a106",si="#b28600",ni="#8e6a00",ai="#684e00",ii="#483700",ri="#302400",oi="#1c1500",li={10:Ja,20:Qa,30:ei,40:ti,50:si,60:ni,70:ai,80:ii,90:ri,100:oi},ci="#fff2e8",di="#ffd9be",hi="#ffb784",ui="#ff832b",pi="#eb6200",gi="#ba4e00",mi="#8a3800",vi="#5e2900",fi="#3e1a00",yi="#231000",Ei={10:ci,20:di,30:hi,40:ui,50:pi,60:gi,70:mi,80:vi,90:fi,100:yi},Oi="#fff1f1",bi="#ffd7d9",Si="#ffb3b8",xi="#ff8389",Ti="#fa4d56",Mi="#da1e28",Ci="#a2191f",Li="#750e13",Ai="#520408",Di="#2d0709",wi={10:Oi,20:bi,30:Si,40:xi,50:Ti,60:Mi,70:Ci,80:Li,90:Ai,100:Di},Pi="#fff0f7",Ri="#ffd6e8",ki="#ffafd2",Ii="#ff7eb6",_i="#ee5396",Ui="#d02670",Vi="#9f1853",Bi="#740937",Ni="#510224",Gi="#2a0a18",$i={10:Pi,20:Ri,30:ki,40:Ii,50:_i,60:Ui,70:Vi,80:Bi,90:Ni,100:Gi},Hi="#f6f2ff",zi="#e8daff",Fi="#d4bbff",Wi="#be95ff",ji="#a56eff",Zi="#8a3ffc",Xi="#6929c4",qi="#491d8b",Yi="#31135e",Ki="#1c0f30",Ji={10:Hi,20:zi,30:Fi,40:Wi,50:ji,60:Zi,70:Xi,80:qi,90:Yi,100:Ki},Qi="#edf5ff",er="#d0e2ff",tr="#a6c8ff",sr="#78a9ff",nr="#4589ff",ar="#0f62fe",ir="#0043ce",rr="#002d9c",or="#001d6c",lr="#001141",cr={10:Qi,20:er,30:tr,40:sr,50:nr,60:ar,70:ir,80:rr,90:or,100:lr},dr="#e5f6ff",hr="#bae6ff",ur="#82cfff",pr="#33b1ff",gr="#1192e8",mr="#0072c3",vr="#00539a",fr="#003a6d",yr="#012749",Er="#061727",Or={10:dr,20:hr,30:ur,40:pr,50:gr,60:mr,70:vr,80:fr,90:yr,100:Er},br="#d9fbfb",Sr="#9ef0f0",xr="#3ddbd9",Tr="#08bdba",Mr="#009d9a",Cr="#007d79",Lr="#005d5d",Ar="#004144",Dr="#022b30",wr="#081a1c",Pr={10:br,20:Sr,30:xr,40:Tr,50:Mr,60:Cr,70:Lr,80:Ar,90:Dr,100:wr},Rr="#defbe6",kr="#a7f0ba",Ir="#6fdc8c",_r="#42be65",Ur="#24a148",Vr="#198038",Br="#0e6027",Nr="#044317",Gr="#022d0d",$r="#071908",Hr={10:Rr,20:kr,30:Ir,40:_r,50:Ur,60:Vr,70:Br,80:Nr,90:Gr,100:$r},zr="#f2f4f8",Fr="#dde1e6",Wr="#c1c7cd",jr="#a2a9b0",Zr="#878d96",Xr="#697077",qr="#4d5358",Yr="#343a3f",Kr="#21272a",Jr="#121619",Qr={10:zr,20:Fr,30:Wr,40:jr,50:Zr,60:Xr,70:qr,80:Yr,90:Kr,100:Jr},eo="#f4f4f4",to="#e0e0e0",so="#c6c6c6",no="#a8a8a8",ao="#8d8d8d",io="#6f6f6f",ro="#525252",oo="#393939",lo="#262626",co="#161616",ho={10:eo,20:to,30:so,40:no,50:ao,60:io,70:ro,80:oo,90:lo,100:co},uo="#f7f3f2",po="#e5e0df",go="#cac5c4",mo="#ada8a8",vo="#8f8b8b",fo="#726e6e",yo="#565151",Eo="#3c3838",Oo="#272525",bo="#171414",So={10:uo,20:po,30:go,40:mo,50:vo,60:fo,70:yo,80:Eo,90:Oo,100:bo},nt={black:{100:Ya},blue:cr,coolGray:Qr,cyan:Or,gray:ho,green:Hr,magenta:$i,orange:Ei,purple:Ji,red:wi,teal:Pr,warmGray:So,white:{0:Ka},yellow:li};const xo=o=>{if(!o)return null;for(const e of Object.keys(nt)){const t=nt[e];for(const s of Object.keys(t))if(t[+s]===o)return s}return null},at=function(){const o=y.select(this.parentNode).select("rect.leaf"),e=getComputedStyle(o.node(),null).getPropertyValue("fill"),t=y.color(e);let s;if(t&&(s=xo(t?t.hex():null)),s==null){const n=y.hsl(t).l;s=Math.abs(n*100-100)}return s>50?"white":"black"};let To=0;class Mo extends G{constructor(){super(...arguments),this.type="treemap",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-treemap"})).attr("opacity",s=>s.parent.data.name===t.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer();this.model.getData();const s=this.model.getDisplayData(),n=this.model.getOptions(),a=c.getProperty(window,"location"),{width:i,height:l}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),d=y.hierarchy({name:n.title||"Treemap",children:s}).sum(f=>f.value).sort((f,b)=>b.value-f.value),h=y.treemap().size([i,l]).paddingInner(1).paddingOuter(0).round(!0)(d),u=t.selectAll("g[data-name='leaf']").data(h.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const p=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>To++).merge(u);p.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:e})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const g=p.selectAll("rect.leaf").data(f=>[f]);g.exit().attr("width",0).attr("height",0).remove(),g.enter().append("rect").classed("leaf",!0).merge(g).attr("width",0).attr("height",0).attr("id",function(){const f=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:e})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),p.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const b=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-clip-${b}`}).append("use").attr("xlink:href",function(){const b=y.select(this.parentNode.parentNode).attr("data-uid"),E=`${n.style.prefix}-leaf-${b}`;return new URL(`#${E}`,a)+""}),f=>null,f=>f.remove()),p.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let b=f;for(;b.depth>1;)b=b.parent;const E=y.hsl(this.model.getFillColor(b.data.name));return[{text:f.data.name,color:E.l<.5?"white":"black"}]},f=>f).join(f=>{const b=f.append("text").text(E=>E.text).style("fill",at).attr("x",7).attr("y",18);return a&&b.attr("clip-path",function(){const E=y.select(this.parentNode).attr("data-uid"),S=`${n.style.prefix}-clip-${E}`;return`url(${new URL(`#${S}`,a)+""})`}),b},f=>f.text(b=>b.text).style("fill",at),f=>f.remove()),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("rect.leaf").on("mouseover",function(t,s){const n=y.select(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),i=s;for(;i.depth>1;)i=i.parent;n.transition("graph_element_mouseover_fill_update").call(l=>e.services.transitions.setupTransition({transition:l,name:"graph_element_mouseover_fill_update"})).style("fill",l=>{const d=e.model.getFillColor(l.parent.data.name);return d&&(a=d),y.color(a).darker(.7).toString()}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:a,label:i.data.name,bold:!0},{label:s.data.name,value:s.data.value}]}),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Treemap.LEAF_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1);let a=s;for(;a.depth>1;)a=a.parent;n.transition().call(i=>e.services.transitions.setupTransition({transition:i,name:"graph_element_mouseout_fill_update"})).style("fill",i=>e.model.getFillColor(i.parent.data.name)),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}}class Co extends G{constructor(){super(...arguments),this.type="wordcloud",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-wordcloud"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this,s=this.getComponentContainer().attr("width","100%").attr("height","100%"),n=this.model.getDisplayData(),a=this.getFontSizeScale(n),i=this.getOptions(),{fontSizeMapsTo:l,wordMapsTo:d}=i.wordCloud,{groupMapsTo:h}=i.data,{width:u,height:m}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});if(u===0||m===0)return;const p=Bt().size([u,m]).words(n.map(function(v){const f=v[l];if(typeof v[l]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[h]:v[h],text:v[d],size:f,value:f}})).padding(5).rotate(0).fontSize(v=>a(v.size)).on("end",g);p.start();function g(v){const f=O.DOMUtils.appendOrSelect(s,"g.words");f.attr("transform",`translate(${p.size()[0]/2}, ${p.size()[1]/2})`);const b=f.selectAll("text").data(v,S=>`${S[h]}-${S.text}`);b.exit().attr("opacity",0).remove(),b.enter().append("text").attr("opacity",0).merge(b).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>t.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:S[h],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>t.model.getFillColor(S[h],S.text,S)).attr("text-anchor","middle").transition().call(S=>t.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:e})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(e){const t=this.getOptions(),{fontSizeMapsTo:s}=t.wordCloud,n=e.map(d=>d[s]).filter(d=>d),a=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=n.length>0,l=i?y.extent(n):[1,1];return y.scaleLinear().domain(l).range(i?t.wordCloud.fontSizeRange(a,e):[4,4])}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=O.debounce(a=>{const i=s.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(l=>s.services.transitions.setupTransition({transition:l,name:"wordcloud-word-mouse-highlight"}));a===null?i.attr("opacity",1):i.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,i){const l=this;n(l),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOVER,{event:a,element:y.select(this),datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:e.tooltip.wordLabel,value:i.text},{label:e.tooltip.valueLabel,value:i.value},{label:e.tooltip.groupLabel,value:i[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[t]})}]})}).on("mousemove",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEMOVE,{element:l,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.WordCloud.WORD_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);n(null),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOUT,{event:a,element:l,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}}class Vt extends G{constructor(){super(...arguments),this.type="geo",this.renderType=r.RenderTypes.SVG}render(){const e=this.getComponentContainer({withinChartClip:!0}),{width:t,height:s}=O.DOMUtils.getSVGElementSize(e,{useAttrs:!0});if(t<1||s<1)return;const n=this.getProjection(),a=c.getProperty(this.getOptions(),"geoData"),i=this.model.getCombinedData(),l={},d={};Object.keys(i).forEach(E=>{typeof i[E].value=="number"?l[E]=i[E]:d[E]=i[E]});const h=Ea(a,Object.values(d)),u=va(a,{type:"GeometryCollection",geometries:Object.values(l)}),m=n.fitSize([t,s],u),p=y.geoPath().projection(m);O.DOMUtils.appendOrSelect(e,"g.geo").selectAll("path").data(u.features).join("path").attr("d",p);const v=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=O.DOMUtils.appendOrSelect(e,"defs");O.DOMUtils.appendOrSelect(f,"pattern").attr("id",v).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",y.line()([[0,0],[0,10]]));const b=O.DOMUtils.appendOrSelect(e,"g.missing-data");O.DOMUtils.appendOrSelect(b,"path").datum(h).attr("d",p).style("fill",`url(#${v})`)}getProjection(){let e=null;switch(c.getProperty(this.getOptions(),"thematic","projection")){case r.Projection.geoEqualEarth:e=y.geoEqualEarth();break;case r.Projection.geoAlbers:e=y.geoAlbers();break;case r.Projection.geoConicEqualArea:e=y.geoConicEqualArea();break;case r.Projection.geoConicEquidistant:e=y.geoConicEquidistant();break;case r.Projection.geoEquirectangular:e=y.geoEquirectangular();break;case r.Projection.geoMercator:e=y.geoMercator();break;case r.Projection.geoNaturalEarth1:e=y.geoNaturalEarth1();break;default:throw new Error("Projection is not supported.")}return e}}class Lo extends Vt{constructor(){super(...arguments),this.type="choropleth"}render(e=!0){super.render();const t=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",a=>this.model.getColorClassName({value:t[a.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const e=this,t=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOVER,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.SHOW,{event:s,hoveredElement:a,items:[{label:n.properties.NAME,value:t[n.properties.NAME].value}]})}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEMOVE,{event:s,element:y.select(this),datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_CLICK,{event:s,element:y.select(this),datum:t[n.properties.NAME]})}).on("mouseout",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOUT,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.HIDE,{event:s,hoveredElement:a})})}}exports.Alluvial=na;exports.Area=ia;exports.Axis=Ue;exports.AxisChartsTooltip=sa;exports.Bar=ve;exports.BinnedRuler=ba;exports.Boxplot=ca;exports.Bubble=ha;exports.Bullet=ua;exports.CanvasChartClip=Jn;exports.ChartBrush=kt;exports.ChartClip=Pt;exports.Choropleth=Lo;exports.CirclePack=Ia;exports.ColorScaleLegend=Ra;exports.Component=G;exports.Donut=Ua;exports.Gauge=Va;exports.GeoProjection=Vt;exports.Grid=aa;exports.GroupedBar=Ba;exports.Heatmap=Na;exports.Highlight=ta;exports.Histogram=Ga;exports.HoverAxis=It;exports.LayoutComponent=Mt;exports.Legend=wt;exports.Line=ra;exports.Lollipop=$a;exports.Meter=Ha;exports.MeterTitle=ka;exports.Modal=Kn;exports.Pie=Ut;exports.Radar=za;exports.Ruler=_e;exports.Scatter=me;exports.SimpleBar=Fa;exports.Skeleton=_t;exports.SkeletonLines=Wa;exports.Spacer=Us;exports.StackedArea=ja;exports.StackedBar=Za;exports.StackedRuler=Sa;exports.StackedScatter=Xa;exports.Threshold=ea;exports.Title=Dt;exports.Toolbar=xt;exports.Tooltip=Rt;exports.Tree=qa;exports.Treemap=Mo;exports.TwoDimensionalAxes=la;exports.WordCloud=Co;exports.ZeroLine=da;exports.ZoomBar=Qn;exports.arrowLeft=Ca;exports.arrowRight=La;exports.buildBezierPathString=Ma;exports.buildElbowPathString=Ta;exports.buildStraightPathString=xa;exports.circle=Aa;exports.createCompounder=Et;exports.diamond=Da;exports.square=wa;exports.tee=Pa;
82
- //# sourceMappingURL=choropleth-f46a0864.js.map
81
+ </svg>`}addEventListeners(){const e=this;this.parent.selectAll("circle.node").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0);const a=e.model.getHierarchyLevel(),i=a>2&&!n.classed("focal"),l=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");let d=!1;if(!i){let h=[],u=[],m=null;if(s.children){s.depth>1&&l&&(d=!0,n.classed("clickable",!0)),h=s.children.map(v=>{if(v!==null)return typeof v.data.value=="number"?{label:v.data.name,value:v.data.value}:{label:v.data.name,labelIcon:l&&a<=2?e.getZoomIcon():null,value:v.value}});const g=e.model.getOptions();u=[{label:c.get(g,"tooltip.totalLabel")||"Total",value:s.value,bold:!0}],e.highlightChildren(s.children)}else m=s.value;const p=getComputedStyle(this,null).getPropertyValue("fill");e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:p,label:s.data.name,labelIcon:d&&l&&a<=2?e.getZoomIcon():null,value:m},...h,...u]})}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),s.children&&e.unhighlightChildren(s.children),e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})}).on("click",function(t,s){const n=y.select(this),a=n.classed("non-focal"),i=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");if(i&&e.model.getHierarchyLevel()>2){const l=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!1),e.focal=null,e.model.updateHierarchyLevel(2),e.services.canvasZoom.zoomOut(l,c.canvasZoomSettings)}else if(s.depth===2&&s.children&&!a&&i){const l=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!0),e.focal=s,e.model.updateHierarchyLevel(3),e.services.canvasZoom.zoomIn(s,l,c.canvasZoomSettings),t.stopPropagation()}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_CLICK,{event:t,element:n,datum:s})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function _a(o,e){const t=y.interpolate(this._current,o);return s=>(this._current=t(s),e(this._current))}class Ut extends G{constructor(){super(...arguments),this.type="pie",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n.data[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return c.pie.innerRadius}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),{groupMapsTo:a}=n.data,{valueMapsTo:i}=n.pie,l=this.model.getDisplayData().filter(L=>L[i]>0),d=this.computeRadius();this.arc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d),this.hoverArc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d+c.pie.hoverArc.outerRadiusOffset);const u=y.pie().value(L=>L[i]).sort(c.getProperty(n,"pie","sortFunction")).padAngle(c.pie.padAngle)(l),p=O.DOMUtils.appendOrSelect(s,"g.slices").attr("role",N.Roles.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[a]);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("slice",!0).attr("opacity",0).merge(p).attr("class",L=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:L.data[a],originalClassName:"slice"})).style("fill",L=>t.model.getFillColor(L.data[a])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:e})).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[i]}, ${c.convertValueToPercentage(L.data[i],l,i)+"%"}`).attrTween("d",function(L){return _a.bind(this)(L,t.arc)});const f=n.pie.labels.enabled,b=f?u.filter(L=>L.data[i]>0):[],S=O.DOMUtils.appendOrSelect(s,"g.labels").attr("role",N.Roles.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(b,L=>L.data[a]);S.exit().attr("opacity",0).remove();const T=S.enter().append("text").classed("pie-label",!0),M=[];T.merge(S).style("text-anchor","middle").text(L=>n.pie.labels.formatter?n.pie.labels.formatter(L):c.convertValueToPercentage(L.data[i],l,i)+"%").datum(function(L){const V=d+7,R=(L.endAngle-L.startAngle)/2+L.startAngle,F=R/Math.PI*180,q=this.getComputedTextLength();return L.textOffsetX=q/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+V)*Math.sin(R),L.yPosition=(L.textOffsetY+V)*-Math.cos(R),L}).attr("transform",function(L,V){const R=b.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(V>=R-2&&F<c.pie.callout.minSliceDegree){let q,H;return L.index===R-1?(q=L.xPosition+c.pie.callout.offsetX+c.pie.callout.textMargin+L.textOffsetX,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.RIGHT,M.push(L)):(q=L.xPosition-c.pie.callout.offsetX-L.textOffsetX-c.pie.callout.textMargin,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.LEFT,M.push(L)),`translate(${q}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(M);const C=c.getProperty(n,"donut")?"donut":"pie",x=c.getProperty(n,C,"alignment"),{width:w}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0}),I=f?c.pie.xOffset:0,$=f?c.pie.yOffset:0;let _=d+I;x===r.Alignments.CENTER?_=w/2:x===r.Alignments.RIGHT&&(_=w-d-c.pie.xOffset);let A=d+$;M.length>0&&(A+=c.pie.yOffsetCallout),s.attr("x",_+7).attr("y",A),this.addEventListeners()}renderCallouts(e){const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",N.Roles.GROUP).attr("data-name","callouts"),s=t.selectAll("g.callout").data(e);s.exit().remove();const n=s.enter().append("g").classed("callout",!0).attr("role",N.Roles.GROUP).attr("aria-roledescription","label callout");n.merge(s).datum(function(l){const{xPosition:d,yPosition:h,direction:u}=l;return u===r.CalloutDirections.RIGHT?(l.startPos={x:d,y:h+l.textOffsetY},l.endPos={x:d+c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+l.textOffsetY},l.intersectPointX=l.endPos.x-c.pie.callout.horizontalLineLength):(l.startPos={x:d,y:h+l.textOffsetY},l.endPos={x:d-c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+l.textOffsetY},l.intersectPointX=l.endPos.x+c.pie.callout.horizontalLineLength),l}),n.append("line").classed("vertical-line",!0).merge(t.selectAll("line.vertical-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",l=>l.startPos.x).attr("y1",l=>l.startPos.y).attr("x2",l=>l.intersectPointX).attr("y2",l=>l.endPos.y),n.append("line").classed("horizontal-line",!0).merge(t.selectAll("line.horizontal-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",l=>l.intersectPointX).attr("y1",l=>l.endPos.y).attr("x2",l=>l.endPos.x).attr("y2",l=>l.endPos.y)}addEventListeners(){const e=this;this.parent.selectAll("path.slice").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0).transition("pie_slice_mouseover").call(l=>e.services.transitions.setupTransition({transition:l,name:"pie_slice_mouseover"})).attr("d",e.hoverArc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOVER,{event:t,element:y.select(this),datum:s});const{groupMapsTo:a}=e.getOptions().data,{valueMapsTo:i}=e.getOptions().pie;e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{label:s.data[a],value:s.data[i]}]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Pie.SLICE_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>e.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",e.arc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}computeRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),s=this.getOptions(),n=Math.min(e,t)/2;return s.pie.labels.enabled?n+c.pie.radiusOffset:n}}class Ua extends Ut{constructor(){super(...arguments),this.type="donut",this.renderType=r.RenderTypes.SVG}render(e=!0){super.render(e);const t=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const s=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.center"),n=this.getOptions(),a=this.computeRadius(),i=c.getProperty(n,"donut","center","label");O.DOMUtils.appendOrSelect(s,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>i===null||i===""?"central":"initial").style("font-size",()=>n.donut.center.numberFontSize(a)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"donut-figure-enter-update",animate:e})).tween("text",function(){return t.centerNumberTween(y.select(this))}),i!==null&&i!==""&&O.DOMUtils.appendOrSelect(s,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>n.donut.center.titleFontSize(a)).attr("y",n.donut.center.titleYPosition(a)).text(i)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(e){const t=this.getOptions();let s=c.getProperty(t,"donut","center","number");s===null&&(s=this.model.getDisplayData().reduce((l,d)=>l+d[t.pie.valueMapsTo],0));const n=parseInt(e.text().replace(/[, ]+/g,""),10)||0;let a;n%1===0&&s%1===0?a=y.interpolateRound:a=y.interpolateNumber;const i=a(n,s);return l=>{const{numberFormatter:d}=t.donut.center;e.text(d(i(l)))}}}const tt="4,10 8,6 12,10",st="12,6 8,10 4,6";class Va extends G{constructor(){super(...arguments),this.type="gauge",this.renderType=r.RenderTypes.SVG}getValue(){var s;return((s=this.model.getData().find(n=>n.group==="value"))==null?void 0:s.value)??null}getValueRatio(){return Ot(this.getValue(),0,100)/100}getDelta(){var s;return((s=this.model.getData().find(n=>n.group==="delta"))==null?void 0:s.value)??null}getArcRatio(){const e=this.getOptions();return c.getProperty(e,"gauge","type")===r.GaugeTypes.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const e=this.getArcSize();return e===2*Math.PI?0:-e/2}getArrow(e){const t=this.getOptions();switch(c.getProperty(t,"gauge","deltaArrow","direction")){case r.ArrowDirections.UP:return tt;case r.ArrowDirections.DOWN:return st;default:return e>0?tt:st}}render(e=!0){const t=this.getComponentContainer().attr("width","100%").attr("height","100%"),s=this.getOptions(),n=this.getValue(),a=this.getValueRatio(),i=this.getArcSize(),l=this.getStartAngle(),d=a*i,h=l+d,u=l+i,m=this.computeRadius(),p=this.getInnerRadius();this.backgroundArc=y.arc().innerRadius(p).outerRadius(m).startAngle(h).endAngle(u),this.arc=y.arc().innerRadius(p).outerRadius(m).startAngle(l).endAngle(h),O.DOMUtils.appendOrSelect(t,"path.arc-background").attr("d",this.backgroundArc);const g=t.selectAll("path.arc-foreground").data([n]);g.enter().append("path").merge(g).attr("class",this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>c.getProperty(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),g.exit().remove();const f=c.getProperty(s,"gauge","alignment"),{width:b}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0});let E=m;f===r.Alignments.CENTER?E=b/2:f===r.Alignments.RIGHT&&(E=b-m),t.attr("x",E).attr("y",m),this.addEventListeners()}drawValueNumber(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"gauge","type"),n=this.getValue(),a=this.getDelta(),i=this.computeRadius(),l=c.getProperty(t,"gauge","valueFontSize"),d=c.getProperty(t,"gauge","deltaFontSize"),h=c.getProperty(t,"gauge","numberSpacing"),u=c.getProperty(t,"gauge","showPercentageSymbol");let m=0;s===r.GaugeTypes.FULL&&!a?m=d(i):s===r.GaugeTypes.SEMI&&a&&(m=-(d(i)+h));const p=O.DOMUtils.appendOrSelect(e,"g.gauge-numbers").attr("transform",`translate(0, ${m})`),g=l(i),v=O.DOMUtils.appendOrSelect(p,"g.gauge-value-number"),f=c.getProperty(t,"gauge","numberFormatter"),b=v.selectAll("text.gauge-value-number").data([n]);b.enter().append("text").attr("class","gauge-value-number").merge(b).style("font-size",`${g}px`).attr("text-anchor","middle").text(w=>f(w));const{width:E}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(e,"text.gauge-value-number"),{useBBox:!0}),S=g/2,T=u?"%":"",M=O.DOMUtils.appendOrSelect(v,"text.gauge-value-symbol").style("font-size",`${S}px`).attr("x",E/2).text(T),{width:C,height:x}=O.DOMUtils.getSVGElementSize(M,{useBBox:!0});M.attr("y",`-${x/2}px`),v.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=this.getDelta();if(n){const a=this.computeRadius(),i=n?c.getProperty(s,"gauge","deltaFontSize"):()=>0,l=n?c.getProperty(s,"gauge","numberFormatter"):()=>null,d=c.getProperty(s,"gauge","deltaArrow","size"),h=c.getProperty(s,"gauge","numberSpacing"),u=c.getProperty(s,"gauge","showPercentageSymbol"),m=O.DOMUtils.appendOrSelect(t,"g.gauge-numbers"),p=O.DOMUtils.appendOrSelect(m,"g.gauge-delta").attr("transform",`translate(0, ${i(a)+h})`),g=O.DOMUtils.appendOrSelect(p,"text.gauge-delta-number"),v=u?"%":"";g.data(n===null?[]:[n]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${i(a)}px`).text(S=>`${l(S)}${v}`);const{width:f}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(t,".gauge-delta-number"),{useBBox:!0}),b=c.getProperty(s,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(n!==null&&b?[n]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-d(a)-f/2).attr("y",-d(a)/2-i(a)*.35).attr("width",d(a)).attr("height",d(a)).attr("viewBox","0 0 16 16").each(function(){const S=y.select(this);O.DOMUtils.appendOrSelect(S,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const T=c.getProperty(s,"gauge","status");O.DOMUtils.appendOrSelect(S,"polygon.gauge-delta-arrow").attr("class",T!==null?`gauge-delta-arrow status--${T}`:"").attr("points",e.getArrow(n))}),E.exit().remove(),g.exit().remove()}else{const a=t.select("g.gauge-delta");a.empty()||a.remove()}}getInnerRadius(){const e=this.computeRadius(),t=c.getProperty(this.getOptions(),"gauge","arcWidth");return e-t}addEventListeners(){const e=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOVER,{event:t,element:y.select(this),datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEMOVE,{event:t,element:n,datum:s})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOUT,{event:t,element:n,datum:s})})}computeRadius(){const e=this.getOptions(),t=c.getProperty(e,"gauge","type"),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return t===r.GaugeTypes.SEMI?Math.min(s/2,n):Math.min(s/2,n/2)}}class Ba extends ve{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=r.RenderTypes.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.model.getDisplayData(this.configs.groups),s=this.getOptions(),{groupMapsTo:n}=s.data;this.setGroupScale();const a=this.getComponentContainer({withinChartClip:!0}),i=c.removeArrayDuplicates(t.map(p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return p[g]&&typeof p[g].toString=="function"?p[g].toString():p[g]})),l=a.selectAll("g.bars").data(i,p=>p);l.exit().attr("opacity",0).remove();const h=l.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP).attr("data-name","bars").merge(l);h.transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-group-update-enter",animate:e})).attr("transform",p=>{const v=this.services.cartesianScales.getDomainValue(p)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?`translate(${v}, 0)`:`translate(0, ${v})`});const u=h.selectAll("path.bar").data(p=>this.getDataCorrespondingToLabel(p),p=>p[n]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-update-enter",animate:e})).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:p[n],originalClassName:"bar"})).style("fill",p=>this.model.getFillColor(p[n])).attr("d",p=>{const g=this.groupScale(p[n]),v=this.getBarWidth(),f=g,b=g+v,E=this.services.cartesianScales.getRangeAxisPosition({datum:p}),S=this.services.cartesianScales.getValueThroughAxisPosition(E,0),T=this.services.cartesianScales.getRangeValue(p),M=this.services.cartesianScales.getDomainValue(p)-v/2,C=M+v;if(!this.isOutsideZoomedDomain(M,C))return c.generateSVGPathString({x0:f,x1:b,y0:S,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",p=>p.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(s=>{const n=this.services.cartesianScales.getDomainIdentifier(s);return s[n].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),t=this.getTotalGroupPadding();return this.getBarWidth()*e.length+t}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),t=this.model.getGroupedData(this.configs.groups);let s=this.defaultStepFactor;if(typeof e.step=="function")s=e.step();else if(t.length>0){const n=t.find(a=>{var i;return((i=a.data)==null?void 0:i.length)>1});if(n){const a=this.services.cartesianScales.getDomainIdentifier(n.data[0]);s=Math.abs(e(n.data[1][a])-e(n.data[0][a]))}}return s}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),t=c.getProperty(e,"bars","width"),s=c.getProperty(e,"bars","maxWidth");if(t!==null&&(s===null||t<=s))return t;const a=this.model.getGroupedData(this.configs.groups).length,i=this.getTotalGroupPadding();return Math.min(s,(this.getDomainScaleStep()-i)/a)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=y.scaleBand().domain(e).rangeRound([0,this.getGroupWidth()])}}class Na extends G{constructor(){super(...arguments),this.type="heatmap",this.renderType=r.RenderTypes.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=e=>{const{detail:t}=e,{datum:s}=t,n=this.model.getUniqueRanges(),a=this.model.getUniqueDomain(),i=this.services.cartesianScales.getDomainLabel(),l=this.services.cartesianScales.getRangeLabel(),d=this.services.cartesianScales.getMainXScale(),h=this.services.cartesianScales.getMainYScale();let u="",m=null,p=null,g=null;this.matrix[s]!==void 0?(u=i,n.forEach(v=>{if(typeof this.matrix[s][v].value=="number"){const f=this.matrix[s][v].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})):(u=l,a.forEach(v=>{if(typeof this.matrix[v][s].value=="number"){const f=this.matrix[v][s].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})),d(s)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${d(s)}, ${y.min(h.range())})`):h(s)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${y.min(d.range())},${h(s)})`),this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t.event,hoveredElement:y.select(e.detail.element),items:[{label:u,value:s,bold:!0},{label:"Min",value:p!==null?p:"-"},{label:"Max",value:g!==null?g:"-"},{label:"Average",value:m!==null?m/a.length:"-"}]})},this.handleAxisMouseOut=e=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:e})}}init(){const e=this.services.events;e.addEventListener(r.Events.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),e.addEventListener(r.Events.Axis.LABEL_FOCUS,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.lower();const{cartesianScales:s}=this.services;if(this.matrix=this.model.getMatrix(),t.html(""),c.getProperty(this.getOptions(),"data","loading"))return;const n=s.getMainXScale(),a=s.getMainYScale(),i=s.getDomainIdentifier(),l=s.getRangeIdentifier(),d=this.model.getUniqueDomain(),h=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),m=n.range(),p=a.range();this.xBandwidth=Math.abs((m[1]-m[0])/d.length),this.yBandwidth=Math.abs((p[1]-p[0])/h.length);const g=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");t.append("defs").append("pattern").attr("id",g).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const v=t.selectAll().data(u).enter().append("g").attr("class",f=>`heat-${f.index}`).classed("cell",!0).attr("transform",f=>`translate(${n(f[i])}, ${a(f[l])})`).append("rect").attr("class",f=>this.model.getColorClassName({value:f.value,originalClassName:`heat-${f.index}`})).classed("heat",!0).classed("null-state",f=>f.index===-1||f.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",f=>f.index===-1||f.value===null?`url(#${g})`:this.model.getFillColor(Number(f.value))).attr("aria-label",f=>f.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(p[1]-p[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(m[1]-m[0]),this.yBandwidth),this.determineDividerStatus()&&(v.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(e,t,s){const n=O.DOMUtils.appendOrSelect(this.parent,e).classed("shadows",!0).classed("highlighter-hidden",!0);O.DOMUtils.appendOrSelect(n,"line.top").attr("x1",-1).attr("x2",t+1),O.DOMUtils.appendOrSelect(n,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",s+1),O.DOMUtils.appendOrSelect(n,"line.down").attr("x1",-1).attr("x2",t+1).attr("y1",s).attr("y2",s),O.DOMUtils.appendOrSelect(n,"line.right").attr("x1",t).attr("x2",t).attr("y1",-1).attr("y2",s+1)}determineDividerStatus(){const e=c.getProperty(this.getOptions(),"heatmap","divider","state");return e!==r.DividerStatus.OFF&&(e===r.DividerStatus.AUTO&&c.heatmap.minCellDividerDimension<=this.xBandwidth&&c.heatmap.minCellDividerDimension<=this.yBandwidth||e===r.DividerStatus.ON)}addEventListener(){const e=this,{cartesianScales:t}=this.services,s=this.getOptions(),n=c.get(s,"tooltip.totalLabel"),a=t.getDomainIdentifier(),i=t.getRangeIdentifier(),l=t.getDomainLabel(),d=t.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(h,u){const m=y.select(this),p=m.select("rect.heat");if(!p.classed("null-state")){const v=c.getTransformOffsets(m.attr("transform"));e.parent.select("g.cell-highlight").attr("transform",`translate(${v.x+e.translationUnits.x}, ${v.y+e.translationUnits.y})`).classed("highlighter-hidden",!1),e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOVER,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,items:[{label:l,value:u[a]},{label:d,value:u[i]},{label:n||"Total",value:u.value,color:p.style("fill")}]})}}).on("mousemove",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){const p=y.select(this).select("rect.heat"),g=p.classed("null-state");e.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),g||(e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOUT,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:h,hoveredElement:p}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleAxisOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class Ga extends G{constructor(){super(...arguments),this.type="histogram",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[n]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer(),s=this.model.getOptions(),{groupIdentifier:n}=s,{groupMapsTo:a}=s.data,i=this.model.getBinnedStackedData(),l=this.services.cartesianScales.getMainXScale(),d=t.selectAll("g.bars").data(i,u=>c.get(u,`0.${a}`));d.exit().attr("opacity",0).remove(),d.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP);const h=t.selectAll("g.bars").selectAll("path.bar").data(u=>u);h.exit().remove(),h.enter().append("path").merge(h).classed("bar",!0).attr(n,(u,m)=>m).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:u[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a])).attr("d",u=>{const m=c.get(u,"data");if(!m)return;const p=l(m.x1)-l(m.x0)-1,g=this.services.cartesianScales.getDomainValue(m.x0),v=g+p,f=this.services.cartesianScales.getRangeValue(u[0]);let b=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(b-f)>0&&Math.abs(b-f)>s.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?b+=1:b-=1),c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>c.getProperty(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const e=this.model.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0);const l=parseFloat(c.get(a,"data.x0")),d=parseFloat(c.get(a,"data.x1")),h=s.services.cartesianScales.getRangeAxisPosition(),u=s.services.cartesianScales.getScaleLabel(h);s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:c.get(e,"bins.rangeLabel")||"Range",value:`${l} – ${d}`},{label:e.tooltip.groupLabel||"Group",value:a[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:a[t]})},{label:u,value:c.get(a,`data.${a[t]}`)}]})}).on("mousemove",function(n){s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("mouseout",function(){y.select(this).classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class $a extends me{constructor(){super(...arguments),this.type="lollipop",this.renderType=r.RenderTypes.SVG,this.handleScatterOnHover=e=>{const t=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[n]!==t.datum[n]?c.lines.weight.unselected:c.lines.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",c.lines.weight.unselected)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[n]!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.model.getOptions(),{groupMapsTo:n}=s.data,{cartesianScales:a}=this.services,i=a.getMainXScale(),l=a.getMainYScale(),d=a.getDomainIdentifier(),h=E=>a.getDomainValue(E),u=E=>a.getRangeValue(E),m=a.getOrientation(),[p,g]=c.flipDomainAndRangeBasedOnOrientation(h,u,m),v=t.selectAll("line.line").data(this.getScatterData(),E=>`${E[n]}-${E[d]}`);v.exit().attr("opacity",0).remove();const b=v.enter().append("line").attr("opacity",0).merge(v).classed("line",!0).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E[n],originalClassName:"line"})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"lollipop-line-update-enter",animate:e})).style("stroke",E=>this.model.getFillColor(E[n],E[d],E)).attr("opacity",1);m===r.CartesianOrientations.HORIZONTAL?b.attr("y1",g).attr("y2",g).attr("x1",i.range()[0]).attr("x2",E=>p(E)-s.points.radius):b.attr("x1",p).attr("x2",p).attr("y1",l.range()[0]).attr("y2",E=>g(E)+s.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class Ha extends G{constructor(){super(...arguments),this.type="meter",this.renderType=r.RenderTypes.SVG}getStackedBounds(e,t){let s=0;return e.map((a,i)=>i!==0?(s+=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:s-t(a.value)}):(s=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:0}))}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),a=c.getProperty(n,"meter","proportional"),i=this.model.getDisplayData(),l=this.model.getStatus(),{width:d}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{groupMapsTo:h}=n.data;let u;if(c.getProperty(n,"meter","proportional")===null)u=100;else{const T=c.getProperty(n,"meter","proportional","total");u=T||this.model.getMaximumDomain(this.model.getDisplayData())}const m=y.scaleLinear().domain([0,u]).range([0,d]),p=this.getStackedBounds(i,m),g=c.getProperty(n,"meter","height");O.DOMUtils.appendOrSelect(s,"rect.container").attr("x",0).attr("y",0).attr("width",d).attr("height",g||(a?c.meter.height.proportional:c.meter.height.default)),O.DOMUtils.appendOrSelect(s,"line.rangeIndicator").attr("x1",d).attr("x2",d).attr("y1",0).attr("y2",g||(a?c.meter.height.proportional:c.meter.height.default));const v=s.selectAll("rect.value").data(p),f=l!=null&&!t.model.isUserProvidedColorScaleValid()&&!a?`value status--${l}`:"value";v.enter().append("rect").classed("value",!0).merge(v).attr("x",T=>T.x).attr("y",0).attr("height",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).attr("class",T=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:T[h],originalClassName:f})).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"meter-bar-update",animate:e})).attr("width",T=>T.value>u?m(u):T.width).style("fill",T=>t.model.getFillColor(T[h])).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",T=>T.value),v.exit().remove();const b=c.getProperty(n,"meter","peak");let E=b;b!==null&&(b>u?E=u:b<i[0].value&&(E=i[0].value>u?u:i[0].value));const S=s.selectAll("line.peak").data(E==null?[]:[E]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"peak-line-update",animate:e})).attr("x1",T=>m(T)).attr("x2",T=>m(T)).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",T=>T),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=c.getProperty(e,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOVER,{event:a,element:l,datum:i}),n&&(l.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:i[t],value:i.value}]}))}).on("mousemove",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEMOVE,{event:a,element:l,datum:i}),n&&s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.Meter.METER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOUT,{event:a,element:l,datum:i}),n&&(l.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class za extends G{constructor(){super(...arguments),this.type="radar",this.renderType=r.RenderTypes.SVG,this.getLabelDimensions=e=>{const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),s=O.DOMUtils.appendOrSelect(t,"text").text(e),{width:n,height:a}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return t.remove(),{width:n,height:a}},this.normalizeFlatData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo"),i=Rs(this.uniqueKeys.map(l=>this.uniqueGroups.map(d=>({[s]:l,[a]:d,[n]:null}))));return c.merge(i,e)},this.normalizeGroupedData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo");return e.map(({name:i,data:l})=>{const d=this.uniqueKeys.map(h=>({[a]:i,[s]:h,[n]:null}));return{name:i,data:c.merge(d,l)}})},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-blob"})).style("fill-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:c.radar.opacity.selected).style("stroke-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-blob"})).style("fill-opacity",c.radar.opacity.selected).style("stroke-opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer(),{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),a=this.model.getData(),i=this.model.getGroupedData(),l=this.getOptions(),d=c.getProperty(l,"data","groupMapsTo"),h=c.getProperty(l,"radar","axes","value"),{angle:u,value:m}=c.getProperty(l,"radar","axes"),{xLabelPadding:p,yLabelPadding:g,yTicksNumber:v,minRange:f,xAxisRectHeight:b}=c.radar;this.uniqueKeys=Array.from(new Set(a.map(D=>D[u]))),this.uniqueGroups=Array.from(new Set(a.map(D=>D[d]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(i);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+g),C=(Math.min(s,n)-S)/2;if(C<=0)return;const x=y.scaleBand().domain(this.fullDataNormalized.map(D=>D[u])).range([0,2*Math.PI].map(D=>D-Math.PI/2)),w=y.min(this.fullDataNormalized.map(D=>D[m])),I=y.scaleLinear().domain([w>=0?0:w,y.max(this.fullDataNormalized.map(D=>D[m]))]).range([f,C]).nice(v),$=I.ticks(v),_=D=>this.model.getFillColor(D),A=y.lineRadial().angle(D=>x(D[u])+Math.PI/2).radius(D=>I(D[m])).curve(y.curveLinearClosed),L=this.uniqueKeys.map(D=>{const P=this.getLabelDimensions(D).width,k=O.distanceBetweenPointOnCircAndVerticalDiameter(x(D),C);return P+k}),R={x:y.max(L)+p,y:n/2},q=O.DOMUtils.appendOrSelect(t,"g.y-axes").attr("role",N.Roles.GROUP).selectAll("path").data($,D=>D),H=D=>this.uniqueKeys.map(P=>({[u]:P,[m]:D}));q.join(D=>D.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:e})).attr("opacity",1).attr("d",k=>A(H(k)))),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:e})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>A(H(k)))),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:e})).attr("d",k=>A(H(k))).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-axes").attr("role",N.Roles.GROUP).selectAll("line").data(this.uniqueKeys,D=>D).join(D=>D.append("line").attr("opacity",0).attr("class",P=>`x-axis-${J(P)}`).attr("stroke-dasharray","0").attr("x1",P=>O.polarToCartesianCoords(x(P),0,R).x).attr("y1",P=>O.polarToCartesianCoords(x(P),0,R).y).attr("x2",P=>O.polarToCartesianCoords(x(P),0,R).x).attr("y2",P=>O.polarToCartesianCoords(x(P),0,R).y).call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:e})).attr("opacity",1).attr("x1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).x).attr("y1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).y).attr("x2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).x).attr("y2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:e})).attr("opacity",1).attr("x1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).x).attr("y1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).y).attr("x2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).x).attr("y2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-labels").attr("role",N.Roles.GROUP).selectAll("text").data(this.uniqueKeys).join(D=>D.append("text").text(P=>P).attr("opacity",0).attr("x",P=>O.polarToCartesianCoords(x(P),I.range()[1]+p,R).x).attr("y",P=>O.polarToCartesianCoords(x(P),I.range()[1]+p,R).y).style("text-anchor",P=>O.radialLabelPlacement(x(P)).textAnchor).style("dominant-baseline",P=>O.radialLabelPlacement(x(P)).dominantBaseline).call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:e})).attr("opacity",1).attr("x",k=>O.polarToCartesianCoords(x(k),I.range()[1]+p,R).x).attr("y",k=>O.polarToCartesianCoords(x(k),I.range()[1]+p,R).y).end().finally(()=>{const k=c.getProperty(l,"radar","alignment"),K=this.getAlignmentXOffset(k,t,this.getParent());t.attr("x",K)})),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.blobs").attr("role",N.Roles.GROUP).selectAll("path").data(this.groupedDataNormalized,D=>D.name).join(D=>D.append("path").attr("class",P=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:P.name,originalClassName:"blob"})).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",P=>P.name).attr("opacity",0).attr("transform",e?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",P=>_(P.name)).style("fill-opacity",c.radar.opacity.selected).style("stroke",P=>_(P.name)).call(P=>{const k=P.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_enter",animate:e}));e&&k.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),k.attr("opacity",1).attr("d",K=>A(K.data))}),D=>(D.attr("class",P=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:P.name,originalClassName:"blob"})).style("fill",P=>_(P.name)).style("stroke",P=>_(P.name)),D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:e})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>A(k.data))),D),D=>D.call(P=>{const k=P.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_exit",animate:e}));e&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),O.DOMUtils.appendOrSelect(t,"g.dots").attr("role",N.Roles.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(D=>c.getProperty(D,m)!==null)).join(D=>D.append("circle").attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",P=>P[h]),D=>D,D=>D.remove()).attr("class",D=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:D[d],originalClassName:J(D[u])})).attr("cx",D=>O.polarToCartesianCoords(x(D[u]),I(D[m]),R).x).attr("cy",D=>O.polarToCartesianCoords(x(D[u]),I(D[m]),R).y).attr("r",0).attr("opacity",0).style("fill",D=>_(D[d])),O.DOMUtils.appendOrSelect(t,"g.x-axes-rect").attr("role",N.Roles.GROUP).selectAll("rect").data(this.uniqueKeys).join(D=>D.append("rect"),D=>D,D=>D.remove()).attr("x",R.x).attr("y",R.y-b/2).attr("width",I.range()[1]).attr("height",b).style("fill","red").style("fill-opacity",0).attr("transform",D=>`rotate(${O.radToDeg(x(D))}, ${R.x}, ${R.y})`),O.DOMUtils.appendOrSelect(t,"g.y-labels").attr("role",N.Roles.GROUP).selectAll("text").data(y.extent($)).join(D=>D.append("text").attr("opacity",0).text(P=>P).attr("x",P=>O.polarToCartesianCoords(-Math.PI/2,I(P),R).x+g).attr("y",P=>O.polarToCartesianCoords(-Math.PI/2,I(P),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:e})).text(k=>k).attr("opacity",1).attr("x",k=>O.polarToCartesianCoords(-Math.PI/2,I(k),R).x+g).attr("y",k=>O.polarToCartesianCoords(-Math.PI/2,I(k),R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_exit",animate:e})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(e,t,s){const n=O.DOMUtils.getSVGElementSize(t,{useBBox:!0}),{width:a}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});let i=0;return e===r.Alignments.CENTER?i=Math.floor((a-n.width)/2):e===r.Alignments.RIGHT&&(i=a-n.width),i}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const e=this,{axes:{angle:t}}=c.getProperty(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOVER,{event:s,element:a,datum:n});const i=e.parent.select(`.x-axes .x-axis-${J(n)}`),l=e.parent.selectAll(`.dots circle.${J(n)}`),d=e.model.getActiveDataGroupNames(),h=e.getOptions(),{groupMapsTo:u}=h.data,m=c.getProperty(h,"radar","axes","value");i.classed("hovered",!0).attr("stroke-dasharray","4 4"),l.classed("hovered",!0).attr("opacity",g=>d.indexOf(g[u])!==-1?1:0).attr("r",c.radar.dotsRadius);const p=e.fullDataNormalized.filter(g=>g[t]===n&&d.indexOf(g[u])!==-1);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,items:p.filter(g=>typeof g[m]=="number").map(g=>({label:g[u],value:g[m],color:e.model.getFillColor(g[u]),class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:g[u]})}))})}).on("mousemove",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEMOVE,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=e.parent.select(`.x-axes .x-axis-${J(n)}`),l=e.parent.selectAll(`.dots circle.${J(n)}`);i.classed("hovered",!1).attr("stroke-dasharray","0"),l.classed("hovered",!1).attr("opacity",0).attr("r",0),e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}class Fa extends ve{constructor(){super(...arguments),this.type="simple-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getOrientation(),l=n.selectAll("path.bar").data(a,h=>h[s]);l.exit().attr("opacity",0).remove(),l.enter().append("path").attr("opacity",0).merge(l).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[s],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[s])).attr("d",h=>{const u=this.services.cartesianScales.getRangeIdentifier(),m=this.getBarWidth(),p=h[u],g=this.services.cartesianScales.getDomainValue(h)-m/2,v=g+m;let f,b;if(Array.isArray(p)&&p.length===2)f=this.services.cartesianScales.getRangeValue(p[0]),b=this.services.cartesianScales.getRangeValue(p[1]);else{const T=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,T)),b=this.services.cartesianScales.getRangeValue(h)}const E=Math.abs(b-f);if(E!==0&&E<2&&(p>0&&i===r.CartesianOrientations.VERTICAL||p<0&&i===r.CartesianOrientations.HORIZONTAL?b=f-2:b=f+2),!this.isOutsideZoomedDomain(g,v))return c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},i)}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:y.select(this),datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Wa extends _t{constructor(){super(...arguments),this.type="skeleton-lines"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading"),s=!c.getProperty(this.getOptions(),"grid","x","enabled")&&!c.getProperty(this.getOptions(),"grid","y","enabled")&&!c.getProperty(this.getOptions(),"axes","bottom","visible")&&!c.getProperty(this.getOptions(),"axes","left","visible");t&&!s?super.renderGridSkeleton(t):t&&s?this.renderSparklineSkeleton(t):this.removeSkeleton()}renderSparklineSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawSparkline(e),this.updateBackdropStyle(),e&&this.setShimmerEffect("shimmer-lines")}drawSparkline(e){const t=this.backdrop.attr("width"),s=[100],n=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),a=n.selectAll("line").data(s);a.enter().append("line").merge(a).attr("x1",0).attr("x2",t).attr("y1",i=>i).attr("y2",i=>i),n.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-skeleton.DAII"),O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class ja extends G{constructor(){super(...arguments),this.type="area-stacked",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>c.getProperty(a,0,n)!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this,n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(v=>n.axes[v].percentage),l=this.model.getStackedData({percentage:i,groups:this.configs.groups}),d=c.getProperty(l,0,0),h=this.services.cartesianScales.getDomainAxisPosition({datum:d}),u=this.services.cartesianScales.getRangeAxisPosition({datum:d}),m=this.services.cartesianScales.getScaleByPosition(u),p=t.selectAll("path.area").data(l,v=>c.getProperty(v,0,a));this.areaGenerator=y.area().x(v=>this.services.cartesianScales.getValueThroughAxisPosition(h,v.data.sharedStackKey)).y0(v=>m(v[0])).y1(v=>m(v[1])).curve(this.services.curves.getD3Curve()),p.exit().attr("opacity",0).remove(),p.enter().append("path").attr("opacity",0).merge(p).data(l,v=>c.getProperty(v,0,a)).attr("class","area").attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:c.getProperty(v,0,a),originalClassName:"area"})).style("fill",v=>s.model.getFillColor(c.getProperty(v,0,a))).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",v=>c.getProperty(v,0,a)).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"area-update-enter",animate:e})).attr("opacity",c.area.opacity.selected).attr("d",this.areaGenerator)}}class Za extends ve{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),i=this.model.getActiveDataGroupNames(),l=t.selectAll("g.bars").data(a,h=>c.getProperty(h,0,n));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP).attr("data-name","bars");const d=t.selectAll("g.bars").selectAll("path.bar").data(h=>h,h=>h.data.sharedStackKey);d.exit().remove(),d.enter().append("path").merge(d).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[n],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[n])).attr("d",h=>{const u=h.data.sharedStackKey,m=this.getBarWidth(),p=this.services.cartesianScales.getDomainValue(u)-m/2,g=p+m,v=this.services.cartesianScales.getRangeValue(h[0]);let f=this.services.cartesianScales.getRangeValue(h[1]);if(!this.isOutsideZoomedDomain(p,g)){if(Math.abs(f-v)>0&&Math.abs(f-v)>s.bars.dividerSize){const b=h[0]<0&&h[1]<=0;b&&i.length>1?this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=h[1]===0?2:1:f-=1:b||(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=1:f-=1)}return c.generateSVGPathString({x0:p,x1:g,y0:v,y1:f},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h[1]-h[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:a});let d=s.model.getDisplayData(s.configs.groups).find(h=>{const u=s.services.cartesianScales.getDomainIdentifier(h),m=s.services.cartesianScales.getRangeIdentifier(h);return h[m]===a.data[a[t]]&&h[u].toString()===a.data.sharedStackKey&&h[t]===a[t]});if(d===void 0){const h=s.services.cartesianScales.getDomainIdentifier(),u=s.services.cartesianScales.getRangeIdentifier();d={[h]:a.data.sharedStackKey,[u]:a.data[a[t]],[t]:a[t]}}s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,data:[d]})}).on("mousemove",function(n,a){const i=y.select(this);s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){s.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);i.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}getBarWidth(){const e=this.getOptions();if(c.getProperty(e,"bars","width"))return e.bars.width;const t=this.services.cartesianScales.getMainXScale(),s=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width,n=this.model.getStackKeys().length,a=c.getProperty(e,"bars","spacingFactor");return t.step?Math.min(e.bars.maxWidth,t.step()/2):Math.min(e.bars.maxWidth,s*a/n)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Xa extends me{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=r.RenderTypes.SVG}render(e){if(!c.getProperty(this.getOptions(),"points","enabled"))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(g=>n.axes[g].percentage),l=this.model.getStackedData({groups:this.configs.groups,percentage:i}),d=s.selectAll("g.dots").data(l,g=>c.getProperty(g,0,a));d.exit().attr("opacity",0).remove();const u=d.enter().append("g").classed("dots",!0).attr("role",N.Roles.GROUP).merge(d).selectAll("circle.dot").data(g=>g);u.exit().attr("opacity",0).remove();const p=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(g=>{const v=g[a],f=this.services.cartesianScales.getDomainIdentifier(g),b=this.services.cartesianScales.getRangeIdentifier(g);return{[a]:v,[f]:g.data.sharedStackKey,[b]:g[1]}});this.styleCircles(p,e),this.addEventListeners()}getTooltipData(e,t){const s=this.getOptions(),{groupMapsTo:n}=s.data,a=Object.keys(s.axes).some(d=>s.axes[d].percentage),i=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=[];return i.forEach((d,h)=>{d.forEach((u,m)=>{const p=u[n],g=u.data.sharedStackKey;let v=u.data[p];const f=u[1],b=this.services.cartesianScales.getDomainIdentifier(u),E=this.services.cartesianScales.getRangeIdentifier(u);v!=null&&e===this.services.cartesianScales.getDomainValue(g)&&t===this.services.cartesianScales.getRangeValue(f)&&(a&&(v=this.model.getStackedData({groups:this.configs.groups})[h][m].data[p]),v!==null&&l.push({[n]:p,[b]:g,[E]:v}))})}),this.model.getDisplayData(this.configs.groups).filter(d=>{const h=this.services.cartesianScales.getDomainIdentifier(d),u=this.services.cartesianScales.getRangeIdentifier(d);return l.find(m=>m[n]==d[n]&&m[h]==d[h]&&m[u]==d[u])!==void 0})}}const ee=6;class qa extends G{constructor(){super(...arguments),this.type="tree",this.renderType=r.RenderTypes.SVG}getLongestLabel(e){let t="";return e.forEach(s=>{const n=s.children?this.getLongestLabel(s.children):"";(n.length>t.length||s.name.length>t.length)&&(t=n.length>s.name.length?n:s.name)}),t}getMockLabelWidth(e,t){const s=e.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(t),{width:n}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return s.remove(),n}render(e=!0){const t=this.getComponentContainer();t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),l=c.getProperty(a,"tree","rootTitle")||"Tree",d=this.getMockLabelWidth(t,l),h=this.getLongestLabel(i),u=this.getMockLabelWidth(t,h),m={top:0,right:0,bottom:0,left:d>0?d+ee:30-ee},p=y.hierarchy({name:l,children:i}),g=10,v=s/6,f=x=>{const w=p.descendants().reverse(),I=p.links();let $=p,_=p;p.eachBefore(B=>{B.x<$.x&&($=B),B.x>_.x&&(_=B)});const A=_.x-$.x,L=t.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-m.left,$.x,s,A].join(" ")),V=C.selectAll("g").data(w,B=>B.id),R=this,F=V.enter().append("g").attr("transform",()=>`translate(${x.y0},${x.x0})`).attr("class",B=>B.depth!==0&&B.children&&B.children.length>0?"clickable":null).on("mouseover",function(B,X){R.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOVER,{event:B,element:y.select(this),datum:X})}).on("click",function(B,X){X.depth!==0&&(X.children=X.children?null:X._children,f(X)),R.services.events.dispatchEvent(r.Events.Tree.NODE_CLICK,{event:B,element:y.select(this),datum:X})}).on("mouseout",function(B,X){R.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOUT,{event:B,element:y.select(this),datum:X})});F.append("circle").attr("r",2.5).attr("class",B=>B._children?"parent":"child").attr("stroke-width",10),F.append("text").attr("dy","0.31em").attr("x",B=>B._children?-ee:ee).attr("text-anchor",B=>B._children?"end":"start").text(B=>B.data.name).clone(!0).attr("class","text-stroke").lower(),V.merge(F).transition(L).attr("transform",B=>`translate(${B.y},${B.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),V.exit().transition(L).remove().attr("transform",()=>`translate(${x.y},${x.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const q=M.selectAll("path").data(I,B=>B.target.id),H=q.enter().append("path").attr("d",()=>{const B={x:x.x0,y:x.y0};return T({source:B,target:B})});q.merge(H).transition(L).attr("d",T),q.exit().transition(L).remove().attr("d",()=>{const B={x:x.x,y:x.y};return T({source:B,target:B})}),p.eachBefore(B=>{B.x0=B.x,B.y0=B.y})},b=p.descendants(),E=b[b.length-1].depth,S=c.getProperty(a,"tree","type")===r.TreeTypes.DENDROGRAM?y.cluster().size([n,s-u-E*ee-d]):y.tree().nodeSize([g,v]).size([n,s-u-E*ee-d]),T=y.linkHorizontal().x(x=>x.y).y(x=>x.x);p.x0=v/2,p.y0=0,p.descendants().forEach((x,w)=>{x.id=w,x._children=x.children}),S(p),t.attr("viewBox",[-m.left,-m.top,s,g]).style("user-select","none");const M=t.append("g").attr("class","links"),C=t.append("g").attr("class","nodes");f(p)}}var Ya="#000000",Ka="#ffffff",Ja="#fcf4d6",Qa="#fddc69",ei="#f1c21b",ti="#d2a106",si="#b28600",ni="#8e6a00",ai="#684e00",ii="#483700",ri="#302400",oi="#1c1500",li={10:Ja,20:Qa,30:ei,40:ti,50:si,60:ni,70:ai,80:ii,90:ri,100:oi},ci="#fff2e8",di="#ffd9be",hi="#ffb784",ui="#ff832b",pi="#eb6200",gi="#ba4e00",mi="#8a3800",vi="#5e2900",fi="#3e1a00",yi="#231000",Ei={10:ci,20:di,30:hi,40:ui,50:pi,60:gi,70:mi,80:vi,90:fi,100:yi},Oi="#fff1f1",bi="#ffd7d9",Si="#ffb3b8",xi="#ff8389",Ti="#fa4d56",Mi="#da1e28",Ci="#a2191f",Li="#750e13",Ai="#520408",Di="#2d0709",wi={10:Oi,20:bi,30:Si,40:xi,50:Ti,60:Mi,70:Ci,80:Li,90:Ai,100:Di},Pi="#fff0f7",Ri="#ffd6e8",ki="#ffafd2",Ii="#ff7eb6",_i="#ee5396",Ui="#d02670",Vi="#9f1853",Bi="#740937",Ni="#510224",Gi="#2a0a18",$i={10:Pi,20:Ri,30:ki,40:Ii,50:_i,60:Ui,70:Vi,80:Bi,90:Ni,100:Gi},Hi="#f6f2ff",zi="#e8daff",Fi="#d4bbff",Wi="#be95ff",ji="#a56eff",Zi="#8a3ffc",Xi="#6929c4",qi="#491d8b",Yi="#31135e",Ki="#1c0f30",Ji={10:Hi,20:zi,30:Fi,40:Wi,50:ji,60:Zi,70:Xi,80:qi,90:Yi,100:Ki},Qi="#edf5ff",er="#d0e2ff",tr="#a6c8ff",sr="#78a9ff",nr="#4589ff",ar="#0f62fe",ir="#0043ce",rr="#002d9c",or="#001d6c",lr="#001141",cr={10:Qi,20:er,30:tr,40:sr,50:nr,60:ar,70:ir,80:rr,90:or,100:lr},dr="#e5f6ff",hr="#bae6ff",ur="#82cfff",pr="#33b1ff",gr="#1192e8",mr="#0072c3",vr="#00539a",fr="#003a6d",yr="#012749",Er="#061727",Or={10:dr,20:hr,30:ur,40:pr,50:gr,60:mr,70:vr,80:fr,90:yr,100:Er},br="#d9fbfb",Sr="#9ef0f0",xr="#3ddbd9",Tr="#08bdba",Mr="#009d9a",Cr="#007d79",Lr="#005d5d",Ar="#004144",Dr="#022b30",wr="#081a1c",Pr={10:br,20:Sr,30:xr,40:Tr,50:Mr,60:Cr,70:Lr,80:Ar,90:Dr,100:wr},Rr="#defbe6",kr="#a7f0ba",Ir="#6fdc8c",_r="#42be65",Ur="#24a148",Vr="#198038",Br="#0e6027",Nr="#044317",Gr="#022d0d",$r="#071908",Hr={10:Rr,20:kr,30:Ir,40:_r,50:Ur,60:Vr,70:Br,80:Nr,90:Gr,100:$r},zr="#f2f4f8",Fr="#dde1e6",Wr="#c1c7cd",jr="#a2a9b0",Zr="#878d96",Xr="#697077",qr="#4d5358",Yr="#343a3f",Kr="#21272a",Jr="#121619",Qr={10:zr,20:Fr,30:Wr,40:jr,50:Zr,60:Xr,70:qr,80:Yr,90:Kr,100:Jr},eo="#f4f4f4",to="#e0e0e0",so="#c6c6c6",no="#a8a8a8",ao="#8d8d8d",io="#6f6f6f",ro="#525252",oo="#393939",lo="#262626",co="#161616",ho={10:eo,20:to,30:so,40:no,50:ao,60:io,70:ro,80:oo,90:lo,100:co},uo="#f7f3f2",po="#e5e0df",go="#cac5c4",mo="#ada8a8",vo="#8f8b8b",fo="#726e6e",yo="#565151",Eo="#3c3838",Oo="#272525",bo="#171414",So={10:uo,20:po,30:go,40:mo,50:vo,60:fo,70:yo,80:Eo,90:Oo,100:bo},nt={black:{100:Ya},blue:cr,coolGray:Qr,cyan:Or,gray:ho,green:Hr,magenta:$i,orange:Ei,purple:Ji,red:wi,teal:Pr,warmGray:So,white:{0:Ka},yellow:li};const xo=o=>{if(!o)return null;for(const e of Object.keys(nt)){const t=nt[e];for(const s of Object.keys(t))if(t[+s]===o)return s}return null},at=function(){const o=y.select(this.parentNode).select("rect.leaf"),e=getComputedStyle(o.node(),null).getPropertyValue("fill"),t=y.color(e);let s;if(t&&(s=xo(t?t.hex():null)),s==null){const n=y.hsl(t).l;s=Math.abs(n*100-100)}return s>50?"white":"black"};let To=0;class Mo extends G{constructor(){super(...arguments),this.type="treemap",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-treemap"})).attr("opacity",s=>s.parent.data.name===t.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer();this.model.getData();const s=this.model.getDisplayData(),n=this.model.getOptions(),a=c.getProperty(window,"location"),{width:i,height:l}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),d=y.hierarchy({name:n.title||"Treemap",children:s}).sum(f=>f.value).sort((f,b)=>b.value-f.value),h=y.treemap().size([i,l]).paddingInner(1).paddingOuter(0).round(!0)(d),u=t.selectAll("g[data-name='leaf']").data(h.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const p=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>To++).merge(u);p.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:e})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const g=p.selectAll("rect.leaf").data(f=>[f]);g.exit().attr("width",0).attr("height",0).remove(),g.enter().append("rect").classed("leaf",!0).merge(g).attr("width",0).attr("height",0).attr("id",function(){const f=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:e})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),p.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const b=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-clip-${b}`}).append("use").attr("xlink:href",function(){const b=y.select(this.parentNode.parentNode).attr("data-uid"),E=`${n.style.prefix}-leaf-${b}`;return new URL(`#${E}`,a)+""}),f=>null,f=>f.remove()),p.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let b=f;for(;b.depth>1;)b=b.parent;const E=y.hsl(this.model.getFillColor(b.data.name));return[{text:f.data.name,color:E.l<.5?"white":"black"}]},f=>f).join(f=>{const b=f.append("text").text(E=>E.text).style("fill",at).attr("x",7).attr("y",18);return a&&b.attr("clip-path",function(){const E=y.select(this.parentNode).attr("data-uid"),S=`${n.style.prefix}-clip-${E}`;return`url(${new URL(`#${S}`,a)+""})`}),b},f=>f.text(b=>b.text).style("fill",at),f=>f.remove()),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("rect.leaf").on("mouseover",function(t,s){const n=y.select(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),i=s;for(;i.depth>1;)i=i.parent;n.transition("graph_element_mouseover_fill_update").call(l=>e.services.transitions.setupTransition({transition:l,name:"graph_element_mouseover_fill_update"})).style("fill",l=>{const d=e.model.getFillColor(l.parent.data.name);return d&&(a=d),y.color(a).darker(.7).toString()}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:a,label:i.data.name,bold:!0},{label:s.data.name,value:s.data.value}]}),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Treemap.LEAF_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1);let a=s;for(;a.depth>1;)a=a.parent;n.transition().call(i=>e.services.transitions.setupTransition({transition:i,name:"graph_element_mouseout_fill_update"})).style("fill",i=>e.model.getFillColor(i.parent.data.name)),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}}class Co extends G{constructor(){super(...arguments),this.type="wordcloud",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-wordcloud"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this,s=this.getComponentContainer().attr("width","100%").attr("height","100%"),n=this.model.getDisplayData(),a=this.getFontSizeScale(n),i=this.getOptions(),{fontSizeMapsTo:l,wordMapsTo:d}=i.wordCloud,{groupMapsTo:h}=i.data,{width:u,height:m}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});if(u===0||m===0)return;const p=Bt().size([u,m]).words(n.map(function(v){const f=v[l];if(typeof v[l]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[h]:v[h],text:v[d],size:f,value:f}})).padding(5).rotate(0).fontSize(v=>a(v.size)).on("end",g);p.start();function g(v){const f=O.DOMUtils.appendOrSelect(s,"g.words");f.attr("transform",`translate(${p.size()[0]/2}, ${p.size()[1]/2})`);const b=f.selectAll("text").data(v,S=>`${S[h]}-${S.text}`);b.exit().attr("opacity",0).remove(),b.enter().append("text").attr("opacity",0).merge(b).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>t.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:S[h],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>t.model.getFillColor(S[h],S.text,S)).attr("text-anchor","middle").transition().call(S=>t.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:e})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(e){const t=this.getOptions(),{fontSizeMapsTo:s}=t.wordCloud,n=e.map(d=>d[s]).filter(d=>d),a=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=n.length>0,l=i?y.extent(n):[1,1];return y.scaleLinear().domain(l).range(i?t.wordCloud.fontSizeRange(a,e):[4,4])}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=O.debounce(a=>{const i=s.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(l=>s.services.transitions.setupTransition({transition:l,name:"wordcloud-word-mouse-highlight"}));a===null?i.attr("opacity",1):i.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,i){const l=this;n(l),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOVER,{event:a,element:y.select(this),datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:e.tooltip.wordLabel,value:i.text},{label:e.tooltip.valueLabel,value:i.value},{label:e.tooltip.groupLabel,value:i[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[t]})}]})}).on("mousemove",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEMOVE,{element:l,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.WordCloud.WORD_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);n(null),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOUT,{event:a,element:l,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}}class Vt extends G{constructor(){super(...arguments),this.type="geo",this.renderType=r.RenderTypes.SVG}render(){const e=this.getComponentContainer({withinChartClip:!0}),{width:t,height:s}=O.DOMUtils.getSVGElementSize(e,{useAttrs:!0});if(t<1||s<1)return;const n=this.getProjection(),a=c.getProperty(this.getOptions(),"geoData"),i=this.model.getCombinedData(),l={},d={};Object.keys(i).forEach(E=>{typeof i[E].value=="number"?l[E]=i[E]:d[E]=i[E]});const h=Ea(a,Object.values(d)),u=va(a,{type:"GeometryCollection",geometries:Object.values(l)}),m=n.fitSize([t,s],u),p=y.geoPath().projection(m);O.DOMUtils.appendOrSelect(e,"g.geo").selectAll("path").data(u.features).join("path").attr("d",p);const v=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=O.DOMUtils.appendOrSelect(e,"defs");O.DOMUtils.appendOrSelect(f,"pattern").attr("id",v).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",y.line()([[0,0],[0,10]]));const b=O.DOMUtils.appendOrSelect(e,"g.missing-data");O.DOMUtils.appendOrSelect(b,"path").datum(h).attr("d",p).style("fill",`url(#${v})`)}getProjection(){let e=null;switch(c.getProperty(this.getOptions(),"thematic","projection")){case r.Projection.geoEqualEarth:e=y.geoEqualEarth();break;case r.Projection.geoAlbers:e=y.geoAlbers();break;case r.Projection.geoConicEqualArea:e=y.geoConicEqualArea();break;case r.Projection.geoConicEquidistant:e=y.geoConicEquidistant();break;case r.Projection.geoEquirectangular:e=y.geoEquirectangular();break;case r.Projection.geoMercator:e=y.geoMercator();break;case r.Projection.geoNaturalEarth1:e=y.geoNaturalEarth1();break;default:throw new Error("Projection is not supported.")}return e}}class Lo extends Vt{constructor(){super(...arguments),this.type="choropleth"}render(e=!0){super.render();const t=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",a=>this.model.getColorClassName({value:t[a.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const e=this,t=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOVER,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.SHOW,{event:s,hoveredElement:a,items:[{label:n.properties.NAME,value:t[n.properties.NAME].value}]})}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEMOVE,{event:s,element:y.select(this),datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_CLICK,{event:s,element:y.select(this),datum:t[n.properties.NAME]})}).on("mouseout",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOUT,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.HIDE,{event:s,hoveredElement:a})})}}exports.Alluvial=na;exports.Area=ia;exports.Axis=Ue;exports.AxisChartsTooltip=sa;exports.Bar=ve;exports.BinnedRuler=ba;exports.Boxplot=ca;exports.Bubble=ha;exports.Bullet=ua;exports.CanvasChartClip=Jn;exports.ChartBrush=kt;exports.ChartClip=Pt;exports.Choropleth=Lo;exports.CirclePack=Ia;exports.ColorScaleLegend=Ra;exports.Component=G;exports.Donut=Ua;exports.Gauge=Va;exports.GeoProjection=Vt;exports.Grid=aa;exports.GroupedBar=Ba;exports.Heatmap=Na;exports.Highlight=ta;exports.Histogram=Ga;exports.HoverAxis=It;exports.LayoutComponent=Mt;exports.Legend=wt;exports.Line=ra;exports.Lollipop=$a;exports.Meter=Ha;exports.MeterTitle=ka;exports.Modal=Kn;exports.Pie=Ut;exports.Radar=za;exports.Ruler=_e;exports.Scatter=me;exports.SimpleBar=Fa;exports.Skeleton=_t;exports.SkeletonLines=Wa;exports.Spacer=Us;exports.StackedArea=ja;exports.StackedBar=Za;exports.StackedRuler=Sa;exports.StackedScatter=Xa;exports.Threshold=ea;exports.Title=Dt;exports.Toolbar=xt;exports.Tooltip=Rt;exports.Tree=qa;exports.Treemap=Mo;exports.TwoDimensionalAxes=la;exports.WordCloud=Co;exports.ZeroLine=da;exports.ZoomBar=Qn;exports.arrowLeft=Ca;exports.arrowRight=La;exports.buildBezierPathString=Ma;exports.buildElbowPathString=Ta;exports.buildStraightPathString=xa;exports.circle=Aa;exports.createCompounder=Et;exports.diamond=Da;exports.square=wa;exports.tee=Pa;
82
+ //# sourceMappingURL=choropleth-db3ae9eb.js.map