@carbon/charts 1.23.12 → 1.23.14

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.
@@ -3,12 +3,13 @@
3
3
  `)}async function AI(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await CI(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function DI(e,t={}){const{width:n,height:r}=cm(e,t),i=await no(e,t,!0);return await AI(i,t),await vm(i,t),TI(i,t),await XR(i,n,r)}async function Sm(e,t={}){const{width:n,height:r}=cm(e,t),i=await DI(e,t),s=await eo(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||WR(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||YR(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function LI(e,t={}){return(await Sm(e,t)).toDataURL()}async function RI(e,t={}){return(await Sm(e,t)).toDataURL("image/jpeg",t.quality||1)}class An{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const II="DONT_STYLE_ME_css_styles_verifier";class k extends An{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(f=>{if(h[f]){const p=h[f],g=parseFloat(p);p&&g>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=I(this.getHolder()).append("div").classed(`${fe}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",II),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),I(this.getHolder()).classed(`${fe}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),RI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),LI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=k.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(k.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Wa(()=>{var a;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(a=this.services.events)==null||a.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}class mt{constructor(t,n,r){if(this.type="",this.renderType=at.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var r;const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(r=this.parent)==null||r.classed(`${fe}--${i}--${this.type}`,!0),n&&n.classed(`${fe}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=k.appendOrSelect(this.parent,`${this.renderType===at.SVG?"svg":"div"}${r}.${fe}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=I(`#${s}`).select("rect");if(o.size()!==0){const l=parseFloat(o.attr("height")),c=parseFloat(o.attr("width"));!isNaN(l)&&!isNaN(c)&&l>0&&c>0&&i.attr("clip-path",`url(#${s})`)}}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ct({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:_m,setPrototypeOf:Tm,isFrozen:kI,getPrototypeOf:PI,getOwnPropertyDescriptor:NI}=Object;let{freeze:ae,seal:Pe,create:Om}=Object,{apply:ou,construct:lu}=typeof Reflect<"u"&&Reflect;ae||(ae=function(t){return t}),Pe||(Pe=function(t){return t}),ou||(ou=function(t,n,r){return t.apply(n,r)}),lu||(lu=function(t,n){return new t(...n)});const io=le(Array.prototype.forEach),$I=le(Array.prototype.lastIndexOf),wm=le(Array.prototype.pop),fs=le(Array.prototype.push),FI=le(Array.prototype.splice),so=le(String.prototype.toLowerCase),cu=le(String.prototype.toString),Mm=le(String.prototype.match),ps=le(String.prototype.replace),UI=le(String.prototype.indexOf),BI=le(String.prototype.trim),Xe=le(Object.prototype.hasOwnProperty),oe=le(RegExp.prototype.test),gs=HI(TypeError);function le(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ou(e,t,r)}}function HI(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return lu(e,n)}}function vt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:so;Tm&&Tm(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(kI(t)||(t[r]=s),i=s)}e[i]=!0}return e}function GI(e){for(let t=0;t<e.length;t++)Xe(e,t)||(e[t]=null);return e}function Dn(e){const t=Om(null);for(const[n,r]of _m(e))Xe(e,n)&&(Array.isArray(r)?t[n]=GI(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Dn(r):t[n]=r);return t}function ms(e,t){for(;e!==null;){const r=NI(e,t);if(r){if(r.get)return le(r.get);if(typeof r.value=="function")return le(r.value)}e=PI(e)}function n(){return null}return n}const Cm=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uu=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hu=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),VI=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),du=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),zI=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Am=ae(["#text"]),Dm=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),fu=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Lm=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ao=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),WI=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),YI=Pe(/<%[\w\W]*|[\w\W]*%>/gm),qI=Pe(/\$\{[\w\W]*/gm),XI=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),ZI=Pe(/^aria-[\-\w]+$/),Rm=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jI=Pe(/^(?:\w+script|data):/i),KI=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Im=Pe(/^html$/i),QI=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var km=Object.freeze({__proto__:null,ARIA_ATTR:ZI,ATTR_WHITESPACE:KI,CUSTOM_ELEMENT:QI,DATA_ATTR:XI,DOCTYPE_NAME:Im,ERB_EXPR:YI,IS_ALLOWED_URI:Rm,IS_SCRIPT_OR_DATA:jI,MUSTACHE_EXPR:WI,TMPLIT_EXPR:qI});const vs={element:1,text:3,progressingInstruction:7,comment:8,document:9},JI=function(){return typeof window>"u"?null:window},tk=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Pm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Nm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:JI();const t=ot=>Nm(ot);if(t.version="3.2.6",t.removed=[],!e||!e.document||e.document.nodeType!==vs.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,g=ms(p,"cloneNode"),m=ms(p,"remove"),v=ms(p,"nextSibling"),x=ms(p,"childNodes"),E=ms(p,"parentNode");if(typeof a=="function"){const ot=n.createElement("template");ot.content&&ot.content.ownerDocument&&(n=ot.content.ownerDocument)}let b,S="";const{implementation:_,createNodeIterator:C,createDocumentFragment:D,getElementsByTagName:B}=n,{importNode:P}=r;let w=Pm();t.isSupported=typeof _m=="function"&&typeof E=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:N,TMPLIT_EXPR:M,DATA_ATTR:O,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:F,ATTR_WHITESPACE:L,CUSTOM_ELEMENT:U}=km;let{IS_ALLOWED_URI:tt}=km,X=null;const Y=vt({},[...Cm,...uu,...hu,...du,...Am]);let Q=null;const ut=vt({},[...Dm,...fu,...Lm,...ao]);let et=Object.seal(Om(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,nt=null,ht=!0,W=!0,j=!1,J=!0,A=!1,G=!0,V=!1,xt=!1,Ut=!1,st=!1,_t=!1,Ne=!1,Oe=!0,Ss=!1;const _s="user-content-";let mr=!0,je=!1,ii={},si=null;const Dv=vt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Lv=null;const Rv=vt({},["audio","video","img","source","image","track"]);let Du=null;const Iv=vt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vo="http://www.w3.org/1998/Math/MathML",yo="http://www.w3.org/2000/svg",Rn="http://www.w3.org/1999/xhtml";let ai=Rn,Lu=!1,Ru=null;const Y$=vt({},[vo,yo,Rn],cu);let Eo=vt({},["mi","mo","mn","ms","mtext"]),xo=vt({},["annotation-xml"]);const q$=vt({},["title","style","font","a","script"]);let Ts=null;const X$=["application/xhtml+xml","text/html"],Z$="text/html";let Xt=null,oi=null;const j$=n.createElement("form"),kv=function(R){return R instanceof RegExp||R instanceof Function},Iu=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===R)){if((!R||typeof R!="object")&&(R={}),R=Dn(R),Ts=X$.indexOf(R.PARSER_MEDIA_TYPE)===-1?Z$:R.PARSER_MEDIA_TYPE,Xt=Ts==="application/xhtml+xml"?cu:so,X=Xe(R,"ALLOWED_TAGS")?vt({},R.ALLOWED_TAGS,Xt):Y,Q=Xe(R,"ALLOWED_ATTR")?vt({},R.ALLOWED_ATTR,Xt):ut,Ru=Xe(R,"ALLOWED_NAMESPACES")?vt({},R.ALLOWED_NAMESPACES,cu):Y$,Du=Xe(R,"ADD_URI_SAFE_ATTR")?vt(Dn(Iv),R.ADD_URI_SAFE_ATTR,Xt):Iv,Lv=Xe(R,"ADD_DATA_URI_TAGS")?vt(Dn(Rv),R.ADD_DATA_URI_TAGS,Xt):Rv,si=Xe(R,"FORBID_CONTENTS")?vt({},R.FORBID_CONTENTS,Xt):Dv,K=Xe(R,"FORBID_TAGS")?vt({},R.FORBID_TAGS,Xt):Dn({}),nt=Xe(R,"FORBID_ATTR")?vt({},R.FORBID_ATTR,Xt):Dn({}),ii=Xe(R,"USE_PROFILES")?R.USE_PROFILES:!1,ht=R.ALLOW_ARIA_ATTR!==!1,W=R.ALLOW_DATA_ATTR!==!1,j=R.ALLOW_UNKNOWN_PROTOCOLS||!1,J=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,A=R.SAFE_FOR_TEMPLATES||!1,G=R.SAFE_FOR_XML!==!1,V=R.WHOLE_DOCUMENT||!1,st=R.RETURN_DOM||!1,_t=R.RETURN_DOM_FRAGMENT||!1,Ne=R.RETURN_TRUSTED_TYPE||!1,Ut=R.FORCE_BODY||!1,Oe=R.SANITIZE_DOM!==!1,Ss=R.SANITIZE_NAMED_PROPS||!1,mr=R.KEEP_CONTENT!==!1,je=R.IN_PLACE||!1,tt=R.ALLOWED_URI_REGEXP||Rm,ai=R.NAMESPACE||Rn,Eo=R.MATHML_TEXT_INTEGRATION_POINTS||Eo,xo=R.HTML_INTEGRATION_POINTS||xo,et=R.CUSTOM_ELEMENT_HANDLING||{},R.CUSTOM_ELEMENT_HANDLING&&kv(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=R.CUSTOM_ELEMENT_HANDLING.tagNameCheck),R.CUSTOM_ELEMENT_HANDLING&&kv(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),A&&(W=!1),_t&&(st=!0),ii&&(X=vt({},Am),Q=[],ii.html===!0&&(vt(X,Cm),vt(Q,Dm)),ii.svg===!0&&(vt(X,uu),vt(Q,fu),vt(Q,ao)),ii.svgFilters===!0&&(vt(X,hu),vt(Q,fu),vt(Q,ao)),ii.mathMl===!0&&(vt(X,du),vt(Q,Lm),vt(Q,ao))),R.ADD_TAGS&&(X===Y&&(X=Dn(X)),vt(X,R.ADD_TAGS,Xt)),R.ADD_ATTR&&(Q===ut&&(Q=Dn(Q)),vt(Q,R.ADD_ATTR,Xt)),R.ADD_URI_SAFE_ATTR&&vt(Du,R.ADD_URI_SAFE_ATTR,Xt),R.FORBID_CONTENTS&&(si===Dv&&(si=Dn(si)),vt(si,R.FORBID_CONTENTS,Xt)),mr&&(X["#text"]=!0),V&&vt(X,["html","head","body"]),X.table&&(vt(X,["tbody"]),delete K.tbody),R.TRUSTED_TYPES_POLICY){if(typeof R.TRUSTED_TYPES_POLICY.createHTML!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof R.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=R.TRUSTED_TYPES_POLICY,S=b.createHTML("")}else b===void 0&&(b=tk(f,i)),b!==null&&typeof S=="string"&&(S=b.createHTML(""));ae&&ae(R),oi=R}},Pv=vt({},[...uu,...hu,...VI]),Nv=vt({},[...du,...zI]),K$=function(R){let Z=E(R);(!Z||!Z.tagName)&&(Z={namespaceURI:ai,tagName:"template"});const it=so(R.tagName),kt=so(Z.tagName);return Ru[R.namespaceURI]?R.namespaceURI===yo?Z.namespaceURI===Rn?it==="svg":Z.namespaceURI===vo?it==="svg"&&(kt==="annotation-xml"||Eo[kt]):!!Pv[it]:R.namespaceURI===vo?Z.namespaceURI===Rn?it==="math":Z.namespaceURI===yo?it==="math"&&xo[kt]:!!Nv[it]:R.namespaceURI===Rn?Z.namespaceURI===yo&&!xo[kt]||Z.namespaceURI===vo&&!Eo[kt]?!1:!Nv[it]&&(q$[it]||!Pv[it]):!!(Ts==="application/xhtml+xml"&&Ru[R.namespaceURI]):!1},un=function(R){fs(t.removed,{element:R});try{E(R).removeChild(R)}catch{m(R)}},li=function(R,Z){try{fs(t.removed,{attribute:Z.getAttributeNode(R),from:Z})}catch{fs(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(R),R==="is")if(st||_t)try{un(Z)}catch{}else try{Z.setAttribute(R,"")}catch{}},$v=function(R){let Z=null,it=null;if(Ut)R="<remove></remove>"+R;else{const Yt=Mm(R,/^[\r\n\t ]+/);it=Yt&&Yt[0]}Ts==="application/xhtml+xml"&&ai===Rn&&(R='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+R+"</body></html>");const kt=b?b.createHTML(R):R;if(ai===Rn)try{Z=new h().parseFromString(kt,Ts)}catch{}if(!Z||!Z.documentElement){Z=_.createDocument(ai,"template",null);try{Z.documentElement.innerHTML=Lu?S:kt}catch{}}const ne=Z.body||Z.documentElement;return R&&it&&ne.insertBefore(n.createTextNode(it),ne.childNodes[0]||null),ai===Rn?B.call(Z,V?"html":"body")[0]:V?Z.documentElement:ne},Fv=function(R){return C.call(R.ownerDocument||R,R,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ku=function(R){return R instanceof d&&(typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||!(R.attributes instanceof u)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function")},Uv=function(R){return typeof o=="function"&&R instanceof o};function In(ot,R,Z){io(ot,it=>{it.call(t,R,Z,oi)})}const Bv=function(R){let Z=null;if(In(w.beforeSanitizeElements,R,null),ku(R))return un(R),!0;const it=Xt(R.nodeName);if(In(w.uponSanitizeElement,R,{tagName:it,allowedTags:X}),G&&R.hasChildNodes()&&!Uv(R.firstElementChild)&&oe(/<[/\w!]/g,R.innerHTML)&&oe(/<[/\w!]/g,R.textContent)||R.nodeType===vs.progressingInstruction||G&&R.nodeType===vs.comment&&oe(/<[/\w]/g,R.data))return un(R),!0;if(!X[it]||K[it]){if(!K[it]&&Gv(it)&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it)))return!1;if(mr&&!si[it]){const kt=E(R)||R.parentNode,ne=x(R)||R.childNodes;if(ne&&kt){const Yt=ne.length;for(let ve=Yt-1;ve>=0;--ve){const kn=g(ne[ve],!0);kn.__removalCount=(R.__removalCount||0)+1,kt.insertBefore(kn,v(R))}}}return un(R),!0}return R instanceof l&&!K$(R)||(it==="noscript"||it==="noembed"||it==="noframes")&&oe(/<\/no(script|embed|frames)/i,R.innerHTML)?(un(R),!0):(A&&R.nodeType===vs.text&&(Z=R.textContent,io([H,N,M],kt=>{Z=ps(Z,kt," ")}),R.textContent!==Z&&(fs(t.removed,{element:R.cloneNode()}),R.textContent=Z)),In(w.afterSanitizeElements,R,null),!1)},Hv=function(R,Z,it){if(Oe&&(Z==="id"||Z==="name")&&(it in n||it in j$))return!1;if(!(W&&!nt[Z]&&oe(O,Z))){if(!(ht&&oe($,Z))){if(!Q[Z]||nt[Z]){if(!(Gv(R)&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,R)||et.tagNameCheck instanceof Function&&et.tagNameCheck(R))&&(et.attributeNameCheck instanceof RegExp&&oe(et.attributeNameCheck,Z)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(Z))||Z==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it))))return!1}else if(!Du[Z]){if(!oe(tt,ps(it,L,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&R!=="script"&&UI(it,"data:")===0&&Lv[R])){if(!(j&&!oe(F,ps(it,L,"")))){if(it)return!1}}}}}}return!0},Gv=function(R){return R!=="annotation-xml"&&Mm(R,U)},Vv=function(R){In(w.beforeSanitizeAttributes,R,null);const{attributes:Z}=R;if(!Z||ku(R))return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let kt=Z.length;for(;kt--;){const ne=Z[kt],{name:Yt,namespaceURI:ve,value:kn}=ne,Os=Xt(Yt),Pu=kn;let re=Yt==="value"?Pu:BI(Pu);if(it.attrName=Os,it.attrValue=re,it.keepAttr=!0,it.forceKeepAttr=void 0,In(w.uponSanitizeAttribute,R,it),re=it.attrValue,Ss&&(Os==="id"||Os==="name")&&(li(Yt,R),re=_s+re),G&&oe(/((--!?|])>)|<\/(style|title)/i,re)){li(Yt,R);continue}if(it.forceKeepAttr)continue;if(!it.keepAttr){li(Yt,R);continue}if(!J&&oe(/\/>/i,re)){li(Yt,R);continue}A&&io([H,N,M],Wv=>{re=ps(re,Wv," ")});const zv=Xt(R.nodeName);if(!Hv(zv,Os,re)){li(Yt,R);continue}if(b&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ve)switch(f.getAttributeType(zv,Os)){case"TrustedHTML":{re=b.createHTML(re);break}case"TrustedScriptURL":{re=b.createScriptURL(re);break}}if(re!==Pu)try{ve?R.setAttributeNS(ve,Yt,re):R.setAttribute(Yt,re),ku(R)?un(R):wm(t.removed)}catch{li(Yt,R)}}In(w.afterSanitizeAttributes,R,null)},Q$=function ot(R){let Z=null;const it=Fv(R);for(In(w.beforeSanitizeShadowDOM,R,null);Z=it.nextNode();)In(w.uponSanitizeShadowNode,Z,null),Bv(Z),Vv(Z),Z.content instanceof s&&ot(Z.content);In(w.afterSanitizeShadowDOM,R,null)};return t.sanitize=function(ot){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,it=null,kt=null,ne=null;if(Lu=!ot,Lu&&(ot="<!-->"),typeof ot!="string"&&!Uv(ot))if(typeof ot.toString=="function"){if(ot=ot.toString(),typeof ot!="string")throw gs("dirty is not a string, aborting")}else throw gs("toString is not a function");if(!t.isSupported)return ot;if(xt||Iu(R),t.removed=[],typeof ot=="string"&&(je=!1),je){if(ot.nodeName){const kn=Xt(ot.nodeName);if(!X[kn]||K[kn])throw gs("root node is forbidden and cannot be sanitized in-place")}}else if(ot instanceof o)Z=$v("<!---->"),it=Z.ownerDocument.importNode(ot,!0),it.nodeType===vs.element&&it.nodeName==="BODY"||it.nodeName==="HTML"?Z=it:Z.appendChild(it);else{if(!st&&!A&&!V&&ot.indexOf("<")===-1)return b&&Ne?b.createHTML(ot):ot;if(Z=$v(ot),!Z)return st?null:Ne?S:""}Z&&Ut&&un(Z.firstChild);const Yt=Fv(je?ot:Z);for(;kt=Yt.nextNode();)Bv(kt),Vv(kt),kt.content instanceof s&&Q$(kt.content);if(je)return ot;if(st){if(_t)for(ne=D.call(Z.ownerDocument);Z.firstChild;)ne.appendChild(Z.firstChild);else ne=Z;return(Q.shadowroot||Q.shadowrootmode)&&(ne=P.call(r,ne,!0)),ne}let ve=V?Z.outerHTML:Z.innerHTML;return V&&X["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&oe(Im,Z.ownerDocument.doctype.name)&&(ve="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
4
4
  `+ve),A&&io([H,N,M],kn=>{ve=ps(ve,kn," ")}),b&&Ne?b.createHTML(ve):ve},t.setConfig=function(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Iu(ot),xt=!0},t.clearConfig=function(){oi=null,xt=!1},t.isValidAttribute=function(ot,R,Z){oi||Iu({});const it=Xt(ot),kt=Xt(R);return Hv(it,kt,Z)},t.addHook=function(ot,R){typeof R=="function"&&fs(w[ot],R)},t.removeHook=function(ot,R){if(R!==void 0){const Z=$I(w[ot],R);return Z===-1?void 0:FI(w[ot],Z,1)[0]}return wm(w[ot])},t.removeHooks=function(ot){w[ot]=[]},t.removeAllHooks=function(){w=Pm()},t}var pu=Nm();const oo=e=>pu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ek=e=>pu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ln=e=>pu.sanitize(e,{ALLOWED_TAGS:[]}),go=class go extends mt{constructor(){super(...arguments),this.type="toolbar",this.renderType=at.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:i,overflowMenuItemList:s}=this.getControlConfigs();s&&i.push(this.getOverflowButtonConfig());const a=n.selectAll("div.toolbar-control").data(i,c=>c.id);a.exit().remove();const o=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),l=this;o.merge(a).classed("disabled",c=>c.shouldBeDisabled()).attr("role","button").attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
5
5
  <button
6
+ type="button"
6
7
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
7
8
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${ln(c.id)}`)}" aria-label="${ln(c.title)}">
8
9
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
9
10
  ${ek(c.iconSVG.content)}
10
11
  </svg>
11
- </button>`).each(function(c,u){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(d){const h=I(this);h.classed("hovered",!0),l.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:d,hoveredElement:h,content:c.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){l.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",d=>{c.shouldBeDisabled()||l.triggerFunctionAndEvent(c,d,this)}).on("keydown",d=>{d.key&&d.key==="Enter"||d.key===" "?(d.preventDefault(),l.triggerFunctionAndEvent(c,d,this)):d.key&&d.key==="ArrowLeft"?l.focusOnPreviousEnabledToolbarItem(u):d.key&&d.key==="ArrowRight"&&l.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,s)=>{const a=I(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(i,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",o=>{o&&o.key==="Enter"?n.triggerFunctionAndEvent(i,t,a.node()):o&&o.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(s):o&&o.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(s):o&&o.key==="Escape"&&n.updateOverflowMenu(!1),o.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===St.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${go.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===St.MAKE_FULLSCREEN&&l?a.type=St.EXIT_FULLSCREEN:a.type===St.EXIT_FULLSCREEN&&!l&&(a.type=St.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
+ </button>`).each(function(c,u){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(d){const h=I(this);h.classed("hovered",!0),l.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:d,hoveredElement:h,content:c.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){l.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",d=>{c.shouldBeDisabled()||l.triggerFunctionAndEvent(c,d,this)}).on("keydown",d=>{d.key&&d.key==="Enter"||d.key===" "?(d.preventDefault(),l.triggerFunctionAndEvent(c,d,this)):d.key&&d.key==="ArrowLeft"?l.focusOnPreviousEnabledToolbarItem(u):d.key&&d.key==="ArrowRight"&&l.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,s)=>{const a=I(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(i,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",o=>{o&&o.key==="Enter"?n.triggerFunctionAndEvent(i,t,a.node()):o&&o.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(s):o&&o.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(s):o&&o.key==="Escape"&&n.updateOverflowMenu(!1),o.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===St.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${go.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===St.MAKE_FULLSCREEN&&l?a.type=St.EXIT_FULLSCREEN:a.type===St.EXIT_FULLSCREEN&&!l&&(a.type=St.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
13
  <circle cx="16" cy="16" r="2"></circle>
13
14
  <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:f}=y(i,"locale","translations","toolbar");let p;switch(t){case St.ZOOM_IN:n&&(p={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case St.ZOOM_OUT:n&&(p={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case St.RESET_ZOOM:n&&(p={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case St.MAKE_FULLSCREEN:p={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case St.EXIT_FULLSCREEN:p={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case St.SHOW_AS_DATATABLE:p={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:f,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(T.Modal.SHOW)};break;case St.EXPORT_CSV:p={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case St.EXPORT_PNG:p={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case St.EXPORT_JPG:p={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return p}getControlIconByType(t){switch(t){case St.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
15
  <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case St.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
@@ -70,5 +71,5 @@
70
71
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
71
72
  <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"/>
72
73
  <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"/>
73
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Zr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Zr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function E2(e,t){const n=gi(this._current,e);return r=>(this._current=n(r),t(this._current))}class dv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=H_().value(M=>M[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(r,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>`${M[a]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return E2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(i,"locale"),v=i.pie.labels.enabled,x=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(r,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(x,M=>M.data[s]);b.exit().attr("opacity",0).remove();const S=b.enter().append("text").classed("pie-label",!0),_=[];S.merge(b).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=x.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=es.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=es.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(i,"donut")?"donut":"pie",D=y(i,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===es.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);$D(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class x2 extends dv{constructor(){super(...arguments),this.type="donut",this.renderType=at.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");k.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=mh:s=Ee;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const fv="4,10 8,6 12,10",pv="12,6 8,10 4,6";class b2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Bp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===cr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case qa.UP:return fv;case qa.DOWN:return pv;default:return t>0?fv:pv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Bi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Bi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(r,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Gt.CENTER?v=m/2:g===Gt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===cr.FULL&&!s?d=l(a):r===cr.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),x=p.selectAll("text.gauge-value-number").data([i]);x.enter().append("text").attr("class","gauge-value-number").merge(x).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,S=u?"%":"",_=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(S),{width:C,height:D}=k.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let S;return b!=null?S=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():S=0,c?`${c(S)}${m}`:`${a(Number(S),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),x=y(r,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&x?[i]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const S=y(r,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",S!==null?`gauge-delta-arrow status--${S}`:"").attr("points",t.getArrow(i))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===cr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class gv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ts(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),x=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,x),b=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return se({x0:g,x1:m,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ki().domain(t).rangeRound([0,this.getGroupWidth()])}}class S2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Pn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Pn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).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 p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xr.OFF&&(t===Xr.AUTO&&Rg.minCellDividerDimension<=this.xBandwidth&&Rg.minCellDividerDimension<=this.yBandwidth||t===Xr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=as(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class _2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),se({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class T2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?On.weight.unselected:On.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",On.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Mn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class O2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(y(i,"meter","proportional")===null)u=100;else{const E=y(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?jt.height.proportional:jt.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?jt.height.proportional:jt.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",E=>E.x).attr("y",0).attr("height",()=>f||(s?jt.height.proportional:jt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const x=r.selectAll("line.peak").data(v==null?[]:[v]);x.enter().append("line").classed("peak",!0).merge(x).attr("y1",0).attr("y2",()=>f||(s?jt.height.proportional:jt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),x.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function mv(e){const t=w2(vv(e),360);return Gn(t,[0,10])||Gn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Gn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Gn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Gn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Gn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Gn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Gn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function w2(e,t){return(e%t+t)%t}function Gn(e,[t,n]){return e>=t&&e<=n}function vv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function M2(e,t){return t*Math.sin(e-Math.PI/2)}class C2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=HD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?ur.opacity.unselected:ur.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?ur.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",ur.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=ur;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const x=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),S=(Math.min(r,i)-x)/2;if(S<=0)return;const _=ki().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=Pn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,zn(this.fullDataNormalized.map(A=>A[d]))]).range([g,S]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=z_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Lf),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=M2(_(A),S);return G+V}),M={x:zn(H)+h,y:i/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vr(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Ft(_(G),0,M).x).attr("y1",G=>Ft(_(G),0,M).y).attr("x2",G=>Ft(_(G),0,M).x).attr("y2",G=>Ft(_(G),0,M).y).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Ft(_(G),D.range()[1]+h,M).x).attr("y",G=>Ft(_(G),D.range()[1]+h,M).y).style("text-anchor",G=>mv(_(G)).textAnchor).style("dominant-baseline",G=>mv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(_(V),D.range()[1]+h,M).x).attr("y",V=>Ft(_(V),D.range()[1]+h,M).y).end().finally(()=>{const V=y(o,"radar","alignment"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",G=>P(G.name,null,G.data)).style("fill-opacity",ur.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",xt=>w(xt.data))}),A=>(A.attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>P(G.name,null,G.data)).style("stroke",G=>P(G.name,null,G.data)),A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(V.data))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vr(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${vv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).attr("x",G=>Ft(-Math.PI/2,D(G),M).x+f).attr("y",G=>Ft(-Math.PI/2,D(G),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,D(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,D(V),M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-i.width)/2):t===Gt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",ur.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class yv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return se({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class A2 extends ue{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Ev extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?Tn.opacity.unselected:Tn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=Yl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Tn.opacity.selected).attr("d",this.areaGenerator)}}class xv extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return se({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class bv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const bs=6;class D2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+bs:30-bs},h=Li({name:o,children:a}),f=10,p=r/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,w].join(" ")),N=S.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-6:bs).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===Ya.DENDROGRAM?hb().size([i,r-u-v*bs-l]):Qb().nodeSize([f,p]).size([i,r-u-v*bs-l]),E=j_().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),x(h),n.attr("viewBox",[-d.left,-0,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),S=n.append("g").attr("class","nodes");g(h)}}var L2="#000000",R2="#ffffff",I2="#fcf4d6",k2="#fddc69",P2="#f1c21b",N2="#d2a106",$2="#b28600",F2="#8e6a00",U2="#684e00",B2="#483700",H2="#302400",G2="#1c1500",V2={10:I2,20:k2,30:P2,40:N2,50:$2,60:F2,70:U2,80:B2,90:H2,100:G2},z2="#fff2e8",W2="#ffd9be",Y2="#ffb784",q2="#ff832b",X2="#eb6200",Z2="#ba4e00",j2="#8a3800",K2="#5e2900",Q2="#3e1a00",J2="#231000",tP={10:z2,20:W2,30:Y2,40:q2,50:X2,60:Z2,70:j2,80:K2,90:Q2,100:J2},eP="#fff1f1",nP="#ffd7d9",rP="#ffb3b8",iP="#ff8389",sP="#fa4d56",aP="#da1e28",oP="#a2191f",lP="#750e13",cP="#520408",uP="#2d0709",hP={10:eP,20:nP,30:rP,40:iP,50:sP,60:aP,70:oP,80:lP,90:cP,100:uP},dP="#fff0f7",fP="#ffd6e8",pP="#ffafd2",gP="#ff7eb6",mP="#ee5396",vP="#d02670",yP="#9f1853",EP="#740937",xP="#510224",bP="#2a0a18",SP={10:dP,20:fP,30:pP,40:gP,50:mP,60:vP,70:yP,80:EP,90:xP,100:bP},_P="#f6f2ff",TP="#e8daff",OP="#d4bbff",wP="#be95ff",MP="#a56eff",CP="#8a3ffc",AP="#6929c4",DP="#491d8b",LP="#31135e",RP="#1c0f30",IP={10:_P,20:TP,30:OP,40:wP,50:MP,60:CP,70:AP,80:DP,90:LP,100:RP},kP="#edf5ff",PP="#d0e2ff",NP="#a6c8ff",$P="#78a9ff",FP="#4589ff",UP="#0f62fe",BP="#0043ce",HP="#002d9c",GP="#001d6c",VP="#001141",zP={10:kP,20:PP,30:NP,40:$P,50:FP,60:UP,70:BP,80:HP,90:GP,100:VP},WP="#e5f6ff",YP="#bae6ff",qP="#82cfff",XP="#33b1ff",ZP="#1192e8",jP="#0072c3",KP="#00539a",QP="#003a6d",JP="#012749",tN="#061727",eN={10:WP,20:YP,30:qP,40:XP,50:ZP,60:jP,70:KP,80:QP,90:JP,100:tN},nN="#d9fbfb",rN="#9ef0f0",iN="#3ddbd9",sN="#08bdba",aN="#009d9a",oN="#007d79",lN="#005d5d",cN="#004144",uN="#022b30",hN="#081a1c",dN={10:nN,20:rN,30:iN,40:sN,50:aN,60:oN,70:lN,80:cN,90:uN,100:hN},fN="#defbe6",pN="#a7f0ba",gN="#6fdc8c",mN="#42be65",vN="#24a148",yN="#198038",EN="#0e6027",xN="#044317",bN="#022d0d",SN="#071908",_N={10:fN,20:pN,30:gN,40:mN,50:vN,60:yN,70:EN,80:xN,90:bN,100:SN},TN="#f2f4f8",ON="#dde1e6",wN="#c1c7cd",MN="#a2a9b0",CN="#878d96",AN="#697077",DN="#4d5358",LN="#343a3f",RN="#21272a",IN="#121619",kN={10:TN,20:ON,30:wN,40:MN,50:CN,60:AN,70:DN,80:LN,90:RN,100:IN},PN="#f4f4f4",NN="#e0e0e0",$N="#c6c6c6",FN="#a8a8a8",UN="#8d8d8d",BN="#6f6f6f",HN="#525252",GN="#393939",VN="#262626",zN="#161616",WN={10:PN,20:NN,30:$N,40:FN,50:UN,60:BN,70:HN,80:GN,90:VN,100:zN},YN="#f7f3f2",qN="#e5e0df",XN="#cac5c4",ZN="#ada8a8",jN="#8f8b8b",KN="#726e6e",QN="#565151",JN="#3c3838",t$="#272525",e$="#171414",n$={10:YN,20:qN,30:XN,40:ZN,50:jN,60:KN,70:QN,80:JN,90:t$,100:e$},Sv={black:{100:L2},blue:zP,coolGray:kN,cyan:eN,gray:WN,green:_N,magenta:SP,orange:tP,purple:IP,red:hP,teal:dN,warmGray:n$,white:{0:R2},yellow:V2};const r$=e=>{if(!e)return null;for(const t of Object.keys(Sv)){const n=Sv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},_v=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=hn(n);let i;if(r&&(i=r$(r?r.hex():null)),i==null){const s=dh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let i$=0;class s$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Li({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=rS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>i$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",_v).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),x=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${x}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",_v),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),hn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function a$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var l$={value:function(){}};function Tv(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new po(n)}function po(e){this._=e}function c$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}po.prototype=Tv.prototype={constructor:po,on:function(e,t){var n=this._,r=c$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=u$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Ov(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ov(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new po(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function u$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ov(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=l$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const h$=o$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Tv},Symbol.toStringTag,{value:"Module"})));var Au,wv;function d$(){if(wv)return Au;wv=1;const e=h$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;Au=function(){var b=[256,256],S=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=x;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=N.map(function(j,J){return j.text=S.call(this,j,J),j.font=_.call(this,j,J),j.style=D.call(this,j,J),j.weight=B.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(r<<5)/ut,Y.height=i/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,Q.y=K+G,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,Ss=(Q.y+Q.y0)*Ut+(st>>5),_s,mr=0;mr<Oe;mr++){_s=0;for(var je=0;je<=xt;je++)Y[Ss+je]|=_s<<Ne|(je<xt?(_s=V[mr*xt+je])>>>_t:0);Ss+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(S=E(Y),L):S},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,S,_,C){if(!S.sprite){var D=b.context,B=b.ratio;D.clearRect(0,0,(r<<5)/B,i/B);var P=0,w=0,H=0,N=_.length;for(--C;++C<N;){S=_[C],D.save(),D.font=S.style+" "+S.weight+" "+~~((S.size+1)/B)+"px "+S.font;const J=D.measureText(S.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=S.size<<1;if(S.rotate){var M=Math.sin(S.rotate*t),O=Math.cos(S.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=r<<5&&(P=0,w+=H,H=0),w+V>=i)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),S.rotate&&D.rotate(S.rotate*t),D.fillText(S.text,A,0),S.padding&&(D.lineWidth=2*S.padding,D.strokeText(S.text,A,0)),D.restore(),S.width=G,S.height=V,S.xoff=P,S.yoff=w,S.x1=G>>1,S.y1=V>>1,S.x0=-S.x1,S.y0=-S.y1,S.hasText=!0,P+=G}for(var tt=D.getImageData(0,0,(r<<5)/B,i/B).data,X=[];--C>=0;)if(S=_[C],!!S.hasText){for(var Y=S.width,Q=Y>>5,ut=S.y1-S.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=S.xoff,P==null)return;w=S.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(r<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(S.y0++,ut--,ht--,w++)}S.y1=S.y0+nt,S.sprite=X.slice(0,(S.y1-S.y0)*Q)}}}function h(b,S,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&S[N+$])return!0;N+=_}return!1}function f(b,S){var _=b[0],C=b[1];S.x+S.x0<_.x&&(_.x=S.x+S.x0),S.y+S.y0<_.y&&(_.y=S.y+S.y0),S.x+S.x1>C.x&&(C.x=S.x+S.x1),S.y+S.y1>C.y&&(C.y=S.y+S.y1)}function p(b,S){return b.x+b.x1>S[0].x&&b.x+b.x0<S[1].x&&b.y+b.y1>S[0].y&&b.y+b.y0<S[1].y}function g(b){var S=b[0]/b[1];return function(_){return[S*(_*=.1)*Math.cos(_),_*Math.sin(_)]}}function m(b){var S=4,_=S*b[0]/b[1],C=0,D=0;return function(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-P&3){case 0:C+=_;break;case 1:D+=S;break;case 2:C-=_;break;default:D-=S;break}return[C,D]}}function v(b){for(var S=[],_=-1;++_<b;)S[_]=0;return S}function x(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Au}var f$=d$();const p$=a$(f$);class g$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=p$().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=k.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,x=>`${x[c]}-${x.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",x=>`${x.size}px`).text(function(x){return x.text}).attr("class",x=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x[c],originalClassName:`word ${x.size>32?"light":""}`})).style("fill",x=>n.model.getFillColor(x[c],x.text,x)).attr("text-anchor","middle").transition().call(x=>n.services.transitions.setupTransition({transition:x,name:"wordcloud-text-update-enter",animate:t})).attr("transform",x=>`translate(${x.x}, ${x.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Fe(i):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Wa(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class m$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=p2(s,Object.values(l)),u=h2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=$x().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Hi()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case an.geoEqualEarth:t=nb();break;case an.geoAlbers:t=Zx();break;case an.geoConicEqualArea:t=Ld();break;case an.geoConicEquidistant:t=tb();break;case an.geoEquirectangular:t=Qx();break;case an.geoMercator:t=jx();break;case an.geoNaturalEarth1:t=rb();break;default:throw new Error("Projection is not supported.")}return t}}class v$ extends m${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.HIDE,{event:r,hoveredElement:s})})}}class Mv extends Ze{constructor(t,n){super(t,n),this.model=new o2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:lr.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new hv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new v$(this.model,this.services)];return this.getChartComponents(t)}}class y$ extends on{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=ct({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:zt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class E$ extends Ze{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new y2(this.model,this.services)];return this.getChartComponents(t)}}const Cv={[be.LINE]:[ei,cn],[be.SCATTER]:[cn],[be.AREA]:[sv,ei,cn],[be.STACKED_AREA]:[Ev,ei,bv,fo],[be.SIMPLE_BAR]:[yv],[be.GROUPED_BAR]:[gv,ni],[be.STACKED_BAR]:[xv,fo]};class x$ extends ge{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Cv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${oC(i.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),i.options),i.type===be.STACKED_AREA&&(o=!0),Cv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Hn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class b$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Av extends Ze{constructor(t,n,r=!1){super(t,n),this.model=new b$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new dv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class S$ extends Av{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class _$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class T$ extends Ze{constructor(t,n){super(t,n),this.model=new _$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new b2(this.model,this.services)];return this.getChartComponents(t)}}class O$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new gv(this.model,this.services),new ni(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class w$ extends pr{constructor(t){super(t),this.axisFlavor=ss.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==rt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==rt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==rt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==rt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Fe(this.getDisplayData(),r=>r.value),n=Ge().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=_n(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(_n(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!We(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=cv(this.getDisplayData(),l)}}class M$ extends ge{constructor(t,n){super(t,n),this.model=new w$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:lr.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new hv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new Xm(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class C$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class A$ extends ge{constructor(t,n){super(t,n),this.model=new C$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new m2(this.model,this.services),new _2(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new ei(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new A2(this.model,this.services),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class L$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new T2(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class R$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class I$ extends Ze{constructor(t,n){var i;super(t,n),this.model=new R$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?ct(_n(At.proportionalMeterChart),n.options):ct(_n(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new v2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new O2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],r=[new ce(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:at.HTML})}}class k$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}class P$ extends Ze{constructor(t,n){super(t,n),this.model=new k$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new C2(this.model,this.services)];return this.getChartComponents(t)}}class N$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class $$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class F$ extends Ze{constructor(t,n){super(t,n),this.model=new $$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new D2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class U$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class B$ extends Ze{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new s$(this.model,this.services)];return this.getChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new yv(this.model,this.services),new ni(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new Ev(this.model,this.services),new ei(this.model,this.services,{stacked:!0}),new bv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class V$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new xv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class z$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class W$ extends Ze{constructor(t,n){super(t,n),this.model=new z$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new g$(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Ck,q.AreaChart=Qk,q.AreaEvent=Nc,q.ArrowDirections=qa,q.AxisEvent=Pc,q.AxisFlavor=ss,q.AxisPositions=z,q.AxisTitleOrientations=Xa,q.BarEvent=Bc,q.BoxplotChart=e2,q.BoxplotEvent=Hc,q.BubbleChart=r2,q.BulletChart=a2,q.CalloutDirections=es,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=Mv,q.CirclePackChart=E$,q.ColorClassNameTypes=lt,q.ColorLegendType=is,q.ComboChart=x$,q.DividerStatus=Xr,q.DominantBaseline=sn,q.DonutChart=S$,q.ExperimentalChoroplethChart=Mv,q.GaugeChart=T$,q.GaugeEvent=Uc,q.GaugeTypes=cr,q.GroupedBarChart=O$,q.HeatmapChart=M$,q.HistogramChart=A$,q.LayoutAlignItems=lr,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qr,q.LegendPositions=Yr,q.LineChart=D$,q.LineEvent=Vc,q.LollipopChart=L$,q.MeterChart=I$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Av,q.PieEvent=Fc,q.Projection=an,q.RadarChart=P$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=rt,q.ScatterChart=N$,q.ScatterEvent=Gc,q.SimpleBarChart=H$,q.Skeletons=Vt,q.StackedAreaChart=G$,q.StackedBarChart=V$,q.Statuses=ns,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=rs,q.ToolbarControlTypes=St,q.TooltipEvent=zr,q.TreeChart=F$,q.TreeEvent=Wc,q.TreeTypes=Ya,q.TreemapChart=B$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=W$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
74
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Zr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Zr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function E2(e,t){const n=gi(this._current,e);return r=>(this._current=n(r),t(this._current))}class dv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=H_().value(M=>M[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(r,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>[M[a],Zc(M.data[a],o,a)+"%",M.data[s]].filter(Boolean).join(", ")).attrTween("d",function(M){return E2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(i,"locale"),v=i.pie.labels.enabled,x=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(r,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(x,M=>M.data[s]);b.exit().attr("opacity",0).remove();const S=b.enter().append("text").classed("pie-label",!0),_=[];S.merge(b).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=x.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=es.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=es.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(i,"donut")?"donut":"pie",D=y(i,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===es.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);$D(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class x2 extends dv{constructor(){super(...arguments),this.type="donut",this.renderType=at.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");k.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=mh:s=Ee;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const fv="4,10 8,6 12,10",pv="12,6 8,10 4,6";class b2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Bp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===cr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case qa.UP:return fv;case qa.DOWN:return pv;default:return t>0?fv:pv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Bi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Bi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(r,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Gt.CENTER?v=m/2:g===Gt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===cr.FULL&&!s?d=l(a):r===cr.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),x=p.selectAll("text.gauge-value-number").data([i]);x.enter().append("text").attr("class","gauge-value-number").merge(x).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,S=u?"%":"",_=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(S),{width:C,height:D}=k.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let S;return b!=null?S=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():S=0,c?`${c(S)}${m}`:`${a(Number(S),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),x=y(r,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&x?[i]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const S=y(r,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",S!==null?`gauge-delta-arrow status--${S}`:"").attr("points",t.getArrow(i))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===cr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class gv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ts(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),x=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,x),b=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return se({x0:g,x1:m,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ki().domain(t).rangeRound([0,this.getGroupWidth()])}}class S2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Pn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Pn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).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 p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xr.OFF&&(t===Xr.AUTO&&Rg.minCellDividerDimension<=this.xBandwidth&&Rg.minCellDividerDimension<=this.yBandwidth||t===Xr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=as(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class _2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),se({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class T2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?On.weight.unselected:On.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",On.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Mn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class O2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(y(i,"meter","proportional")===null)u=100;else{const E=y(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?jt.height.proportional:jt.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?jt.height.proportional:jt.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",E=>E.x).attr("y",0).attr("height",()=>f||(s?jt.height.proportional:jt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const x=r.selectAll("line.peak").data(v==null?[]:[v]);x.enter().append("line").classed("peak",!0).merge(x).attr("y1",0).attr("y2",()=>f||(s?jt.height.proportional:jt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),x.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function mv(e){const t=w2(vv(e),360);return Gn(t,[0,10])||Gn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Gn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Gn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Gn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Gn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Gn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Gn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function w2(e,t){return(e%t+t)%t}function Gn(e,[t,n]){return e>=t&&e<=n}function vv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function M2(e,t){return t*Math.sin(e-Math.PI/2)}class C2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=HD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?ur.opacity.unselected:ur.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?ur.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",ur.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=ur;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const x=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),S=(Math.min(r,i)-x)/2;if(S<=0)return;const _=ki().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=Pn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,zn(this.fullDataNormalized.map(A=>A[d]))]).range([g,S]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=z_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Lf),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=M2(_(A),S);return G+V}),M={x:zn(H)+h,y:i/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vr(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Ft(_(G),0,M).x).attr("y1",G=>Ft(_(G),0,M).y).attr("x2",G=>Ft(_(G),0,M).x).attr("y2",G=>Ft(_(G),0,M).y).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Ft(_(G),D.range()[1]+h,M).x).attr("y",G=>Ft(_(G),D.range()[1]+h,M).y).style("text-anchor",G=>mv(_(G)).textAnchor).style("dominant-baseline",G=>mv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(_(V),D.range()[1]+h,M).x).attr("y",V=>Ft(_(V),D.range()[1]+h,M).y).end().finally(()=>{const V=y(o,"radar","alignment"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",G=>P(G.name,null,G.data)).style("fill-opacity",ur.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",xt=>w(xt.data))}),A=>(A.attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>P(G.name,null,G.data)).style("stroke",G=>P(G.name,null,G.data)),A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(V.data))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vr(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${vv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).attr("x",G=>Ft(-Math.PI/2,D(G),M).x+f).attr("y",G=>Ft(-Math.PI/2,D(G),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,D(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,D(V),M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-i.width)/2):t===Gt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",ur.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class yv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return se({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class A2 extends ue{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Ev extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?Tn.opacity.unselected:Tn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=Yl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Tn.opacity.selected).attr("d",this.areaGenerator)}}class xv extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return se({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class bv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const bs=6;class D2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+bs:30-bs},h=Li({name:o,children:a}),f=10,p=r/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,w].join(" ")),N=S.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-6:bs).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===Ya.DENDROGRAM?hb().size([i,r-u-v*bs-l]):Qb().nodeSize([f,p]).size([i,r-u-v*bs-l]),E=j_().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),x(h),n.attr("viewBox",[-d.left,-0,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),S=n.append("g").attr("class","nodes");g(h)}}var L2="#000000",R2="#ffffff",I2="#fcf4d6",k2="#fddc69",P2="#f1c21b",N2="#d2a106",$2="#b28600",F2="#8e6a00",U2="#684e00",B2="#483700",H2="#302400",G2="#1c1500",V2={10:I2,20:k2,30:P2,40:N2,50:$2,60:F2,70:U2,80:B2,90:H2,100:G2},z2="#fff2e8",W2="#ffd9be",Y2="#ffb784",q2="#ff832b",X2="#eb6200",Z2="#ba4e00",j2="#8a3800",K2="#5e2900",Q2="#3e1a00",J2="#231000",tP={10:z2,20:W2,30:Y2,40:q2,50:X2,60:Z2,70:j2,80:K2,90:Q2,100:J2},eP="#fff1f1",nP="#ffd7d9",rP="#ffb3b8",iP="#ff8389",sP="#fa4d56",aP="#da1e28",oP="#a2191f",lP="#750e13",cP="#520408",uP="#2d0709",hP={10:eP,20:nP,30:rP,40:iP,50:sP,60:aP,70:oP,80:lP,90:cP,100:uP},dP="#fff0f7",fP="#ffd6e8",pP="#ffafd2",gP="#ff7eb6",mP="#ee5396",vP="#d02670",yP="#9f1853",EP="#740937",xP="#510224",bP="#2a0a18",SP={10:dP,20:fP,30:pP,40:gP,50:mP,60:vP,70:yP,80:EP,90:xP,100:bP},_P="#f6f2ff",TP="#e8daff",OP="#d4bbff",wP="#be95ff",MP="#a56eff",CP="#8a3ffc",AP="#6929c4",DP="#491d8b",LP="#31135e",RP="#1c0f30",IP={10:_P,20:TP,30:OP,40:wP,50:MP,60:CP,70:AP,80:DP,90:LP,100:RP},kP="#edf5ff",PP="#d0e2ff",NP="#a6c8ff",$P="#78a9ff",FP="#4589ff",UP="#0f62fe",BP="#0043ce",HP="#002d9c",GP="#001d6c",VP="#001141",zP={10:kP,20:PP,30:NP,40:$P,50:FP,60:UP,70:BP,80:HP,90:GP,100:VP},WP="#e5f6ff",YP="#bae6ff",qP="#82cfff",XP="#33b1ff",ZP="#1192e8",jP="#0072c3",KP="#00539a",QP="#003a6d",JP="#012749",tN="#061727",eN={10:WP,20:YP,30:qP,40:XP,50:ZP,60:jP,70:KP,80:QP,90:JP,100:tN},nN="#d9fbfb",rN="#9ef0f0",iN="#3ddbd9",sN="#08bdba",aN="#009d9a",oN="#007d79",lN="#005d5d",cN="#004144",uN="#022b30",hN="#081a1c",dN={10:nN,20:rN,30:iN,40:sN,50:aN,60:oN,70:lN,80:cN,90:uN,100:hN},fN="#defbe6",pN="#a7f0ba",gN="#6fdc8c",mN="#42be65",vN="#24a148",yN="#198038",EN="#0e6027",xN="#044317",bN="#022d0d",SN="#071908",_N={10:fN,20:pN,30:gN,40:mN,50:vN,60:yN,70:EN,80:xN,90:bN,100:SN},TN="#f2f4f8",ON="#dde1e6",wN="#c1c7cd",MN="#a2a9b0",CN="#878d96",AN="#697077",DN="#4d5358",LN="#343a3f",RN="#21272a",IN="#121619",kN={10:TN,20:ON,30:wN,40:MN,50:CN,60:AN,70:DN,80:LN,90:RN,100:IN},PN="#f4f4f4",NN="#e0e0e0",$N="#c6c6c6",FN="#a8a8a8",UN="#8d8d8d",BN="#6f6f6f",HN="#525252",GN="#393939",VN="#262626",zN="#161616",WN={10:PN,20:NN,30:$N,40:FN,50:UN,60:BN,70:HN,80:GN,90:VN,100:zN},YN="#f7f3f2",qN="#e5e0df",XN="#cac5c4",ZN="#ada8a8",jN="#8f8b8b",KN="#726e6e",QN="#565151",JN="#3c3838",t$="#272525",e$="#171414",n$={10:YN,20:qN,30:XN,40:ZN,50:jN,60:KN,70:QN,80:JN,90:t$,100:e$},Sv={black:{100:L2},blue:zP,coolGray:kN,cyan:eN,gray:WN,green:_N,magenta:SP,orange:tP,purple:IP,red:hP,teal:dN,warmGray:n$,white:{0:R2},yellow:V2};const r$=e=>{if(!e)return null;for(const t of Object.keys(Sv)){const n=Sv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},_v=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=hn(n);let i;if(r&&(i=r$(r?r.hex():null)),i==null){const s=dh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let i$=0;class s$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Li({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=rS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>i$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",_v).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),x=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${x}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",_v),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),hn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function a$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var l$={value:function(){}};function Tv(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new po(n)}function po(e){this._=e}function c$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}po.prototype=Tv.prototype={constructor:po,on:function(e,t){var n=this._,r=c$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=u$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Ov(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ov(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new po(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function u$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ov(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=l$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const h$=o$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Tv},Symbol.toStringTag,{value:"Module"})));var Au,wv;function d$(){if(wv)return Au;wv=1;const e=h$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;Au=function(){var b=[256,256],S=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=x;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=N.map(function(j,J){return j.text=S.call(this,j,J),j.font=_.call(this,j,J),j.style=D.call(this,j,J),j.weight=B.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(r<<5)/ut,Y.height=i/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,Q.y=K+G,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,Ss=(Q.y+Q.y0)*Ut+(st>>5),_s,mr=0;mr<Oe;mr++){_s=0;for(var je=0;je<=xt;je++)Y[Ss+je]|=_s<<Ne|(je<xt?(_s=V[mr*xt+je])>>>_t:0);Ss+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(S=E(Y),L):S},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,S,_,C){if(!S.sprite){var D=b.context,B=b.ratio;D.clearRect(0,0,(r<<5)/B,i/B);var P=0,w=0,H=0,N=_.length;for(--C;++C<N;){S=_[C],D.save(),D.font=S.style+" "+S.weight+" "+~~((S.size+1)/B)+"px "+S.font;const J=D.measureText(S.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=S.size<<1;if(S.rotate){var M=Math.sin(S.rotate*t),O=Math.cos(S.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=r<<5&&(P=0,w+=H,H=0),w+V>=i)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),S.rotate&&D.rotate(S.rotate*t),D.fillText(S.text,A,0),S.padding&&(D.lineWidth=2*S.padding,D.strokeText(S.text,A,0)),D.restore(),S.width=G,S.height=V,S.xoff=P,S.yoff=w,S.x1=G>>1,S.y1=V>>1,S.x0=-S.x1,S.y0=-S.y1,S.hasText=!0,P+=G}for(var tt=D.getImageData(0,0,(r<<5)/B,i/B).data,X=[];--C>=0;)if(S=_[C],!!S.hasText){for(var Y=S.width,Q=Y>>5,ut=S.y1-S.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=S.xoff,P==null)return;w=S.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(r<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(S.y0++,ut--,ht--,w++)}S.y1=S.y0+nt,S.sprite=X.slice(0,(S.y1-S.y0)*Q)}}}function h(b,S,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&S[N+$])return!0;N+=_}return!1}function f(b,S){var _=b[0],C=b[1];S.x+S.x0<_.x&&(_.x=S.x+S.x0),S.y+S.y0<_.y&&(_.y=S.y+S.y0),S.x+S.x1>C.x&&(C.x=S.x+S.x1),S.y+S.y1>C.y&&(C.y=S.y+S.y1)}function p(b,S){return b.x+b.x1>S[0].x&&b.x+b.x0<S[1].x&&b.y+b.y1>S[0].y&&b.y+b.y0<S[1].y}function g(b){var S=b[0]/b[1];return function(_){return[S*(_*=.1)*Math.cos(_),_*Math.sin(_)]}}function m(b){var S=4,_=S*b[0]/b[1],C=0,D=0;return function(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-P&3){case 0:C+=_;break;case 1:D+=S;break;case 2:C-=_;break;default:D-=S;break}return[C,D]}}function v(b){for(var S=[],_=-1;++_<b;)S[_]=0;return S}function x(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Au}var f$=d$();const p$=a$(f$);class g$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=p$().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=k.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,x=>`${x[c]}-${x.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",x=>`${x.size}px`).text(function(x){return x.text}).attr("class",x=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x[c],originalClassName:`word ${x.size>32?"light":""}`})).style("fill",x=>n.model.getFillColor(x[c],x.text,x)).attr("text-anchor","middle").transition().call(x=>n.services.transitions.setupTransition({transition:x,name:"wordcloud-text-update-enter",animate:t})).attr("transform",x=>`translate(${x.x}, ${x.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Fe(i):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Wa(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class m$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=p2(s,Object.values(l)),u=h2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=$x().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Hi()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case an.geoEqualEarth:t=nb();break;case an.geoAlbers:t=Zx();break;case an.geoConicEqualArea:t=Ld();break;case an.geoConicEquidistant:t=tb();break;case an.geoEquirectangular:t=Qx();break;case an.geoMercator:t=jx();break;case an.geoNaturalEarth1:t=rb();break;default:throw new Error("Projection is not supported.")}return t}}class v$ extends m${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.HIDE,{event:r,hoveredElement:s})})}}class Mv extends Ze{constructor(t,n){super(t,n),this.model=new o2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:lr.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new hv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new v$(this.model,this.services)];return this.getChartComponents(t)}}class y$ extends on{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=ct({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:zt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class E$ extends Ze{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new y2(this.model,this.services)];return this.getChartComponents(t)}}const Cv={[be.LINE]:[ei,cn],[be.SCATTER]:[cn],[be.AREA]:[sv,ei,cn],[be.STACKED_AREA]:[Ev,ei,bv,fo],[be.SIMPLE_BAR]:[yv],[be.GROUPED_BAR]:[gv,ni],[be.STACKED_BAR]:[xv,fo]};class x$ extends ge{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Cv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${oC(i.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),i.options),i.type===be.STACKED_AREA&&(o=!0),Cv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Hn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class b$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Av extends Ze{constructor(t,n,r=!1){super(t,n),this.model=new b$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new dv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class S$ extends Av{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class _$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class T$ extends Ze{constructor(t,n){super(t,n),this.model=new _$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new b2(this.model,this.services)];return this.getChartComponents(t)}}class O$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new gv(this.model,this.services),new ni(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class w$ extends pr{constructor(t){super(t),this.axisFlavor=ss.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==rt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==rt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==rt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==rt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Fe(this.getDisplayData(),r=>r.value),n=Ge().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=_n(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(_n(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!We(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=cv(this.getDisplayData(),l)}}class M$ extends ge{constructor(t,n){super(t,n),this.model=new w$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:lr.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new hv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new Xm(this.model,this.services),new lo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class C$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class A$ extends ge{constructor(t,n){super(t,n),this.model=new C$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new m2(this.model,this.services),new _2(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new ei(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new A2(this.model,this.services),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class L$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new T2(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class R$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class I$ extends Ze{constructor(t,n){var i;super(t,n),this.model=new R$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?ct(_n(At.proportionalMeterChart),n.options):ct(_n(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new v2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new O2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],r=[new ce(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:at.HTML})}}class k$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}class P$ extends Ze{constructor(t,n){super(t,n),this.model=new k$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new C2(this.model,this.services)];return this.getChartComponents(t)}}class N$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Hn(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class $$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class F$ extends Ze{constructor(t,n){super(t,n),this.model=new $$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new D2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class U$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class B$ extends Ze{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new s$(this.model,this.services)];return this.getChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new yv(this.model,this.services),new ni(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new Ev(this.model,this.services),new ei(this.model,this.services,{stacked:!0}),new bv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class V$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new fo(this.model,this.services),new xv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class z$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class W$ extends Ze{constructor(t,n){super(t,n),this.model=new z$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new g$(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Ck,q.AreaChart=Qk,q.AreaEvent=Nc,q.ArrowDirections=qa,q.AxisEvent=Pc,q.AxisFlavor=ss,q.AxisPositions=z,q.AxisTitleOrientations=Xa,q.BarEvent=Bc,q.BoxplotChart=e2,q.BoxplotEvent=Hc,q.BubbleChart=r2,q.BulletChart=a2,q.CalloutDirections=es,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=Mv,q.CirclePackChart=E$,q.ColorClassNameTypes=lt,q.ColorLegendType=is,q.ComboChart=x$,q.DividerStatus=Xr,q.DominantBaseline=sn,q.DonutChart=S$,q.ExperimentalChoroplethChart=Mv,q.GaugeChart=T$,q.GaugeEvent=Uc,q.GaugeTypes=cr,q.GroupedBarChart=O$,q.HeatmapChart=M$,q.HistogramChart=A$,q.LayoutAlignItems=lr,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qr,q.LegendPositions=Yr,q.LineChart=D$,q.LineEvent=Vc,q.LollipopChart=L$,q.MeterChart=I$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Av,q.PieEvent=Fc,q.Projection=an,q.RadarChart=P$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=rt,q.ScatterChart=N$,q.ScatterEvent=Gc,q.SimpleBarChart=H$,q.Skeletons=Vt,q.StackedAreaChart=G$,q.StackedBarChart=V$,q.Statuses=ns,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=rs,q.ToolbarControlTypes=St,q.TooltipEvent=zr,q.TreeChart=F$,q.TreeEvent=Wc,q.TreeTypes=Ya,q.TreemapChart=B$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=W$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
74
75
  //# sourceMappingURL=bundle.umd.cjs.map