@syncfusion/ej2-treemap 27.1.53 → 27.2.2

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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-treemap.min.js
3
- * version : 27.1.53
3
+ * version : 27.2.2
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- this.ej=this.ej||{},this.ej.treemap=function(e,t,i,r,l){"use strict";function o(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function n(e,i){var r=document.getElementById("treeMapMeasureText");return null===r&&(r=t.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(r)),r.innerHTML=t.SanitizeHtmlHelper.sanitize(e),r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new Ce(r.clientWidth,r.clientHeight)}function a(e,t,i){var r=t,l=n(t,i).width;if(l>e)for(var o=t.length-1;o>=0;--o)if(r=t.substring(0,o)+"...",(l=n(r,i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}function s(e,t,i,r){var l;switch(t){case"Near":l=e.x;break;case"Center":l="title"===r?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":l="title"===r?e.width-e.y-i.width:e.x+e.width-i.width}var o="title"===r?e.y+i.height/2:e.y+e.height/2+i.height/2;return new Te(l,o)}function h(e,t,i){var r=e.createText(t,i);return r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.style["user-select"]="none",r.style["-moz-user-select"]="none",r.style["-webkit-touch-callout"]="none",r.style["-webkit-user-select"]="none",r.style["-khtml-user-select"]="none",r.style["-ms-user-select"]="none",r.style["-o-user-select"]="none",r}function d(e,r,l,o,a){void 0===a&&(a=!1);var s,d,p,g={"font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:r.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:l},c="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],m=new i.SvgRenderer("");if(!t.isNullOrUndefined(c)&&!t.isNullOrUndefined(e.connectorText)&&c.search(e.connectorText[1])>=0)for(var u=c.split("#"),f=0;f<u.length;f++){var y=-1===u[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?u[f]:e.connectorText;if(g.id=e.id+"_"+f,p=h(m,g,y),f%2==0&&0!==f){y=y.replace(/\s+/g,"&nbsp")}var v=n(y,r);g.x=0!==f?g.x+v.width:g.x+v.width+5,o.appendChild(p)}else p=h(m,g,c),o.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var b=1,S=e.text.length;b<S;b++)d=n(e.text[b],r).height,s=m.createTSpan({x:e.x,id:e.id,y:e.y+b*d},e.text[b]),p.appendChild(s);o.appendChild(p)}return p}function p(e,i,r){var l,o=e.split("_RectPath")[0];l=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+o+"_LabelTemplate"),t.isNullOrUndefined(l)||(l.innerHTML=r)}function g(e){return document.getElementById(e)}function c(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function m(e,t,i,r){for(var l,o=!1,n="",a=r.leafItemSettings,s=0;s<e.length;s++){var h=i[l=r.levels[s]?r.levels[s].groupPath:a.labelPath?a.labelPath:r.weightValuePath]||"undefined";if(e[s]===h&&(n+=h+(s===e.length-1?"":"#"))===t){o=!0;break}}return o}function u(e){var t;if(e){var i=Object.keys(e);t={};for(var r=0;r<i.length;r++)if(e[i[r]]instanceof Array){t.values=e[i[r]],t.key=i[r];break}}return t}function f(e,t,i,r){if("Child"===i){t.push(e.levelOrderName);var l=u(e).values;if(l&&l.length>0){for(s=0;s<l.length;s++)-1===t.indexOf(l[s].levelOrderName)&&t.push(l[s].levelOrderName);for(var o=0;o<l.length;o++)f(l[o],t,i,r)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),f(e.parent,t,i,r));else if("All"===i)for(var n=e.levelOrderName.split("#")[0],a=void 0,s=0;s<r.layout.renderItems.length;s++)(a=r.layout.renderItems[s]).levelOrderName.indexOf(n)>-1&&-1===t.indexOf(a.levelOrderName)&&t.push(a.levelOrderName);else t.push(e.levelOrderName);return t}function y(e){var i=null;try{i="function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(r){i=t.compile(e)}return i}function v(e,i,r){var l=t.createElement("div",{id:i});l.style.cssText="position: absolute;pointer-events: auto;";for(var o=e.length;o>0;)l.appendChild(e[0]),o--;for(var n=l.innerHTML,a=Object.keys(r),s=0;s<a.length;s++){var h=RegExp;n=n.replace(new h("{{:"+a[s]+"}}","g"),r[a[s].toString()])}return l.innerHTML=n,l}function b(e,t,i,r,l){var o=new Te(0,0),n="Template"===r?l.areaRect.x:0,a="Template"===r?l.areaRect.y:0;return o.x=Math.abs(n-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!l.enableDrillDown||"BottomLeftTopRight"!==l.renderDirection&&"BottomRightTopLeft"!==l.renderDirection?o.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===r?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===r?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):o.y=Math.abs(e.y+e.height-i.height+5),o}function S(e,t){var i=new Ce(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var r=document.getElementById(e.id);return r.parentNode.removeChild(r),i}function x(e){return(e.width-e.x)*(e.height-e.y)}function w(e){var t=C(e),i=t.width,r=t.height;return Math.min(i,r)}function C(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function F(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function I(e,t,i){var r=i.getBoundingClientRect(),l=i.ownerDocument.defaultView.pageXOffset,o=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=r.left+l-a,h=r.top+o-n;return new Te(e-s,t-h)}function L(e,i,r){var l,o,n=[];if(t.isNullOrUndefined(i)&&t.isNullOrUndefined(r)&&isNaN(r))return null;for(var a=0;a<e.length;a++){var s=!1,h=r;t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to)||t.isNullOrUndefined(e[a].value)?(t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to))&&t.isNullOrUndefined(e[a].value)||(r>=e[a].from&&e[a].to>=r||e[a].value===i)&&(e[a].value===i&&(s=!0),l="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],h):e[a].color):r>=e[a].from&&e[a].to>=r&&e[a].value===i&&(s=!0,l="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],h):e[a].color),(r>=e[a].from&&r<=e[a].to||e[a].value===i)&&!t.isNullOrUndefined(e[a].minOpacity)&&!t.isNullOrUndefined(e[a].maxOpacity)&&l&&(o=O(e[a],r)),(""===l||t.isNullOrUndefined(l))&&t.isNullOrUndefined(e[a].from)&&t.isNullOrUndefined(e[a].to)&&t.isNullOrUndefined(e[a].minOpacity)&&t.isNullOrUndefined(e[a].maxOpacity)&&t.isNullOrUndefined(e[a].value)&&(l="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),o=t.isNullOrUndefined(o)?"1":o,n.push(l)}for(var d=n.length-1;d>=0;d--)d=(l=n[d])?-1:d;return{fill:l,opacity:o}}function O(e,t){var i=1;return t>=e.from&&t<=e.to&&(i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity),i.toString()}function T(e,t){return E(e,t)}function N(e,t,i){return"#"+V(e)+V(t)+V(i)}function E(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:N((i=D(Number(t),e)).r,i.g,i.b)}function D(e,t){var i=t.from,r=t.to,l=0,o=r-i;l=(e-i)/o;var n,a;if(t.color.length<=2)n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);else{n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);for(var s=o/(t.color.length-1),h=t.color.length-1,d=[],p={},g=1;g<h;g++)p={b:i+g*s,color:t.color[g]},d.push(p);for(var c=0;c<d.length;c++)i<=e&&e<=d[c].b&&0===c?(a="#"===d[c].color.charAt(0)?d[c].color:X(d[c].color),l=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s):d[c].b<=e&&e<=r&&c===d.length-1&&(n="#"===d[c].color.charAt(0)?d[c].color:X(d[c].color),l=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s),c!==d.length-1&&c<d.length&&d[c].b<=e&&e<=d[c+1].b&&(n="#"===d[c].color.charAt(0)?d[c].color:X(d[c].color),a="#"===d[c+1].color.charAt(0)?d[c+1].color:X(d[c+1].color),l=Math.abs(e-d[c+1].b)/s)}return M(l,n,a)}function M(e,t,i){var r=i.split("#")[1],l=t.split("#")[1],o=P(e,parseInt(l.substr(0,2),16),parseInt(r.substr(0,2),16)),n=P(e,parseInt(l.substr(2,2),16),parseInt(r.substr(2,2),16)),a=P(e,parseInt(l.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ne(o,n,a)}function P(e,t,i){var r=i-t;return Math.round(t+r*e)}function _(e,t,i){for(var r,l=t.split(" "),o="",s=[],h=0,d=l.length;h<d;h++)r=l[h],n(o.concat(r),i).width<e?o=o.concat((""===o?"":" ")+r):""!==o?(s.push(a(e,o,i)),o=r):(s.push(a(e,r,i)),r=""),o&&h===d-1&&s.push(a(e,o,i));return s}function B(e,t,i){var r=[],l=0,o=n(t,i).width,a=t.length;if(e>=o)return r.push(t),r;for(var s=t.length;s>l;s--){var h=t.slice(l,s);if((o=n(h,i).width)<=e){if(r.push(h),l+=h.length,a===l)return r;s=a+1}}return r}function R(e,t,i,r){var l=n(i,r);return l.width>e||l.height>t?" ":i}function z(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function U(e,t,i){var r=e.levelSelection;if(r)for(var l=0;l<r.length;l++)t.getAttribute("id")===r[l]?t.childElementCount>0&&(t.children[0].setAttribute("class",i),A(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function k(e,t){var i=e.legendId;if(i)for(var r=0;r<i.length;r++)for(var l=0;l<t.childElementCount;l++)if(t.childNodes[l].id===i[r]){var o=t.childNodes[l];o.setAttribute("fill",e.selectionSettings.fill),o.setAttribute("stroke",e.selectionSettings.border.color),o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("opacity",e.selectionSettings.opacity)}}function H(e,i,r){for(var l,o=0;o<e.length;o++)A(l=t.isNullOrUndefined(e[o].childNodes[0])?e[o]:e[o].childNodes[0],r.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])].options),e[o].classList.remove(i),o-=1}function A(e,i){e.setAttribute("opacity",i.opacity),t.isNullOrUndefined(i.fill)||e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function W(e,i,r){if(t.isNullOrUndefined(e))return null;for(var l=0,o=Object.keys(i);l<o.length;l++){var n=o[l];e=e.split("${"+n+"}").join(j(i[n],r).toString())}return e}function j(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}function G(e){return"#"+V(e.r)+V(e.g)+V(e.b)}function V(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function q(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Ne(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ne(255,255,255)}function X(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText");t.style.color=e;var i=(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(",");return G(new Ne(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function J(e,t,r,l,o){var n=new i.SvgRenderer(""),a=Y(e,r,t,o,l);return n["draw"+a.functionName](a.renderOption)}function Y(e,i,r,l,o){var n,a="Path",s=i.width,h=i.height,d=e.x,p=e.y,g=e.x+-s/2,c=e.y+-h/2;switch(r){case"Circle":case"Bubble":a="Ellipse",t.merge(l,{rx:s/2,ry:h/2,cx:d,cy:p});break;case"VerticalLine":n="M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(l,{d:n});break;case"Diamond":n="M "+g+" "+p+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+p+" L "+d+" "+(p+h/2)+" L "+g+" "+p+" z",t.merge(l,{d:n});break;case"Rectangle":n="M "+g+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" L "+g+" "+(p+-h/2)+" z",t.merge(l,{d:n});break;case"Triangle":n="M "+g+" "+(p+h/2)+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" z",t.merge(l,{d:n});break;case"InvertedTriangle":n="M "+(d+s/2)+" "+(p-h/2)+" L "+d+" "+(p+h/2)+" L "+(d-s/2)+" "+(p-h/2)+" L "+(d+s/2)+" "+(p-h/2)+" z",t.merge(l,{d:n});break;case"Pentagon":for(var m=void 0,u=void 0,f=0;f<=5;f++)m=s/2*Math.cos(Math.PI/180*(72*f)),u=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+m)+" "+(p+u)+" ":n.concat("L "+(d+m)+" "+(p+u)+" ");n=n.concat("Z"),t.merge(l,{d:n});break;case"Star":n="M "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" L "+(e.x-i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x+i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x-i.width/3)+" "+(e.y-i.height/2)+" L "+e.x+" "+(e.y+i.height/2)+" L "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" Z",t.merge(l,{d:n});break;case"Cross":n="M "+g+" "+p+" L "+(d+s/2)+" "+p+" M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(l,{d:n});break;case"Image":a="Image",t.merge(l,{href:o,height:h,width:s,x:g,y:c})}return{renderOption:l,functionName:a}}function Z(e,t){for(var i=!1,r=0;r<e.length;r++)if(t.levelOrderName===e[r].levelOrderName){i=!0;break}return i}function Q(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];K(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function $(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];K(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth);for(var r=i.ShapeCollection.Elements.length,l=0;l<r;l++)K(i.ShapeCollection.Elements[l],i.shapeOldFill,i.shapeOldOpacity,i.shapeOldBorderColor,i.shapeOldBorderWidth)}}function K(e,t,i,r,l){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",r),e.setAttribute("stroke-width",l)}function ee(e,t,i){Q(e),H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function te(e,t,i){for(var r,l=0;l<e;l++)for(var o=i.treeMapLegendModule.legendCollections[l].legendData.length,n=0;n<o;n++)if(i.treeMapLegendModule.legendCollections[l].legendData[n].levelOrderName===t.levelOrderName){r=l;break}return r}function ie(e,t,i,r,l,o,n){e.push({legendEle:r,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:l,shapeOldFill:o[i].options.fill,shapeOldOpacity:o[i].options.opacity,shapeOldBorderColor:o[i].options.border.color,shapeOldBorderWidth:o[i].options.border.width})}function re(e,i,r,l){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function le(e){var i=document.getElementById(e);return i?t.remove(i):null}function oe(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":t={backgroundColor:i,titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0}}return t}var ne="Roboto, Segoe UI, Noto, Sans-serif",ae=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),se=function(e,t,i,r){var l,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},he=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("#808080")],i.prototype,"color",void 0),se([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(10)],i.prototype,"left",void 0),se([t.Property(10)],i.prototype,"right",void 0),se([t.Property(10)],i.prototype,"top",void 0),se([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"size",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(ne)],i.prototype,"fontFamily",void 0),se([t.Property("")],i.prototype,"fontWeight",void 0),se([t.Property("Normal")],i.prototype,"fontStyle",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("")],i.prototype,"text",void 0),se([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),i}(ge),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Complex({},ce)],i.prototype,"subtitleSettings",void 0),i}(ge),ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"from",void 0),se([t.Property(null)],i.prototype,"to",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(null)],i.prototype,"label",void 0),se([t.Property(null)],i.prototype,"value",void 0),se([t.Property(null)],i.prototype,"minOpacity",void 0),se([t.Property(null)],i.prototype,"maxOpacity",void 0),se([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("Default")],i.prototype,"mode",void 0),se([t.Property("transparent")],i.prototype,"background",void 0),se([t.Property("Circle")],i.prototype,"shape",void 0),se([t.Property("")],i.prototype,"width",void 0),se([t.Property("")],i.prototype,"height",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(15)],i.prototype,"shapeWidth",void 0),se([t.Property(15)],i.prototype,"shapeHeight",void 0),se([t.Property(10)],i.prototype,"shapePadding",void 0),se([t.Property(null)],i.prototype,"imageUrl",void 0),se([t.Complex({color:null,width:null},he)],i.prototype,"border",void 0),se([t.Complex({color:"#000000",width:0},he)],i.prototype,"shapeBorder",void 0),se([t.Complex({},ge)],i.prototype,"title",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"titleStyle",void 0),se([t.Property("Bottom")],i.prototype,"position",void 0),se([t.Property("None")],i.prototype,"orientation",void 0),se([t.Property(!1)],i.prototype,"invertedPointer",void 0),se([t.Property("After")],i.prototype,"labelPosition",void 0),se([t.Property("None")],i.prototype,"labelDisplayMode",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Property({x:0,y:0})],i.prototype,"location",void 0),se([t.Property(null)],i.prototype,"showLegendPath",void 0),se([t.Property(null)],i.prototype,"valuePath",void 0),se([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupIndex",void 0),se([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property(0)],i.prototype,"gap",void 0),se([t.Property(10)],i.prototype,"padding",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showLabels",void 0),se([t.Property(null)],i.prototype,"labelPath",void 0),se([t.Property(null)],i.prototype,"labelFormat",void 0),se([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),se([t.Complex({color:null,size:null},pe)],i.prototype,"labelStyle",void 0),se([t.Property(null)],i.prototype,"labelTemplate",void 0),se([t.Property("Center")],i.prototype,"templatePosition",void 0),se([t.Property("Trim")],i.prototype,"interSectAction",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("")],i.prototype,"template",void 0),se([t.Property(null)],i.prototype,"format",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(.75)],i.prototype,"opacity",void 0),se([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),se([t.Complex({width:null,color:null},he)],i.prototype,"border",void 0),se([t.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},pe)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Se=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),xe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property("#808080")],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),we=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupPath",void 0),se([t.Property(0)],i.prototype,"groupGap",void 0),se([t.Property(10)],i.prototype,"groupPadding",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showHeader",void 0),se([t.Property(20)],i.prototype,"headerHeight",void 0),se([t.Property(null)],i.prototype,"headerTemplate",void 0),se([t.Property(null)],i.prototype,"headerFormat",void 0),se([t.Property("Near")],i.prototype,"headerAlignment",void 0),se([t.Complex({color:null,size:"13px"},pe)],i.prototype,"headerStyle",void 0),se([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),Ce=function(){function e(e,t){this.width=e,this.height=t}return e}(),Fe=function(){function e(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}return e}(),Ie=function(){function e(e,t,i,r,l,o){this.y=l.y,this.x=l.x,this.height=l.height,this.width=l.width,this.id=e,this.fill=t,this.opacity=r,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=o}return e}(),Le=function(){function e(e,t,i,r,l,o,n){this.id=e,this.opacity=l,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=o,this.d=n}return e}(),Oe=function(){function e(e,t,i,r,l,o,n,a){void 0===o&&(o=""),this.transform="",this.baseLine="auto",this.id=e,this.text=l,this.transform=o,this.anchor=r,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a}return e}(),Te=function(){function e(e,t){this.x=e,this.y=t}return e}(),Ne=function(){function e(e,t,i){this.r=e,this.g=t,this.b=i}return e}(),Ee=function(){function e(e,t,i,r,l){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=l}return e}(),De=function(){function e(e){this.treemap=e}return e.prototype.processLayoutPanel=function(){var e,i;if(this.treemap.treemapLevelData.levelsData&&this.treemap.treemapLevelData.levelsData.length>0)if(e=t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(t.isNullOrUndefined(this.treemap.drilledItems)?!t.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData[0]:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[])[0],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),t.isNullOrUndefined(this.treemap.currentLevel)||(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(e||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems();else{var r=this.treemap.drilledItems.length-1,l=this.treemap.drilledItems[r].data,o={};o[this.treemap.drilledItems[r].data.groupName]=[l],t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[r].data.groupIndex),this.calculateLayoutItems(o||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,r={},l=u(e).values;if(l&&l.length>0&&0===t.length){for(var o=0;o<l.length;o++)l[o].groupIndex===i.initialDrillDown.groupIndex&&l[o].name===i.initialDrillDown.groupName&&(l[o].isDrilled=!0,r[l[o].groupName]=[l[o]],t.push(r));for(var n=0;n<l.length;n++)this.getDrilldownData(l[n],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],t.isNullOrUndefined(this.treemap.weightValuePath)||(this.treemap.layoutType.indexOf("SliceAndDice")>-1?this.computeSliceAndDiceDimensional(e,i):(i.height=i.height+i.y,i.width=i.width+i.x,this.computeSquarifyDimensional(e,i)))},e.prototype.computeSliceAndDiceDimensional=function(e,t){var i,r,l,o,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=u(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var h=0;h<s.length;h++)r=s[h].groupIndex,l=0===a.length||r===a.length?n.gap:a[r].groupGap,o=0===a.length?0:a[r]?a[r].showHeader?a[r].headerHeight:0:a[r-1].showHeader?a[r-1].headerHeight:0,i=s[h].rect,i=new Fe(i.x+l/2,i.y+(o+l/2),i.width-l,Math.abs(i.height-(l+o))),this.computeSliceAndDiceDimensional(s[h],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var r,l=i.height*i.width,o=this.treemap.levels,n=0,a=0;e.forEach(function(e){a+=e.weight}),e.forEach(function(e){e.weightArea=l*e.weight/a});var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(c);for(var h=0;h<e.length;h++){var d=e[h];d.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||t.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?d.groupIndex===o.length-1:d.groupIndex===this.treemap.levels.length),s?(r=l/a*e[h].weight/i.height,n<=i.width&&(e[h].rect=new Fe(n+i.x,i.y,r,i.height))):(r=l/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new Fe(i.x,n+i.y,i.width,r))),n+=r,this.renderItems.push(e[h])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,r,l,o,n,a=this.treemap.leafItemSettings,s=this.treemap.levels,h=u(e).values;if(h&&h.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(h)),this.calculateChildrenLayout(e,h,t),this.treemap.levels.length>0))for(var d=0;d<h.length;d++)l=(r=h[d]).groupIndex,i=r.rect,o=(r.isLeafItem?a.padding:s[l].groupPadding)/2,n=this.treemap.isHierarchicalData?0===l&&r.isLeafItem?0:s[l]&&s[l].showHeader?s[l].headerHeight:0:0===s.length?0:s[l]&&s[l].showHeader?s[l].headerHeight:0,i=new Fe(i.x+o,i.y+(n+o),i.width-o,i.height-o),!r.isLeafItem&&r.weight>0&&this.computeSquarifyDimensional(h[d],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,x(i)),t.sort(z),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var l=e.length;if(0===l){c=this.getCoordinates(t,i);return m=r.concat(c)}var o=w(i),n=e[0],a=e.slice(1,l);if(this.aspectRatio(t,n,o)){var s=t.concat(n);return this.performRowsLayout(a,s,i,r)}for(var h=t.length,d=0,p=0;p<h;p+=1)d+=t[p].itemArea;var g=this.cutArea(i,d),c=this.getCoordinates(t,i),m=r.concat(c);return this.performRowsLayout(e,[],g,m)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var r=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(r,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,r=1/0,l=-1/0,o=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<r&&(r=a),a>l&&(l=a),o+=a}return Math.max(Math.pow(t,2)*l/Math.pow(o,2),Math.pow(o,2)/(Math.pow(t,2)*r))},e.prototype.cutArea=function(e,t){var i=C(e),r=i.width,l=i.height,o=i.x,n=i.y;if(r>=l){var a=t/l;return F(h={x:o+a,y:n,width:r-a,height:l})}var s=t/r,h={x:o,y:n+s,width:r,height:l-s};return F(h)},e.prototype.getCoordinates=function(e,i){for(var r,l=C(i),o=l.width,n=l.height,a=l.x,s=l.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<h;c+=1)g+=e[c].itemArea;for(var m,u,f,y=g/n,v=g/o,b=a,S=s,x=[],c=0;c<h;c+=1){var w=e[c];if(r=w.groupIndex,w.isLeafItem=0===d.length||(this.treemap.isHierarchicalData?r===d.length:!t.isNullOrUndefined(p.labelPath)&&r===d.length),u=Z(this.parentData[0],w),f=u?this.treemap.areaRect:w.parent.rect,m=w.isLeafItem?p.padding:d[r].groupPadding,o>=n){var F=S+w.itemArea/y;w.rect={x:b,y:S,width:b+y,height:F},S=F}else{var I=b+w.itemArea/v;w.rect={x:b,y:S,width:I,height:S+v},b=I}w.weight>0&&(u||Math.round(i.y+m/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+m/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),x.push(w))}return x},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,r=[],l=0;l<i;l+=1){for(var o=e.length,n=0,a=0;a<o;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<o;d++)(h=e[d]).itemArea=h.weight*s,r.push(h)}return r},e.prototype.onDemandProcess=function(e){var i,r={};r=e[0].parent,this.treemap.currentLevel=r.isDrilled?r.groupIndex:null;var l={};t.isNullOrUndefined(r.groupName)?l=r:l[r.groupName]=[r],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||(i=this.treemap.totalRect);for(var o=this.treemap.levels.length,n=0;n<o;n++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[n]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(l,i),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,r,l,o=this,n=this.treemap;this.renderer=n.renderer;var a,s,h,d,p,g,c,m,f,y,v,b,S,x=n.element.id,w=n.layoutType,F=this.treemap.leafItemSettings.interSectAction,I="",L=document.getElementById(n.element.id+"_Secondary_Element"),O=n.levels;this.layoutGroup=this.renderer.createGroup({id:x+"_TreeMap_"+w+"_Layout"});var T,N,E,D=t.createElement("div",{id:n.element.id+"_Label_Template_Group",className:"template"});D.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+n.areaRect.y+"px;left:"+n.areaRect.x+"px;height:"+n.areaRect.height+"px;width:"+n.areaRect.width+"px;";for(var M,P,_=!1,B=n.leafItemSettings,R=this,z=0;z<this.renderItems.length;z++)!function(w){if(c=R.renderItems[w],s=c.groupIndex,R.treemap.drillDownView&&t.isNullOrUndefined(R.treemap.currentLevel)&&s>0||R.treemap.drillDownView&&s>R.treemap.currentLevel+1)return"continue";d=c.rect,_=c.isLeafItem,y=x+"_Level_Index_"+s+"_Item_Index_"+w,T=R.renderer.createGroup({id:y+"_Group"}),b=(_?B.gap:O[s].groupGap)/2;var z=R.treemap.totalRect?C(R.treemap.totalRect):R.treemap.areaRect;"Squarified"===n.layoutType&&(d.width=Math.abs(d.x-d.width)-b,d.height=Math.abs(d.y-d.height)-b),"TopRightBottomLeft"===n.renderDirection?d.x=z.x+z.width-d.width-Math.abs(z.x-d.x):"BottomLeftTopRight"===n.renderDirection?d.y=z.y+z.height-d.height-Math.abs(z.y-d.y):"BottomRightTopLeft"===n.renderDirection&&(d.x=z.x+z.width-d.width-Math.abs(z.x-d.x),d.y=z.y+z.height-d.height-Math.abs(z.y-d.y)),r=R.getItemColor(_,c),g=r.fill,f=r.opacity,p=_?B.labelFormat:O[s].headerFormat;var k;if(i=_?B.showLabels:O[s].showHeader,s===R.treemap.currentLevel)if(R.treemap.enableBreadcrumb){P="#"+R.treemap.breadcrumbConnector+"#",k=c.levelOrderName.replace(/#/gi,P),k=0!==s?"#"+k:k}else k=c.name;else R.treemap.enableBreadcrumb&&(c.isDrilled=!1),k=c.name;m=W(p,c.data,R.treemap)||k||"undefined",M=u(c).values,m=!_&&M&&M.length>0&&R.treemap.enableDrillDown?c.isDrilled?n.enableRtl?m+" [-]":"[-] "+m:n.enableRtl?m+" [+]":"[+] "+m:m,(S=_?B.labelStyle:O[s].headerStyle).fontFamily=R.treemap.themeStyle.labelFontFamily||S.fontFamily,S.fontWeight=S.fontWeight||R.treemap.themeStyle.fontWeight,S.size=S.size||R.treemap.themeStyle.labelFontSize,E=_?B.border:O[s].border,e=_?B.labelPosition:"Near"===O[s].headerAlignment?"TopLeft":"Center"===O[s].headerAlignment?"TopCenter":"TopRight",h=_?B.templatePosition:O[s].templatePosition,N=_?B.labelTemplate:O[s].headerTemplate,c.options={border:E,opacity:f,fill:g},l={cancel:!1,name:"itemRendering",treemap:R.treemap,text:m,currentItem:c,RenderItems:R.renderItems,options:c.options},R.treemap.trigger("itemRendering",l,function(r){if(!r.cancel){I=" M "+d.x+" "+d.y+" L "+(d.x+d.width)+" "+d.y+" L "+(d.x+d.width)+" "+(d.y+d.height)+" L "+d.x+" "+(d.y+d.height)+"z",a=new Le(y+"_RectPath",g,E.width,E.color,f,null,I);var n=o.renderer.drawPath(a);T.appendChild(n),i&&(l.text!==m&&(l.text=W(l.text,c.data,o.treemap)||k),o.renderItemText(l.text.toString(),T,S,d,F,y,g,e,P)),N&&(v=o.renderTemplate(L,y,d,h,N,c,_),t.isNullOrUndefined(v)||(D.appendChild(v),o.treemap.renderReactTemplates())),T.setAttribute("aria-label",c.name),o.treemap.enableDrillDown&&_||o.treemap.selectionSettings.enable||o.treemap.highlightSettings.enable?(T.setAttribute("role","button"),T.setAttribute("tabindex",o.treemap.tabIndex.toString()),T.style.cursor=o.treemap.highlightSettings.enable&&!o.treemap.selectionSettings.enable&&o.treemap.enableDrillDown&&c.groupIndex===o.treemap.levels.length-1?"default":!o.treemap.highlightSettings.enable||o.treemap.selectionSettings.enable||o.treemap.enableDrillDown?"pointer":"default"):T.setAttribute("role","region"),U(o.treemap,T,"treeMapSelection"),o.layoutGroup.appendChild(T)}})}(z);D.childNodes.length>0&&L.appendChild(D),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,l,o,s,h,p,g){var c,m,u,f=[],y=[],v=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,m=this.labelInterSectAction(l,e,r,o),c=n(f&&f[0]||m[0],r),this.treemap.enableRtl){var S=n(e,r),x=e.search("[+]")||e.search("[-]");if(l.width<S.width&&x>0){var w=e.substring(x-1,e.length),C=n("[+]",r);m[0]=a(l.width-C.width-5,m[0],r)+w}}var F=b(l,p,c,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var I=[],L=null,O=[],T=0;T<f.length;T++)v+=(c=n(L=a(l.width-5,f[T],r),r)).height,O.push(c.width),I.push(L);m=I,c.width=Math.max.apply(null,O),c.height=v}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var N=0;N<m.length;N++)v+=(c=n(m[N],r)).height,l.height-5>v&&y.push(m[N]);if("Wrap"===o&&m.length!==y.length&&y.length){var E=y.length-1,D=y[E];D=D.substring(0,D.length-1)+"...",y.splice(E),"..."!==D&&y.push(D)}}else u=m,y.push(u);d(new Oe(s+"_Text",F.x,F.y,"start",y,"","",g),r,r.color||this.getSaturatedColor(h),i)},e.prototype.getItemColor=function(e,i){var r=this.treemap,l=e?r.leafItemSettings.fill:r.levels[i.groupIndex].fill,o=e?r.leafItemSettings.opacity:r.levels[i.groupIndex].opacity;t.isNullOrUndefined(r.treemapLevelData.defaultLevelsData)||r.treemapLevelData.defaultLevelsData.length>0&&(r.treemapLevelData.levelsData=r.treemapLevelData.defaultLevelsData);var n=u(r.treemapLevelData.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=L(a,i.data[r.equalColorValuePath],i.data[r.rangeColorValuePath]);t.isNullOrUndefined(s)||(l=t.isNullOrUndefined(s.fill)?r.leafItemSettings.fill:s.fill,o=s.opacity)}else for(var h=0;h<n.length;h++)n[h].levelOrderName===i.levelOrderName.split("#")[0]&&(l=t.isNullOrUndefined(l)?t.isNullOrUndefined(r.colorValuePath)?!t.isNullOrUndefined(r.palette)&&r.palette.length>0?r.palette[h%r.palette.length]:"#808080":n[h].data[r.colorValuePath]:l);return{fill:l,opacity:o}},e.prototype.getSaturatedColor=function(e){var t=e,i=q(X(t="transparent"===t?window.getComputedStyle(document.body,null).backgroundColor:t));return Math.round((299*i.r+587*i.g+114*i.b)/1e3)>=128?"black":"white"},e.prototype.renderTemplate=function(e,i,r,l,o,n,a){var s=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if(t.isNullOrUndefined(o.prototype)&&"string"==typeof o)for(var d=Object.keys(n.data),p=0;p<d.length;p++){var g=RegExp;o=o.replace(new g("{{:"+d[p]+"}}","g"),n.data[d[p].toString()])}var c;if(!t.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=b(r,l,S(c=v(y(o)(n.data,this.treemap,o,this.treemap.element.id+h,!1),s,n.data),e),"Template",this.treemap);c.style.left=m.x+"px",c.style.top=m.y+"px"}return c},e.prototype.labelInterSectAction=function(e,t,i,r){var l,o=e.width-10;switch(r){case"Hide":l=[R(o,e.height,t,i)];break;case"Trim":l=[a(o+3,t,i)];break;case"WrapByWord":l=_(o,t,i);break;case"Wrap":l=B(o,t,i)}return l},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}();!function(e){e.mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"}}(e.Theme||(e.Theme={}));var Me=function(){function e(e){}return e.prototype.print=function(e,i){var r=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no");r.moveTo(0,0),r.resizeTo(screen.availWidth,screen.availHeight);var l={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:"beforePrint"};e.trigger("beforePrint",l,function(){l.cancel||t.print(l.htmlContent,r)})},e.prototype.getHTMLContent=function(e,i){var r=t.createElement("div");if(i)i instanceof Array?i.forEach(function(e){r.appendChild(g(e).cloneNode(!0))}):i instanceof Element?r.appendChild(i.cloneNode(!0)):r.appendChild(g(i).cloneNode(!0));else{var l=e.element.cloneNode(!0),o=l.getElementsByTagName("svg")[0];if(!t.isNullOrUndefined(o)&&(o=o.childNodes[0],!t.isNullOrUndefined(o))){var n=o.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n||o.setAttribute("fill","rgba(0, 0, 0, 1)"):o.setAttribute("fill","rgba(255,255,255, 1)")}r.appendChild(l)}return r},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),Pe=function(){function e(e){}return e.prototype.export=function(e,i,r,l){return new Promise(function(o,n){var a=t.createElement("canvas",{id:"ej2-canvas",attrs:{height:e.availableSize.height.toString(),width:e.availableSize.width.toString()}}),s=e.svgObject.cloneNode(!0),h=s.childNodes[0];if(!t.isNullOrUndefined(h)){var d=h.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),g='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+s.outerHTML+"</svg>",c=window.URL.createObjectURL(new Blob("SVG"===i?[g]:[(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"}));if("SVG"===i)l?re(r,i,c,p):o(null);else{var m=new Image,u=a.getContext("2d");m.onload=function(){u.drawImage(m,0,0),window.URL.revokeObjectURL(c),l?re(r,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?o(a.toDataURL("image/jpeg")):"PNG"===i&&o(a.toDataURL("image/png"))},m.src=c}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),_e=function(){function e(e){}return e.prototype.export=function(e,i,r,o,n){return new Promise(function(i,a){var s=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});o=t.isNullOrUndefined(o)?l.PdfPageOrientation.Landscape:o;var h=e.svgObject.cloneNode(!0),d=h.childNodes[0];if(!t.isNullOrUndefined(d)){var p=d.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p||h.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):h.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var g=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(h)],{type:"image/svg+xml"})),c=new Image,m=s.getContext("2d");c.onload=function(){m.drawImage(c,0,0),window.URL.revokeObjectURL(g);var t=new l.PdfDocument,a=s.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=o,a=a.slice(a.indexOf(",")+1),t.pages.add().graphics.drawImage(new l.PdfBitmap(a),0,0,e.availableSize.width-60,e.availableSize.height),n?(t.save(r+".pdf"),t.destroy()):i(null)},c.src=g})},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(){},e}(),Be=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Re=function(e,t,i,r){var l,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},ze=function(e){function l(t,i){var r=e.call(this,t,i)||this;return r.isResize=!1,r.orientation="Horizontal",r.drilledItems=[],r.isHierarchicalData=!1,r.levelSelection=[],r.legendId=[],r}return Be(l,e),l.prototype.preRender=function(){var e=this;this.trigger("load",{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},l.prototype.render=function(){this.renderElements()},l.prototype.renderElements=function(){this.treemapLevelData=new Ue,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=oe(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),t.isNullOrUndefined(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},l.prototype.processDataManager=function(){var e,i,l,o,n=this;this.dataSource instanceof r.DataManager?(e=this.dataSource,i=this.query instanceof r.Query?this.query:new r.Query,e.executeQuery(i).then(function(e){n.dataSource=e.result,n.renderTreeMapElements()})):this.dataSource instanceof Ee?(o=this.dataSource,(l=new t.Fetch(o.dataOptions,o.type,o.contentType)).onSuccess=function(e){if(t.isNullOrUndefined(e.type)||"application/octet-stream"!==e.type)n.dataSource=e,n.renderTreeMapElements();else{var i=new FileReader,r=n;i.onload=function(){e=JSON.parse(i.result.toString()),r.dataSource=e,r.renderTreeMapElements()},i.readAsText(e)}},l.send(o.sendData)):this.renderTreeMapElements()},l.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger("loaded",{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},l.prototype.createSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}t.isNullOrUndefined(this.renderer)&&(this.renderer=new i.SvgRenderer(this.element.id)),t.isNullOrUndefined(this.layout)&&(this.layout=new De(this)),this.clearTemplate();var e=this.element.clientWidth,r=this.element.clientHeight;this.availableSize=new Ce(o(this.width,e)||e||600,o(this.height,r)||r||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},l.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-treemap").length;this.element.id="treemap_control_"+e}this.renderer=new i.SvgRenderer(this.element.id),this.layout=new De(this)},l.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");if(e&&e.childElementCount>0&&e.parentNode.removeChild(e),t.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))){var i=t.createElement("div",{id:this.element.id+"_Secondary_Element"});i.style.cssText="position: absolute;z-index:1;",this.element.appendChild(i)}},l.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!t.isNullOrUndefined(this.svgObject)&&!t.isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))&&!t.isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},l.prototype.renderBorder=function(){var e=this.border.width,i=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");if((this.border.width>0||this.background||this.themeStyle.backgroundColor)&&t.isNullOrUndefined(i)){var r=new Ie(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new Fe(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(r))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},l.prototype.renderTitle=function(e,i,r,l){var o,h={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},p=this.availableSize.width-this.margin.right-this.margin.left;if(h.fontFamily=h.fontFamily||this.themeStyle.fontFamily,h.fontWeight=h.fontWeight||this.themeStyle.titleFontWeight,h.size=h.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){t.isNullOrUndefined(l)&&(l=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var g=a(p,e.text,h),c=n(g,h),m=s(t.isNullOrUndefined(r)?new Fe(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,c,i),u=new Oe(this.element.id+"_TreeMap_"+i,m.x,m.y,"start",g),f=new Fe(m.x,m.y,c.width,c.height),y=d(u,h,h.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),l);y.setAttribute("aria-label",e.description||e.text),y.setAttribute("role","region"),y.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(o=this.availableSize.height-f.y-10-this.margin.bottom,this.areaRect=new Fe(this.margin.left,f.y+10,p,o)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",f,l):this.svgObject.appendChild(l)}else o=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new Fe(this.margin.left,this.margin.top,p,o)},l.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(this.treemapLevelData.levelsData=[],this.dataSource.map(function(e){e[i.weightValuePath]=e[i.weightValuePath]?e[i.weightValuePath].toString():e[i.weightValuePath]}),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var r={};r.level=0,e=this.leafItemSettings.labelPath,r[e]=[];for(o=0;o<this.dataSource.length;o++){var l=u(this.dataSource[o]).values;this.isHierarchicalData&&l&&l.length>0?l.forEach(function(t){t[e]&&r[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})}):this.dataSource[o][e]&&r[e].push({groupIndex:0,name:this.dataSource[o][e],levelOrderName:this.dataSource[o][e].toString(),data:this.dataSource[o],weight:this.dataSource[o][this.weightValuePath]})}this.treemapLevelData.levelsData.push(r)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=t.extend([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(var o=0;o<this.treemapLevelData.hierarchyData.length;o++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[o],o);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][e],"Parent")}},l.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=u(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},l.prototype.processHierarchicalData=function(e,i){var r,l,o,n=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if(a=u(e),(r=a?a.values:null)&&r.length>0){o=a.key;for(var h=0;h<this.levels.length;h++)o===this.levels[h].groupPath&&(l=h);for(var d=0;d<r.length;d++){r[d].name=r[d][s],r[d].levelOrderName=(0===l?r[d].name:e.levelOrderName+"#"+r[d].name)+"";var p=r[d].levelOrderName,g=void 0;p.search("#")>0&&(g=p.split("#").length-1),r[d].groupIndex=t.isNullOrUndefined(l)?g===this.levels.length?this.levels.length:g:l,0!==l&&(r[d].parent=e),r[d].groupName=o,r[d].data=r[d],r[d].isDrilled=!1,r[d].weight=r[d][this.weightValuePath]}r.forEach(function(e){n.processHierarchicalData(e,i)})}if(i===this.treemapLevelData.hierarchyData.length-1){var c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];if(!t.isNullOrUndefined(c)){for(var m=0;m<this.treemapLevelData.hierarchyData.length;m++)r=u(this.treemapLevelData.hierarchyData[m]).values,0!==m&&r&&(r.forEach(function(e){c.push(e)}),this.treemapLevelData.hierarchyData.splice(m,1),m-=1);c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];for(var f=0;f<c.length;f++)a[this.levels[0].groupPath]=c,c[f].parent=a}}},l.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},l.prototype.export=function(e,i,r,l){var o=this;return t.isNullOrUndefined(l)&&(l=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,n){t(o.pdfExportModule.export(o,e,i,r,l))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,r){t(o.imageExportModule.export(o,e,i,l))}):null},l.prototype.processFlatJsonData=function(){this.dataSource=this.dataSource;for(var e,i=[],r=0;r<this.levels.length+1;r++){e=this.levels[r]?this.levels[r].groupPath:this.leafItemSettings.labelPath;var l={};l.level=r,l[e]=[],this.treemapLevelData.levelsData.push(l);for(var o=0;o<this.dataSource.length;o++){var n={},a="";if(!t.isNullOrUndefined(e)){var s=this.dataSource[o][e];if(0!==r)for(var h=0;h<=r;h++){var d=this.levels[h]?this.levels[h].groupPath:e;a+=this.dataSource[o][d]+(h===r?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(n.name=s,n.levelOrderName=(a||s)+"",n.groupIndex=r,n.isDrilled=!1,n.groupName=e,n.data=this.dataSource[o],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(n),i.push(a||s))}}}},l.prototype.reOrderLevelData=function(e){for(var i,r=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,l=this.levels[e-1].groupPath,o=this.treemapLevelData.levelsData[e][r],n=this.treemapLevelData.levelsData[e-1][l],a=0;a<o.length;a++){i=o[a].levelOrderName;for(var s=0;s<n.length;s++)if(n[s][r]=t.isNullOrUndefined(n[s][r])?[]:n[s][r],this.IsChildHierarchy(i.split("#"),n[s].levelOrderName.split("#"))){t.isNullOrUndefined(o[a].parent)&&(o[a].parent=n[s]),n[s][r].push(o[a]);break}}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][r],"Child"),this.treemapLevelData.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},l.prototype.IsChildHierarchy=function(e,t){for(var i=!1,r=0;r<t.length;r++){if(e.length<r||t[r]!==e[r])return!1;i=!0}return i},l.prototype.findTotalWeight=function(e,t){for(var i,r,l,o=this,n={},a=this,s=0;s<e.length;s++)!function(s){i=0,l=e[s].groupName,r=e[s].levelOrderName.split("#"),a.dataSource.forEach(function(t){m(r,e[s].levelOrderName,t,o)&&(i+=parseFloat(t[o.weightValuePath]))}),"Parent"===t&&(n[l]=e,e[s].parent=n),e[s].weight=i}(s)},l.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.clickOnTreeMap),t.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),t.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap),t.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeEvent)},l.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),t.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),t.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),t.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},l.prototype.setCulture=function(){this.intl=new t.Internationalization},l.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},l.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var r={name:"resize",cancel:!1,previousSize:this.availableSize,currentSize:new Ce(0,0),treemap:this};this.resizeTo&&clearTimeout(this.resizeTo),!t.isNullOrUndefined(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),r.currentSize=i.availableSize,i.trigger("resize",r,function(e){i.render(),i.refreshing=!1})},500))}},l.prototype.clickOnTreeMap=function(e){var i,r,l=this,o=e.target,n=o.id,a=o.innerHTML,s={cancel:!1,name:"click",treemap:this,mouseEvent:e};this.trigger("click",s),n.indexOf("_Item_Index")>-1&&(e.preventDefault(),r=parseFloat(n.split("_Item_Index_")[1]),i={cancel:!1,name:"itemClick",treemap:this,item:this.layout.renderItems[r],mouseEvent:e,groupIndex:this.layout.renderItems[r].groupIndex,groupName:this.layout.renderItems[r].name,text:a,contentItemTemplate:a},this.trigger("itemClick",i,function(e){e.text===a&&e.contentItemTemplate===a||(t.isNullOrUndefined(l.leafItemSettings.labelTemplate)?(e.text=W(e.text,e.item.data,e.treemap),o.textContent=e.text):p(n,o,e.contentItemTemplate))}));var h,d=(new Date).getMilliseconds();t.isNullOrUndefined(this.doubleClick)||(!t.isNullOrUndefined(h)&&d-h<500&&this.doubleClickOnTreeMap(e),h=d)},l.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:"doubleClick",treemap:this,mouseEvent:e};this.trigger("doubleClick",t)},l.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:"rightClick",treemap:this,mouseEvent:e};this.trigger("rightClick",t)},l.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),this.notify(t.Browser.touchStartEvent,e)},l.prototype.mouseMoveOnTreeMap=function(e){var i,r,l=e.target.id,o={cancel:!1,name:"mouseMove",treemap:this,mouseEvent:e};this.trigger("mouseMove",o);var n;l.indexOf("_Item_Index")>-1?(n=u(r=this.layout.renderItems[parseFloat(l.split("_Item_Index_")[1])]).values,this.element.style.cursor=!r.isLeafItem&&n&&n.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:"itemMove",treemap:this,item:r,mouseEvent:e},this.trigger("itemMove",i)):this.element.style.cursor="default",this.notify(t.Browser.touchMoveEvent,e)},l.prototype.calculateSelectedTextLevels=function(e,t){for(var i,r,l,o=t.levelOrderName.split("#"),n=0,a=Object.keys(o);n<a.length;n++)o[r=a[n]]===e&&(i=parseInt(r,10),l=e);return{drillLevel:i,currentLevelLabel:l,levelText:o}},l.prototype.calculatePreviousLevelChildItems=function(e,i,r){for(var l,o,n,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,h=0;h<s;h++)n=0===h?e.levelText[h]:n+"#"+e.levelText[h];a=s>1?s:a;for(var d=0,p=Object.values(this.layout.renderItems);d<p.length;d++)(o=p[d]).levelOrderName.split("#")[0]===e.levelText[0]&&(l=0===a?t.isNullOrUndefined(n)?n:e.levelText[a]:r?n:n+"#"+e.levelText[a])===o.levelOrderName&&(this.drilledItems.push({name:o.levelOrderName,data:o}),r=!0,++a<=i.groupIndex&&(n=l=l+"#"+e.levelText[a]));return r},l.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var r,l={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((r=this.drilledItems[i].data.parent).isDrilled=!0,l[r[this.drilledItems[i].data.groupName]]=[r],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(l[t.groupName]=[t]),l},l.prototype.mouseEndOnTreeMap=function(e){var i,r,l,o,n,a,s,h=this,d=e.target,p=d.id,g=!1,c={},m=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",f=this.element.id+"_Label_Template_Group";if(p.indexOf("_Item_Index")>-1&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),o=parseFloat(p.split("_Item_Index_")[1]),n=this.layout.renderItems[o];var y=d.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(y,n),a=s.drillLevel,this.drillDownView||-1===y.search("[+]")||(g=this.calculatePreviousLevelChildItems(s,n,g))),0!==this.levels.length&&!n.isLeafItem&&u(n).values&&u(n).values.length>0){if(this.drilledItems.length>0){n=g?this.drilledItems[this.drilledItems.length-1].data:n;for(var v=0;v<this.drilledItems.length;v++){if(!t.isNullOrUndefined(a)){var b=this.drilledItems.length;if(c=this.compareSelectedLabelWithDrillDownItems(s,n,v),b!==this.drilledItems.length){v-=1;break}}if(n.levelOrderName===this.drilledItems[v].name&&!g&&t.isNullOrUndefined(a)){0===n.groupIndex&&n.parent[n.groupName]instanceof Array?(n.isDrilled=!n.isDrilled,n.isDrilled?c[n.groupName]=[n]:c=n.parent):(n.isDrilled=!1,n.parent.isDrilled=!0,n=n.parent,c[n.groupName]=[n]),this.drilledItems.splice(v,1),v-=1;break}v===this.drilledItems.length-1&&t.isNullOrUndefined(a)&&(n.isDrilled=!0,c[n.groupName]=[n])}}else n.isDrilled=!0,c[n.groupName]=[n];r={cancel:!1,name:"drillStart",treemap:this,element:d,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:n.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.name:n.name,rightClick:3===e.which,childItems:null,item:c},this.trigger("drillStart",r,function(e){if(h.currentLevel=n.isDrilled&&t.isNullOrUndefined(a)?n.groupIndex:!t.isNullOrUndefined(a)&&h.enableBreadcrumb&&n.isDrilled?a:null,!e.cancel){if(document.getElementById(m)){var r=document.getElementById(m);r.parentNode.removeChild(r)}if(i=t.extend({},h.areaRect,i,!0),h.legendSettings.visible&&!t.isNullOrUndefined(h.treeMapLegendModule)&&(t.isNullOrUndefined(c)||(h.treeMapLegendModule.legendGroup.textContent="",h.treeMapLegendModule.legendGroup=null,h.treeMapLegendModule.widthIncrement=0,h.treeMapLegendModule.heightIncrement=0,h.enableBreadcrumb&&!t.isNullOrUndefined(a)?h.drilledLegendItems={name:h.drilledItems[h.drilledItems.length-1].data.levelOrderName,data:h.drilledItems[h.drilledItems.length-1].data}:h.drilledLegendItems={name:n.levelOrderName,data:n},h.treeMapLegendModule.renderLegend()),i=t.isNullOrUndefined(h.totalRect)?i:h.totalRect),document.getElementById(f)){var l=document.getElementById(f);l.parentNode.removeChild(l)}t.isNullOrUndefined(e.childItems)||e.cancel?(h.layout.calculateLayoutItems(c,i),h.layout.renderLayoutItems()):h.layout.onDemandProcess(e.childItems)}}),l={cancel:!1,name:"drillEnd",treemap:this,renderItems:this.layout.renderItems},this.trigger("drillEnd",l),!g&&t.isNullOrUndefined(a)&&this.drilledItems.push({name:n.levelOrderName,data:n})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},l.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Q(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},l.prototype.selectItem=function(e,i){t.isNullOrUndefined(i)&&(i=!0);for(var r="",l=0;l<e.length;l++)l!==e.length-1?r+=e[l]+"#":r+=e[l];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(r,i)},l.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,Me],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Pe],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,_e],name:"PdfExport"}),e},l.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,r=0,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"background":this.renderBorder();break;case"height":case"width":case"layoutType":case"levels":case"drillDownView":case"renderDirection":case"leafItemSettings":case"legendSettings":case"dataSource":i=!0}i&&(this.createSvg(),this.renderElements())}},l.prototype.getModuleName=function(){return"treemap"},l.prototype.destroy=function(){this.unWireEVents(),le("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,t.isNullOrUndefined(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},l.prototype.removeSvg=function(){if(le(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}},l.prototype.getPersistData=function(){return""},Re([t.Property(!1)],l.prototype,"allowPrint",void 0),Re([t.Property(!1)],l.prototype,"allowImageExport",void 0),Re([t.Property(!1)],l.prototype,"allowPdfExport",void 0),Re([t.Property(null)],l.prototype,"width",void 0),Re([t.Property(null)],l.prototype,"height",void 0),Re([t.Complex({},he)],l.prototype,"border",void 0),Re([t.Complex({},de)],l.prototype,"margin",void 0),Re([t.Property(null)],l.prototype,"background",void 0),Re([t.Property("Material")],l.prototype,"theme",void 0),Re([t.Complex({},me)],l.prototype,"titleSettings",void 0),Re([t.Property("Squarified")],l.prototype,"layoutType",void 0),Re([t.Property(null)],l.prototype,"dataSource",void 0),Re([t.Property(null)],l.prototype,"query",void 0),Re([t.Property(null)],l.prototype,"weightValuePath",void 0),Re([t.Property("")],l.prototype,"rangeColorValuePath",void 0),Re([t.Property("")],l.prototype,"equalColorValuePath",void 0),Re([t.Property(null)],l.prototype,"colorValuePath",void 0),Re([t.Property([])],l.prototype,"palette",void 0),Re([t.Property("TopLeftBottomRight")],l.prototype,"renderDirection",void 0),Re([t.Property(!1)],l.prototype,"enableDrillDown",void 0),Re([t.Property(!1)],l.prototype,"enableBreadcrumb",void 0),Re([t.Property(" - ")],l.prototype,"breadcrumbConnector",void 0),Re([t.Property(!1)],l.prototype,"drillDownView",void 0),Re([t.Complex({},ye)],l.prototype,"initialDrillDown",void 0),Re([t.Complex({},ve)],l.prototype,"leafItemSettings",void 0),Re([t.Collection([],we)],l.prototype,"levels",void 0),Re([t.Complex({},xe)],l.prototype,"highlightSettings",void 0),Re([t.Complex({},Se)],l.prototype,"selectionSettings",void 0),Re([t.Complex({},be)],l.prototype,"tooltipSettings",void 0),Re([t.Complex({},fe)],l.prototype,"legendSettings",void 0),Re([t.Property(!1)],l.prototype,"useGroupingSeparator",void 0),Re([t.Property(null)],l.prototype,"description",void 0),Re([t.Property(0)],l.prototype,"tabIndex",void 0),Re([t.Property(null)],l.prototype,"format",void 0),Re([t.Event()],l.prototype,"load",void 0),Re([t.Event()],l.prototype,"beforePrint",void 0),Re([t.Event()],l.prototype,"loaded",void 0),Re([t.Event()],l.prototype,"itemRendering",void 0),Re([t.Event()],l.prototype,"drillStart",void 0),Re([t.Event()],l.prototype,"drillEnd",void 0),Re([t.Event()],l.prototype,"itemSelected",void 0),Re([t.Event()],l.prototype,"itemHighlight",void 0),Re([t.Event()],l.prototype,"tooltipRendering",void 0),Re([t.Event()],l.prototype,"itemClick",void 0),Re([t.Event()],l.prototype,"itemMove",void 0),Re([t.Event()],l.prototype,"click",void 0),Re([t.Event()],l.prototype,"doubleClick",void 0),Re([t.Event()],l.prototype,"rightClick",void 0),Re([t.Event()],l.prototype,"mouseMove",void 0),Re([t.Event()],l.prototype,"resize",void 0),Re([t.Event()],l.prototype,"legendItemRendering",void 0),Re([t.Event()],l.prototype,"legendRendering",void 0),l=Re([t.NotifyPropertyChanges],l)}(t.Component),Ue=function(){function e(){}return e}(),ke=function(){function e(e){this.page=0,this.legendBorderRect=new Fe(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new Fe(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.page=0,this.legendRenderingCollections=[],this.legendCollections=[],this.legendNames=[],this.totalPages=[],this.gradientCount=1,this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.treemap.renderer.createDefs(),this.treemap.svgObject.appendChild(this.defsElement);var t={cancel:!1,name:"legendRendering",treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger("legendRendering",t,function(t){t.cancel||t._changePosition===e.treemap.legendSettings.position||(e.treemap.legendSettings.position=t._changePosition),e.calculateLegendBounds(),e.legendCollections.length>0&&e.drawLegend()})},e.prototype.calculateLegendBounds=function(){var e=this,i=this.treemap,r=i.legendSettings;if(this.findColorMappingLegendItems(i.treemapLevelData.levelsData[0]),(!t.isNullOrUndefined(this.treemap.palette)&&this.treemap.palette.length>0||!t.isNullOrUndefined(i.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(i.treemapLevelData.levelsData[0]),this.legendCollections.length>0){this.legendCollections.sort(function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0});var l=r.position,o=r.title.text,s=r.titleStyle,h=r.mode,d=0,p=0,g=0,c=0,m=r.shapeHeight,u=r.shapeWidth,f=[],y=[],v="None"===r.orientation?"Top"===l||"Bottom"===l||"Auto"===l&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":r.orientation,b=r.width.length>1?r.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(r.width):parseFloat(r.width):null,S=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;s.fontFamily=s.fontFamily||i.themeStyle.fontFamily,s.fontWeight=s.fontWeight||i.themeStyle.titleFontWeight,s.size=s.size||i.themeStyle.subtitleFontSize;var x=n(o,s),w=0,C=0,F=r.shapePadding,I=r.textStyle;if(I.size=I.size||i.themeStyle.legendFontSize,I.fontFamily=I.fontFamily||i.themeStyle.fontFamily,I.fontWeight=I.fontWeight||i.themeStyle.fontWeight,"Default"===h){b=t.isNullOrUndefined(b)?i.areaRect.width:b,S=t.isNullOrUndefined(S)?i.areaRect.height:S;for(var L=0,O=0;O<this.legendCollections.length;O++){var T=this.legendCollections[O];t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var N=n(T.legendName,I);if(this.textMaxWidth=Math.max(this.textMaxWidth,N.width),0===O)w=d=10+u/2,C=p=10+x.height+(m>N.height?m/2:N.height/4);else{var E=N.height>m?N.height:m;if("Horizontal"===v){var D=y[L-1].x+y[L-1].width+10+u;if(D+F+N.width>b){var M=(y[L-1].y>f[L-1].y+m/2?y[L-1].y:f[L-1].y+m/2)+10;M+E>S?(this.getPageChanged(),L=0,f=[],y=[],d=w,p=C):(d=f[0].x,p=M+E/2)}else d=D-u/2,p=f[L-1].y}else{var P=y[L-1].y>f[L-1].y+m/2?y[L-1].y:f[L-1].y+m/2;if(P+10+E>S){var _=y[L-1].x+this.textMaxWidth+10;_+F+N.width>b?(d=w,p=C,y=[],f=[],this.getPageChanged(),L=0):(d=_+u/2,p=f[0].y)}else d=f[L-1].x,p=P+10+m/2}}g=d+u/2+F,c=p+N.height/4,f.push({x:d,y:p}),y.push({x:g,y:c,width:N.width,height:N.height/2}),this.totalPages[this.page].Collection.push({DisplayText:T.legendName,element:T.gradientElement,Shape:{x:d,y:p},Text:{x:g,y:c},Fill:T.legendFill,Data:T.legendData,Rect:{x:f[L].x-u/2,y:f[L].y-m/2<c-N.height?f[L].y-m/2:c-N.height,width:Math.abs(f[L].x-u/2-(g+N.width)),height:m>N.height?m:N.height}}),L++}var B=this.totalPages[0].Collection;B.forEach(function(t,i){var r=new Fe(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(w=r.x,C=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(w-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(C-(r.y+r.height)))}),b=this.widthIncrement<b?this.widthIncrement:b,S=this.heightIncrement<S?this.heightIncrement:S,this.legendItemRect={x:B[0].Rect.x,y:B[0].Rect.y,width:b,height:S}}else{var R=this.legendCollections.length,z="Horizontal"===v?t.isNullOrUndefined(b)?i.areaRect.width/R:b/R:t.isNullOrUndefined(b)?25:b,U="Horizontal"===v?t.isNullOrUndefined(S)?25:S:t.isNullOrUndefined(S)?i.areaRect.height/R:S/R;w=0,C=x.height+10;for(var k=r.labelPosition,H=0,A=0,W=r.labelDisplayMode,j=0,G=0,O=0;O<this.legendCollections.length;O++){w="Horizontal"===v?w+z:w,C="Horizontal"===v?C:C+U;var V=this.legendCollections[O].legendName,q=new Ce(0,0);"None"===W?q=n(V,I):"Trim"===W?q=n(V=a("Horizontal"===v?z:U,V,I),I):V="",j=Math.max(j,q.height),G=Math.max(G,q.width),q.width>0&&q.height>0&&("Horizontal"===v?(g=w+z/2,c="After"===k?C+U+q.height/2+10:C-10):(g="After"===k?w-q.width/2-10:w+z+q.width/2+10,c=C+U/2+q.height/4)),0===O&&(H="Horizontal"===v?w:"After"===k?g-q.width/2:w,A="Horizontal"===v?"After"===k?C:c-q.height/2:C),O===R-1&&(b="Horizontal"===v?Math.abs(w+z-H):z+G+10,S="Horizontal"===v?U+j/2+10:Math.abs(C+U-A)),this.legendRenderingCollections.push({fill:this.legendCollections[O].legendFill,x:w,y:C,width:z,height:U,element:this.legendCollections[O].gradientElement,text:V,textX:g,textY:c,textWidth:q.width,textHeight:q.height,data:this.legendCollections[O].legendData})}this.legendItemRect={x:H,y:A,width:b,height:S}}}},e.prototype.getPageChanged=function(){this.page++,t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},e.prototype.findColorMappingLegendItems=function(e){var t=u(e).values;if(t&&t.length>0&&(this.calculateLegendItems(t),this.treemap.levels.length>0))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},e.prototype.findPaletteLegendItems=function(e){var i,r;if(!t.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&t.isNullOrUndefined(this.treemap.drilledLegendItems))for(var l=u(e).values,o=0;o<l.length;o++)if(l[o].Name===this.treemap.initialDrillDown.groupName){l[o].isDrilled=!l[o].isDrilled,e=l[o],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,r=this.treemap.palette.length>0?this.treemap.palette[o%this.treemap.palette.length]:l[o].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!t.isNullOrUndefined(this.treemap.drilledLegendItems)){var n=this.treemap.drilledLegendItems;r=n.data.options.fill,i=n.data.isDrilled?u(n.data).values:u(n.data.parent).values}else i=u(e).values;var a;if(i&&i.length>0){for(var s=0;s<i.length;s++)(t.isNullOrUndefined(i[s].data[this.treemap.legendSettings.showLegendPath])||i[s].data[this.treemap.legendSettings.showLegendPath])&&(a=i[s].data[this.treemap.legendSettings.valuePath]?i[s].data[this.treemap.legendSettings.valuePath]:i[s].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,a)||this.legendCollections.push({legendName:a,legendFill:this.treemap.palette.length>0?t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:r:i[s].data[this.treemap.colorValuePath],legendData:[],itemArea:i[s].weight}));if(this.legendCollections.sort(z),this.treemap.palette.length>0)for(var h=0;h<this.legendCollections.length;h++)this.legendCollections[h].legendFill=t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[h%this.treemap.palette.length]:r}},e.prototype.calculateLegendItems=function(e){var i,r,l,o,n,a,s,h,d,p,g,c,m,u,f,y,v,b,S,x=!1,w=this.treemap.leafItemSettings,C=this.treemap.levels,F=this.treemap.legendSettings.position,I=!1,L=0;this.outOfRangeLegend=null;for(var O=0;O<e.length;O++){r="",f=!1,y=!1,I=!1,o=e[O].data,h=e[O].groupIndex,s=(a=0===this.treemap.levels.length||h===this.treemap.levels.length)?w.colorMapping:C[h].colorMapping;for(var T=0;T<s.length;T++){var N=s[T];if(p=null,l=Number(o[this.treemap.rangeColorValuePath]),d=o[this.treemap.equalColorValuePath],N.value=t.isNullOrUndefined(N.value)?N.value:N.value.toString(),!t.isNullOrUndefined(N.from)&&!t.isNullOrUndefined(N.to)&&l>=N.from&&l<=N.to&&N.showLegend?(x=!0,y=!0,m=N.from+" - "+N.to,n=t.isNullOrUndefined(N.label)?N.from+" - "+N.to:N.label,r=t.isNullOrUndefined(N.color)?r:N.color,i=this.isAddNewLegendData(m)):!t.isNullOrUndefined(N.value)&&d===N.value&&N.showLegend&&(x=!0,f=!0,m=N.value.toString(),n=t.isNullOrUndefined(N.label)?N.value.toString():N.label,r=t.isNullOrUndefined(N.color)?r:"[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,i=this.isAddNewLegendData(m)),x&&t.isNullOrUndefined(N.value)&&N.maxOpacity&&N.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var E=[];if(I=!0,"[object Array]"===Object.prototype.toString.call(N.color))for(var D=0;D<N.color.length;D++){M={colorStop:(D*(100/(N.color.length-1))+"%").toString(),color:N.color[D]};E.push(M)}else{var M={colorStop:"0%",color:r},P={colorStop:"100%",color:r};E.push(M),E.push(P)}g="Top"===F||"Bottom"===F?"100%":"0%",c="Top"===F||"Bottom"===F?"0%":"100%";var _={id:"groupIndex_"+h+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:g,y2:c};p=this.treemap.renderer.drawGradient("linearGradient",_,E).childNodes[0],"[object Array]"!==Object.prototype.toString.call(N.color)&&(p.childNodes[0].setAttribute("stop-opacity",N.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",N.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&x&&!u?(x=!1,r="[object Array]"===Object.prototype.toString.call(N.color)&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(N.value)?this.legendGradientColor(N,L):r,this.legendCollections.push({actualValue:m,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:n,legendFill:r,legendData:[],groupIndex:a?-1:h,gradientElement:t.isNullOrUndefined(p)?t.isNullOrUndefined(N.value)?this.legendLinearGradient:null:p,name:e[O].name,opacity:this.treemap.legendSettings.opacity,borderColor:this.treemap.legendSettings.border.color,borderWidth:this.treemap.legendSettings.border.width}),this.legendCollections[this.legendCollections.length-1].legendData.push(e[O]),L++):x&&!u&&(x=!1,this.legendCollections[i.value].legendData.push(e[O])),y||I||f||t.isNullOrUndefined(N.from)&&t.isNullOrUndefined(N.to)&&t.isNullOrUndefined(N.minOpacity)&&t.isNullOrUndefined(N.maxOpacity)&&t.isNullOrUndefined(N.value)&&!t.isNullOrUndefined(N.color)&&(v="[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,b=t.isNullOrUndefined(N.label)?"Others":N.label,u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,b),t.isNullOrUndefined(this.outOfRangeLegend)&&!u&&(this.legendCollections.push({actualValue:b,legendData:[],legendName:b,legendFill:v}),S=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[S-1],L++),this.legendCollections[this.legendCollections.length-1].legendData.push(e[O]))}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,r=0;r<e.length;r++)if(e[r].legendName===t){i=!0;break}return i},e.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var r=0;r<this.legendCollections.length;r++){if(e===this.legendCollections[r].actualValue){t=!1,i=r;break}r===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,t,i=this.treemap.legendSettings,r=this.treemap.renderer,l=i.textStyle;if(this.legendGroup=r.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===i.mode)this.drawLegendItem(this.currentPage);else for(var o=0;o<this.legendRenderingCollections.length;o++){var n=this.treemap.element.id+"_Legend_Index_"+o,a=this.treemap.element.id+"_Legend_Index_"+o+"_Text",s=this.legendRenderingCollections[o];e=(t=s.element)?"url(#"+t.id+")":s.fill;var h=new Fe(s.x,s.y,s.width,s.height),p=new Te(s.textX,s.textY),g=new Ie(n,e,i.shapeBorder,i.opacity,h);this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(g.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+g.height)-Math.abs(this.legendBorderRect.y-g.y),p.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+s.textHeight/2-Math.abs(this.legendBorderRect.y-p.y)):(g.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+g.width)-Math.abs(this.legendBorderRect.x-g.x),p.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-p.x))),d(new Oe(a,p.x,p.y,"middle",s.text,"",""),l,l.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(r.drawRectangle(g))}k(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,r){var l=e.Shape,o=e.Text,a=n(e.DisplayText,r.textStyle);return l.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-l.x),o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+a.width+t)-Math.abs(this.legendBorderRect.x-o.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(l.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-l.y)-r.shapeHeight/2,o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)),{shapeLocation:l,textLocation:o}},e.prototype.drawLegendItem=function(e){var i,r,l,o=this,a=this.treemap,s=a.legendSettings,h=new Ce(s.shapeWidth,s.shapeHeight),p=a.renderer,g=s.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var c="HorizontalLine"===s.shape||"VerticalLine"===s.shape||"Cross"===s.shape,m=c?t.isNullOrUndefined(s.fill)?"#000000":s.fill:g.color,u=c&&0===g.width?1:g.width,f=this,y=0;y<this.totalPages[e].Collection.length;y++)!function(t){var n=f.totalPages[e].Collection[t],g=n.DisplayText,y=p.createGroup({id:a.element.id+"_Legend_Index_"+t});y.setAttribute("aria-label",g+" Legend"),y.setAttribute("role","region");var v=a.element.id+"_Legend_Shape_Index_"+t,b=a.element.id+"_Legend_Text_Index_"+t,S=n.Shape,x=n.Text;a.enableRtl&&(r=f.defaultLegendRtlLocation(n,10,a,s),S=r.shapeLocation,x=r.textLocation),l={cancel:!1,name:"legendItemRendering",treemap:a,fill:n.Fill,shape:s.shape,imageUrl:s.imageUrl},a.trigger("legendItemRendering",l,function(e){var t=new Le(v,e.fill,u,c?n.Fill:m,s.opacity,"");y.appendChild(J(S,e.shape,h,e.imageUrl,t)),d(i=new Oe(b,x.x,x.y,"start",g,"",""),s.textStyle,s.textStyle.color||a.themeStyle.legendTextColor,y),o.legendGroup.appendChild(y)})}(y);var v=void 0;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,S=s.textStyle,x=n(b,S),w=this.legendItemRect.x+this.legendItemRect.width-x.width-20-10,C=this.legendItemRect.x+this.legendItemRect.width,F=this.legendItemRect.y+this.legendItemRect.height+2.5+10,I=C-10-x.width/2-5;v=p.createGroup({id:a.element.id+"_Legend_Paging_Group"});var L=p.createGroup({id:a.element.id+"_Legend_Left_Paging_Group"}),O=p.createGroup({id:a.element.id+"_Legend_Right_Paging_Group"}),T=" M "+C+" "+F+" L "+(C-10)+" "+(F-5)+" L "+(C-10)+" "+(F+5)+" z ",N=" M "+w+" "+F+" L "+(w+10)+" "+(F-5)+" L "+(w+10)+" "+(F+5)+" z ",E=new Le(a.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);L.appendChild(p.drawPath(E));var D=new Ie(a.element.id+"_Left_Page_Rect","transparent",{},1,new Fe(w-5,F-10,20,20),"");L.appendChild(p.drawRectangle(D)),this.wireEvents(L);var M=new Le(a.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",T);O.appendChild(p.drawPath(M));var P=new Ie(a.element.id+"_Right_Page_Rect","transparent",{},1,new Fe(C-10,F-5,10,10),"");O.appendChild(p.drawRectangle(P)),this.wireEvents(O),v.appendChild(L),v.appendChild(O);var _={id:a.element.id+"_Paging_Text",x:I,y:F+x.height/4,fill:"#a6a6a6","font-size":"14px","font-style":S.fontStyle,"font-family":S.fontFamily,"font-weight":S.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":"",role:"region","aria-label":b};v.appendChild(p.createText(_,b)),this.legendGroup.appendChild(v)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,r=t.titleStyle,l=n(a(this.legendItemRect.width+20,i,r),r);this.legendBorderRect=new Fe(this.legendItemRect.x-10,this.legendItemRect.y-10-l.height,this.legendItemRect.width+20,this.legendItemRect.height+20+l.height+("Interactive"===t.mode?0:0!==this.page?10:0));var o={color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth},s=new Ie(e.element.id+"_Legend_Border",t.background,o,1,this.legendBorderRect,""),h=e.renderer.drawRectangle(s);h.style.pointerEvents="none",this.legendGroup.appendChild(h),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),e.svgObject.appendChild(this.legendGroup)},e.prototype.renderLegendTitle=function(){var e,t=this.treemap.legendSettings,i=t.titleStyle,r=t.title.text,l=a(this.legendItemRect.width+20,r,i),o=n(l,i);if(r){var s=d(e=new Oe(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-o.height/2-5,"middle",l,""),i,i.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);s.setAttribute("role","region"),s.setAttribute("aria-label",r)}},e.prototype.renderInteractivePointer=function(e){var i=this.treemap,r=e.target,l=i.element.id+"_Interactive_Legend";r=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):r;var o,n=i.legendSettings;if(r.id.indexOf("_Item_Index")>-1&&n.visible&&this.legendRenderingCollections.length>0){var a=void 0,s=void 0,h=void 0,d=void 0,p=void 0,g=void 0,c=void 0;o=i.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];for(var m=i.svgObject.getBoundingClientRect(),u=0;u<this.legendCollections.length;u++){a=this.legendCollections[u],s=(c=document.getElementById(i.element.id+"_Legend_Index_"+u)).getBoundingClientRect();var f=new Fe(Math.abs(s.left-m.left),Math.abs(s.top-m.top),s.width,s.height);if(d=c.getAttribute("fill"),p=n.shapeBorder.color,g=n.shapeBorder.width,!t.isNullOrUndefined(a.legendData)){h=a.legendData;for(var y=0;y<h.length;y++)if(h[y].levelOrderName===o.levelOrderName){this.drawInteractivePointer(n,d,p,l,g,f);break}}}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,r,l,o){var n,a,s;n="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=o.x+o.width/2)+" "+(s=o.y+o.height)+" L "+(a-10)+" "+(s+10)+" L "+(a+10)+" "+(s+10)+" Z ":" M "+(a=o.x+o.width/2)+" "+(s=o.y)+" L "+(a-10)+" "+(s-10)+" L "+(a+10)+" "+(s-10)+" Z ":e.invertedPointer?" M "+(a=o.x)+" "+(s=o.y+o.height/2)+" L "+(a-10)+" "+(s-10)+" L "+(a-10)+" "+(s+10)+" z ":" M "+(a=o.x+o.width)+" "+(s=o.y+o.height/2)+" L "+(a+10)+" "+(s-10)+" L "+(a+10)+" "+(s+10)+" z ";var h=new Le(r,t,l,i,1,"",n);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(h))},e.prototype.getLegendAlignment=function(e,i,r,l){var o,n,a,s=(a=t.extend({},e.areaRect,a,!0)).x,h=a.y,d=a.height,p=a.width,g=e.availableSize.width,c=e.availableSize.height,m="Auto"===l.position?g>c?"Right":"Bottom":l.position;if("Float"===l.position)this.translate=l.location;else{switch(m){case"Top":case"Bottom":a.height=d-r,o=g/2-i/2,n="Top"===m?h:h+a.height+10,a.y="Top"===m?h+r+10:h;break;case"Left":case"Right":a.width=p-i,o="Left"===m?s:s+a.width,n=c/2-r/2,a.x="Left"===m?s+i:s}switch(l.alignment){case"Near":"Top"===m||"Bottom"===m?o=a.x:n=a.y;break;case"Far":"Top"===m||"Bottom"===m?o=g-i:n=c-r}this.treemap.totalRect=a,this.translate=new Te(o,n)}},e.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},e.prototype.removeInteractivePointer=function(){if(document.getElementById(this.treemap.element.id+"_Interactive_Legend")){var e=document.getElementById(this.treemap.element.id+"_Interactive_Legend");e.parentNode.removeChild(e)}},e.prototype.changeNextPage=function(e){this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?this.currentPage-1:this.currentPage+1,this.currentPage>=0&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?0:this.totalPages.length-1},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.changeNextPage,this)},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapLegend"},e.prototype.destroy=function(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},e.prototype.legendGradientColor=function(e,i){var r,l="http://www.w3.org/2000/svg";if(!t.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var o=this.treemap.renderer.createDefs(),n=document.createElementNS(l,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",h="Top"===a||"Bottom"===a?"0":"100";n.setAttribute("id","linear_"+i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2",s+"%"),n.setAttribute("y2",h+"%");for(var d=0;d<e.color.length;d++){var p=100/(e.color.length-1),g=document.createElementNS(l,"stop");g.setAttribute("offset",d*p+"%"),g.setAttribute("stop-color",e.color[d]),g.setAttribute("stop-opacity",1..toString()),n.appendChild(g)}o.appendChild(n),this.legendLinearGradient=n;var c="url(#linear_"+i+")";this.defsElement.appendChild(n),r=c}return r},e}(),He=function(){function e(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}return e.prototype.mouseMove=function(e){var t,i,r,l,o,n,a,s=this.treemap,h=e.target.id,d=[],p=this.treemap.highlightSettings,g=[],c=this.treemap.treeMapSelectionModule;if(h.indexOf("_Item_Index")>-1&&(!c||this.treemap.selectionId!==h)){if(this.highLightId!==h){o=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var m=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];x=void 0;if(this.treemap.legendSettings.visible){C=this.treemap.treeMapLegendModule.legendCollections;x=te(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+x):document.getElementById(this.treemap.element.id+"_Legend_Index_"+x),null===this.shapeElement||c&&this.shapeElement.getAttribute("id")===c.legendSelectId?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):c&&this.shapeElement===c.shapeElement?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),Q(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:C[x].legendFill,oldOpacity:C[x].opacity,oldBorderColor:C[x].borderColor,oldBorderWidth:C[x].borderWidth}),K(this.shapeElement,p.fill,p.opacity,p.border.color,p.border.width.toString()),this.target="highlight")}if(a=f(r,[],p.mode,s),!this.treemap.legendSettings.visible||(!c||(!this.shapeElement||this.shapeElement.getAttribute("id")!==c.legendSelectId)))if(this.treemap.legendSettings.visible&&(c&&this.shapeElement===c.shapeElement))t=!1;else{for(I=0;I<o.childElementCount;I++){n=o.childNodes[I],l=!0,r=s.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])];for(L=0;L<m.length;L++)if(n.id===m[L].id){l=!1;break}a.indexOf(r.levelOrderName)>-1&&l&&(g.push(n),d.push(r))}H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var u=0;u<g.length;u++)A((n=g[u]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:"itemHighlight",treemap:s,items:d,elements:g},s.trigger("itemHighlight",i)}}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){if(this.treemap.legendSettings.visible&&(!c||c.legendSelectId!==h)&&(!c||c.shapeSelectId!==h)){var y,v=void 0,b=void 0,S=document.getElementById(h);"highlight"===this.shapeTarget&&$(this.legendHighlightCollection),this.shapeTarget="highlight";for(var x="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]),w=this.treemap.treeMapLegendModule.legendCollections[x].legendData.length,C=this.treemap.treeMapLegendModule.legendCollections,F=parseInt(h[h.length-1],10),I=0;I<w;I++)for(var L=0;L<this.treemap.layout.renderItems.length;L++)if(this.treemap.treeMapLegendModule.legendCollections[x].legendData[I].levelOrderName===this.treemap.layout.renderItems[L].levelOrderName){v=L,b=this.treemap.layout.renderItems[L].groupIndex;var O=document.getElementById(this.treemap.element.id+"_Level_Index_"+b+"_Item_Index_"+v+"_RectPath");0===I&&(this.legendHighlightCollection=[],ie(this.legendHighlightCollection,F,L,S,O,this.treemap.layout.renderItems,C),y=this.legendHighlightCollection.length,this.legendHighlightCollection[y-1].ShapeCollection={Elements:[]}),K(S,p.fill,p.opacity,p.border.color,p.border.width.toString()),K(O,p.fill,p.opacity,p.border.color,p.border.width.toString()),y=this.legendHighlightCollection.length,this.legendHighlightCollection[y-1].ShapeCollection.Elements.push(O)}}}else c&&this.shapeElement&&this.shapeElement.getAttribute("id")===c.legendSelectId||(c?this.shapeElement!==c.shapeElement:this.treemap.legendSettings.visible)&&H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||c&&this.shapeElement&&this.shapeElement.getAttribute("id")===c.legendSelectId||(c?this.shapeElement!==c.shapeElement:!c||c.legendSelect)&&(Q(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&$(this.legendHighlightCollection),this.highLightId="",t=!1;return t},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchMoveEvent,this.mouseMove,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchMoveEvent,this.mouseMove)},e.prototype.getModuleName=function(){return"treeMapHighlight"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null},e}(),Ae=function(){function e(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}return e.prototype.mouseDown=function(e){var t,i=e.target,r=this.treemap;r.levelSelection=[];var l,o,n,a,s=[],h=i.id,d=i.innerHTML,g=[],c=r.selectionSettings,m=this.treemap.treeMapHighlightModule,u=r.element.id+"_TreeMap_"+r.layoutType+"_Layout";if(h.indexOf("_Item_Index")>-1)if(e.preventDefault(),this.treemap.selectionId!==h&&this.legendSelect){o=document.getElementById(u),l=r.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];T=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var y=this.treemap.treeMapLegendModule.legendCollections.length,v=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),m&&(m.shapeTarget="selection",m.shapeHighlightCollection=[]),T=te(y,l,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+T):document.getElementById(this.treemap.element.id+"_Legend_Index_"+T),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:v[T].legendFill,oldOpacity:v[T].opacity,oldBorderColor:v[T].borderColor,oldBorderWidth:v[T].borderWidth}),K(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()))}a=f(l,[],c.mode,r);for(var b=0;b<o.childElementCount;b++)n=o.childNodes[b],l=r.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],a.indexOf(l.levelOrderName)>-1&&(g.push(n),r.levelSelection.push(n.id),s.push(l));H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),x=0;x<g.length;x++){if(n=g[x],S.length>0)for(var w=0;w<S.length;w++)S[w].id===n.id&&S[w].classList.remove("treeMapHighLight"),A(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");else A(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");t={cancel:!1,name:"itemSelected",treemap:r,items:s,elements:g,text:d,contentItemTemplate:d},r.trigger("itemSelected",t,function(e){e.contentItemTemplate!==d&&p(h,i,e.contentItemTemplate)})}}else Q(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){v=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var C,F=void 0,I=void 0;this.legendSelectId=h,this.legendSelect=!1;var L=parseInt(h[h.length-1],10),O=document.getElementById(h);$(this.legendSelectionCollection),m&&(m.shapeTarget="selection");for(var T="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]),N=this.treemap.treeMapLegendModule.legendCollections[T].legendData.length,x=0;x<N;x++)for(var E=0;E<this.treemap.layout.renderItems.length;E++)if(this.treemap.treeMapLegendModule.legendCollections[T].legendData[x].levelOrderName===this.treemap.layout.renderItems[E].levelOrderName){F=E,I=this.treemap.layout.renderItems[E].groupIndex;var D=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+F+"_RectPath");0===x&&(ie(this.legendSelectionCollection,L,E,O,D,this.treemap.layout.renderItems,v),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection={Elements:[]}),K(O,c.fill,c.opacity,c.border.color,c.border.width.toString()),K(D,c.fill,c.opacity,c.border.color,c.border.width.toString()),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection.Elements.push(D)}}else $(this.legendSelectionCollection),m&&(m.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,r=0;r<this.treemap.layout.renderItems.length;r++)if(e===this.treemap.layout.renderItems[r].levelOrderName){i=this.treemap.layout.renderItems[r];break}var l=this.treemap.selectionSettings,o=[],n=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var h=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",d=document.getElementById(h),p=f(i,[],l.mode,this.treemap),g=0;g<d.childElementCount;g++)n=d.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(o.push(n),this.treemap.levelSelection.push(n.id),s.push(i));if(this.treemap.legendSettings.visible)for(var c=0;c<s.length;c++){this.shapeSelect=!1;var m=this.treemap.treeMapLegendModule.legendCollections.length,u=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),a=te(m,s[c],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+a):document.getElementById(this.treemap.element.id+"_Legend_Index_"+a),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:u[a].legendFill,oldOpacity:u[a].opacity,oldBorderColor:u[a].borderColor,oldBorderWidth:u[a].borderWidth}),K(this.shapeElement,l.fill,l.opacity,l.border.color,l.border.width.toString()))}H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var y=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=y.childNodes[0].id;for(var v=document.getElementsByClassName("treeMapHighLight"),b=0;b<o.length;b++)if(n=o[b],v.length>0)for(var S=0;S<v.length;S++)v[S].id===n.id&&v[S].classList.remove("treeMapHighLight"),A(n.childNodes[0],{border:l.border,fill:l.fill,opacity:l.opacity}),n.classList.add("treeMapSelection");else l.fill="null"===l.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options.fill:l.fill,A(n.childNodes[0],{border:l.border,fill:l.fill,opacity:l.opacity}),n.classList.add("treeMapSelection")}else Q(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchStartEvent,this.mouseDown,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchStartEvent,this.mouseDown)},e.prototype.getModuleName=function(){return"treeMapSelection"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null},e}(),We=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&(i[r[l]]=e[r[l]]);return i},je=function(){function e(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var i,r,l,o,n,a=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(o=e).changedTouches[0].pageX,r=o.changedTouches[0].pageY,l=o.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,r=e.pageY,l=e.target);var s,h,d,p,g=l.id,c={},m={},u=[];if(g.indexOf("_Item_Index")>-1){if(c=this.treemap.layout.renderItems[parseFloat(g.split("_Item_Index_")[1])],!t.isNullOrUndefined(c)){s=c.weight,m=c.data,t.isNullOrUndefined(c.options)||(p=c.options.fill),u=this.treemap.enableRtl?[(t.isNullOrUndefined(this.tooltipSettings.format)?null:W(this.tooltipSettings.format,m,this.treemap))||j(s,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[(t.isNullOrUndefined(this.tooltipSettings.format)?null:W(this.tooltipSettings.format,m,this.treemap))||this.treemap.weightValuePath.toString()+" : "+j(s,this.treemap)],document.getElementById(this.tooltipId)?h=document.getElementById(this.tooltipId):((h=t.createElement("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(h)),(d=I(i,r,this.treemap.svgObject)).y=this.tooltipSettings.template?d.y+10:d.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=t.isNullOrUndefined(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var f={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};n={cancel:!1,name:"tooltipRendering",item:c,options:{location:d,text:u,data:m,border:f,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:l,eventArgs:e},this.treemap.trigger("tooltipRendering",n,function(e){a.addTooltip(n,p,h)})}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,r,l,o){var n,a;t.isNullOrUndefined(e)?(n=o.cancel,a=o):(n=e.cancel,a=We(e,["cancel"]).options),n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({theme:this.treemap.theme,enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[r],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor,border:a.border,enableShadow:!0}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(l),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(){t.isNullOrUndefined(this.svgTooltip)||this.svgTooltip.destroy(),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},e}();return ze.Inject(je,ke,He,Ae,Me,_e,Pe),e.Border=he,e.ColorMapping=ue,e.ColorValue=Ne,e.CommonTitleSettings=ge,e.Font=pe,e.HighlightSettings=xe,e.ImageExport=Pe,e.InitialDrillSettings=ye,e.LayoutPanel=De,e.LeafItemSettings=ve,e.LegendSettings=fe,e.LevelSettings=we,e.LevelsData=Ue,e.Location=Te,e.Margin=de,e.PathOption=Le,e.PdfExport=_e,e.Print=Me,e.Rect=Fe,e.RectOption=Ie,e.SelectionSettings=Se,e.Size=Ce,e.SubTitleSettings=ce,e.TextOption=Oe,e.TitleSettings=me,e.TooltipSettings=be,e.TreeMap=ze,e.TreeMapAjax=Ee,e.TreeMapHighlight=He,e.TreeMapLegend=ke,e.TreeMapSelection=Ae,e.TreeMapTooltip=je,e.applyOptions=A,e.beforePrint="beforePrint",e.click="click",e.colorCollections=T,e.colorMap=L,e.colorNameToHex=X,e.componentToHex=V,e.convertElement=v,e.convertHexToColor=q,e.convertToContainer=C,e.convertToHexCode=G,e.convertToRect=F,e.createTextStyle=h,e.deSaturationColor=O,e.defaultFont=ne,e.doubleClick="doubleClick",e.drawSymbol=J,e.drillEnd="drillEnd",e.drillStart="drillStart",e.findChildren=u,e.findHightLightItems=f,e.findLabelLocation=b,e.findPosition=s,e.formatValue=j,e.getArea=x,e.getColorByValue=E,e.getElement=g,e.getGradientColor=D,e.getLegendIndex=te,e.getMousePosition=I,e.getPercentage=P,e.getPercentageColor=M,e.getShortestEdge=w,e.getTemplateFunction=y,e.getThemeStyle=oe,e.hide=R,e.isContainsData=m,e.isParentItem=Z,e.itemClick="itemClick",e.itemHighlight="itemHighlight",e.itemMove="itemMove",e.itemRendering="itemRendering",e.itemSelected="itemSelected",e.itemsToOrder=c,e.legendItemRendering="legendItemRendering",e.legendMaintain=k,e.legendRendering="legendRendering",e.load="load",e.loaded="loaded",e.maintainSelection=U,e.measureElement=S,e.measureText=n,e.mouseMove="mouseMove",e.orderByArea=z,e.pushCollection=ie,e.removeClassNames=H,e.removeElement=le,e.removeLegend=$,e.removeSelectionWithHighlight=ee,e.removeShape=Q,e.renderLegendShape=Y,e.renderTextElement=d,e.resize="resize",e.rgbToHex=N,e.rightClick="rightClick",e.setColor=K,e.setItemTemplateContent=p,e.stringToNumber=o,e.textFormatter=W,e.textTrim=a,e.textWrap=B,e.tooltipRendering="tooltipRendering",e.triggerDownload=re,e.wordWrap=_,e}({},ej.base,ej.svgbase,ej.data,ej.pdfexport),this.ejs=ej;
10
+ this.ej=this.ej||{},this.ej.treemap=function(e,t,i,r,l){"use strict";function o(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function n(e,i){var r=document.getElementById("treeMapMeasureText");return null===r&&(r=t.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(r)),r.innerHTML=t.SanitizeHtmlHelper.sanitize(e),r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new Fe(r.clientWidth,r.clientHeight)}function a(e,t,i){var r=t,l=n(t,i).width;if(l>e)for(var o=t.length-1;o>=0;--o)if(r=t.substring(0,o)+"...",(l=n(r,i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}function s(e,t,i,r){var l;switch(t){case"Near":l=e.x;break;case"Center":l="title"===r?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":l="title"===r?e.width-e.y-i.width:e.x+e.width-i.width}var o="title"===r?e.y+i.height/2:e.y+e.height/2+i.height/2;return new Te(l,o)}function h(e,t,i){var r=e.createText(t,i);return r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.style["user-select"]="none",r.style["-moz-user-select"]="none",r.style["-webkit-touch-callout"]="none",r.style["-webkit-user-select"]="none",r.style["-khtml-user-select"]="none",r.style["-ms-user-select"]="none",r.style["-o-user-select"]="none",r}function d(e,r,l,o,a){void 0===a&&(a=!1);var s,d,p,g={"font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:r.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:l},c="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],m=new i.SvgRenderer("");if(!t.isNullOrUndefined(c)&&!t.isNullOrUndefined(e.connectorText)&&c.search(e.connectorText[1])>=0)for(var u=c.split("#"),f=0;f<u.length;f++){var y=-1===u[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?u[f]:e.connectorText;if(g.id=e.id+"_"+f,p=h(m,g,y),f%2==0&&0!==f){y=y.replace(/\s+/g,"&nbsp")}var v=n(y,r);g.x=0!==f?g.x+v.width:g.x+v.width+5,o.appendChild(p)}else p=h(m,g,c),o.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var b=1,S=e.text.length;b<S;b++)d=n(e.text[b],r).height,s=m.createTSpan({x:e.x,id:e.id,y:e.y+b*d},e.text[b]),p.appendChild(s);o.appendChild(p)}return p}function p(e,i,r){var l,o=e.split("_RectPath")[0];l=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+o+"_LabelTemplate"),t.isNullOrUndefined(l)||(l.innerHTML=r)}function g(e){return document.getElementById(e)}function c(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function m(e,t,i,r){for(var l,o=!1,n="",a=r.leafItemSettings,s=0;s<e.length;s++){var h=i[l=r.levels[s]?r.levels[s].groupPath:a.labelPath?a.labelPath:r.weightValuePath]||"undefined";if(e[s]===h&&(n+=h+(s===e.length-1?"":"#"))===t){o=!0;break}}return o}function u(e){var t;if(e){var i=Object.keys(e);t={};for(var r=0;r<i.length;r++)if(e[i[r]]instanceof Array){t.values=e[i[r]],t.key=i[r];break}}return t}function f(e,t,i,r){if("Child"===i){t.push(e.levelOrderName);var l=u(e).values;if(l&&l.length>0){for(s=0;s<l.length;s++)-1===t.indexOf(l[s].levelOrderName)&&t.push(l[s].levelOrderName);for(var o=0;o<l.length;o++)f(l[o],t,i,r)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),f(e.parent,t,i,r));else if("All"===i)for(var n=e.levelOrderName.split("#")[0],a=void 0,s=0;s<r.layout.renderItems.length;s++)(a=r.layout.renderItems[s]).levelOrderName.indexOf(n)>-1&&-1===t.indexOf(a.levelOrderName)&&t.push(a.levelOrderName);else t.push(e.levelOrderName);return t}function y(e){var i=null;try{i="function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(r){i=t.compile(e)}return i}function v(e,i,r){var l=t.createElement("div",{id:i});l.style.cssText="position: absolute;pointer-events: auto;";for(var o=e.length;o>0;)l.appendChild(e[0]),o--;for(var n=l.innerHTML,a=Object.keys(r),s=0;s<a.length;s++){var h=RegExp;n=n.replace(new h("{{:"+a[s]+"}}","g"),r[a[s].toString()])}return l.innerHTML=n,l}function b(e,t,i,r,l){var o=new Te(0,0),n="Template"===r?l.areaRect.x:0,a="Template"===r?l.areaRect.y:0;return o.x=Math.abs(n-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!l.enableDrillDown||"BottomLeftTopRight"!==l.renderDirection&&"BottomRightTopLeft"!==l.renderDirection?o.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===r?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===r?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):o.y=Math.abs(e.y+e.height-i.height+5),o}function S(e,t){var i=new Fe(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var r=document.getElementById(e.id);return r.parentNode.removeChild(r),i}function x(e){return(e.width-e.x)*(e.height-e.y)}function w(e){var t=F(e),i=t.width,r=t.height;return Math.min(i,r)}function F(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function C(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function I(e,t,i){var r=i.getBoundingClientRect(),l=i.ownerDocument.defaultView.pageXOffset,o=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=r.left+l-a,h=r.top+o-n;return new Te(e-s,t-h)}function L(e,i,r){var l,o,n=[];if(t.isNullOrUndefined(i)&&t.isNullOrUndefined(r)&&isNaN(r))return null;for(var a=0;a<e.length;a++){var s=!1,h=r;t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to)||t.isNullOrUndefined(e[a].value)?(t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to))&&t.isNullOrUndefined(e[a].value)||(r>=e[a].from&&e[a].to>=r||e[a].value===i)&&(e[a].value===i&&(s=!0),l="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],h):e[a].color):r>=e[a].from&&e[a].to>=r&&e[a].value===i&&(s=!0,l="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],h):e[a].color),(r>=e[a].from&&r<=e[a].to||e[a].value===i)&&!t.isNullOrUndefined(e[a].minOpacity)&&!t.isNullOrUndefined(e[a].maxOpacity)&&l&&(o=O(e[a],r)),(""===l||t.isNullOrUndefined(l))&&t.isNullOrUndefined(e[a].from)&&t.isNullOrUndefined(e[a].to)&&t.isNullOrUndefined(e[a].minOpacity)&&t.isNullOrUndefined(e[a].maxOpacity)&&t.isNullOrUndefined(e[a].value)&&(l="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),o=t.isNullOrUndefined(o)?"1":o,n.push(l)}for(var d=n.length-1;d>=0;d--)d=(l=n[d])?-1:d;return{fill:l,opacity:o}}function O(e,t){var i=1;return t>=e.from&&t<=e.to&&(i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity),i.toString()}function T(e,t){return E(e,t)}function N(e,t,i){return"#"+V(e)+V(t)+V(i)}function E(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:N((i=D(Number(t),e)).r,i.g,i.b)}function D(e,t){var i=t.from,r=t.to,l=0,o=r-i;l=(e-i)/o;var n,a;if(t.color.length<=2)n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);else{n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);for(var s=o/(t.color.length-1),h=t.color.length-1,d=[],p={},g=1;g<h;g++)p={b:i+g*s,color:t.color[g]},d.push(p);for(var c=0;c<d.length;c++)i<=e&&e<=d[c].b&&0===c?(a="#"===d[c].color.charAt(0)?d[c].color:X(d[c].color),l=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s):d[c].b<=e&&e<=r&&c===d.length-1&&(n="#"===d[c].color.charAt(0)?d[c].color:X(d[c].color),l=e<d[c].b?1-Math.abs((e-d[c].b)/s):(e-d[c].b)/s),c!==d.length-1&&c<d.length&&d[c].b<=e&&e<=d[c+1].b&&(n="#"===d[c].color.charAt(0)?d[c].color:X(d[c].color),a="#"===d[c+1].color.charAt(0)?d[c+1].color:X(d[c+1].color),l=Math.abs(e-d[c+1].b)/s)}return M(l,n,a)}function M(e,t,i){var r=i.split("#")[1],l=t.split("#")[1],o=P(e,parseInt(l.substr(0,2),16),parseInt(r.substr(0,2),16)),n=P(e,parseInt(l.substr(2,2),16),parseInt(r.substr(2,2),16)),a=P(e,parseInt(l.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ne(o,n,a)}function P(e,t,i){var r=i-t;return Math.round(t+r*e)}function _(e,t,i){for(var r,l=t.split(" "),o="",s=[],h=0,d=l.length;h<d;h++)r=l[h],n(o.concat(r),i).width<e?o=o.concat((""===o?"":" ")+r):""!==o?(s.push(a(e,o,i)),o=r):(s.push(a(e,r,i)),r=""),o&&h===d-1&&s.push(a(e,o,i));return s}function B(e,t,i){var r=[],l=0,o=n(t,i).width,a=t.length;if(e>=o)return r.push(t),r;for(var s=t.length;s>l;s--){var h=t.slice(l,s);if((o=n(h,i).width)<=e){if(r.push(h),l+=h.length,a===l)return r;s=a+1}}return r}function R(e,t,i,r){var l=n(i,r);return l.width>e||l.height>t?" ":i}function z(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function U(e,t,i){var r=e.levelSelection;if(r)for(var l=0;l<r.length;l++)t.getAttribute("id")===r[l]?t.childElementCount>0&&(t.children[0].setAttribute("class",i),A(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function k(e,t){var i=e.legendId;if(i)for(var r=0;r<i.length;r++)for(var l=0;l<t.childElementCount;l++)if(t.childNodes[l].id===i[r]){var o=t.childNodes[l];o.setAttribute("fill",e.selectionSettings.fill),o.setAttribute("stroke",e.selectionSettings.border.color),o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("opacity",e.selectionSettings.opacity)}}function H(e,i,r){for(var l,o=0;o<e.length;o++)A(l=t.isNullOrUndefined(e[o].childNodes[0])?e[o]:e[o].childNodes[0],r.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])].options),e[o].classList.remove(i),o-=1}function A(e,i){e.setAttribute("opacity",i.opacity),t.isNullOrUndefined(i.fill)||e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function W(e,i,r){if(t.isNullOrUndefined(e))return null;for(var l=0,o=Object.keys(i);l<o.length;l++){var n=o[l];e=e.split("${"+n+"}").join(j(i[n],r).toString())}return e}function j(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}function G(e){return"#"+V(e.r)+V(e.g)+V(e.b)}function V(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function q(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Ne(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ne(255,255,255)}function X(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText");t.style.color=e;var i=(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(",");return G(new Ne(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function J(e,t,r,l,o){var n=new i.SvgRenderer(""),a=Y(e,r,t,o,l);return n["draw"+a.functionName](a.renderOption)}function Y(e,i,r,l,o){var n,a="Path",s=i.width,h=i.height,d=e.x,p=e.y,g=e.x+-s/2,c=e.y+-h/2;switch(r){case"Circle":case"Bubble":a="Ellipse",t.merge(l,{rx:s/2,ry:h/2,cx:d,cy:p});break;case"VerticalLine":n="M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(l,{d:n});break;case"Diamond":n="M "+g+" "+p+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+p+" L "+d+" "+(p+h/2)+" L "+g+" "+p+" z",t.merge(l,{d:n});break;case"Rectangle":n="M "+g+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" L "+g+" "+(p+-h/2)+" z",t.merge(l,{d:n});break;case"Triangle":n="M "+g+" "+(p+h/2)+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+g+" "+(p+h/2)+" z",t.merge(l,{d:n});break;case"InvertedTriangle":n="M "+(d+s/2)+" "+(p-h/2)+" L "+d+" "+(p+h/2)+" L "+(d-s/2)+" "+(p-h/2)+" L "+(d+s/2)+" "+(p-h/2)+" z",t.merge(l,{d:n});break;case"Pentagon":for(var m=void 0,u=void 0,f=0;f<=5;f++)m=s/2*Math.cos(Math.PI/180*(72*f)),u=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+m)+" "+(p+u)+" ":n.concat("L "+(d+m)+" "+(p+u)+" ");n=n.concat("Z"),t.merge(l,{d:n});break;case"Star":n="M "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" L "+(e.x-i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x+i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x-i.width/3)+" "+(e.y-i.height/2)+" L "+e.x+" "+(e.y+i.height/2)+" L "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" Z",t.merge(l,{d:n});break;case"Cross":n="M "+g+" "+p+" L "+(d+s/2)+" "+p+" M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(l,{d:n});break;case"Image":a="Image",t.merge(l,{href:o,height:h,width:s,x:g,y:c})}return{renderOption:l,functionName:a}}function Z(e,t){for(var i=!1,r=0;r<e.length;r++)if(t.levelOrderName===e[r].levelOrderName){i=!0;break}return i}function Q(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];K(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function $(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];K(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth);for(var r=i.ShapeCollection.Elements.length,l=0;l<r;l++)K(i.ShapeCollection.Elements[l],i.shapeOldFill,i.shapeOldOpacity,i.shapeOldBorderColor,i.shapeOldBorderWidth)}}function K(e,t,i,r,l){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",r),e.setAttribute("stroke-width",l)}function ee(e,t,i){Q(e),H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function te(e,t,i){for(var r,l=0;l<e;l++)for(var o=i.treeMapLegendModule.legendCollections[l].legendData.length,n=0;n<o;n++)if(i.treeMapLegendModule.legendCollections[l].legendData[n].levelOrderName===t.levelOrderName){r=l;break}return r}function ie(e,t,i,r,l,o,n){e.push({legendEle:r,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:l,shapeOldFill:o[i].options.fill,shapeOldOpacity:o[i].options.opacity,shapeOldBorderColor:o[i].options.border.color,shapeOldBorderWidth:o[i].options.border.width})}function re(e,i,r,l){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function le(e){var i=document.getElementById(e);return i?t.remove(i):null}function oe(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":t={backgroundColor:i,titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:ne,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:ne,legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:ne,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0}}return t}var ne="Roboto, Segoe UI, Noto, Sans-serif",ae=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),se=function(e,t,i,r){var l,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},he=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("#808080")],i.prototype,"color",void 0),se([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(10)],i.prototype,"left",void 0),se([t.Property(10)],i.prototype,"right",void 0),se([t.Property(10)],i.prototype,"top",void 0),se([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"size",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(ne)],i.prototype,"fontFamily",void 0),se([t.Property("")],i.prototype,"fontWeight",void 0),se([t.Property("Normal")],i.prototype,"fontStyle",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("")],i.prototype,"text",void 0),se([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),i}(ge),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Complex({},ce)],i.prototype,"subtitleSettings",void 0),i}(ge),ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"from",void 0),se([t.Property(null)],i.prototype,"to",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(null)],i.prototype,"label",void 0),se([t.Property(null)],i.prototype,"value",void 0),se([t.Property(null)],i.prototype,"minOpacity",void 0),se([t.Property(null)],i.prototype,"maxOpacity",void 0),se([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("Default")],i.prototype,"mode",void 0),se([t.Property("transparent")],i.prototype,"background",void 0),se([t.Property("Circle")],i.prototype,"shape",void 0),se([t.Property("")],i.prototype,"width",void 0),se([t.Property("")],i.prototype,"height",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(15)],i.prototype,"shapeWidth",void 0),se([t.Property(15)],i.prototype,"shapeHeight",void 0),se([t.Property(10)],i.prototype,"shapePadding",void 0),se([t.Property(null)],i.prototype,"imageUrl",void 0),se([t.Complex({color:null,width:null},he)],i.prototype,"border",void 0),se([t.Complex({color:"#000000",width:0},he)],i.prototype,"shapeBorder",void 0),se([t.Complex({},ge)],i.prototype,"title",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"titleStyle",void 0),se([t.Property("Bottom")],i.prototype,"position",void 0),se([t.Property("None")],i.prototype,"orientation",void 0),se([t.Property(!1)],i.prototype,"invertedPointer",void 0),se([t.Property("After")],i.prototype,"labelPosition",void 0),se([t.Property("None")],i.prototype,"labelDisplayMode",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Property({x:0,y:0})],i.prototype,"location",void 0),se([t.Property(null)],i.prototype,"showLegendPath",void 0),se([t.Property(null)],i.prototype,"valuePath",void 0),se([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupIndex",void 0),se([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property(0)],i.prototype,"gap",void 0),se([t.Property(10)],i.prototype,"padding",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showLabels",void 0),se([t.Property(null)],i.prototype,"labelPath",void 0),se([t.Property(null)],i.prototype,"labelFormat",void 0),se([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),se([t.Complex({color:null,size:null,fontFamily:null},pe)],i.prototype,"labelStyle",void 0),se([t.Property(null)],i.prototype,"labelTemplate",void 0),se([t.Property("Center")],i.prototype,"templatePosition",void 0),se([t.Property("Trim")],i.prototype,"interSectAction",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("")],i.prototype,"template",void 0),se([t.Property(null)],i.prototype,"format",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(.75)],i.prototype,"opacity",void 0),se([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),se([t.Complex({width:null,color:null},he)],i.prototype,"border",void 0),se([t.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},pe)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Se=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),xe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property("#808080")],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),we=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupPath",void 0),se([t.Property(0)],i.prototype,"groupGap",void 0),se([t.Property(10)],i.prototype,"groupPadding",void 0),se([t.Complex({},he)],i.prototype,"border",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showHeader",void 0),se([t.Property(20)],i.prototype,"headerHeight",void 0),se([t.Property(null)],i.prototype,"headerTemplate",void 0),se([t.Property(null)],i.prototype,"headerFormat",void 0),se([t.Property("Near")],i.prototype,"headerAlignment",void 0),se([t.Complex({color:null,size:"13px",fontFamily:null},pe)],i.prototype,"headerStyle",void 0),se([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),Fe=function(){function e(e,t){this.width=e,this.height=t}return e}(),Ce=function(){function e(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}return e}(),Ie=function(){function e(e,t,i,r,l,o){this.y=l.y,this.x=l.x,this.height=l.height,this.width=l.width,this.id=e,this.fill=t,this.opacity=r,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=o}return e}(),Le=function(){function e(e,t,i,r,l,o,n){this.id=e,this.opacity=l,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=o,this.d=n}return e}(),Oe=function(){function e(e,t,i,r,l,o,n,a){void 0===o&&(o=""),this.transform="",this.baseLine="auto",this.id=e,this.text=l,this.transform=o,this.anchor=r,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a}return e}(),Te=function(){function e(e,t){this.x=e,this.y=t}return e}(),Ne=function(){function e(e,t,i){this.r=e,this.g=t,this.b=i}return e}(),Ee=function(){function e(e,t,i,r,l){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=l}return e}(),De=function(){function e(e){this.treemap=e}return e.prototype.processLayoutPanel=function(){var e,i;if(this.treemap.treemapLevelData.levelsData&&this.treemap.treemapLevelData.levelsData.length>0)if(e=t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(t.isNullOrUndefined(this.treemap.drilledItems)?!t.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData[0]:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[])[0],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),t.isNullOrUndefined(this.treemap.currentLevel)||(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(e||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems();else{var r=this.treemap.drilledItems.length-1,l=this.treemap.drilledItems[r].data,o={};o[this.treemap.drilledItems[r].data.groupName]=[l],t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[r].data.groupIndex),this.calculateLayoutItems(o||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,r={},l=u(e).values;if(l&&l.length>0&&0===t.length){for(var o=0;o<l.length;o++)l[o].groupIndex===i.initialDrillDown.groupIndex&&l[o].name===i.initialDrillDown.groupName&&(l[o].isDrilled=!0,r[l[o].groupName]=[l[o]],t.push(r));for(var n=0;n<l.length;n++)this.getDrilldownData(l[n],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],t.isNullOrUndefined(this.treemap.weightValuePath)||(this.treemap.layoutType.indexOf("SliceAndDice")>-1?this.computeSliceAndDiceDimensional(e,i):(i.height=i.height+i.y,i.width=i.width+i.x,this.computeSquarifyDimensional(e,i)))},e.prototype.computeSliceAndDiceDimensional=function(e,t){var i,r,l,o,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=u(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var h=0;h<s.length;h++)r=s[h].groupIndex,l=0===a.length||r===a.length?n.gap:a[r].groupGap,o=0===a.length?0:a[r]?a[r].showHeader?a[r].headerHeight:0:a[r-1].showHeader?a[r-1].headerHeight:0,i=s[h].rect,i=new Ce(i.x+l/2,i.y+(o+l/2),i.width-l,Math.abs(i.height-(l+o))),this.computeSliceAndDiceDimensional(s[h],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var r,l=i.height*i.width,o=this.treemap.levels,n=0,a=0;e.forEach(function(e){a+=e.weight}),e.forEach(function(e){e.weightArea=l*e.weight/a});var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(c);for(var h=0;h<e.length;h++){var d=e[h];d.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||t.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?d.groupIndex===o.length-1:d.groupIndex===this.treemap.levels.length),s?(r=l/a*e[h].weight/i.height,n<=i.width&&(e[h].rect=new Ce(n+i.x,i.y,r,i.height))):(r=l/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new Ce(i.x,n+i.y,i.width,r))),n+=r,this.renderItems.push(e[h])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,r,l,o,n,a=this.treemap.leafItemSettings,s=this.treemap.levels,h=u(e).values;if(h&&h.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(h)),this.calculateChildrenLayout(e,h,t),this.treemap.levels.length>0))for(var d=0;d<h.length;d++)l=(r=h[d]).groupIndex,i=r.rect,o=(r.isLeafItem?a.padding:s[l].groupPadding)/2,n=this.treemap.isHierarchicalData?0===l&&r.isLeafItem?0:s[l]&&s[l].showHeader?s[l].headerHeight:0:0===s.length?0:s[l]&&s[l].showHeader?s[l].headerHeight:0,i=new Ce(i.x+o,i.y+(n+o),i.width-o,i.height-o),!r.isLeafItem&&r.weight>0&&this.computeSquarifyDimensional(h[d],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,x(i)),t.sort(z),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var l=e.length;if(0===l){c=this.getCoordinates(t,i);return m=r.concat(c)}var o=w(i),n=e[0],a=e.slice(1,l);if(this.aspectRatio(t,n,o)){var s=t.concat(n);return this.performRowsLayout(a,s,i,r)}for(var h=t.length,d=0,p=0;p<h;p+=1)d+=t[p].itemArea;var g=this.cutArea(i,d),c=this.getCoordinates(t,i),m=r.concat(c);return this.performRowsLayout(e,[],g,m)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var r=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(r,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,r=1/0,l=-1/0,o=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<r&&(r=a),a>l&&(l=a),o+=a}return Math.max(Math.pow(t,2)*l/Math.pow(o,2),Math.pow(o,2)/(Math.pow(t,2)*r))},e.prototype.cutArea=function(e,t){var i=F(e),r=i.width,l=i.height,o=i.x,n=i.y;if(r>=l){var a=t/l;return C(h={x:o+a,y:n,width:r-a,height:l})}var s=t/r,h={x:o,y:n+s,width:r,height:l-s};return C(h)},e.prototype.getCoordinates=function(e,i){for(var r,l=F(i),o=l.width,n=l.height,a=l.x,s=l.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<h;c+=1)g+=e[c].itemArea;for(var m,u,f,y=g/n,v=g/o,b=a,S=s,x=[],c=0;c<h;c+=1){var w=e[c];if(r=w.groupIndex,w.isLeafItem=0===d.length||(this.treemap.isHierarchicalData?r===d.length:!t.isNullOrUndefined(p.labelPath)&&r===d.length),u=Z(this.parentData[0],w),f=u?this.treemap.areaRect:w.parent.rect,m=w.isLeafItem?p.padding:d[r].groupPadding,o>=n){var C=S+w.itemArea/y;w.rect={x:b,y:S,width:b+y,height:C},S=C}else{var I=b+w.itemArea/v;w.rect={x:b,y:S,width:I,height:S+v},b=I}w.weight>0&&(u||Math.round(i.y+m/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+m/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),x.push(w))}return x},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,r=[],l=0;l<i;l+=1){for(var o=e.length,n=0,a=0;a<o;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<o;d++)(h=e[d]).itemArea=h.weight*s,r.push(h)}return r},e.prototype.onDemandProcess=function(e){var i,r={};r=e[0].parent,this.treemap.currentLevel=r.isDrilled?r.groupIndex:null;var l={};t.isNullOrUndefined(r.groupName)?l=r:l[r.groupName]=[r],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||(i=this.treemap.totalRect);for(var o=this.treemap.levels.length,n=0;n<o;n++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[n]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(l,i),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,r,l,o=this,n=this.treemap;this.renderer=n.renderer;var a,s,h,d,p,g,c,m,f,y,v,b,S,x=n.element.id,w=n.layoutType,C=this.treemap.leafItemSettings.interSectAction,I="",L=document.getElementById(n.element.id+"_Secondary_Element"),O=n.levels;this.layoutGroup=this.renderer.createGroup({id:x+"_TreeMap_"+w+"_Layout"});var T,N,E,D=t.createElement("div",{id:n.element.id+"_Label_Template_Group",className:"template"});D.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+n.areaRect.y+"px;left:"+n.areaRect.x+"px;height:"+n.areaRect.height+"px;width:"+n.areaRect.width+"px;";for(var M,P,_=!1,B=n.leafItemSettings,R=this,z=0;z<this.renderItems.length;z++)!function(w){if(c=R.renderItems[w],s=c.groupIndex,R.treemap.drillDownView&&t.isNullOrUndefined(R.treemap.currentLevel)&&s>0||R.treemap.drillDownView&&s>R.treemap.currentLevel+1)return"continue";d=c.rect,_=c.isLeafItem,y=x+"_Level_Index_"+s+"_Item_Index_"+w,T=R.renderer.createGroup({id:y+"_Group"}),b=(_?B.gap:O[s].groupGap)/2;var z=R.treemap.totalRect?F(R.treemap.totalRect):R.treemap.areaRect;"Squarified"===n.layoutType&&(d.width=Math.abs(d.x-d.width)-b,d.height=Math.abs(d.y-d.height)-b),"TopRightBottomLeft"===n.renderDirection?d.x=z.x+z.width-d.width-Math.abs(z.x-d.x):"BottomLeftTopRight"===n.renderDirection?d.y=z.y+z.height-d.height-Math.abs(z.y-d.y):"BottomRightTopLeft"===n.renderDirection&&(d.x=z.x+z.width-d.width-Math.abs(z.x-d.x),d.y=z.y+z.height-d.height-Math.abs(z.y-d.y)),r=R.getItemColor(_,c),g=r.fill,f=r.opacity,p=_?B.labelFormat:O[s].headerFormat;var k;if(i=_?B.showLabels:O[s].showHeader,s===R.treemap.currentLevel)if(R.treemap.enableBreadcrumb){P="#"+R.treemap.breadcrumbConnector+"#",k=c.levelOrderName.replace(/#/gi,P),k=0!==s?"#"+k:k}else k=c.name;else R.treemap.enableBreadcrumb&&(c.isDrilled=!1),k=c.name;m=W(p,c.data,R.treemap)||k||"undefined",M=u(c).values,m=!_&&M&&M.length>0&&R.treemap.enableDrillDown?c.isDrilled?n.enableRtl?m+" [-]":"[-] "+m:n.enableRtl?m+" [+]":"[+] "+m:m;var H=_?B.labelStyle.fontFamily:O[s].headerStyle.fontFamily;H=H||R.treemap.themeStyle.labelFontFamily;var A=_?B.labelStyle.size:O[s].headerStyle.size;A=A||R.treemap.themeStyle.labelFontSize;var j=_?B.labelStyle.fontWeight:O[s].headerStyle.fontWeight;j=j||R.treemap.themeStyle.fontWeight;var G=_?B.labelStyle.color:O[s].headerStyle.color,V=_?B.labelStyle.fontStyle:O[s].headerStyle.fontStyle,q=_?B.labelStyle.opacity:O[s].headerStyle.opacity;S={fontFamily:H,size:A,fontWeight:j,color:G,fontStyle:V,opacity:q},E=_?B.border:O[s].border,e=_?B.labelPosition:"Near"===O[s].headerAlignment?"TopLeft":"Center"===O[s].headerAlignment?"TopCenter":"TopRight",h=_?B.templatePosition:O[s].templatePosition,N=_?B.labelTemplate:O[s].headerTemplate,c.options={border:E,opacity:f,fill:g},l={cancel:!1,name:"itemRendering",treemap:R.treemap,text:m,currentItem:c,RenderItems:R.renderItems,options:c.options,textColor:S.color},R.treemap.trigger("itemRendering",l,function(r){if(!r.cancel){I=" M "+d.x+" "+d.y+" L "+(d.x+d.width)+" "+d.y+" L "+(d.x+d.width)+" "+(d.y+d.height)+" L "+d.x+" "+(d.y+d.height)+"z",a=new Le(y+"_RectPath",g,E.width,E.color,f,null,I);var n=o.renderer.drawPath(a);T.appendChild(n),i&&(l.text!==m&&(l.text=W(l.text,c.data,o.treemap)||k),S.color=l.textColor?l.textColor:S.color,o.renderItemText(l.text.toString(),T,S,d,C,y,g,e,P)),N&&(v=o.renderTemplate(L,y,d,h,N,c,_),t.isNullOrUndefined(v)||(D.appendChild(v),o.treemap.renderReactTemplates())),T.setAttribute("aria-label",c.name),o.treemap.enableDrillDown&&_||o.treemap.selectionSettings.enable||o.treemap.highlightSettings.enable?(T.setAttribute("role","button"),T.setAttribute("tabindex",o.treemap.tabIndex.toString()),T.style.cursor=o.treemap.highlightSettings.enable&&!o.treemap.selectionSettings.enable&&o.treemap.enableDrillDown&&c.groupIndex===o.treemap.levels.length-1?"default":!o.treemap.highlightSettings.enable||o.treemap.selectionSettings.enable||o.treemap.enableDrillDown?"pointer":"default"):T.setAttribute("role","region"),U(o.treemap,T,"treeMapSelection"),o.layoutGroup.appendChild(T)}})}(z);D.childNodes.length>0&&L.appendChild(D),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,l,o,s,h,p,g){var c,m,u,f=[],y=[],v=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,m=this.labelInterSectAction(l,e,r,o),c=n(f&&f[0]||m[0],r),this.treemap.enableRtl){var S=n(e,r),x=e.search("[+]")||e.search("[-]");if(l.width<S.width&&x>0){var w=e.substring(x-1,e.length),F=n("[+]",r);m[0]=a(l.width-F.width-5,m[0],r)+w}}var C=b(l,p,c,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var I=[],L=null,O=[],T=0;T<f.length;T++)v+=(c=n(L=a(l.width-5,f[T],r),r)).height,O.push(c.width),I.push(L);m=I,c.width=Math.max.apply(null,O),c.height=v}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var N=0;N<m.length;N++)v+=(c=n(m[N],r)).height,l.height-5>v&&y.push(m[N]);if("Wrap"===o&&m.length!==y.length&&y.length){var E=y.length-1,D=y[E];D=D.substring(0,D.length-1)+"...",y.splice(E),"..."!==D&&y.push(D)}}else u=m,y.push(u);d(new Oe(s+"_Text",C.x,C.y,"start",y,"","",g),r,r.color||this.getSaturatedColor(h),i)},e.prototype.getItemColor=function(e,i){var r=this.treemap,l=e?r.leafItemSettings.fill:r.levels[i.groupIndex].fill,o=e?r.leafItemSettings.opacity:r.levels[i.groupIndex].opacity;t.isNullOrUndefined(r.treemapLevelData.defaultLevelsData)||r.treemapLevelData.defaultLevelsData.length>0&&(r.treemapLevelData.levelsData=r.treemapLevelData.defaultLevelsData);var n=u(r.treemapLevelData.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=L(a,i.data[r.equalColorValuePath],i.data[r.rangeColorValuePath]);t.isNullOrUndefined(s)||(l=t.isNullOrUndefined(s.fill)?r.leafItemSettings.fill:s.fill,o=s.opacity)}else for(var h=0;h<n.length;h++)n[h].levelOrderName===i.levelOrderName.split("#")[0]&&(l=t.isNullOrUndefined(l)?t.isNullOrUndefined(r.colorValuePath)?!t.isNullOrUndefined(r.palette)&&r.palette.length>0?r.palette[h%r.palette.length]:"#808080":n[h].data[r.colorValuePath]:l);return{fill:l,opacity:o}},e.prototype.getSaturatedColor=function(e){var t=e,i=q(X(t="transparent"===t?window.getComputedStyle(document.body,null).backgroundColor:t));return Math.round((299*i.r+587*i.g+114*i.b)/1e3)>=128?"black":"white"},e.prototype.renderTemplate=function(e,i,r,l,o,n,a){var s=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if(t.isNullOrUndefined(o.prototype)&&"string"==typeof o)for(var d=Object.keys(n.data),p=0;p<d.length;p++){var g=RegExp;o=o.replace(new g("{{:"+d[p]+"}}","g"),n.data[d[p].toString()])}var c;if(!t.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=b(r,l,S(c=v(y(o)(n.data,this.treemap,o,this.treemap.element.id+h,!1),s,n.data),e),"Template",this.treemap);c.style.left=m.x+"px",c.style.top=m.y+"px"}return c},e.prototype.labelInterSectAction=function(e,t,i,r){var l,o=e.width-10;switch(r){case"Hide":l=[R(o,e.height,t,i)];break;case"Trim":l=[a(o+3,t,i)];break;case"WrapByWord":l=_(o,t,i);break;case"Wrap":l=B(o,t,i)}return l},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}();!function(e){e.mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"}}(e.Theme||(e.Theme={}));var Me=function(){function e(e){}return e.prototype.print=function(e,i){var r=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no");r.moveTo(0,0),r.resizeTo(screen.availWidth,screen.availHeight);var l={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:"beforePrint"};e.trigger("beforePrint",l,function(){l.cancel||t.print(l.htmlContent,r)})},e.prototype.getHTMLContent=function(e,i){var r=t.createElement("div");if(i)i instanceof Array?i.forEach(function(e){r.appendChild(g(e).cloneNode(!0))}):i instanceof Element?r.appendChild(i.cloneNode(!0)):r.appendChild(g(i).cloneNode(!0));else{var l=e.element.cloneNode(!0),o=l.getElementsByTagName("svg")[0];if(!t.isNullOrUndefined(o)&&(o=o.childNodes[0],!t.isNullOrUndefined(o))){var n=o.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n||o.setAttribute("fill","rgba(0, 0, 0, 1)"):o.setAttribute("fill","rgba(255,255,255, 1)")}r.appendChild(l)}return r},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),Pe=function(){function e(e){}return e.prototype.export=function(e,i,r,l){return new Promise(function(o,n){var a=t.createElement("canvas",{id:"ej2-canvas",attrs:{height:e.availableSize.height.toString(),width:e.availableSize.width.toString()}}),s=e.svgObject.cloneNode(!0),h=s.childNodes[0];if(!t.isNullOrUndefined(h)){var d=h.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),g='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+s.outerHTML+"</svg>",c=window.URL.createObjectURL(new Blob("SVG"===i?[g]:[(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"}));if("SVG"===i)l?re(r,i,c,p):o(null);else{var m=new Image,u=a.getContext("2d");m.onload=function(){u.drawImage(m,0,0),window.URL.revokeObjectURL(c),l?re(r,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?o(a.toDataURL("image/jpeg")):"PNG"===i&&o(a.toDataURL("image/png"))},m.src=c}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),_e=function(){function e(e){}return e.prototype.export=function(e,i,r,o,n){return new Promise(function(i,a){var s=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});o=t.isNullOrUndefined(o)?l.PdfPageOrientation.Landscape:o;var h=e.svgObject.cloneNode(!0),d=h.childNodes[0];if(!t.isNullOrUndefined(d)){var p=d.getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p||h.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):h.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var g=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(h)],{type:"image/svg+xml"})),c=new Image,m=s.getContext("2d");c.onload=function(){m.drawImage(c,0,0),window.URL.revokeObjectURL(g);var t=new l.PdfDocument,a=s.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=o,a=a.slice(a.indexOf(",")+1),t.pages.add().graphics.drawImage(new l.PdfBitmap(a),0,0,e.availableSize.width-60,e.availableSize.height),n?(t.save(r+".pdf"),t.destroy()):i(null)},c.src=g})},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(){},e}(),Be=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Re=function(e,t,i,r){var l,o=arguments.length,n=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},ze=function(e){function l(t,i){var r=e.call(this,t,i)||this;return r.isResize=!1,r.orientation="Horizontal",r.drilledItems=[],r.isHierarchicalData=!1,r.levelSelection=[],r.legendId=[],r}return Be(l,e),l.prototype.preRender=function(){var e=this;this.trigger("load",{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},l.prototype.render=function(){this.renderElements()},l.prototype.renderElements=function(){this.treemapLevelData=new Ue,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=oe(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),t.isNullOrUndefined(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},l.prototype.processDataManager=function(){var e,i,l,o,n=this;this.dataSource instanceof r.DataManager?(e=this.dataSource,i=this.query instanceof r.Query?this.query:new r.Query,e.executeQuery(i).then(function(e){n.dataSource=e.result,n.renderTreeMapElements()})):this.dataSource instanceof Ee?(o=this.dataSource,(l=new t.Fetch(o.dataOptions,o.type,o.contentType)).onSuccess=function(e){if(t.isNullOrUndefined(e.type)||"application/octet-stream"!==e.type)n.dataSource=e,n.renderTreeMapElements();else{var i=new FileReader,r=n;i.onload=function(){e=JSON.parse(i.result.toString()),r.dataSource=e,r.renderTreeMapElements()},i.readAsText(e)}},l.send(o.sendData)):this.renderTreeMapElements()},l.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger("loaded",{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},l.prototype.createSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}t.isNullOrUndefined(this.renderer)&&(this.renderer=new i.SvgRenderer(this.element.id)),t.isNullOrUndefined(this.layout)&&(this.layout=new De(this)),this.clearTemplate();var e=this.element.clientWidth,r=this.element.clientHeight;this.availableSize=new Fe(o(this.width,e)||e||600,o(this.height,r)||r||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},l.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-treemap").length;this.element.id="treemap_control_"+e}this.renderer=new i.SvgRenderer(this.element.id),this.layout=new De(this)},l.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");if(e&&e.childElementCount>0&&e.parentNode.removeChild(e),t.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))){var i=t.createElement("div",{id:this.element.id+"_Secondary_Element"});i.style.cssText="position: absolute;z-index:1;",this.element.appendChild(i)}},l.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!t.isNullOrUndefined(this.svgObject)&&!t.isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))&&!t.isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},l.prototype.renderBorder=function(){var e=this.border.width,i=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");if((this.border.width>0||this.background||this.themeStyle.backgroundColor)&&t.isNullOrUndefined(i)){var r=new Ie(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new Ce(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(r))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},l.prototype.renderTitle=function(e,i,r,l){var o,h={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},p=this.availableSize.width-this.margin.right-this.margin.left;if(h.fontFamily=h.fontFamily||this.themeStyle.fontFamily,h.fontWeight=h.fontWeight||this.themeStyle.titleFontWeight,h.size=h.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){t.isNullOrUndefined(l)&&(l=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var g=a(p,e.text,h),c=n(g,h),m=s(t.isNullOrUndefined(r)?new Ce(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,c,i),u=new Oe(this.element.id+"_TreeMap_"+i,m.x,m.y,"start",g),f=new Ce(m.x,m.y,c.width,c.height),y=d(u,h,h.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),l);y.setAttribute("aria-label",e.description||e.text),y.setAttribute("role","region"),y.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(o=this.availableSize.height-f.y-10-this.margin.bottom,this.areaRect=new Ce(this.margin.left,f.y+10,p,o)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",f,l):this.svgObject.appendChild(l)}else o=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new Ce(this.margin.left,this.margin.top,p,o)},l.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(this.treemapLevelData.levelsData=[],this.dataSource.map(function(e){e[i.weightValuePath]=e[i.weightValuePath]?e[i.weightValuePath].toString():e[i.weightValuePath]}),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var r={};r.level=0,e=this.leafItemSettings.labelPath,r[e]=[];for(o=0;o<this.dataSource.length;o++){var l=u(this.dataSource[o]).values;this.isHierarchicalData&&l&&l.length>0?l.forEach(function(t){t[e]&&r[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})}):this.dataSource[o][e]&&r[e].push({groupIndex:0,name:this.dataSource[o][e],levelOrderName:this.dataSource[o][e].toString(),data:this.dataSource[o],weight:this.dataSource[o][this.weightValuePath]})}this.treemapLevelData.levelsData.push(r)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=t.extend([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(var o=0;o<this.treemapLevelData.hierarchyData.length;o++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[o],o);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][e],"Parent")}},l.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=u(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},l.prototype.processHierarchicalData=function(e,i){var r,l,o,n=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if(a=u(e),(r=a?a.values:null)&&r.length>0){o=a.key;for(var h=0;h<this.levels.length;h++)o===this.levels[h].groupPath&&(l=h);for(var d=0;d<r.length;d++){r[d].name=r[d][s],r[d].levelOrderName=(0===l?r[d].name:e.levelOrderName+"#"+r[d].name)+"";var p=r[d].levelOrderName,g=void 0;p.search("#")>0&&(g=p.split("#").length-1),r[d].groupIndex=t.isNullOrUndefined(l)?g===this.levels.length?this.levels.length:g:l,0!==l&&(r[d].parent=e),r[d].groupName=o,r[d].data=r[d],r[d].isDrilled=!1,r[d].weight=r[d][this.weightValuePath]}r.forEach(function(e){n.processHierarchicalData(e,i)})}if(i===this.treemapLevelData.hierarchyData.length-1){var c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];if(!t.isNullOrUndefined(c)){for(var m=0;m<this.treemapLevelData.hierarchyData.length;m++)r=u(this.treemapLevelData.hierarchyData[m]).values,0!==m&&r&&(r.forEach(function(e){c.push(e)}),this.treemapLevelData.hierarchyData.splice(m,1),m-=1);c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];for(var f=0;f<c.length;f++)a[this.levels[0].groupPath]=c,c[f].parent=a}}},l.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},l.prototype.export=function(e,i,r,l){var o=this;return t.isNullOrUndefined(l)&&(l=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,n){t(o.pdfExportModule.export(o,e,i,r,l))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,r){t(o.imageExportModule.export(o,e,i,l))}):null},l.prototype.processFlatJsonData=function(){this.dataSource=this.dataSource;for(var e,i=[],r=0;r<this.levels.length+1;r++){e=this.levels[r]?this.levels[r].groupPath:this.leafItemSettings.labelPath;var l={};l.level=r,l[e]=[],this.treemapLevelData.levelsData.push(l);for(var o=0;o<this.dataSource.length;o++){var n={},a="";if(!t.isNullOrUndefined(e)){var s=this.dataSource[o][e];if(0!==r)for(var h=0;h<=r;h++){var d=this.levels[h]?this.levels[h].groupPath:e;a+=this.dataSource[o][d]+(h===r?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(n.name=s,n.levelOrderName=(a||s)+"",n.groupIndex=r,n.isDrilled=!1,n.groupName=e,n.data=this.dataSource[o],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(n),i.push(a||s))}}}},l.prototype.reOrderLevelData=function(e){for(var i,r=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,l=this.levels[e-1].groupPath,o=this.treemapLevelData.levelsData[e][r],n=this.treemapLevelData.levelsData[e-1][l],a=0;a<o.length;a++){i=o[a].levelOrderName;for(var s=0;s<n.length;s++)if(n[s][r]=t.isNullOrUndefined(n[s][r])?[]:n[s][r],this.IsChildHierarchy(i.split("#"),n[s].levelOrderName.split("#"))){t.isNullOrUndefined(o[a].parent)&&(o[a].parent=n[s]),n[s][r].push(o[a]);break}}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][r],"Child"),this.treemapLevelData.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},l.prototype.IsChildHierarchy=function(e,t){for(var i=!1,r=0;r<t.length;r++){if(e.length<r||t[r]!==e[r])return!1;i=!0}return i},l.prototype.findTotalWeight=function(e,t){for(var i,r,l,o=this,n={},a=this,s=0;s<e.length;s++)!function(s){i=0,l=e[s].groupName,r=e[s].levelOrderName.split("#"),a.dataSource.forEach(function(t){m(r,e[s].levelOrderName,t,o)&&(i+=parseFloat(t[o.weightValuePath]))}),"Parent"===t&&(n[l]=e,e[s].parent=n),e[s].weight=i}(s)},l.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.clickOnTreeMap),t.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),t.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap),t.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeEvent)},l.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),t.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),t.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),t.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},l.prototype.setCulture=function(){this.intl=new t.Internationalization},l.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},l.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var r={name:"resize",cancel:!1,previousSize:this.availableSize,currentSize:new Fe(0,0),treemap:this};this.resizeTo&&clearTimeout(this.resizeTo),!t.isNullOrUndefined(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),r.currentSize=i.availableSize,i.trigger("resize",r,function(e){i.render(),i.refreshing=!1})},500))}},l.prototype.clickOnTreeMap=function(e){var i,r,l=this,o=e.target,n=o.id,a=o.innerHTML,s={cancel:!1,name:"click",treemap:this,mouseEvent:e};this.trigger("click",s),n.indexOf("_Item_Index")>-1&&(e.preventDefault(),r=parseFloat(n.split("_Item_Index_")[1]),i={cancel:!1,name:"itemClick",treemap:this,item:this.layout.renderItems[r],mouseEvent:e,groupIndex:this.layout.renderItems[r].groupIndex,groupName:this.layout.renderItems[r].name,text:a,contentItemTemplate:a},this.trigger("itemClick",i,function(e){e.text===a&&e.contentItemTemplate===a||(t.isNullOrUndefined(l.leafItemSettings.labelTemplate)?(e.text=W(e.text,e.item.data,e.treemap),o.textContent=e.text):p(n,o,e.contentItemTemplate))}));var h,d=(new Date).getMilliseconds();t.isNullOrUndefined(this.doubleClick)||(!t.isNullOrUndefined(h)&&d-h<500&&this.doubleClickOnTreeMap(e),h=d)},l.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:"doubleClick",treemap:this,mouseEvent:e};this.trigger("doubleClick",t)},l.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:"rightClick",treemap:this,mouseEvent:e};this.trigger("rightClick",t)},l.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),this.notify(t.Browser.touchStartEvent,e)},l.prototype.mouseMoveOnTreeMap=function(e){var i,r,l=e.target.id,o={cancel:!1,name:"mouseMove",treemap:this,mouseEvent:e};this.trigger("mouseMove",o);var n;l.indexOf("_Item_Index")>-1?(n=u(r=this.layout.renderItems[parseFloat(l.split("_Item_Index_")[1])]).values,this.element.style.cursor=!r.isLeafItem&&n&&n.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:"itemMove",treemap:this,item:r,mouseEvent:e},this.trigger("itemMove",i)):this.element.style.cursor="default",this.notify(t.Browser.touchMoveEvent,e)},l.prototype.calculateSelectedTextLevels=function(e,t){for(var i,r,l,o=t.levelOrderName.split("#"),n=0,a=Object.keys(o);n<a.length;n++)o[r=a[n]]===e&&(i=parseInt(r,10),l=e);return{drillLevel:i,currentLevelLabel:l,levelText:o}},l.prototype.calculatePreviousLevelChildItems=function(e,i,r){for(var l,o,n,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,h=0;h<s;h++)n=0===h?e.levelText[h]:n+"#"+e.levelText[h];a=s>1?s:a;for(var d=0,p=Object.values(this.layout.renderItems);d<p.length;d++)(o=p[d]).levelOrderName.split("#")[0]===e.levelText[0]&&(l=0===a?t.isNullOrUndefined(n)?n:e.levelText[a]:r?n:n+"#"+e.levelText[a])===o.levelOrderName&&(this.drilledItems.push({name:o.levelOrderName,data:o}),r=!0,++a<=i.groupIndex&&(n=l=l+"#"+e.levelText[a]));return r},l.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var r,l={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((r=this.drilledItems[i].data.parent).isDrilled=!0,l[r[this.drilledItems[i].data.groupName]]=[r],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(l[t.groupName]=[t]),l},l.prototype.mouseEndOnTreeMap=function(e){var i,r,l,o,n,a,s,h=this,d=e.target,p=d.id,g=!1,c={},m=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",f=this.element.id+"_Label_Template_Group";if(p.indexOf("_Item_Index")>-1&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),o=parseFloat(p.split("_Item_Index_")[1]),n=this.layout.renderItems[o];var y=d.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(y,n),a=s.drillLevel,this.drillDownView||-1===y.search("[+]")||(g=this.calculatePreviousLevelChildItems(s,n,g))),0!==this.levels.length&&!n.isLeafItem&&u(n).values&&u(n).values.length>0){if(this.drilledItems.length>0){n=g?this.drilledItems[this.drilledItems.length-1].data:n;for(var v=0;v<this.drilledItems.length;v++){if(!t.isNullOrUndefined(a)){var b=this.drilledItems.length;if(c=this.compareSelectedLabelWithDrillDownItems(s,n,v),b!==this.drilledItems.length){v-=1;break}}if(n.levelOrderName===this.drilledItems[v].name&&!g&&t.isNullOrUndefined(a)){0===n.groupIndex&&n.parent[n.groupName]instanceof Array?(n.isDrilled=!n.isDrilled,n.isDrilled?c[n.groupName]=[n]:c=n.parent):(n.isDrilled=!1,n.parent.isDrilled=!0,n=n.parent,c[n.groupName]=[n]),this.drilledItems.splice(v,1),v-=1;break}v===this.drilledItems.length-1&&t.isNullOrUndefined(a)&&(n.isDrilled=!0,c[n.groupName]=[n])}}else n.isDrilled=!0,c[n.groupName]=[n];r={cancel:!1,name:"drillStart",treemap:this,element:d,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:n.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.name:n.name,rightClick:3===e.which,childItems:null,item:c},this.trigger("drillStart",r,function(e){if(h.currentLevel=n.isDrilled&&t.isNullOrUndefined(a)?n.groupIndex:!t.isNullOrUndefined(a)&&h.enableBreadcrumb&&n.isDrilled?a:null,!e.cancel){if(document.getElementById(m)){var r=document.getElementById(m);r.parentNode.removeChild(r)}if(i=t.extend({},h.areaRect,i,!0),h.legendSettings.visible&&!t.isNullOrUndefined(h.treeMapLegendModule)&&(t.isNullOrUndefined(c)||(h.treeMapLegendModule.legendGroup.textContent="",h.treeMapLegendModule.legendGroup=null,h.treeMapLegendModule.widthIncrement=0,h.treeMapLegendModule.heightIncrement=0,h.enableBreadcrumb&&!t.isNullOrUndefined(a)?h.drilledLegendItems={name:h.drilledItems[h.drilledItems.length-1].data.levelOrderName,data:h.drilledItems[h.drilledItems.length-1].data}:h.drilledLegendItems={name:n.levelOrderName,data:n},h.treeMapLegendModule.renderLegend()),i=t.isNullOrUndefined(h.totalRect)?i:h.totalRect),document.getElementById(f)){var l=document.getElementById(f);l.parentNode.removeChild(l)}t.isNullOrUndefined(e.childItems)||e.cancel?(h.layout.calculateLayoutItems(c,i),h.layout.renderLayoutItems()):h.layout.onDemandProcess(e.childItems)}}),l={cancel:!1,name:"drillEnd",treemap:this,renderItems:this.layout.renderItems},this.trigger("drillEnd",l),!g&&t.isNullOrUndefined(a)&&this.drilledItems.push({name:n.levelOrderName,data:n})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},l.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Q(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},l.prototype.selectItem=function(e,i){t.isNullOrUndefined(i)&&(i=!0);for(var r="",l=0;l<e.length;l++)l!==e.length-1?r+=e[l]+"#":r+=e[l];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(r,i)},l.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,Me],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Pe],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,_e],name:"PdfExport"}),e},l.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,r=0,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"background":this.renderBorder();break;case"height":case"width":case"layoutType":case"levels":case"drillDownView":case"renderDirection":case"leafItemSettings":case"legendSettings":case"dataSource":i=!0}i&&(this.createSvg(),this.renderElements())}},l.prototype.getModuleName=function(){return"treemap"},l.prototype.destroy=function(){this.unWireEVents(),le("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,t.isNullOrUndefined(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},l.prototype.removeSvg=function(){if(le(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}},l.prototype.getPersistData=function(){return""},Re([t.Property(!1)],l.prototype,"allowPrint",void 0),Re([t.Property(!1)],l.prototype,"allowImageExport",void 0),Re([t.Property(!1)],l.prototype,"allowPdfExport",void 0),Re([t.Property(null)],l.prototype,"width",void 0),Re([t.Property(null)],l.prototype,"height",void 0),Re([t.Complex({},he)],l.prototype,"border",void 0),Re([t.Complex({},de)],l.prototype,"margin",void 0),Re([t.Property(null)],l.prototype,"background",void 0),Re([t.Property("Material")],l.prototype,"theme",void 0),Re([t.Complex({},me)],l.prototype,"titleSettings",void 0),Re([t.Property("Squarified")],l.prototype,"layoutType",void 0),Re([t.Property(null)],l.prototype,"dataSource",void 0),Re([t.Property(null)],l.prototype,"query",void 0),Re([t.Property(null)],l.prototype,"weightValuePath",void 0),Re([t.Property("")],l.prototype,"rangeColorValuePath",void 0),Re([t.Property("")],l.prototype,"equalColorValuePath",void 0),Re([t.Property(null)],l.prototype,"colorValuePath",void 0),Re([t.Property([])],l.prototype,"palette",void 0),Re([t.Property("TopLeftBottomRight")],l.prototype,"renderDirection",void 0),Re([t.Property(!1)],l.prototype,"enableDrillDown",void 0),Re([t.Property(!1)],l.prototype,"enableBreadcrumb",void 0),Re([t.Property(" - ")],l.prototype,"breadcrumbConnector",void 0),Re([t.Property(!1)],l.prototype,"drillDownView",void 0),Re([t.Complex({},ye)],l.prototype,"initialDrillDown",void 0),Re([t.Complex({},ve)],l.prototype,"leafItemSettings",void 0),Re([t.Collection([],we)],l.prototype,"levels",void 0),Re([t.Complex({},xe)],l.prototype,"highlightSettings",void 0),Re([t.Complex({},Se)],l.prototype,"selectionSettings",void 0),Re([t.Complex({},be)],l.prototype,"tooltipSettings",void 0),Re([t.Complex({},fe)],l.prototype,"legendSettings",void 0),Re([t.Property(!1)],l.prototype,"useGroupingSeparator",void 0),Re([t.Property(null)],l.prototype,"description",void 0),Re([t.Property(0)],l.prototype,"tabIndex",void 0),Re([t.Property(null)],l.prototype,"format",void 0),Re([t.Event()],l.prototype,"load",void 0),Re([t.Event()],l.prototype,"beforePrint",void 0),Re([t.Event()],l.prototype,"loaded",void 0),Re([t.Event()],l.prototype,"itemRendering",void 0),Re([t.Event()],l.prototype,"drillStart",void 0),Re([t.Event()],l.prototype,"drillEnd",void 0),Re([t.Event()],l.prototype,"itemSelected",void 0),Re([t.Event()],l.prototype,"itemHighlight",void 0),Re([t.Event()],l.prototype,"tooltipRendering",void 0),Re([t.Event()],l.prototype,"itemClick",void 0),Re([t.Event()],l.prototype,"itemMove",void 0),Re([t.Event()],l.prototype,"click",void 0),Re([t.Event()],l.prototype,"doubleClick",void 0),Re([t.Event()],l.prototype,"rightClick",void 0),Re([t.Event()],l.prototype,"mouseMove",void 0),Re([t.Event()],l.prototype,"resize",void 0),Re([t.Event()],l.prototype,"legendItemRendering",void 0),Re([t.Event()],l.prototype,"legendRendering",void 0),l=Re([t.NotifyPropertyChanges],l)}(t.Component),Ue=function(){function e(){}return e}(),ke=function(){function e(e){this.page=0,this.legendBorderRect=new Ce(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new Ce(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.page=0,this.legendRenderingCollections=[],this.legendCollections=[],this.legendNames=[],this.totalPages=[],this.gradientCount=1,this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.treemap.renderer.createDefs(),this.treemap.svgObject.appendChild(this.defsElement);var t={cancel:!1,name:"legendRendering",treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger("legendRendering",t,function(t){t.cancel||t._changePosition===e.treemap.legendSettings.position||(e.treemap.legendSettings.position=t._changePosition),e.calculateLegendBounds(),e.legendCollections.length>0&&e.drawLegend()})},e.prototype.calculateLegendBounds=function(){var e=this,i=this.treemap,r=i.legendSettings;if(this.findColorMappingLegendItems(i.treemapLevelData.levelsData[0]),(!t.isNullOrUndefined(this.treemap.palette)&&this.treemap.palette.length>0||!t.isNullOrUndefined(i.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(i.treemapLevelData.levelsData[0]),this.legendCollections.length>0){this.legendCollections.sort(function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0});var l=r.position,o=r.title.text,s=r.titleStyle,h=r.mode,d=0,p=0,g=0,c=0,m=r.shapeHeight,u=r.shapeWidth,f=[],y=[],v="None"===r.orientation?"Top"===l||"Bottom"===l||"Auto"===l&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":r.orientation,b=r.width.length>1?r.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(r.width):parseFloat(r.width):null,S=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;s.fontFamily=s.fontFamily||i.themeStyle.fontFamily,s.fontWeight=s.fontWeight||i.themeStyle.titleFontWeight,s.size=s.size||i.themeStyle.subtitleFontSize;var x=n(o,s),w=0,F=0,C=r.shapePadding,I=r.textStyle;if(I.size=I.size||i.themeStyle.legendFontSize,I.fontFamily=I.fontFamily||i.themeStyle.fontFamily,I.fontWeight=I.fontWeight||i.themeStyle.fontWeight,"Default"===h){b=t.isNullOrUndefined(b)?i.areaRect.width:b,S=t.isNullOrUndefined(S)?i.areaRect.height:S;for(var L=0,O=0;O<this.legendCollections.length;O++){var T=this.legendCollections[O];t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var N=n(T.legendName,I);if(this.textMaxWidth=Math.max(this.textMaxWidth,N.width),0===O)w=d=10+u/2,F=p=10+x.height+(m>N.height?m/2:N.height/4);else{var E=N.height>m?N.height:m;if("Horizontal"===v){var D=y[L-1].x+y[L-1].width+10+u;if(D+C+N.width>b){var M=(y[L-1].y>f[L-1].y+m/2?y[L-1].y:f[L-1].y+m/2)+10;M+E>S?(this.getPageChanged(),L=0,f=[],y=[],d=w,p=F):(d=f[0].x,p=M+E/2)}else d=D-u/2,p=f[L-1].y}else{var P=y[L-1].y>f[L-1].y+m/2?y[L-1].y:f[L-1].y+m/2;if(P+10+E>S){var _=y[L-1].x+this.textMaxWidth+10;_+C+N.width>b?(d=w,p=F,y=[],f=[],this.getPageChanged(),L=0):(d=_+u/2,p=f[0].y)}else d=f[L-1].x,p=P+10+m/2}}g=d+u/2+C,c=p+N.height/4,f.push({x:d,y:p}),y.push({x:g,y:c,width:N.width,height:N.height/2}),this.totalPages[this.page].Collection.push({DisplayText:T.legendName,element:T.gradientElement,Shape:{x:d,y:p},Text:{x:g,y:c},Fill:T.legendFill,Data:T.legendData,Rect:{x:f[L].x-u/2,y:f[L].y-m/2<c-N.height?f[L].y-m/2:c-N.height,width:Math.abs(f[L].x-u/2-(g+N.width)),height:m>N.height?m:N.height}}),L++}var B=this.totalPages[0].Collection;B.forEach(function(t,i){var r=new Ce(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(w=r.x,F=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(w-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(F-(r.y+r.height)))}),b=this.widthIncrement<b?this.widthIncrement:b,S=this.heightIncrement<S?this.heightIncrement:S,this.legendItemRect={x:B[0].Rect.x,y:B[0].Rect.y,width:b,height:S}}else{var R=this.legendCollections.length,z="Horizontal"===v?t.isNullOrUndefined(b)?i.areaRect.width/R:b/R:t.isNullOrUndefined(b)?25:b,U="Horizontal"===v?t.isNullOrUndefined(S)?25:S:t.isNullOrUndefined(S)?i.areaRect.height/R:S/R;w=0,F=x.height+10;for(var k=r.labelPosition,H=0,A=0,W=r.labelDisplayMode,j=0,G=0,O=0;O<this.legendCollections.length;O++){w="Horizontal"===v?w+z:w,F="Horizontal"===v?F:F+U;var V=this.legendCollections[O].legendName,q=new Fe(0,0);"None"===W?q=n(V,I):"Trim"===W?q=n(V=a("Horizontal"===v?z:U,V,I),I):V="",j=Math.max(j,q.height),G=Math.max(G,q.width),q.width>0&&q.height>0&&("Horizontal"===v?(g=w+z/2,c="After"===k?F+U+q.height/2+10:F-10):(g="After"===k?w-q.width/2-10:w+z+q.width/2+10,c=F+U/2+q.height/4)),0===O&&(H="Horizontal"===v?w:"After"===k?g-q.width/2:w,A="Horizontal"===v?"After"===k?F:c-q.height/2:F),O===R-1&&(b="Horizontal"===v?Math.abs(w+z-H):z+G+10,S="Horizontal"===v?U+j/2+10:Math.abs(F+U-A)),this.legendRenderingCollections.push({fill:this.legendCollections[O].legendFill,x:w,y:F,width:z,height:U,element:this.legendCollections[O].gradientElement,text:V,textX:g,textY:c,textWidth:q.width,textHeight:q.height,data:this.legendCollections[O].legendData})}this.legendItemRect={x:H,y:A,width:b,height:S}}}},e.prototype.getPageChanged=function(){this.page++,t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},e.prototype.findColorMappingLegendItems=function(e){var t=u(e).values;if(t&&t.length>0&&(this.calculateLegendItems(t),this.treemap.levels.length>0))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},e.prototype.findPaletteLegendItems=function(e){var i,r;if(!t.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&t.isNullOrUndefined(this.treemap.drilledLegendItems))for(var l=u(e).values,o=0;o<l.length;o++)if(l[o].Name===this.treemap.initialDrillDown.groupName){l[o].isDrilled=!l[o].isDrilled,e=l[o],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,r=this.treemap.palette.length>0?this.treemap.palette[o%this.treemap.palette.length]:l[o].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!t.isNullOrUndefined(this.treemap.drilledLegendItems)){var n=this.treemap.drilledLegendItems;r=n.data.options.fill,i=n.data.isDrilled?u(n.data).values:u(n.data.parent).values}else i=u(e).values;var a;if(i&&i.length>0){for(var s=0;s<i.length;s++)(t.isNullOrUndefined(i[s].data[this.treemap.legendSettings.showLegendPath])||i[s].data[this.treemap.legendSettings.showLegendPath])&&(a=i[s].data[this.treemap.legendSettings.valuePath]?i[s].data[this.treemap.legendSettings.valuePath]:i[s].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,a)||this.legendCollections.push({legendName:a,legendFill:this.treemap.palette.length>0?t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:r:i[s].data[this.treemap.colorValuePath],legendData:[],itemArea:i[s].weight}));if(this.legendCollections.sort(z),this.treemap.palette.length>0)for(var h=0;h<this.legendCollections.length;h++)this.legendCollections[h].legendFill=t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[h%this.treemap.palette.length]:r}},e.prototype.calculateLegendItems=function(e){var i,r,l,o,n,a,s,h,d,p,g,c,m,u,f,y,v,b,S,x=!1,w=this.treemap.leafItemSettings,F=this.treemap.levels,C=this.treemap.legendSettings.position,I=!1,L=0;this.outOfRangeLegend=null;for(var O=0;O<e.length;O++){r="",f=!1,y=!1,I=!1,o=e[O].data,h=e[O].groupIndex,s=(a=0===this.treemap.levels.length||h===this.treemap.levels.length)?w.colorMapping:F[h].colorMapping;for(var T=0;T<s.length;T++){var N=s[T];if(p=null,l=Number(o[this.treemap.rangeColorValuePath]),d=o[this.treemap.equalColorValuePath],N.value=t.isNullOrUndefined(N.value)?N.value:N.value.toString(),!t.isNullOrUndefined(N.from)&&!t.isNullOrUndefined(N.to)&&l>=N.from&&l<=N.to&&N.showLegend?(x=!0,y=!0,m=N.from+" - "+N.to,n=t.isNullOrUndefined(N.label)?N.from+" - "+N.to:N.label,r=t.isNullOrUndefined(N.color)?r:N.color,i=this.isAddNewLegendData(m)):!t.isNullOrUndefined(N.value)&&d===N.value&&N.showLegend&&(x=!0,f=!0,m=N.value.toString(),n=t.isNullOrUndefined(N.label)?N.value.toString():N.label,r=t.isNullOrUndefined(N.color)?r:"[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,i=this.isAddNewLegendData(m)),x&&t.isNullOrUndefined(N.value)&&N.maxOpacity&&N.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var E=[];if(I=!0,"[object Array]"===Object.prototype.toString.call(N.color))for(var D=0;D<N.color.length;D++){M={colorStop:(D*(100/(N.color.length-1))+"%").toString(),color:N.color[D]};E.push(M)}else{var M={colorStop:"0%",color:r},P={colorStop:"100%",color:r};E.push(M),E.push(P)}g="Top"===C||"Bottom"===C?"100%":"0%",c="Top"===C||"Bottom"===C?"0%":"100%";var _={id:"groupIndex_"+h+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:g,y2:c};p=this.treemap.renderer.drawGradient("linearGradient",_,E).childNodes[0],"[object Array]"!==Object.prototype.toString.call(N.color)&&(p.childNodes[0].setAttribute("stop-opacity",N.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",N.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&x&&!u?(x=!1,r="[object Array]"===Object.prototype.toString.call(N.color)&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(N.value)?this.legendGradientColor(N,L):r,this.legendCollections.push({actualValue:m,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:n,legendFill:r,legendData:[],groupIndex:a?-1:h,gradientElement:t.isNullOrUndefined(p)?t.isNullOrUndefined(N.value)?this.legendLinearGradient:null:p,name:e[O].name,opacity:this.treemap.legendSettings.opacity,borderColor:this.treemap.legendSettings.border.color,borderWidth:this.treemap.legendSettings.border.width}),this.legendCollections[this.legendCollections.length-1].legendData.push(e[O]),L++):x&&!u&&(x=!1,this.legendCollections[i.value].legendData.push(e[O])),y||I||f||t.isNullOrUndefined(N.from)&&t.isNullOrUndefined(N.to)&&t.isNullOrUndefined(N.minOpacity)&&t.isNullOrUndefined(N.maxOpacity)&&t.isNullOrUndefined(N.value)&&!t.isNullOrUndefined(N.color)&&(v="[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,b=t.isNullOrUndefined(N.label)?"Others":N.label,u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,b),t.isNullOrUndefined(this.outOfRangeLegend)&&!u&&(this.legendCollections.push({actualValue:b,legendData:[],legendName:b,legendFill:v}),S=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[S-1],L++),this.legendCollections[this.legendCollections.length-1].legendData.push(e[O]))}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,r=0;r<e.length;r++)if(e[r].legendName===t){i=!0;break}return i},e.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var r=0;r<this.legendCollections.length;r++){if(e===this.legendCollections[r].actualValue){t=!1,i=r;break}r===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,t,i=this.treemap.legendSettings,r=this.treemap.renderer,l=i.textStyle;if(this.legendGroup=r.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===i.mode)this.drawLegendItem(this.currentPage);else for(var o=0;o<this.legendRenderingCollections.length;o++){var n=this.treemap.element.id+"_Legend_Index_"+o,a=this.treemap.element.id+"_Legend_Index_"+o+"_Text",s=this.legendRenderingCollections[o];e=(t=s.element)?"url(#"+t.id+")":s.fill;var h=new Ce(s.x,s.y,s.width,s.height),p=new Te(s.textX,s.textY),g=new Ie(n,e,i.shapeBorder,i.opacity,h);this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(g.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+g.height)-Math.abs(this.legendBorderRect.y-g.y),p.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+s.textHeight/2-Math.abs(this.legendBorderRect.y-p.y)):(g.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+g.width)-Math.abs(this.legendBorderRect.x-g.x),p.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-p.x))),d(new Oe(a,p.x,p.y,"middle",s.text,"",""),l,l.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(r.drawRectangle(g))}k(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,r){var l=e.Shape,o=e.Text,a=n(e.DisplayText,r.textStyle);return l.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-l.x),o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+a.width+t)-Math.abs(this.legendBorderRect.x-o.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(l.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-l.y)-r.shapeHeight/2,o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)),{shapeLocation:l,textLocation:o}},e.prototype.drawLegendItem=function(e){var i,r,l,o=this,a=this.treemap,s=a.legendSettings,h=new Fe(s.shapeWidth,s.shapeHeight),p=a.renderer,g=s.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var c="HorizontalLine"===s.shape||"VerticalLine"===s.shape||"Cross"===s.shape,m=c?t.isNullOrUndefined(s.fill)?"#000000":s.fill:g.color,u=c&&0===g.width?1:g.width,f=this,y=0;y<this.totalPages[e].Collection.length;y++)!function(t){var n=f.totalPages[e].Collection[t],g=n.DisplayText,y=p.createGroup({id:a.element.id+"_Legend_Index_"+t});y.setAttribute("aria-label",g+" Legend"),y.setAttribute("role","region");var v=a.element.id+"_Legend_Shape_Index_"+t,b=a.element.id+"_Legend_Text_Index_"+t,S=n.Shape,x=n.Text;a.enableRtl&&(r=f.defaultLegendRtlLocation(n,10,a,s),S=r.shapeLocation,x=r.textLocation),l={cancel:!1,name:"legendItemRendering",treemap:a,fill:n.Fill,shape:s.shape,imageUrl:s.imageUrl},a.trigger("legendItemRendering",l,function(e){var t=new Le(v,e.fill,u,c?n.Fill:m,s.opacity,"");y.appendChild(J(S,e.shape,h,e.imageUrl,t)),d(i=new Oe(b,x.x,x.y,"start",g,"",""),s.textStyle,s.textStyle.color||a.themeStyle.legendTextColor,y),o.legendGroup.appendChild(y)})}(y);var v=void 0;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,S=s.textStyle,x=n(b,S),w=this.legendItemRect.x+this.legendItemRect.width-x.width-20-10,F=this.legendItemRect.x+this.legendItemRect.width,C=this.legendItemRect.y+this.legendItemRect.height+2.5+10,I=F-10-x.width/2-5;v=p.createGroup({id:a.element.id+"_Legend_Paging_Group"});var L=p.createGroup({id:a.element.id+"_Legend_Left_Paging_Group"}),O=p.createGroup({id:a.element.id+"_Legend_Right_Paging_Group"}),T=" M "+F+" "+C+" L "+(F-10)+" "+(C-5)+" L "+(F-10)+" "+(C+5)+" z ",N=" M "+w+" "+C+" L "+(w+10)+" "+(C-5)+" L "+(w+10)+" "+(C+5)+" z ",E=new Le(a.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);L.appendChild(p.drawPath(E));var D=new Ie(a.element.id+"_Left_Page_Rect","transparent",{},1,new Ce(w-5,C-10,20,20),"");L.appendChild(p.drawRectangle(D)),this.wireEvents(L);var M=new Le(a.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",T);O.appendChild(p.drawPath(M));var P=new Ie(a.element.id+"_Right_Page_Rect","transparent",{},1,new Ce(F-10,C-5,10,10),"");O.appendChild(p.drawRectangle(P)),this.wireEvents(O),v.appendChild(L),v.appendChild(O);var _={id:a.element.id+"_Paging_Text",x:I,y:C+x.height/4,fill:"#a6a6a6","font-size":"14px","font-style":S.fontStyle,"font-family":S.fontFamily,"font-weight":S.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":"",role:"region","aria-label":b};v.appendChild(p.createText(_,b)),this.legendGroup.appendChild(v)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,r=t.titleStyle,l=n(a(this.legendItemRect.width+20,i,r),r);this.legendBorderRect=new Ce(this.legendItemRect.x-10,this.legendItemRect.y-10-l.height,this.legendItemRect.width+20,this.legendItemRect.height+20+l.height+("Interactive"===t.mode?0:0!==this.page?10:0));var o={color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth},s=new Ie(e.element.id+"_Legend_Border",t.background,o,1,this.legendBorderRect,""),h=e.renderer.drawRectangle(s);h.style.pointerEvents="none",this.legendGroup.appendChild(h),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),e.svgObject.appendChild(this.legendGroup)},e.prototype.renderLegendTitle=function(){var e,t=this.treemap.legendSettings,i=t.titleStyle,r=t.title.text,l=a(this.legendItemRect.width+20,r,i),o=n(l,i);if(r){var s=d(e=new Oe(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-o.height/2-5,"middle",l,""),i,i.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);s.setAttribute("role","region"),s.setAttribute("aria-label",r)}},e.prototype.renderInteractivePointer=function(e){var i=this.treemap,r=e.target,l=i.element.id+"_Interactive_Legend";r=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):r;var o,n=i.legendSettings;if(r.id.indexOf("_Item_Index")>-1&&n.visible&&this.legendRenderingCollections.length>0){var a=void 0,s=void 0,h=void 0,d=void 0,p=void 0,g=void 0,c=void 0;o=i.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];for(var m=i.svgObject.getBoundingClientRect(),u=0;u<this.legendCollections.length;u++){a=this.legendCollections[u],s=(c=document.getElementById(i.element.id+"_Legend_Index_"+u)).getBoundingClientRect();var f=new Ce(Math.abs(s.left-m.left),Math.abs(s.top-m.top),s.width,s.height);if(d=c.getAttribute("fill"),p=n.shapeBorder.color,g=n.shapeBorder.width,!t.isNullOrUndefined(a.legendData)){h=a.legendData;for(var y=0;y<h.length;y++)if(h[y].levelOrderName===o.levelOrderName){this.drawInteractivePointer(n,d,p,l,g,f);break}}}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,r,l,o){var n,a,s;n="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=o.x+o.width/2)+" "+(s=o.y+o.height)+" L "+(a-10)+" "+(s+10)+" L "+(a+10)+" "+(s+10)+" Z ":" M "+(a=o.x+o.width/2)+" "+(s=o.y)+" L "+(a-10)+" "+(s-10)+" L "+(a+10)+" "+(s-10)+" Z ":e.invertedPointer?" M "+(a=o.x)+" "+(s=o.y+o.height/2)+" L "+(a-10)+" "+(s-10)+" L "+(a-10)+" "+(s+10)+" z ":" M "+(a=o.x+o.width)+" "+(s=o.y+o.height/2)+" L "+(a+10)+" "+(s-10)+" L "+(a+10)+" "+(s+10)+" z ";var h=new Le(r,t,l,i,1,"",n);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(h))},e.prototype.getLegendAlignment=function(e,i,r,l){var o,n,a,s=(a=t.extend({},e.areaRect,a,!0)).x,h=a.y,d=a.height,p=a.width,g=e.availableSize.width,c=e.availableSize.height,m="Auto"===l.position?g>c?"Right":"Bottom":l.position;if("Float"===l.position)this.translate=l.location;else{switch(m){case"Top":case"Bottom":a.height=d-r,o=g/2-i/2,n="Top"===m?h:h+a.height+10,a.y="Top"===m?h+r+10:h;break;case"Left":case"Right":a.width=p-i,o="Left"===m?s:s+a.width,n=c/2-r/2,a.x="Left"===m?s+i:s}switch(l.alignment){case"Near":"Top"===m||"Bottom"===m?o=a.x:n=a.y;break;case"Far":"Top"===m||"Bottom"===m?o=g-i:n=c-r}this.treemap.totalRect=a,this.translate=new Te(o,n)}},e.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},e.prototype.removeInteractivePointer=function(){if(document.getElementById(this.treemap.element.id+"_Interactive_Legend")){var e=document.getElementById(this.treemap.element.id+"_Interactive_Legend");e.parentNode.removeChild(e)}},e.prototype.changeNextPage=function(e){this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?this.currentPage-1:this.currentPage+1,this.currentPage>=0&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?0:this.totalPages.length-1},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.changeNextPage,this)},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapLegend"},e.prototype.destroy=function(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},e.prototype.legendGradientColor=function(e,i){var r,l="http://www.w3.org/2000/svg";if(!t.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var o=this.treemap.renderer.createDefs(),n=document.createElementNS(l,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",h="Top"===a||"Bottom"===a?"0":"100";n.setAttribute("id","linear_"+i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2",s+"%"),n.setAttribute("y2",h+"%");for(var d=0;d<e.color.length;d++){var p=100/(e.color.length-1),g=document.createElementNS(l,"stop");g.setAttribute("offset",d*p+"%"),g.setAttribute("stop-color",e.color[d]),g.setAttribute("stop-opacity",1..toString()),n.appendChild(g)}o.appendChild(n),this.legendLinearGradient=n;var c="url(#linear_"+i+")";this.defsElement.appendChild(n),r=c}return r},e}(),He=function(){function e(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}return e.prototype.mouseMove=function(e){var t,i,r,l,o,n,a,s=this.treemap,h=e.target.id,d=[],p=this.treemap.highlightSettings,g=[],c=this.treemap.treeMapSelectionModule;if(h.indexOf("_Item_Index")>-1&&(!c||this.treemap.selectionId!==h)){if(this.highLightId!==h){o=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var m=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];x=void 0;if(this.treemap.legendSettings.visible){F=this.treemap.treeMapLegendModule.legendCollections;x=te(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+x):document.getElementById(this.treemap.element.id+"_Legend_Index_"+x),null===this.shapeElement||c&&this.shapeElement.getAttribute("id")===c.legendSelectId?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):c&&this.shapeElement===c.shapeElement?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),Q(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:F[x].legendFill,oldOpacity:F[x].opacity,oldBorderColor:F[x].borderColor,oldBorderWidth:F[x].borderWidth}),K(this.shapeElement,p.fill,p.opacity,p.border.color,p.border.width.toString()),this.target="highlight")}if(a=f(r,[],p.mode,s),!this.treemap.legendSettings.visible||(!c||(!this.shapeElement||this.shapeElement.getAttribute("id")!==c.legendSelectId)))if(this.treemap.legendSettings.visible&&(c&&this.shapeElement===c.shapeElement))t=!1;else{for(I=0;I<o.childElementCount;I++){n=o.childNodes[I],l=!0,r=s.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])];for(L=0;L<m.length;L++)if(n.id===m[L].id){l=!1;break}a.indexOf(r.levelOrderName)>-1&&l&&(g.push(n),d.push(r))}H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var u=0;u<g.length;u++)A((n=g[u]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:"itemHighlight",treemap:s,items:d,elements:g},s.trigger("itemHighlight",i)}}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){if(this.treemap.legendSettings.visible&&(!c||c.legendSelectId!==h)&&(!c||c.shapeSelectId!==h)){var y,v=void 0,b=void 0,S=document.getElementById(h);"highlight"===this.shapeTarget&&$(this.legendHighlightCollection),this.shapeTarget="highlight";for(var x="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]),w=this.treemap.treeMapLegendModule.legendCollections[x].legendData.length,F=this.treemap.treeMapLegendModule.legendCollections,C=parseInt(h[h.length-1],10),I=0;I<w;I++)for(var L=0;L<this.treemap.layout.renderItems.length;L++)if(this.treemap.treeMapLegendModule.legendCollections[x].legendData[I].levelOrderName===this.treemap.layout.renderItems[L].levelOrderName){v=L,b=this.treemap.layout.renderItems[L].groupIndex;var O=document.getElementById(this.treemap.element.id+"_Level_Index_"+b+"_Item_Index_"+v+"_RectPath");0===I&&(this.legendHighlightCollection=[],ie(this.legendHighlightCollection,C,L,S,O,this.treemap.layout.renderItems,F),y=this.legendHighlightCollection.length,this.legendHighlightCollection[y-1].ShapeCollection={Elements:[]}),K(S,p.fill,p.opacity,p.border.color,p.border.width.toString()),K(O,p.fill,p.opacity,p.border.color,p.border.width.toString()),y=this.legendHighlightCollection.length,this.legendHighlightCollection[y-1].ShapeCollection.Elements.push(O)}}}else c&&this.shapeElement&&this.shapeElement.getAttribute("id")===c.legendSelectId||(c?this.shapeElement!==c.shapeElement:this.treemap.legendSettings.visible)&&H(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||c&&this.shapeElement&&this.shapeElement.getAttribute("id")===c.legendSelectId||(c?this.shapeElement!==c.shapeElement:!c||c.legendSelect)&&(Q(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&$(this.legendHighlightCollection),this.highLightId="",t=!1;return t},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchMoveEvent,this.mouseMove,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchMoveEvent,this.mouseMove)},e.prototype.getModuleName=function(){return"treeMapHighlight"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null},e}(),Ae=function(){function e(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}return e.prototype.mouseDown=function(e){var t,i=e.target,r=this.treemap;r.levelSelection=[];var l,o,n,a,s=[],h=i.id,d=i.innerHTML,g=[],c=r.selectionSettings,m=this.treemap.treeMapHighlightModule,u=r.element.id+"_TreeMap_"+r.layoutType+"_Layout";if(h.indexOf("_Item_Index")>-1)if(e.preventDefault(),this.treemap.selectionId!==h&&this.legendSelect){o=document.getElementById(u),l=r.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];T=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var y=this.treemap.treeMapLegendModule.legendCollections.length,v=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),m&&(m.shapeTarget="selection",m.shapeHighlightCollection=[]),T=te(y,l,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+T):document.getElementById(this.treemap.element.id+"_Legend_Index_"+T),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:v[T].legendFill,oldOpacity:v[T].opacity,oldBorderColor:v[T].borderColor,oldBorderWidth:v[T].borderWidth}),K(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()))}a=f(l,[],c.mode,r);for(var b=0;b<o.childElementCount;b++)n=o.childNodes[b],l=r.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],a.indexOf(l.levelOrderName)>-1&&(g.push(n),r.levelSelection.push(n.id),s.push(l));H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),x=0;x<g.length;x++){if(n=g[x],S.length>0)for(var w=0;w<S.length;w++)S[w].id===n.id&&S[w].classList.remove("treeMapHighLight"),A(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");else A(n.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),n.classList.add("treeMapSelection");t={cancel:!1,name:"itemSelected",treemap:r,items:s,elements:g,text:d,contentItemTemplate:d},r.trigger("itemSelected",t,function(e){e.contentItemTemplate!==d&&p(h,i,e.contentItemTemplate)})}}else Q(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){v=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var F,C=void 0,I=void 0;this.legendSelectId=h,this.legendSelect=!1;var L=parseInt(h[h.length-1],10),O=document.getElementById(h);$(this.legendSelectionCollection),m&&(m.shapeTarget="selection");for(var T="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]),N=this.treemap.treeMapLegendModule.legendCollections[T].legendData.length,x=0;x<N;x++)for(var E=0;E<this.treemap.layout.renderItems.length;E++)if(this.treemap.treeMapLegendModule.legendCollections[T].legendData[x].levelOrderName===this.treemap.layout.renderItems[E].levelOrderName){C=E,I=this.treemap.layout.renderItems[E].groupIndex;var D=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+C+"_RectPath");0===x&&(ie(this.legendSelectionCollection,L,E,O,D,this.treemap.layout.renderItems,v),F=this.legendSelectionCollection.length,this.legendSelectionCollection[F-1].ShapeCollection={Elements:[]}),K(O,c.fill,c.opacity,c.border.color,c.border.width.toString()),K(D,c.fill,c.opacity,c.border.color,c.border.width.toString()),F=this.legendSelectionCollection.length,this.legendSelectionCollection[F-1].ShapeCollection.Elements.push(D)}}else $(this.legendSelectionCollection),m&&(m.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,r=0;r<this.treemap.layout.renderItems.length;r++)if(e===this.treemap.layout.renderItems[r].levelOrderName){i=this.treemap.layout.renderItems[r];break}var l=this.treemap.selectionSettings,o=[],n=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var h=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",d=document.getElementById(h),p=f(i,[],l.mode,this.treemap),g=0;g<d.childElementCount;g++)n=d.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(o.push(n),this.treemap.levelSelection.push(n.id),s.push(i));if(this.treemap.legendSettings.visible)for(var c=0;c<s.length;c++){this.shapeSelect=!1;var m=this.treemap.treeMapLegendModule.legendCollections.length,u=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),a=te(m,s[c],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+a):document.getElementById(this.treemap.element.id+"_Legend_Index_"+a),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:u[a].legendFill,oldOpacity:u[a].opacity,oldBorderColor:u[a].borderColor,oldBorderWidth:u[a].borderWidth}),K(this.shapeElement,l.fill,l.opacity,l.border.color,l.border.width.toString()))}H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var y=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=y.childNodes[0].id;for(var v=document.getElementsByClassName("treeMapHighLight"),b=0;b<o.length;b++)if(n=o[b],v.length>0)for(var S=0;S<v.length;S++)v[S].id===n.id&&v[S].classList.remove("treeMapHighLight"),A(n.childNodes[0],{border:l.border,fill:l.fill,opacity:l.opacity}),n.classList.add("treeMapSelection");else l.fill="null"===l.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options.fill:l.fill,A(n.childNodes[0],{border:l.border,fill:l.fill,opacity:l.opacity}),n.classList.add("treeMapSelection")}else Q(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],H(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchStartEvent,this.mouseDown,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchStartEvent,this.mouseDown)},e.prototype.getModuleName=function(){return"treeMapSelection"},e.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null},e}(),We=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&(i[r[l]]=e[r[l]]);return i},je=function(){function e(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var i,r,l,o,n,a=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(o=e).changedTouches[0].pageX,r=o.changedTouches[0].pageY,l=o.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,r=e.pageY,l=e.target);var s,h,d,p,g=l.id,c={},m={},u=[];if(g.indexOf("_Item_Index")>-1){if(c=this.treemap.layout.renderItems[parseFloat(g.split("_Item_Index_")[1])],!t.isNullOrUndefined(c)){s=c.weight,m=c.data,t.isNullOrUndefined(c.options)||(p=c.options.fill),u=this.treemap.enableRtl?[(t.isNullOrUndefined(this.tooltipSettings.format)?null:W(this.tooltipSettings.format,m,this.treemap))||j(s,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[(t.isNullOrUndefined(this.tooltipSettings.format)?null:W(this.tooltipSettings.format,m,this.treemap))||this.treemap.weightValuePath.toString()+" : "+j(s,this.treemap)],document.getElementById(this.tooltipId)?h=document.getElementById(this.tooltipId):((h=t.createElement("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(h)),(d=I(i,r,this.treemap.svgObject)).y=this.tooltipSettings.template?d.y+10:d.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=t.isNullOrUndefined(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var f={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};n={cancel:!1,name:"tooltipRendering",item:c,options:{location:d,text:u,data:m,border:f,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:l,eventArgs:e},this.treemap.trigger("tooltipRendering",n,function(e){a.addTooltip(n,p,h)})}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,r,l,o){var n,a;t.isNullOrUndefined(e)?(n=o.cancel,a=o):(n=e.cancel,a=We(e,["cancel"]).options),n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({theme:this.treemap.theme,enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[r],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor,border:a.border,enableShadow:!0}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(l),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(){t.isNullOrUndefined(this.svgTooltip)||this.svgTooltip.destroy(),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},e}();return ze.Inject(je,ke,He,Ae,Me,_e,Pe),e.Border=he,e.ColorMapping=ue,e.ColorValue=Ne,e.CommonTitleSettings=ge,e.Font=pe,e.HighlightSettings=xe,e.ImageExport=Pe,e.InitialDrillSettings=ye,e.LayoutPanel=De,e.LeafItemSettings=ve,e.LegendSettings=fe,e.LevelSettings=we,e.LevelsData=Ue,e.Location=Te,e.Margin=de,e.PathOption=Le,e.PdfExport=_e,e.Print=Me,e.Rect=Ce,e.RectOption=Ie,e.SelectionSettings=Se,e.Size=Fe,e.SubTitleSettings=ce,e.TextOption=Oe,e.TitleSettings=me,e.TooltipSettings=be,e.TreeMap=ze,e.TreeMapAjax=Ee,e.TreeMapHighlight=He,e.TreeMapLegend=ke,e.TreeMapSelection=Ae,e.TreeMapTooltip=je,e.applyOptions=A,e.beforePrint="beforePrint",e.click="click",e.colorCollections=T,e.colorMap=L,e.colorNameToHex=X,e.componentToHex=V,e.convertElement=v,e.convertHexToColor=q,e.convertToContainer=F,e.convertToHexCode=G,e.convertToRect=C,e.createTextStyle=h,e.deSaturationColor=O,e.defaultFont=ne,e.doubleClick="doubleClick",e.drawSymbol=J,e.drillEnd="drillEnd",e.drillStart="drillStart",e.findChildren=u,e.findHightLightItems=f,e.findLabelLocation=b,e.findPosition=s,e.formatValue=j,e.getArea=x,e.getColorByValue=E,e.getElement=g,e.getGradientColor=D,e.getLegendIndex=te,e.getMousePosition=I,e.getPercentage=P,e.getPercentageColor=M,e.getShortestEdge=w,e.getTemplateFunction=y,e.getThemeStyle=oe,e.hide=R,e.isContainsData=m,e.isParentItem=Z,e.itemClick="itemClick",e.itemHighlight="itemHighlight",e.itemMove="itemMove",e.itemRendering="itemRendering",e.itemSelected="itemSelected",e.itemsToOrder=c,e.legendItemRendering="legendItemRendering",e.legendMaintain=k,e.legendRendering="legendRendering",e.load="load",e.loaded="loaded",e.maintainSelection=U,e.measureElement=S,e.measureText=n,e.mouseMove="mouseMove",e.orderByArea=z,e.pushCollection=ie,e.removeClassNames=H,e.removeElement=le,e.removeLegend=$,e.removeSelectionWithHighlight=ee,e.removeShape=Q,e.renderLegendShape=Y,e.renderTextElement=d,e.resize="resize",e.rgbToHex=N,e.rightClick="rightClick",e.setColor=K,e.setItemTemplateContent=p,e.stringToNumber=o,e.textFormatter=W,e.textTrim=a,e.textWrap=B,e.tooltipRendering="tooltipRendering",e.triggerDownload=re,e.wordWrap=_,e}({},ej.base,ej.svgbase,ej.data,ej.pdfexport),this.ejs=ej;
11
11
  //# sourceMappingURL=ej2-treemap.min.js.map