@syncfusion/ej2-treemap 21.2.3 → 22.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -0
- package/dist/ej2-treemap.min.js +2 -2
- package/dist/ej2-treemap.umd.min.js +2 -2
- package/dist/ej2-treemap.umd.min.js.map +1 -1
- package/dist/es6/ej2-treemap.es2015.js +126 -18
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +126 -18
- package/dist/es6/ej2-treemap.es5.js.map +1 -1
- package/dist/global/ej2-treemap.min.js +2 -2
- package/dist/global/ej2-treemap.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +15 -12
- package/src/treemap/layout/legend.js +2 -0
- package/src/treemap/layout/render-panel.js +2 -1
- package/src/treemap/model/base-model.d.ts +7 -4
- package/src/treemap/model/base.d.ts +7 -4
- package/src/treemap/model/base.js +5 -5
- package/src/treemap/model/image-export.js +14 -3
- package/src/treemap/model/interface.d.ts +15 -1
- package/src/treemap/model/pdf-export.js +4 -2
- package/src/treemap/model/print.js +14 -2
- package/src/treemap/model/theme.js +72 -0
- package/src/treemap/treemap-model.d.ts +1 -1
- package/src/treemap/treemap.js +8 -6
- package/src/treemap/user-interaction/tooltip.js +3 -0
- package/src/treemap/utils/enum.d.ts +5 -1
- package/src/treemap/utils/helper.d.ts +1 -1
- package/src/treemap/utils/helper.js +4 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-treemap.umd.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 22.1.34
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t(e.ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,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 He(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 Ge(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,c={"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},g="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],u=new i.SvgRenderer("");if(!t.isNullOrUndefined(g)&&!t.isNullOrUndefined(e.connectorText)&&g.search(e.connectorText[1])>=0)for(var m=g.split("#"),f=0;f<m.length;f++){var v=-1===m[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?m[f]:e.connectorText;if(c.id=e.id+"_"+f,p=h(u,c,v),f%2==0&&0!==f){v=v.replace(/\s+/g," ")}var y=n(v,r);c.x=0!==f?c.x+y.width:c.x+y.width+5,o.appendChild(p)}else p=h(u,c,g),o.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var b=1,x=e.text.length;b<x;b++)d=n(e.text[b],r).height,s=u.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 c(e){return document.getElementById(e)}function g(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function u(e,t,i,r){for(var l=!1,o="",n=r.leafItemSettings,a=0;a<e.length;a++){var s=i[r.levels[a]?r.levels[a].groupPath:n.labelPath?n.labelPath:r.weightValuePath]||"undefined";if(e[a]===s&&(o+=s+(a===e.length-1?"":"#"))===t){l=!0;break}}return l}function m(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=m(e).values;if(l&&l.length>0){for(var o=0;o<l.length;o++)-1===t.indexOf(l[o].levelOrderName)&&t.push(l[o].levelOrderName);for(var n=0;n<l.length;n++)f(l[n],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){var a=e.levelOrderName.split("#")[0],s=void 0;for(o=0;o<r.layout.renderItems.length;o++)(s=r.layout.renderItems[o]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function v(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){i=t.compile(e)}return i}function y(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 Ge(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 x(e,t){var i=new He(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 S(e){return(e.width-e.x)*(e.height-e.y)}function w(e){var t=I(e),i=t.width,r=t.height;return Math.min(i,r)}function I(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 L(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 Ge(e-s,t-h)}function O(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]:M(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]:M(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=P(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 P(e,t){var i=1;if(t>=e.from&&t<=e.to){i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity}return i.toString()}function M(e,t){return T(e,t)}function N(e,t,i){return"#"+W(e)+W(t)+W(i)}function T(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={},c=1;c<h;c++)p={b:i+c*s,color:t.color[c]},d.push(p);for(var g=0;g<d.length;g++)i<=e&&e<=d[g].b&&0===g?(a="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),l=e<d[g].b?1-Math.abs((e-d[g].b)/s):(e-d[g].b)/s):d[g].b<=e&&e<=r&&g===d.length-1&&(n="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),l=e<d[g].b?1-Math.abs((e-d[g].b)/s):(e-d[g].b)/s),g!==d.length-1&&g<d.length&&d[g].b<=e&&e<=d[g+1].b&&(n="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),a="#"===d[g+1].color.charAt(0)?d[g+1].color:X(d[g+1].color),l=Math.abs(e-d[g+1].b)/s)}return E(l,n,a)}function E(e,t,i){var r=i.split("#")[1],l=t.split("#")[1],o=F(e,parseInt(l.substr(0,2),16),parseInt(r.substr(0,2),16)),n=F(e,parseInt(l.substr(2,2),16),parseInt(r.substr(2,2),16)),a=F(e,parseInt(l.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ve(o,n,a)}function F(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 R(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 B(e,t,i,r){var l=n(i,r);return l.width>e||l.height>t?" ":i}function U(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function H(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),k(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function z(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 A(e,i,r){for(var l,o=0;o<e.length;o++)k(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 k(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 j(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(G(i[n],r).toString())}return e}function G(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}function V(e){return"#"+W(e.r)+W(e.g)+W(e.b)}function W(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 Ve(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ve(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 V(new Ve(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function J(e,t,r,l,o,n){var a=new i.SvgRenderer(""),s=Y(e,r,t,o,l),h=a["draw"+s.functionName](s.renderOption);return h.setAttribute("aria-label",n),h}function Y(e,i,r,l,o){var n,a="Path",s=i.width,h=i.height,d=e.x,p=e.y,c=e.x+-s/2,g=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 "+c+" "+p+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+p+" L "+d+" "+(p+h/2)+" L "+c+" "+p+" z",t.merge(l,{d:n});break;case"Rectangle":n="M "+c+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+c+" "+(p+h/2)+" L "+c+" "+(p+-h/2)+" z",t.merge(l,{d:n});break;case"Triangle":n="M "+c+" "+(p+h/2)+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+c+" "+(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 u=void 0,m=void 0,f=0;f<=5;f++)u=s/2*Math.cos(Math.PI/180*(72*f)),m=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+u)+" "+(p+m)+" ":n.concat("L "+(d+u)+" "+(p+m)+" ");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 "+c+" "+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:c,y:g})}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),A(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",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif"};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif"};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue"};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter"};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter"};break;case"bootstrap5":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#212529",subTitleFontColor:"#212529",tooltipFillColor:"#212529",tooltipFontColor:"#F9FAFB",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Helvetica Neue",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};break;case"bootstrap5dark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#E9ECEF",tooltipFontColor:"#212529",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Helvetica Neue",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI"};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI"};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif"}}return t}var ne="beforePrint",ae="itemRendering",se="drillStart",he="drillEnd",de="itemSelected",pe="itemHighlight",ce="tooltipRendering",ge="itemClick",ue="itemMove",me="doubleClick",fe="rightClick",ve="mouseMove",ye="legendItemRendering",be="legendRendering",xe="resize",Se="Roboto, Segoe UI, Noto, Sans-serif",we=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)}}(),Ie=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},Ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("#808080")],i.prototype,"color",void 0),Ie([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),Le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(10)],i.prototype,"left",void 0),Ie([t.Property(10)],i.prototype,"right",void 0),Ie([t.Property(10)],i.prototype,"top",void 0),Ie([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"size",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(Se)],i.prototype,"fontFamily",void 0),Ie([t.Property("Normal")],i.prototype,"fontWeight",void 0),Ie([t.Property("Normal")],i.prototype,"fontStyle",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("")],i.prototype,"text",void 0),Ie([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({fontFamily:null},Oe)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),i}(Pe),Ne=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({fontFamily:null},Oe)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Complex({},Me)],i.prototype,"subtitleSettings",void 0),i}(Pe),Te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"from",void 0),Ie([t.Property(null)],i.prototype,"to",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(null)],i.prototype,"label",void 0),Ie([t.Property(null)],i.prototype,"value",void 0),Ie([t.Property(null)],i.prototype,"minOpacity",void 0),Ie([t.Property(null)],i.prototype,"maxOpacity",void 0),Ie([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("Default")],i.prototype,"mode",void 0),Ie([t.Property("transparent")],i.prototype,"background",void 0),Ie([t.Property("Circle")],i.prototype,"shape",void 0),Ie([t.Property("")],i.prototype,"width",void 0),Ie([t.Property("")],i.prototype,"height",void 0),Ie([t.Complex({fontFamily:null},Oe)],i.prototype,"textStyle",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(15)],i.prototype,"shapeWidth",void 0),Ie([t.Property(15)],i.prototype,"shapeHeight",void 0),Ie([t.Property(10)],i.prototype,"shapePadding",void 0),Ie([t.Property(null)],i.prototype,"imageUrl",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"border",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"shapeBorder",void 0),Ie([t.Complex({},Pe)],i.prototype,"title",void 0),Ie([t.Complex({size:"14px"},Oe)],i.prototype,"titleStyle",void 0),Ie([t.Property("Bottom")],i.prototype,"position",void 0),Ie([t.Property("None")],i.prototype,"orientation",void 0),Ie([t.Property(!1)],i.prototype,"invertedPointer",void 0),Ie([t.Property("After")],i.prototype,"labelPosition",void 0),Ie([t.Property("None")],i.prototype,"labelDisplayMode",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Property({x:0,y:0})],i.prototype,"location",void 0),Ie([t.Property(null)],i.prototype,"showLegendPath",void 0),Ie([t.Property(null)],i.prototype,"valuePath",void 0),Ie([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),Ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupIndex",void 0),Ie([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),Fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(0)],i.prototype,"gap",void 0),Ie([t.Property(10)],i.prototype,"padding",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showLabels",void 0),Ie([t.Property(null)],i.prototype,"labelPath",void 0),Ie([t.Property(null)],i.prototype,"labelFormat",void 0),Ie([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),Ie([t.Complex({color:null,size:"12px"},Oe)],i.prototype,"labelStyle",void 0),Ie([t.Property(null)],i.prototype,"labelTemplate",void 0),Ie([t.Property("Center")],i.prototype,"templatePosition",void 0),Ie([t.Property("Trim")],i.prototype,"interSectAction",void 0),Ie([t.Collection([],Te)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),_e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("")],i.prototype,"template",void 0),Ie([t.Property(null)],i.prototype,"format",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(.75)],i.prototype,"opacity",void 0),Ie([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Complex({fontFamily:Se,size:"13px"},Oe)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property("#808080")],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupPath",void 0),Ie([t.Property(0)],i.prototype,"groupGap",void 0),Ie([t.Property(10)],i.prototype,"groupPadding",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showHeader",void 0),Ie([t.Property(20)],i.prototype,"headerHeight",void 0),Ie([t.Property(null)],i.prototype,"headerTemplate",void 0),Ie([t.Property(null)],i.prototype,"headerFormat",void 0),Ie([t.Property("Near")],i.prototype,"headerAlignment",void 0),Ie([t.Complex({color:null,size:"13px"},Oe)],i.prototype,"headerStyle",void 0),Ie([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),Ie([t.Collection([],Te)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),He=function(){return function(e,t){this.width=e,this.height=t}}(),ze=function(){return function(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}}(),Ae=function(){return function(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}}(),ke=function(){return function(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}}(),je=function(){return function(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}}(),Ge=function(){return function(e,t){this.x=e,this.y=t}}(),Ve=function(){return function(e,t,i){this.r=e,this.g=t,this.b=i}}(),We=function(){return function(e,t,i,r,l){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=l}}(),qe=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=m(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=m(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 ze(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(g);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 ze(n+i.x,i.y,r,i.height))):(r=l/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new ze(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=m(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 ze(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,S(i)),t.sort(U),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var l=e.length;if(0===l){var o=this.getCoordinates(t,i);return u=r.concat(o)}var n=w(i),a=e[0],s=e.slice(1,l);if(this.aspectRatio(t,a,n)){var h=t.concat(a);return this.performRowsLayout(s,h,i,r)}for(var d=t.length,p=0,c=0;c<d;c+=1)p+=t[c].itemArea;var g=this.cutArea(i,p),u=(o=this.getCoordinates(t,i),r.concat(o));return this.performRowsLayout(e,[],g,u)},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=I(e),r=i.width,l=i.height,o=i.x,n=i.y;if(r>=l){var a=t/l;return C({x:o+a,y:n,width:r-a,height:l})}var s=t/r;return C({x:o,y:n+s,width:r,height:l-s})},e.prototype.getCoordinates=function(e,i){for(var r,l=I(i),o=l.width,n=l.height,a=l.x,s=l.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,c=0,g=0;g<h;g+=1)c+=e[g].itemArea;var u,m,f,v=c/n,y=c/o,b=a,x=s,S=[];for(g=0;g<h;g+=1){var w=e[g];if(r=w.groupIndex,w.isLeafItem=0===d.length||(this.treemap.isHierarchicalData?r===d.length:!t.isNullOrUndefined(p.labelPath)&&r===d.length),m=Z(this.parentData[0],w),f=m?this.treemap.areaRect:w.parent.rect,u=w.isLeafItem?p.padding:d[r].groupPadding,o>=n){var C=x+w.itemArea/v;w.rect={x:b,y:x,width:b+v,height:C},x=C}else{var L=b+w.itemArea/y;w.rect={x:b,y:x,width:L,height:x+y},b=L}w.weight>0&&(m||Math.round(i.y+u/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+u/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),S.push(w))}return S},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,c,g,u,f,v,y,b,x,S=n.element.id,w=n.layoutType,C=this.treemap.leafItemSettings.interSectAction,L="",O=document.getElementById(n.element.id+"_Secondary_Element"),P=n.levels;this.layoutGroup=this.renderer.createGroup({id:S+"_TreeMap_"+w+"_Layout"});var M,N,T,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 E,F,_=!1,R=n.leafItemSettings,B=function(w){if(g=U.renderItems[w],s=g.groupIndex,U.treemap.drillDownView&&t.isNullOrUndefined(U.treemap.currentLevel)&&s>0||U.treemap.drillDownView&&s>U.treemap.currentLevel+1)return"continue";d=g.rect,_=g.isLeafItem,v=S+"_Level_Index_"+s+"_Item_Index_"+w,M=U.renderer.createGroup({id:v+"_Group"}),b=(_?R.gap:P[s].groupGap)/2;var B=U.treemap.totalRect?I(U.treemap.totalRect):U.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=B.x+B.width-d.width-Math.abs(B.x-d.x):"BottomLeftTopRight"===n.renderDirection?d.y=B.y+B.height-d.height-Math.abs(B.y-d.y):"BottomRightTopLeft"===n.renderDirection&&(d.x=B.x+B.width-d.width-Math.abs(B.x-d.x),d.y=B.y+B.height-d.height-Math.abs(B.y-d.y)),r=U.getItemColor(_,g),c=r.fill,f=r.opacity,p=_?R.labelFormat:P[s].headerFormat;var z;if(i=_?R.showLabels:P[s].showHeader,s===U.treemap.currentLevel)if(U.treemap.enableBreadcrumb){F="#"+U.treemap.breadcrumbConnector+"#",z=g.levelOrderName.replace(/#/gi,F),z=0!==s?"#"+z:z}else z=g.name;else U.treemap.enableBreadcrumb&&(g.isDrilled=!1),z=g.name;u=j(p,g.data,U.treemap)||z||"undefined",E=m(g).values,u=!_&&E&&E.length>0&&U.treemap.enableDrillDown?g.isDrilled?n.enableRtl?u+" [-]":"[-] "+u:n.enableRtl?u+" [+]":"[+] "+u:u,(x=_?R.labelStyle:P[s].headerStyle).fontFamily=U.treemap.themeStyle.labelFontFamily||x.fontFamily,T=_?R.border:P[s].border,e=_?R.labelPosition:"Near"===P[s].headerAlignment?"TopLeft":"Center"===P[s].headerAlignment?"TopCenter":"TopRight",h=_?R.templatePosition:P[s].templatePosition,N=_?R.labelTemplate:P[s].headerTemplate,g.options={border:T,opacity:f,fill:c},l={cancel:!1,name:ae,treemap:U.treemap,text:u,currentItem:g,RenderItems:U.renderItems,options:g.options},U.treemap.trigger(ae,l,function(r){if(!r.cancel){L=" 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 ke(v+"_RectPath",c,T.width,T.color,f,null,L);var n=o.renderer.drawPath(a);M.appendChild(n),i&&(l.text!==u&&(l.text=j(l.text,g.data,o.treemap)||z),o.renderItemText(l.text.toString(),M,x,d,C,v,c,e,F)),N&&(y=o.renderTemplate(O,v,d,h,N,g,_),t.isNullOrUndefined(y)||(D.appendChild(y),o.treemap.renderReactTemplates())),M.setAttribute("aria-label",g.name),M.setAttribute("role",""),M.setAttribute("tabindex",(o.treemap.tabIndex+w+2).toString()),H(o.treemap,M,"treeMapSelection"),o.layoutGroup.appendChild(M)}})},U=this,z=0;z<this.renderItems.length;z++)B(z);D.childNodes.length>0&&O.appendChild(D),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,l,o,s,h,p,c){var g,u,m,f=[],v=[],y=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,u=this.labelInterSectAction(l,e,r,o),g=n(f&&f[0]||u[0],r),this.treemap.enableRtl){var x=n(e,r),S=e.search("[+]")||e.search("[-]");if(l.width<x.width&&S>0){var w=e.substring(S-1,e.length),I=n("[+]",r);u[0]=a(l.width-I.width-5,u[0],r)+w}}var C=b(l,p,g,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var L=[],O=null,P=[],M=0;M<f.length;M++)y+=(g=n(O=a(l.width-5,f[M],r),r)).height,P.push(g.width),L.push(O);u=L,g.width=Math.max.apply(null,P),g.height=y}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var N=0;N<u.length;N++)y+=(g=n(u[N],r)).height,l.height-5>y&&v.push(u[N]);if("Wrap"===o&&u.length!==v.length&&v.length){var T=v.length-1,D=v[T];D=D.substring(0,D.length-1)+"...",v.splice(T),"..."!==D&&v.push(D)}}else m=u,v.push(m);d(new je(s+"_Text",C.x,C.y,"start",v,"","",c),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=m(r.treemapLevelData.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=O(a,i.data[r.equalColorValuePath],i.data[r.rangeColorValuePath]);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)?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))for(var d=Object.keys(n.data),p=0;p<d.length;p++){var c=RegExp;o=o.replace(new c("{{:"+d[p]+"}}","g"),n.data[d[p].toString()])}var g;if(!t.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var u=b(r,l,x(g=y(v(o)(n.data,this.treemap,o,this.treemap.element.id+h,!1),s,n.data),e),"Template",this.treemap);g.style.left=u.x+"px",g.style.top=u.y+"px"}return g},e.prototype.labelInterSectAction=function(e,t,i,r){var l,o=e.width-10;switch(r){case"Hide":l=[B(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=R(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}();(e.Theme||(e.Theme={})).mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};var Xe=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:ne};e.trigger(ne,l,function(){l.cancel||t.print(l.htmlContent,r)})},e.prototype.getHTMLContent=function(e,i){var r=t.createElement("div");return i?i instanceof Array?i.forEach(function(e){r.appendChild(c(e).cloneNode(!0))}):i instanceof Element?r.appendChild(i.cloneNode(!0)):r.appendChild(c(i).cloneNode(!0)):r.appendChild(e.element.cloneNode(!0)),r},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),Je=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=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),h='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+e.svgObject.outerHTML+"</svg>",d=window.URL.createObjectURL(new Blob("SVG"===i?[h]:[(new XMLSerializer).serializeToString(e.svgObject)],{type:"image/svg+xml"}));if("SVG"===i)l?re(r,i,d,s):o(null);else{var p=new Image,c=a.getContext("2d");p.onload=function(){c.drawImage(p,0,0),window.URL.revokeObjectURL(d),l?re(r,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),s):"JPEG"===i?o(a.toDataURL("image/jpeg")):"PNG"===i&&o(a.toDataURL("image/png"))},p.src=d}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),Ye=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&&"TailwindDark"!==e.theme&&"Bootstrap5"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"Fluent"!==e.theme&&"FluentDark"!==e.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p||h.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var c=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(h)],{type:"image/svg+xml"})),g=new Image,u=s.getContext("2d");g.onload=function(){u.drawImage(g,0,0),window.URL.revokeObjectURL(c);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)},g.src=c})},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(){},e}(),Ze=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)}}(),Qe=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},$e=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 Ze(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 Ke,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;if(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()})}else this.dataSource instanceof We?(o=this.dataSource,(l=new t.Ajax(o.dataOptions,o.type,o.async,o.contentType)).onSuccess=function(e){n.dataSource=JSON.parse("["+e+"]")[0],n.renderTreeMapElements()},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 qe(this)),this.clearTemplate();var e=this.element.clientWidth,r=this.element.clientHeight;this.availableSize=new He(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 qe(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 Ae(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new ze(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.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 c=a(p,e.text,h),g=n(c,h),u=s(t.isNullOrUndefined(r)?new ze(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,g,i),m=new je(this.element.id+"_TreeMap_"+i,u.x,u.y,"start",c),f=new ze(u.x,u.y,g.width,g.height),v=d(m,h,h.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),l);v.setAttribute("aria-label",e.description||e.text),v.setAttribute("role",""),v.setAttribute("tabindex",(this.tabIndex+("title"===i?1:2)).toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(o=this.availableSize.height-f.y-10-this.margin.bottom,this.areaRect=new ze(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 ze(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(var l=0;l<this.dataSource.length;l++){var o=m(this.dataSource[l]).values;this.isHierarchicalData&&o&&o.length>0?o.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[l][e]&&r[e].push({groupIndex:0,name:this.dataSource[l][e],levelOrderName:this.dataSource[l][e].toString(),data:this.dataSource[l],weight:this.dataSource[l][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(l=0;l<this.treemapLevelData.hierarchyData.length;l++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[l],l);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=m(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=m(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,c=void 0;p.search("#")>0&&(c=p.split("#").length-1),r[d].groupIndex=t.isNullOrUndefined(l)?c===this.levels.length?this.levels.length:c: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){for(var g=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath],u=0;u<this.treemapLevelData.hierarchyData.length;u++)r=m(this.treemapLevelData.hierarchyData[u]).values,0!==u&&r&&(r.forEach(function(e){g.push(e)}),this.treemapLevelData.hierarchyData.splice(u,1),u-=1);g=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];for(var f=0;f<g.length;f++)a[this.levels[0].groupPath]=g,g[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=function(a){i=0,l=e[a].groupName,r=e[a].levelOrderName.split("#"),s.dataSource.forEach(function(t){u(r,e[a].levelOrderName,t,o)&&(i+=parseFloat(t[o.weightValuePath]))}),"Parent"===t&&(n[l]=e,e[a].parent=n),e[a].weight=i},s=this,h=0;h<e.length;h++)a(h)},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",""),this.element.setAttribute("tabindex",this.tabIndex.toString())},l.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var r={name:xe,cancel:!1,previousSize:this.availableSize,currentSize:new He(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(xe,r,function(e){i.render()})},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:ge,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(ge,i,function(e){e.text===a&&e.contentItemTemplate===a||(t.isNullOrUndefined(l.leafItemSettings.labelTemplate)?(e.text=j(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:me,treemap:this,mouseEvent:e};this.trigger(me,t)},l.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:fe,treemap:this,mouseEvent:e};this.trigger(fe,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:ve,treemap:this,mouseEvent:e};this.trigger(ve,o);var n;l.indexOf("_Item_Index")>-1&&(n=m(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:ue,treemap:this,item:r,mouseEvent:e},this.trigger(ue,i)),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,c=!1,g={},u=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 v=d.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(v,n),a=s.drillLevel,this.drillDownView||-1===v.search("[+]")||(c=this.calculatePreviousLevelChildItems(s,n,c))),0!==this.levels.length&&!n.isLeafItem&&m(n).values&&m(n).values.length>0){if(this.drilledItems.length>0){n=c?this.drilledItems[this.drilledItems.length-1].data:n;for(var y=0;y<this.drilledItems.length;y++){if(!t.isNullOrUndefined(a)){var b=this.drilledItems.length;if(g=this.compareSelectedLabelWithDrillDownItems(s,n,y),b!==this.drilledItems.length){y-=1;break}}if(n.levelOrderName===this.drilledItems[y].name&&!c&&t.isNullOrUndefined(a)){0===n.groupIndex&&n.parent[n.groupName]instanceof Array?(n.isDrilled=!n.isDrilled,n.isDrilled?g[n.groupName]=[n]:g=n.parent):(n.isDrilled=!1,n.parent.isDrilled=!0,n=n.parent,g[n.groupName]=[n]),this.drilledItems.splice(y,1),y-=1;break}y===this.drilledItems.length-1&&t.isNullOrUndefined(a)&&(n.isDrilled=!0,g[n.groupName]=[n])}}else n.isDrilled=!0,g[n.groupName]=[n];r={cancel:!1,name:se,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:g},this.trigger(se,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(u)){var r=document.getElementById(u);r.parentNode.removeChild(r)}if(i=t.extend({},h.areaRect,i,!0),h.legendSettings.visible&&!t.isNullOrUndefined(h.treeMapLegendModule)&&(t.isNullOrUndefined(g)||(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(g,i),h.layout.renderLayoutItems()):h.layout.onDemandProcess(e.childItems)}}),l={cancel:!1,name:he,treemap:this,renderItems:this.layout.renderItems},this.trigger(he,l),!c&&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(),A(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]}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this]}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this]}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this]}),this.allowPrint&&e.push({member:"Print",args:[this,Xe]}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Je]}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,Ye]}),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)},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""},Qe([t.Property(!1)],l.prototype,"allowPrint",void 0),Qe([t.Property(!1)],l.prototype,"allowImageExport",void 0),Qe([t.Property(!1)],l.prototype,"allowPdfExport",void 0),Qe([t.Property(null)],l.prototype,"width",void 0),Qe([t.Property(null)],l.prototype,"height",void 0),Qe([t.Complex({},Ce)],l.prototype,"border",void 0),Qe([t.Complex({},Le)],l.prototype,"margin",void 0),Qe([t.Property(null)],l.prototype,"background",void 0),Qe([t.Property("Material")],l.prototype,"theme",void 0),Qe([t.Complex({},Ne)],l.prototype,"titleSettings",void 0),Qe([t.Property("Squarified")],l.prototype,"layoutType",void 0),Qe([t.Property(null)],l.prototype,"dataSource",void 0),Qe([t.Property(null)],l.prototype,"query",void 0),Qe([t.Property(null)],l.prototype,"weightValuePath",void 0),Qe([t.Property("")],l.prototype,"rangeColorValuePath",void 0),Qe([t.Property("")],l.prototype,"equalColorValuePath",void 0),Qe([t.Property(null)],l.prototype,"colorValuePath",void 0),Qe([t.Property([])],l.prototype,"palette",void 0),Qe([t.Property("TopLeftBottomRight")],l.prototype,"renderDirection",void 0),Qe([t.Property(!1)],l.prototype,"enableDrillDown",void 0),Qe([t.Property(!1)],l.prototype,"enableBreadcrumb",void 0),Qe([t.Property(" - ")],l.prototype,"breadcrumbConnector",void 0),Qe([t.Property(!1)],l.prototype,"drillDownView",void 0),Qe([t.Complex({},Ee)],l.prototype,"initialDrillDown",void 0),Qe([t.Complex({},Fe)],l.prototype,"leafItemSettings",void 0),Qe([t.Collection([],Ue)],l.prototype,"levels",void 0),Qe([t.Complex({},Be)],l.prototype,"highlightSettings",void 0),Qe([t.Complex({},Re)],l.prototype,"selectionSettings",void 0),Qe([t.Complex({},_e)],l.prototype,"tooltipSettings",void 0),Qe([t.Complex({},De)],l.prototype,"legendSettings",void 0),Qe([t.Property(!1)],l.prototype,"useGroupingSeparator",void 0),Qe([t.Property(null)],l.prototype,"description",void 0),Qe([t.Property(1)],l.prototype,"tabIndex",void 0),Qe([t.Property(null)],l.prototype,"format",void 0),Qe([t.Event()],l.prototype,"load",void 0),Qe([t.Event()],l.prototype,"beforePrint",void 0),Qe([t.Event()],l.prototype,"loaded",void 0),Qe([t.Event()],l.prototype,"itemRendering",void 0),Qe([t.Event()],l.prototype,"drillStart",void 0),Qe([t.Event()],l.prototype,"drillEnd",void 0),Qe([t.Event()],l.prototype,"itemSelected",void 0),Qe([t.Event()],l.prototype,"itemHighlight",void 0),Qe([t.Event()],l.prototype,"tooltipRendering",void 0),Qe([t.Event()],l.prototype,"itemClick",void 0),Qe([t.Event()],l.prototype,"itemMove",void 0),Qe([t.Event()],l.prototype,"click",void 0),Qe([t.Event()],l.prototype,"doubleClick",void 0),Qe([t.Event()],l.prototype,"rightClick",void 0),Qe([t.Event()],l.prototype,"mouseMove",void 0),Qe([t.Event()],l.prototype,"resize",void 0),Qe([t.Event()],l.prototype,"legendItemRendering",void 0),Qe([t.Event()],l.prototype,"legendRendering",void 0),l=Qe([t.NotifyPropertyChanges],l)}(t.Component),Ke=function(){return function(){}}(),et=function(){function e(e){this.page=0,this.legendBorderRect=new ze(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new ze(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:be,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger(be,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]),(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,c=0,g=0,u=r.shapeHeight,m=r.shapeWidth,f=[],v=[],y="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,x=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;s.fontFamily=i.themeStyle.fontFamily||s.fontFamily,s.size=i.themeStyle.legendFontSize||s.size;var S=n(o,s),w=0,I=0,C=r.shapePadding,L=r.textStyle;if(L.size=L.size||i.themeStyle.legendFontSize,L.fontFamily=L.fontFamily||i.themeStyle.fontFamily,"Default"===h){b=t.isNullOrUndefined(b)?i.areaRect.width:b,x=t.isNullOrUndefined(x)?i.areaRect.height:x;for(var O=0,P=0;P<this.legendCollections.length;P++){var M=this.legendCollections[P];t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var N=n(M.legendName,L);if(this.textMaxWidth=Math.max(this.textMaxWidth,N.width),0===P)w=d=10+m/2,I=p=10+S.height+(u>N.height?u/2:N.height/4);else{var T=N.height>u?N.height:u;if("Horizontal"===y){var D=v[O-1].x+v[O-1].width+10+m;if(D+C+N.width>b){var E=(v[O-1].y>f[O-1].y+u/2?v[O-1].y:f[O-1].y+u/2)+10;E+T>x?(this.getPageChanged(),O=0,f=[],v=[],d=w,p=I):(d=f[0].x,p=E+T/2)}else d=D-m/2,p=f[O-1].y}else{var F=v[O-1].y>f[O-1].y+u/2?v[O-1].y:f[O-1].y+u/2;if(F+10+T>x){var _=v[O-1].x+this.textMaxWidth+10;_+C+N.width>b?(d=w,p=I,v=[],f=[],this.getPageChanged(),O=0):(d=_+m/2,p=f[0].y)}else d=f[O-1].x,p=F+10+u/2}}c=d+m/2+C,g=p+N.height/4,f.push({x:d,y:p}),v.push({x:c,y:g,width:N.width,height:N.height/2}),this.totalPages[this.page].Collection.push({DisplayText:M.legendName,element:M.gradientElement,Shape:{x:d,y:p},Text:{x:c,y:g},Fill:M.legendFill,Data:M.legendData,Rect:{x:f[O].x-m/2,y:f[O].y-u/2<g-N.height?f[O].y-u/2:g-N.height,width:Math.abs(f[O].x-m/2-(c+N.width)),height:u>N.height?u:N.height}}),O++}var R=this.totalPages[0].Collection;R.forEach(function(t,i){var r=new ze(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(w=r.x,I=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(w-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(I-(r.y+r.height)))}),b=this.widthIncrement<b?this.widthIncrement:b,x=this.heightIncrement<x?this.heightIncrement:x,this.legendItemRect={x:R[0].Rect.x,y:R[0].Rect.y,width:b,height:x}}else{var B=this.legendCollections.length,U="Horizontal"===y?t.isNullOrUndefined(b)?i.areaRect.width/B:b/B:t.isNullOrUndefined(b)?25:b,H="Horizontal"===y?t.isNullOrUndefined(x)?25:x:t.isNullOrUndefined(x)?i.areaRect.height/B:x/B;w=0,I=S.height+10;var z=r.labelPosition,A=0,k=0,j=r.labelDisplayMode,G=0,V=0;for(P=0;P<this.legendCollections.length;P++){w="Horizontal"===y?w+U:w,I="Horizontal"===y?I:I+H;var W=this.legendCollections[P].legendName,q=new He(0,0);"None"===j?q=n(W,L):"Trim"===j?q=n(W=a("Horizontal"===y?U:H,W,L),L):W="",G=Math.max(G,q.height),V=Math.max(V,q.width),q.width>0&&q.height>0&&("Horizontal"===y?(c=w+U/2,g="After"===z?I+H+q.height/2+10:I-10):(c="After"===z?w-q.width/2-10:w+U+q.width/2+10,g=I+H/2+q.height/4)),0===P&&(A="Horizontal"===y?w:"After"===z?c-q.width/2:w,k="Horizontal"===y?"After"===z?I:g-q.height/2:I),P===B-1&&(b="Horizontal"===y?Math.abs(w+U-A):U+V+10,x="Horizontal"===y?H+G/2+10:Math.abs(I+H-k)),this.legendRenderingCollections.push({fill:this.legendCollections[P].legendFill,x:w,y:I,width:U,height:H,element:this.legendCollections[P].gradientElement,text:W,textX:c,textY:g,textWidth:q.width,textHeight:q.height,data:this.legendCollections[P].legendData})}this.legendItemRect={x:A,y:k,width:b,height:x}}}},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=m(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=m(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;if(r=n.data.options.fill,n.data.isDrilled)i=m(n.data).values;else{i=m(n.data.parent).values}}else i=m(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(U),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,c,g,u,m,f,v,y,b,x,S=!1,w=this.treemap.leafItemSettings,I=this.treemap.levels,C=this.treemap.legendSettings.position,L=!1,O=0;this.outOfRangeLegend=null;for(var P=0;P<e.length;P++){r="",f=!1,v=!1,L=!1,o=e[P].data,h=e[P].groupIndex,s=(a=0===this.treemap.levels.length||h===this.treemap.levels.length)?w.colorMapping:I[h].colorMapping;for(var M=0;M<s.length;M++){var N=s[M];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?(S=!0,v=!0,u=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(u)):!t.isNullOrUndefined(N.value)&&d===N.value&&N.showLegend&&(S=!0,f=!0,u=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(u)),S&&t.isNullOrUndefined(N.value)&&N.maxOpacity&&N.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var T=[];if(L=!0,"[object Array]"===Object.prototype.toString.call(N.color))for(var D=0;D<N.color.length;D++){var E={colorStop:(D*(100/(N.color.length-1))+"%").toString(),color:N.color[D]};T.push(E)}else{E={colorStop:"0%",color:r};var F={colorStop:"100%",color:r};T.push(E),T.push(F)}c="Top"===C||"Bottom"===C?"100%":"0%",g="Top"===C||"Bottom"===C?"0%":"100%";var _={id:"groupIndex_"+h+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:c,y2:g};p=this.treemap.renderer.drawGradient("linearGradient",_,T).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++}m=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&S&&!m?(S=!1,r="[object Array]"===Object.prototype.toString.call(N.color)&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(N.value)?this.legendGradientColor(N,O):r,this.legendCollections.push({actualValue:u,levelIndex:a?-1:M,leafIndex:a?M:-1,legendName:n,legendFill:r,legendData:[],groupIndex:a?-1:h,gradientElement:t.isNullOrUndefined(p)?t.isNullOrUndefined(N.value)?this.legendLinearGradient:null:p,name:e[P].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[P]),O++):S&&!m&&(S=!1,this.legendCollections[i.value].legendData.push(e[P])),v||L||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)&&(y="[object Array]"===Object.prototype.toString.call(N.color)?N.color[0]:N.color,b=t.isNullOrUndefined(N.label)?"Others":N.label,t.isNullOrUndefined(this.outOfRangeLegend)&&(this.legendCollections.push({actualValue:b,legendData:[],legendName:b,legendFill:y}),x=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[x-1],O++),this.legendCollections[x-1].legendData.push(e[P]))}}},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 ze(s.x,s.y,s.width,s.height),p=new Ge(s.textX,s.textY),c=new Ae(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?(c.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+c.height)-Math.abs(this.legendBorderRect.y-c.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)):(c.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+c.width)-Math.abs(this.legendBorderRect.x-c.x),p.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-p.x))),d(new je(a,p.x,p.y,"middle",s.text,"",""),l,l.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(r.drawRectangle(c))}z(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=this,o=this.treemap,a=o.legendSettings,s=new He(a.shapeWidth,a.shapeHeight),h=o.renderer,p=a.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var c="HorizontalLine"===a.shape||"VerticalLine"===a.shape||"Cross"===a.shape,g=c?t.isNullOrUndefined(a.fill)?"#000000":a.fill:p.color,u=c&&0===p.width?1:p.width,m=function(t){var n=f.totalPages[e].Collection[t],p=h.createGroup({id:o.element.id+"_Legend_Index_"+t}),m=n.DisplayText,v=o.element.id+"_Legend_Shape_Index_"+t,y=o.element.id+"_Legend_Text_Index_"+t,b=n.Shape,x=n.Text;o.enableRtl&&(i=f.defaultLegendRtlLocation(n,10,o,a),b=i.shapeLocation,x=i.textLocation),r={cancel:!1,name:ye,treemap:o,fill:n.Fill,shape:a.shape,imageUrl:a.imageUrl},o.trigger(ye,r,function(e){var t=new ke(v,e.fill,u,c?n.Fill:g,a.opacity,"");p.appendChild(J(b,e.shape,s,e.imageUrl,t,m)),d(new je(y,x.x,x.y,"start",m,"",""),a.textStyle,a.textStyle.color||o.themeStyle.legendTextColor,p),l.legendGroup.appendChild(p)})},f=this,v=0;v<this.totalPages[e].Collection.length;v++)m(v);var y=void 0;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,x=a.textStyle,S=n(b,x),w=this.legendItemRect.x+this.legendItemRect.width-S.width-20-10,I=this.legendItemRect.x+this.legendItemRect.width,C=this.legendItemRect.y+this.legendItemRect.height+2.5+10,L=I-10-S.width/2-5;y=h.createGroup({id:o.element.id+"_Legend_Paging_Group"});var O=h.createGroup({id:o.element.id+"_Legend_Left_Paging_Group"}),P=h.createGroup({id:o.element.id+"_Legend_Right_Paging_Group"}),M=" M "+I+" "+C+" L "+(I-10)+" "+(C-5)+" L "+(I-10)+" "+(C+5)+" z ",N=" M "+w+" "+C+" L "+(w+10)+" "+(C-5)+" L "+(w+10)+" "+(C+5)+" z ",T=new ke(o.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);O.appendChild(h.drawPath(T));var D=new Ae(o.element.id+"_Left_Page_Rect","transparent",{},1,new ze(w-5,C-10,20,20),"");O.appendChild(h.drawRectangle(D)),this.wireEvents(O);var E=new ke(o.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",M);P.appendChild(h.drawPath(E));var F=new Ae(o.element.id+"_Right_Page_Rect","transparent",{},1,new ze(I-10,C-5,10,10),"");P.appendChild(h.drawRectangle(F)),this.wireEvents(P),y.appendChild(O),y.appendChild(P);var _={id:o.element.id+"_Paging_Text",x:L,y:C+S.height/4,fill:"#a6a6a6","font-size":"14px","font-style":x.fontStyle,"font-family":x.fontFamily,"font-weight":x.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":""};y.appendChild(h.createText(_,b)),this.legendGroup.appendChild(y)}}},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 ze(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=new Ae(e.element.id+"_Legend_Border",t.background,t.border,1,this.legendBorderRect,""),s=e.renderer.drawRectangle(o);s.style.pointerEvents="none",this.legendGroup.appendChild(s),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=this.treemap.legendSettings,t=e.titleStyle,i=e.title.text,r=a(this.legendItemRect.width+20,i,t),l=n(r,t);i&&d(new je(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-l.height/2-5,"middle",r,""),t,t.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup)},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,c=void 0,g=void 0;o=i.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];for(var u=i.svgObject.getBoundingClientRect(),m=0;m<this.legendCollections.length;m++){a=this.legendCollections[m],s=(g=document.getElementById(i.element.id+"_Legend_Index_"+m)).getBoundingClientRect();var f=new ze(Math.abs(s.left-u.left),Math.abs(s.top-u.top),s.width,s.height);if(d=g.getAttribute("fill"),p=n.shapeBorder.color,c=n.shapeBorder.width,!t.isNullOrUndefined(a.legendData)){h=a.legendData;for(var v=0;v<h.length;v++)if(h[v].levelOrderName===o.levelOrderName){this.drawInteractivePointer(n,d,p,l,c,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 ke(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,c=e.availableSize.width,g=e.availableSize.height,u="Auto"===l.position?c>g?"Right":"Bottom":l.position;if("Float"===l.position)this.translate=l.location;else{switch(u){case"Top":case"Bottom":a.height=d-r,o=c/2-i/2,n="Top"===u?h:h+a.height+10,a.y="Top"===u?h+r+10:h;break;case"Left":case"Right":a.width=p-i,o="Left"===u?s:s+a.width,n=g/2-r/2,a.x="Left"===u?s+i:s}switch(l.alignment){case"Near":"Top"===u||"Bottom"===u?o=a.x:n=a.y;break;case"Far":"Top"===u||"Bottom"===u?o=c-i:n=g-r}this.treemap.totalRect=a,this.translate=new Ge(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(){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()},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),c=document.createElementNS(l,"stop");c.setAttribute("offset",d*p+"%"),c.setAttribute("stop-color",e.color[d]),c.setAttribute("stop-opacity",1..toString()),n.appendChild(c)}o.appendChild(n),this.legendLinearGradient=n;var g="url(#linear_"+i+")";this.defsElement.appendChild(n),r=g}return r},e}(),tt=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,c=[],g=this.treemap.treeMapSelectionModule;if(h.indexOf("_Item_Index")>-1&&(!g||this.treemap.selectionId!==h)){if(this.highLightId!==h){o=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var u=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var m=void 0;if(this.treemap.legendSettings.visible){var v=this.treemap.treeMapLegendModule.legendCollections;m=te(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+m):document.getElementById(this.treemap.element.id+"_Legend_Index_"+m),null===this.shapeElement||g&&this.shapeElement.getAttribute("id")===g.legendSelectId?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):g&&this.shapeElement===g.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:v[m].legendFill,oldOpacity:v[m].opacity,oldBorderColor:v[m].borderColor,oldBorderWidth:v[m].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||(!g||(!this.shapeElement||this.shapeElement.getAttribute("id")!==g.legendSelectId)))if(this.treemap.legendSettings.visible&&(g&&this.shapeElement===g.shapeElement))t=!1;else{for(var y=0;y<o.childElementCount;y++){n=o.childNodes[y],l=!0,r=s.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])];for(var b=0;b<u.length;b++)if(n.id===u[b].id){l=!1;break}a.indexOf(r.levelOrderName)>-1&&l&&(c.push(n),d.push(r))}A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var x=0;x<c.length;x++)k((n=c[x]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:pe,treemap:s,items:d,elements:c},s.trigger(pe,i)}}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){if(this.treemap.legendSettings.visible&&(!g||g.legendSelectId!==h)&&(!g||g.shapeSelectId!==h)){var S,w=void 0,I=void 0,C=document.getElementById(h);"highlight"===this.shapeTarget&&$(this.legendHighlightCollection),this.shapeTarget="highlight";m="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var L=this.treemap.treeMapLegendModule.legendCollections[m].legendData.length,O=(v=this.treemap.treeMapLegendModule.legendCollections,parseInt(h[h.length-1],10));for(y=0;y<L;y++)for(b=0;b<this.treemap.layout.renderItems.length;b++)if(this.treemap.treeMapLegendModule.legendCollections[m].legendData[y].levelOrderName===this.treemap.layout.renderItems[b].levelOrderName){w=b,I=this.treemap.layout.renderItems[b].groupIndex;var P=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+w+"_RectPath");0===y&&(this.legendHighlightCollection=[],ie(this.legendHighlightCollection,O,b,C,P,this.treemap.layout.renderItems,v),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection={Elements:[]}),K(C,p.fill,p.opacity,p.border.color,p.border.width.toString()),K(P,p.fill,p.opacity,p.border.color,p.border.width.toString()),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection.Elements.push(P)}}}else g&&this.shapeElement&&this.shapeElement.getAttribute("id")===g.legendSelectId||(g?this.shapeElement!==g.shapeElement:this.treemap.legendSettings.visible)&&A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||g&&this.shapeElement&&this.shapeElement.getAttribute("id")===g.legendSelectId||(g?this.shapeElement!==g.shapeElement:!g||g.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}(),it=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,c=[],g=r.selectionSettings,u=this.treemap.treeMapHighlightModule,m=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(m),l=r.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var v=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var y=this.treemap.treeMapLegendModule.legendCollections.length,b=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),u&&(u.shapeTarget="selection",u.shapeHighlightCollection=[]),v=te(y,l,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+v):document.getElementById(this.treemap.element.id+"_Legend_Index_"+v),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:b[v].legendFill,oldOpacity:b[v].opacity,oldBorderColor:b[v].borderColor,oldBorderWidth:b[v].borderWidth}),K(this.shapeElement,g.fill,g.opacity,g.border.color,g.border.width.toString()))}a=f(l,[],g.mode,r);for(var x=0;x<o.childElementCount;x++)n=o.childNodes[x],l=r.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],a.indexOf(l.levelOrderName)>-1&&(c.push(n),r.levelSelection.push(n.id),s.push(l));A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),w=0;w<c.length;w++){if(n=c[w],S.length>0)for(var I=0;I<S.length;I++)S[I].id===n.id&&S[I].classList.remove("treeMapHighLight"),k(n.childNodes[0],{border:g.border,fill:g.fill,opacity:g.opacity}),n.classList.add("treeMapSelection");else k(n.childNodes[0],{border:g.border,fill:g.fill,opacity:g.opacity}),n.classList.add("treeMapSelection");t={cancel:!1,name:de,treemap:r,items:s,elements:c,text:d,contentItemTemplate:d},r.trigger(de,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=[],A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){b=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var C,L=void 0,O=void 0;this.legendSelectId=h,this.legendSelect=!1;var P=parseInt(h[h.length-1],10),M=document.getElementById(h);$(this.legendSelectionCollection),u&&(u.shapeTarget="selection");v="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var N=this.treemap.treeMapLegendModule.legendCollections[v].legendData.length;for(w=0;w<N;w++)for(var T=0;T<this.treemap.layout.renderItems.length;T++)if(this.treemap.treeMapLegendModule.legendCollections[v].legendData[w].levelOrderName===this.treemap.layout.renderItems[T].levelOrderName){L=T,O=this.treemap.layout.renderItems[T].groupIndex;var D=document.getElementById(this.treemap.element.id+"_Level_Index_"+O+"_Item_Index_"+L+"_RectPath");0===w&&(ie(this.legendSelectionCollection,P,T,M,D,this.treemap.layout.renderItems,b),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection={Elements:[]}),K(M,g.fill,g.opacity,g.border.color,g.border.width.toString()),K(D,g.fill,g.opacity,g.border.color,g.border.width.toString()),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection.Elements.push(D)}}else $(this.legendSelectionCollection),u&&(u.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),c=0;c<d.childElementCount;c++)n=d.childNodes[c],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 g=0;g<s.length;g++){this.shapeSelect=!1;var u=this.treemap.treeMapLegendModule.legendCollections.length,m=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),a=te(u,s[g],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:m[a].legendFill,oldOpacity:m[a].opacity,oldBorderColor:m[a].borderColor,oldBorderWidth:m[a].borderWidth}),K(this.shapeElement,l.fill,l.opacity,l.border.color,l.border.width.toString()))}A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var v=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=v.childNodes[0].id;for(var y=document.getElementsByClassName("treeMapHighLight"),b=0;b<o.length;b++)if(n=o[b],y.length>0)for(var x=0;x<y.length;x++)y[x].id===n.id&&y[x].classList.remove("treeMapHighLight"),k(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,k(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=[],A(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}(),rt=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){var l=0;for(r=Object.getOwnPropertySymbols(e);l<r.length;l++)t.indexOf(r[l])<0&&(i[r[l]]=e[r[l]])}return i},lt=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,c=l.id,g={},u={},m=[];c.indexOf("_Item_Index")>-1?(g=this.treemap.layout.renderItems[parseFloat(c.split("_Item_Index_")[1])],t.isNullOrUndefined(g)||(s=g.weight,u=g.data,t.isNullOrUndefined(g.options)||(p=g.options.fill),m=this.treemap.enableRtl?[t.SanitizeHtmlHelper.sanitize(j(this.tooltipSettings.format,u,this.treemap))||t.SanitizeHtmlHelper.sanitize(G(s,this.treemap)+" : "+this.treemap.weightValuePath.toString())]:[t.SanitizeHtmlHelper.sanitize(j(this.tooltipSettings.format,u,this.treemap))||t.SanitizeHtmlHelper.sanitize(this.treemap.weightValuePath.toString()+" : "+G(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=L(i,r,this.treemap.svgObject)).y=this.tooltipSettings.template?d.y+10:d.y,this.tooltipSettings.textStyle.fontFamily=this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.color=this.treemap.themeStyle.tooltipFontColor||this.tooltipSettings.textStyle.color,this.tooltipSettings.textStyle.opacity=this.treemap.themeStyle.tooltipTextOpacity||this.tooltipSettings.textStyle.opacity,n={cancel:!1,name:ce,item:g,options:{location:d,text:m,data:u,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:l,eventArgs:e},this.treemap.trigger(ce,n,function(e){a.addTooltip(n,p,h)}))):(this.removeTooltip(),this.treemap.clearTemplate())},e.prototype.addTooltip=function(e,r,l,o){var n,a;if(t.isNullOrUndefined(e))n=o.cancel,a=o;else{n=e.cancel,a=rt(e,["cancel"]).options}n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({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}),(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}();e.TreeMap=$e,e.LevelsData=Ke,e.Border=Ce,e.Margin=Le,e.Font=Oe,e.CommonTitleSettings=Pe,e.SubTitleSettings=Me,e.TitleSettings=Ne,e.ColorMapping=Te,e.LegendSettings=De,e.InitialDrillSettings=Ee,e.LeafItemSettings=Fe,e.TooltipSettings=_e,e.SelectionSettings=Re,e.HighlightSettings=Be,e.LevelSettings=Ue,e.load="load",e.loaded="loaded",e.beforePrint=ne,e.itemRendering=ae,e.drillStart=se,e.drillEnd=he,e.itemSelected=de,e.itemHighlight=pe,e.tooltipRendering=ce,e.itemClick=ge,e.itemMove=ue,e.click="click",e.doubleClick=me,e.rightClick=fe,e.mouseMove=ve,e.legendItemRendering=ye,e.legendRendering=be,e.resize=xe,e.defaultFont=Se,e.getThemeStyle=oe,e.Size=He,e.stringToNumber=o,e.Rect=ze,e.RectOption=Ae,e.PathOption=ke,e.measureText=n,e.TextOption=je,e.textTrim=a,e.Location=Ge,e.findPosition=s,e.createTextStyle=h,e.renderTextElement=d,e.setItemTemplateContent=p,e.getElement=c,e.itemsToOrder=g,e.isContainsData=u,e.findChildren=m,e.findHightLightItems=f,e.getTemplateFunction=v,e.convertElement=y,e.findLabelLocation=b,e.measureElement=x,e.getArea=S,e.getShortestEdge=w,e.convertToContainer=I,e.convertToRect=C,e.getMousePosition=L,e.colorMap=O,e.deSaturationColor=P,e.colorCollections=M,e.rgbToHex=N,e.getColorByValue=T,e.getGradientColor=D,e.getPercentageColor=E,e.getPercentage=F,e.wordWrap=_,e.textWrap=R,e.hide=B,e.orderByArea=U,e.maintainSelection=H,e.legendMaintain=z,e.removeClassNames=A,e.applyOptions=k,e.textFormatter=j,e.formatValue=G,e.ColorValue=Ve,e.convertToHexCode=V,e.componentToHex=W,e.convertHexToColor=q,e.colorNameToHex=X,e.drawSymbol=J,e.renderLegendShape=Y,e.isParentItem=Z,e.TreeMapAjax=We,e.removeShape=Q,e.removeLegend=$,e.setColor=K,e.removeSelectionWithHighlight=ee,e.getLegendIndex=te,e.pushCollection=ie,e.triggerDownload=re,e.removeElement=le,e.TreeMapLegend=et,e.LayoutPanel=qe,e.TreeMapHighlight=tt,e.TreeMapSelection=it,e.TreeMapTooltip=lt,e.ImageExport=Je,e.PdfExport=Ye,e.Print=Xe,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t(e.ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,t,i,r,o){"use strict";function l(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 Ue(r.clientWidth,r.clientHeight)}function a(e,t,i){var r=t,o=n(t,i).width;if(o>e)for(var l=t.length-1;l>=0;--l)if(r=t.substring(0,l)+"...",(o=n(r,i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}function s(e,t,i,r){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===r?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===r?e.width-e.y-i.width:e.x+e.width-i.width}var l="title"===r?e.y+i.height/2:e.y+e.height/2+i.height/2;return new je(o,l)}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,o,l,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:o},c="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],u=new i.SvgRenderer("");if(!t.isNullOrUndefined(c)&&!t.isNullOrUndefined(e.connectorText)&&c.search(e.connectorText[1])>=0)for(var m=c.split("#"),f=0;f<m.length;f++){var y=-1===m[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?m[f]:e.connectorText;if(g.id=e.id+"_"+f,p=h(u,g,y),f%2==0&&0!==f){y=y.replace(/\s+/g," ")}var v=n(y,r);g.x=0!==f?g.x+v.width:g.x+v.width+5,l.appendChild(p)}else p=h(u,g,c),l.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var b=1,x=e.text.length;b<x;b++)d=n(e.text[b],r).height,s=u.createTSpan({x:e.x,id:e.id,y:e.y+b*d},e.text[b]),p.appendChild(s);l.appendChild(p)}return p}function p(e,i,r){var o,l=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+l+"_LabelTemplate"),t.isNullOrUndefined(o)||(o.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 u(e,t,i,r){for(var o=!1,l="",n=r.leafItemSettings,a=0;a<e.length;a++){var s=i[r.levels[a]?r.levels[a].groupPath:n.labelPath?n.labelPath:r.weightValuePath]||"undefined";if(e[a]===s&&(l+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function m(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 o=m(e).values;if(o&&o.length>0){for(var l=0;l<o.length;l++)-1===t.indexOf(o[l].levelOrderName)&&t.push(o[l].levelOrderName);for(var n=0;n<o.length;n++)f(o[n],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){var a=e.levelOrderName.split("#")[0],s=void 0;for(l=0;l<r.layout.renderItems.length;l++)(s=r.layout.renderItems[l]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.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 o=t.createElement("div",{id:i});o.style.cssText="position: absolute;pointer-events: auto;";for(var l=e.length;l>0;)o.appendChild(e[0]),l--;for(var n=o.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 o.innerHTML=n,o}function b(e,t,i,r,o){var l=new je(0,0),n="Template"===r?o.areaRect.x:0,a="Template"===r?o.areaRect.y:0;return l.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,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?l.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)):l.y=Math.abs(e.y+e.height-i.height+5),l}function x(e,t){var i=new Ue(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 S(e){return(e.width-e.x)*(e.height-e.y)}function w(e){var t=I(e),i=t.width,r=t.height;return Math.min(i,r)}function I(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 L(e,t,i){var r=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,l=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=r.left+o-a,h=r.top+l-n;return new je(e-s,t-h)}function O(e,i,r){var o,l,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),o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:N(e[a],h):e[a].color):r>=e[a].from&&e[a].to>=r&&e[a].value===i&&(s=!0,o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:N(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)&&o&&(l=F(e[a],r)),(""===o||t.isNullOrUndefined(o))&&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)&&(o="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),l=t.isNullOrUndefined(l)?"1":l,n.push(o)}for(var d=n.length-1;d>=0;d--)d=(o=n[d])?-1:d;return{fill:o,opacity:l}}function F(e,t){var i=1;if(t>=e.from&&t<=e.to){i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity}return i.toString()}function N(e,t){return E(e,t)}function T(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]:T((i=D(Number(t),e)).r,i.g,i.b)}function D(e,t){var i=t.from,r=t.to,o=0,l=r-i;o=(e-i)/l;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=l/(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),o=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),o=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),o=Math.abs(e-d[c+1].b)/s)}return M(o,n,a)}function M(e,t,i){var r=i.split("#")[1],o=t.split("#")[1],l=P(e,parseInt(o.substr(0,2),16),parseInt(r.substr(0,2),16)),n=P(e,parseInt(o.substr(2,2),16),parseInt(r.substr(2,2),16)),a=P(e,parseInt(o.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ge(l,n,a)}function P(e,t,i){var r=i-t;return Math.round(t+r*e)}function _(e,t,i){for(var r,o=t.split(" "),l="",s=[],h=0,d=o.length;h<d;h++)r=o[h],n(l.concat(r),i).width<e?l=l.concat((""===l?"":" ")+r):""!==l?(s.push(a(e,l,i)),l=r):(s.push(a(e,r,i)),r=""),l&&h===d-1&&s.push(a(e,l,i));return s}function R(e,t,i){var r=[],o=0,l=n(t,i).width,a=t.length;if(e>=l)return r.push(t),r;for(var s=t.length;s>o;s--){var h=t.slice(o,s);if((l=n(h,i).width)<=e){if(r.push(h),o+=h.length,a===o)return r;s=a+1}}return r}function B(e,t,i,r){var o=n(i,r);return o.width>e||o.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 o=0;o<r.length;o++)t.getAttribute("id")===r[o]?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 H(e,t){var i=e.legendId;if(i)for(var r=0;r<i.length;r++)for(var o=0;o<t.childElementCount;o++)if(t.childNodes[o].id===i[r]){var l=t.childNodes[o];l.setAttribute("fill",e.selectionSettings.fill),l.setAttribute("stroke",e.selectionSettings.border.color),l.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),l.setAttribute("opacity",e.selectionSettings.opacity)}}function k(e,i,r){for(var o,l=0;l<e.length;l++)A(o=t.isNullOrUndefined(e[l].childNodes[0])?e[l]:e[l].childNodes[0],r.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options),e[l].classList.remove(i),l-=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 o=0,l=Object.keys(i);o<l.length;o++){var n=l[o];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 Ge(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ge(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 Ge(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function J(e,t,r,o,l,n){var a=new i.SvgRenderer(""),s=Y(e,r,t,l,o),h=a["draw"+s.functionName](s.renderOption);return h.setAttribute("aria-label",n),h}function Y(e,i,r,o,l){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(o,{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(o,{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(o,{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(o,{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(o,{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(o,{d:n});break;case"Pentagon":for(var u=void 0,m=void 0,f=0;f<=5;f++)u=s/2*Math.cos(Math.PI/180*(72*f)),m=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+u)+" "+(p+m)+" ":n.concat("L "+(d+u)+" "+(p+m)+" ");n=n.concat("Z"),t.merge(o,{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(o,{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(o,{d:n});break;case"Image":a="Image",t.merge(o,{href:l,height:h,width:s,x:g,y:c})}return{renderOption:o,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,o=0;o<r;o++)K(i.ShapeCollection.Elements[o],i.shapeOldFill,i.shapeOldOpacity,i.shapeOldBorderColor,i.shapeOldBorderWidth)}}function K(e,t,i,r,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",r),e.setAttribute("stroke-width",o)}function ee(e,t,i){Q(e),k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function te(e,t,i){for(var r,o=0;o<e;o++)for(var l=i.treeMapLegendModule.legendCollections[o].legendData.length,n=0;n<l;n++)if(i.treeMapLegendModule.legendCollections[o].legendData[n].levelOrderName===t.levelOrderName){r=o;break}return r}function ie(e,t,i,r,o,l,n){e.push({legendEle:r,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:o,shapeOldFill:l[i].options.fill,shapeOldOpacity:l[i].options.opacity,shapeOldBorderColor:l[i].options.border.color,shapeOldBorderWidth:l[i].options.border.width})}function re(e,i,r,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function oe(e){var i=document.getElementById(e);return i?t.remove(i):null}function le(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"};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"};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"};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"};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"};break;case"bootstrap5":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#212529",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Helvetica Neue",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};break;case"bootstrap5dark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#E9ECEF",tooltipFontColor:"#212529",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Helvetica Neue",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};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"};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"};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"};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"};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"}}return t}var ne="beforePrint",ae="itemRendering",se="drillStart",he="drillEnd",de="itemSelected",pe="itemHighlight",ge="tooltipRendering",ce="itemClick",ue="itemMove",me="doubleClick",fe="rightClick",ye="mouseMove",ve="legendItemRendering",be="legendRendering",xe="resize",Se="Roboto, Segoe UI, Noto, Sans-serif",we=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)}}(),Ie=function(e,t,i,r){var o,l=arguments.length,n=l<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--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},Ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("#808080")],i.prototype,"color",void 0),Ie([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),Le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(10)],i.prototype,"left",void 0),Ie([t.Property(10)],i.prototype,"right",void 0),Ie([t.Property(10)],i.prototype,"top",void 0),Ie([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"size",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(Se)],i.prototype,"fontFamily",void 0),Ie([t.Property("")],i.prototype,"fontWeight",void 0),Ie([t.Property("Normal")],i.prototype,"fontStyle",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("")],i.prototype,"text",void 0),Ie([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),Ne=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({fontFamily:null,fontWeight:null},Oe)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),i}(Fe),Te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({fontFamily:null,fontWeight:null},Oe)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Complex({},Ne)],i.prototype,"subtitleSettings",void 0),i}(Fe),Ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"from",void 0),Ie([t.Property(null)],i.prototype,"to",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(null)],i.prototype,"label",void 0),Ie([t.Property(null)],i.prototype,"value",void 0),Ie([t.Property(null)],i.prototype,"minOpacity",void 0),Ie([t.Property(null)],i.prototype,"maxOpacity",void 0),Ie([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("Default")],i.prototype,"mode",void 0),Ie([t.Property("transparent")],i.prototype,"background",void 0),Ie([t.Property("Circle")],i.prototype,"shape",void 0),Ie([t.Property("")],i.prototype,"width",void 0),Ie([t.Property("")],i.prototype,"height",void 0),Ie([t.Complex({size:"12px",fontFamily:null,fontWeight:null},Oe)],i.prototype,"textStyle",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(15)],i.prototype,"shapeWidth",void 0),Ie([t.Property(15)],i.prototype,"shapeHeight",void 0),Ie([t.Property(10)],i.prototype,"shapePadding",void 0),Ie([t.Property(null)],i.prototype,"imageUrl",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"border",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"shapeBorder",void 0),Ie([t.Complex({},Fe)],i.prototype,"title",void 0),Ie([t.Complex({size:"14px"},Oe)],i.prototype,"titleStyle",void 0),Ie([t.Property("Bottom")],i.prototype,"position",void 0),Ie([t.Property("None")],i.prototype,"orientation",void 0),Ie([t.Property(!1)],i.prototype,"invertedPointer",void 0),Ie([t.Property("After")],i.prototype,"labelPosition",void 0),Ie([t.Property("None")],i.prototype,"labelDisplayMode",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Property({x:0,y:0})],i.prototype,"location",void 0),Ie([t.Property(null)],i.prototype,"showLegendPath",void 0),Ie([t.Property(null)],i.prototype,"valuePath",void 0),Ie([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupIndex",void 0),Ie([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(0)],i.prototype,"gap",void 0),Ie([t.Property(10)],i.prototype,"padding",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showLabels",void 0),Ie([t.Property(null)],i.prototype,"labelPath",void 0),Ie([t.Property(null)],i.prototype,"labelFormat",void 0),Ie([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),Ie([t.Complex({color:null,size:"12px"},Oe)],i.prototype,"labelStyle",void 0),Ie([t.Property(null)],i.prototype,"labelTemplate",void 0),Ie([t.Property("Center")],i.prototype,"templatePosition",void 0),Ie([t.Property("Trim")],i.prototype,"interSectAction",void 0),Ie([t.Collection([],Ee)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),_e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("")],i.prototype,"template",void 0),Ie([t.Property(null)],i.prototype,"format",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(.75)],i.prototype,"opacity",void 0),Ie([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Complex({fontFamily:Se,size:null,fontWeight:null},Oe)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property("#808080")],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupPath",void 0),Ie([t.Property(0)],i.prototype,"groupGap",void 0),Ie([t.Property(10)],i.prototype,"groupPadding",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showHeader",void 0),Ie([t.Property(20)],i.prototype,"headerHeight",void 0),Ie([t.Property(null)],i.prototype,"headerTemplate",void 0),Ie([t.Property(null)],i.prototype,"headerFormat",void 0),Ie([t.Property("Near")],i.prototype,"headerAlignment",void 0),Ie([t.Complex({color:null,size:"13px"},Oe)],i.prototype,"headerStyle",void 0),Ie([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),Ie([t.Collection([],Ee)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),Ue=function(){return function(e,t){this.width=e,this.height=t}}(),He=function(){return function(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}}(),ke=function(){return function(e,t,i,r,o,l){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=r,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=l}}(),Ae=function(){return function(e,t,i,r,o,l,n){this.id=e,this.opacity=o,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=l,this.d=n}}(),We=function(){return function(e,t,i,r,o,l,n,a){void 0===l&&(l=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=l,this.anchor=r,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a}}(),je=function(){return function(e,t){this.x=e,this.y=t}}(),Ge=function(){return function(e,t,i){this.r=e,this.g=t,this.b=i}}(),Ve=function(){return function(e,t,i,r,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=o}}(),qe=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,o=this.treemap.drilledItems[r].data,l={};l[this.treemap.drilledItems[r].data.groupName]=[o],t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[r].data.groupIndex),this.calculateLayoutItems(l||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,r={},o=m(e).values;if(o&&o.length>0&&0===t.length){for(var l=0;l<o.length;l++)o[l].groupIndex===i.initialDrillDown.groupIndex&&o[l].name===i.initialDrillDown.groupName&&(o[l].isDrilled=!0,r[o[l].groupName]=[o[l]],t.push(r));for(var n=0;n<o.length;n++)this.getDrilldownData(o[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,o,l,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=m(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,o=0===a.length||r===a.length?n.gap:a[r].groupGap,l=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 He(i.x+o/2,i.y+(l+o/2),i.width-o,Math.abs(i.height-(o+l))),this.computeSliceAndDiceDimensional(s[h],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var r,o=i.height*i.width,l=this.treemap.levels,n=0,a=0;e.forEach(function(e){a+=e.weight}),e.forEach(function(e){e.weightArea=o*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===l.length||(this.treemap.isHierarchicalData||t.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?d.groupIndex===l.length-1:d.groupIndex===this.treemap.levels.length),s?(r=o/a*e[h].weight/i.height,n<=i.width&&(e[h].rect=new He(n+i.x,i.y,r,i.height))):(r=o/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new He(i.x,n+i.y,i.width,r))),n+=r,this.renderItems.push(e[h])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,r,o,l,n,a=this.treemap.leafItemSettings,s=this.treemap.levels,h=m(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++)o=(r=h[d]).groupIndex,i=r.rect,l=(r.isLeafItem?a.padding:s[o].groupPadding)/2,n=this.treemap.isHierarchicalData?0===o&&r.isLeafItem?0:s[o]&&s[o].showHeader?s[o].headerHeight:0:0===s.length?0:s[o]&&s[o].showHeader?s[o].headerHeight:0,i=new He(i.x+l,i.y+(n+l),i.width-l,i.height-l),!r.isLeafItem&&r.weight>0&&this.computeSquarifyDimensional(h[d],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,S(i)),t.sort(z),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var o=e.length;if(0===o){var l=this.getCoordinates(t,i);return u=r.concat(l)}var n=w(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,n)){var h=t.concat(a);return this.performRowsLayout(s,h,i,r)}for(var d=t.length,p=0,g=0;g<d;g+=1)p+=t[g].itemArea;var c=this.cutArea(i,p),u=(l=this.getCoordinates(t,i),r.concat(l));return this.performRowsLayout(e,[],c,u)},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,o=-1/0,l=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<r&&(r=a),a>o&&(o=a),l+=a}return Math.max(Math.pow(t,2)*o/Math.pow(l,2),Math.pow(l,2)/(Math.pow(t,2)*r))},e.prototype.cutArea=function(e,t){var i=I(e),r=i.width,o=i.height,l=i.x,n=i.y;if(r>=o){var a=t/o;return C({x:l+a,y:n,width:r-a,height:o})}var s=t/r;return C({x:l,y:n+s,width:r,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var r,o=I(i),l=o.width,n=o.height,a=o.x,s=o.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<h;c+=1)g+=e[c].itemArea;var u,m,f,y=g/n,v=g/l,b=a,x=s,S=[];for(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),m=Z(this.parentData[0],w),f=m?this.treemap.areaRect:w.parent.rect,u=w.isLeafItem?p.padding:d[r].groupPadding,l>=n){var C=x+w.itemArea/y;w.rect={x:b,y:x,width:b+y,height:C},x=C}else{var L=b+w.itemArea/v;w.rect={x:b,y:x,width:L,height:x+v},b=L}w.weight>0&&(m||Math.round(i.y+u/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+u/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),S.push(w))}return S},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,r=[],o=0;o<i;o+=1){for(var l=e.length,n=0,a=0;a<l;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<l;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 o={};t.isNullOrUndefined(r.groupName)?o=r:o[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 l=this.treemap.levels.length,n=0;n<l;n++){l===e[0].groupIndex?this.treemap.levels[l]=this.treemap.levels[n]:this.treemap.levels.splice(l-1,1)}this.calculateLayoutItems(o,i),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,r,o,l=this,n=this.treemap;this.renderer=n.renderer;var a,s,h,d,p,g,c,u,f,y,v,b,x,S=n.element.id,w=n.layoutType,C=this.treemap.leafItemSettings.interSectAction,L="",O=document.getElementById(n.element.id+"_Secondary_Element"),F=n.levels;this.layoutGroup=this.renderer.createGroup({id:S+"_TreeMap_"+w+"_Layout"});var N,T,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,R=n.leafItemSettings,B=function(w){if(c=z.renderItems[w],s=c.groupIndex,z.treemap.drillDownView&&t.isNullOrUndefined(z.treemap.currentLevel)&&s>0||z.treemap.drillDownView&&s>z.treemap.currentLevel+1)return"continue";d=c.rect,_=c.isLeafItem,y=S+"_Level_Index_"+s+"_Item_Index_"+w,N=z.renderer.createGroup({id:y+"_Group"}),b=(_?R.gap:F[s].groupGap)/2;var B=z.treemap.totalRect?I(z.treemap.totalRect):z.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=B.x+B.width-d.width-Math.abs(B.x-d.x):"BottomLeftTopRight"===n.renderDirection?d.y=B.y+B.height-d.height-Math.abs(B.y-d.y):"BottomRightTopLeft"===n.renderDirection&&(d.x=B.x+B.width-d.width-Math.abs(B.x-d.x),d.y=B.y+B.height-d.height-Math.abs(B.y-d.y)),r=z.getItemColor(_,c),g=r.fill,f=r.opacity,p=_?R.labelFormat:F[s].headerFormat;var H;if(i=_?R.showLabels:F[s].showHeader,s===z.treemap.currentLevel)if(z.treemap.enableBreadcrumb){P="#"+z.treemap.breadcrumbConnector+"#",H=c.levelOrderName.replace(/#/gi,P),H=0!==s?"#"+H:H}else H=c.name;else z.treemap.enableBreadcrumb&&(c.isDrilled=!1),H=c.name;u=W(p,c.data,z.treemap)||H||"undefined",M=m(c).values,u=!_&&M&&M.length>0&&z.treemap.enableDrillDown?c.isDrilled?n.enableRtl?u+" [-]":"[-] "+u:n.enableRtl?u+" [+]":"[+] "+u:u,(x=_?R.labelStyle:F[s].headerStyle).fontFamily=z.treemap.themeStyle.labelFontFamily||x.fontFamily,x.fontWeight=x.fontWeight||z.treemap.themeStyle.fontWeight,E=_?R.border:F[s].border,e=_?R.labelPosition:"Near"===F[s].headerAlignment?"TopLeft":"Center"===F[s].headerAlignment?"TopCenter":"TopRight",h=_?R.templatePosition:F[s].templatePosition,T=_?R.labelTemplate:F[s].headerTemplate,c.options={border:E,opacity:f,fill:g},o={cancel:!1,name:ae,treemap:z.treemap,text:u,currentItem:c,RenderItems:z.renderItems,options:c.options},z.treemap.trigger(ae,o,function(r){if(!r.cancel){L=" 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 Ae(y+"_RectPath",g,E.width,E.color,f,null,L);var n=l.renderer.drawPath(a);N.appendChild(n),i&&(o.text!==u&&(o.text=W(o.text,c.data,l.treemap)||H),l.renderItemText(o.text.toString(),N,x,d,C,y,g,e,P)),T&&(v=l.renderTemplate(O,y,d,h,T,c,_),t.isNullOrUndefined(v)||(D.appendChild(v),l.treemap.renderReactTemplates())),N.setAttribute("aria-label",c.name),N.setAttribute("role",""),N.setAttribute("tabindex",(l.treemap.tabIndex+w+2).toString()),U(l.treemap,N,"treeMapSelection"),l.layoutGroup.appendChild(N)}})},z=this,H=0;H<this.renderItems.length;H++)B(H);D.childNodes.length>0&&O.appendChild(D),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,o,l,s,h,p,g){var c,u,m,f=[],y=[],v=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,u=this.labelInterSectAction(o,e,r,l),c=n(f&&f[0]||u[0],r),this.treemap.enableRtl){var x=n(e,r),S=e.search("[+]")||e.search("[-]");if(o.width<x.width&&S>0){var w=e.substring(S-1,e.length),I=n("[+]",r);u[0]=a(o.width-I.width-5,u[0],r)+w}}var C=b(o,p,c,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var L=[],O=null,F=[],N=0;N<f.length;N++)v+=(c=n(O=a(o.width-5,f[N],r),r)).height,F.push(c.width),L.push(O);u=L,c.width=Math.max.apply(null,F),c.height=v}if("WrapByWord"===l||"Wrap"===l||"Trim"===l){for(var T=0;T<u.length;T++)v+=(c=n(u[T],r)).height,o.height-5>v&&y.push(u[T]);if("Wrap"===l&&u.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 m=u,y.push(m);d(new We(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,o=e?r.leafItemSettings.fill:r.levels[i.groupIndex].fill,l=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=m(r.treemapLevelData.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=O(a,i.data[r.equalColorValuePath],i.data[r.rangeColorValuePath]);o=t.isNullOrUndefined(s.fill)?r.leafItemSettings.fill:s.fill,l=s.opacity}else for(var h=0;h<n.length;h++)n[h].levelOrderName===i.levelOrderName.split("#")[0]&&(o=t.isNullOrUndefined(o)?t.isNullOrUndefined(r.colorValuePath)?r.palette.length>0?r.palette[h%r.palette.length]:"#808080":n[h].data[r.colorValuePath]:o);return{fill:o,opacity:l}},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,o,l,n,a){var s=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if(t.isNullOrUndefined(l.prototype)&&"string"==typeof l)for(var d=Object.keys(n.data),p=0;p<d.length;p++){var g=RegExp;l=l.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 u=b(r,o,x(c=v(y(l)(n.data,this.treemap,l,this.treemap.element.id+h,!1),s,n.data),e),"Template",this.treemap);c.style.left=u.x+"px",c.style.top=u.y+"px"}return c},e.prototype.labelInterSectAction=function(e,t,i,r){var o,l=e.width-10;switch(r){case"Hide":o=[B(l,e.height,t,i)];break;case"Trim":o=[a(l+3,t,i)];break;case"WrapByWord":o=_(l,t,i);break;case"Wrap":o=R(l,t,i)}return o},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}();(e.Theme||(e.Theme={})).mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};var Xe=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 o={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:ne};e.trigger(ne,o,function(){o.cancel||t.print(o.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 o=e.element.cloneNode(!0),l=o.childNodes[1];if(!t.isNullOrUndefined(l)){var n=(l=l.childNodes[0]).getAttribute("fill");"Tailwind"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n||o.childNodes[1].childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):o.childNodes[1].childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}r.appendChild(o)}return r},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),Je=function(){function e(e){}return e.prototype.export=function(e,i,r,o){return new Promise(function(l,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||"rgba(255,255,255, 0.0)"!==d&&"transparent"!==d?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==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)o?re(r,i,c,p):l(null);else{var u=new Image,m=a.getContext("2d");u.onload=function(){m.drawImage(u,0,0),window.URL.revokeObjectURL(c),o?re(r,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?l(a.toDataURL("image/jpeg")):"PNG"===i&&l(a.toDataURL("image/png"))},u.src=c}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),Ye=function(){function e(e){}return e.prototype.export=function(e,i,r,l,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()}});l=t.isNullOrUndefined(l)?o.PdfPageOrientation.Landscape:l;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||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p?"TailwindDark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==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,u=s.getContext("2d");c.onload=function(){u.drawImage(c,0,0),window.URL.revokeObjectURL(g);var t=new o.PdfDocument,a=s.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=l,a=a.slice(a.indexOf(",")+1),t.pages.add().graphics.drawImage(new o.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}(),Ze=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)}}(),Qe=function(e,t,i,r){var o,l=arguments.length,n=l<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--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},$e=function(e){function o(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 Ze(o,e),o.prototype.preRender=function(){var e=this;this.trigger("load",{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},o.prototype.render=function(){this.renderElements()},o.prototype.renderElements=function(){this.treemapLevelData=new Ke,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=le(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),t.isNullOrUndefined(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},o.prototype.processDataManager=function(){var e,i,o,l,n=this;if(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()})}else this.dataSource instanceof Ve?(l=this.dataSource,(o=new t.Fetch(l.dataOptions,l.type,l.contentType)).onSuccess=function(e){n.dataSource=e,n.renderTreeMapElements()},o.send(l.sendData)):this.renderTreeMapElements()},o.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()},o.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 qe(this)),this.clearTemplate();var e=this.element.clientWidth,r=this.element.clientHeight;this.availableSize=new Ue(l(this.width,e)||e||600,l(this.height,r)||r||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},o.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 qe(this)},o.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)}},o.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)},o.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 ke(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new He(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)},o.prototype.renderTitle=function(e,i,r,o){var l,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(o)&&(o=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var g=a(p,e.text,h),c=n(g,h),u=s(t.isNullOrUndefined(r)?new He(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,c,i),m=new We(this.element.id+"_TreeMap_"+i,u.x,u.y,"start",g),f=new He(u.x,u.y,c.width,c.height),y=d(m,h,h.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);y.setAttribute("aria-label",e.description||e.text),y.setAttribute("role",""),y.setAttribute("tabindex",(this.tabIndex+("title"===i?1:2)).toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(l=this.availableSize.height-f.y-10-this.margin.bottom,this.areaRect=new He(this.margin.left,f.y+10,p,l)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",f,o):this.svgObject.appendChild(o)}else l=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new He(this.margin.left,this.margin.top,p,l)},o.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(var o=0;o<this.dataSource.length;o++){var l=m(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(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")}},o.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=m(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},o.prototype.processHierarchicalData=function(e,i){var r,o,l,n=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if(a=m(e),(r=a?a.values:null)&&r.length>0){l=a.key;for(var h=0;h<this.levels.length;h++)l===this.levels[h].groupPath&&(o=h);for(var d=0;d<r.length;d++){r[d].name=r[d][s],r[d].levelOrderName=(0===o?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(o)?g===this.levels.length?this.levels.length:g:o,0!==o&&(r[d].parent=e),r[d].groupName=l,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){for(var c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath],u=0;u<this.treemapLevelData.hierarchyData.length;u++)r=m(this.treemapLevelData.hierarchyData[u]).values,0!==u&&r&&(r.forEach(function(e){c.push(e)}),this.treemapLevelData.hierarchyData.splice(u,1),u-=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}},o.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},o.prototype.export=function(e,i,r,o){var l=this;return t.isNullOrUndefined(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,n){t(l.pdfExportModule.export(l,e,i,r,o))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,r){t(l.imageExportModule.export(l,e,i,o))}):null},o.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 o={};o.level=r,o[e]=[],this.treemapLevelData.levelsData.push(o);for(var l=0;l<this.dataSource.length;l++){var n={},a="";if(!t.isNullOrUndefined(e)){var s=this.dataSource[l][e];if(0!==r)for(var h=0;h<=r;h++){var d=this.levels[h]?this.levels[h].groupPath:e;a+=this.dataSource[l][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[l],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(n),i.push(a||s))}}}},o.prototype.reOrderLevelData=function(e){for(var i,r=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,l=this.treemapLevelData.levelsData[e][r],n=this.treemapLevelData.levelsData[e-1][o],a=0;a<l.length;a++){i=l[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(l[a].parent)&&(l[a].parent=n[s]),n[s][r].push(l[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)},o.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},o.prototype.findTotalWeight=function(e,t){for(var i,r,o,l=this,n={},a=function(a){i=0,o=e[a].groupName,r=e[a].levelOrderName.split("#"),s.dataSource.forEach(function(t){u(r,e[a].levelOrderName,t,l)&&(i+=parseFloat(t[l.weightValuePath]))}),"Parent"===t&&(n[o]=e,e[a].parent=n),e[a].weight=i},s=this,h=0;h<e.length;h++)a(h)},o.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)},o.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)},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role",""),this.element.setAttribute("tabindex",this.tabIndex.toString())},o.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var r={name:xe,cancel:!1,previousSize:this.availableSize,currentSize:new Ue(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(xe,r,function(e){i.render(),i.refreshing=!1})},500))}},o.prototype.clickOnTreeMap=function(e){var i,r,o=this,l=e.target,n=l.id,a=l.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:ce,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(ce,i,function(e){e.text===a&&e.contentItemTemplate===a||(t.isNullOrUndefined(o.leafItemSettings.labelTemplate)?(e.text=W(e.text,e.item.data,e.treemap),l.textContent=e.text):p(n,l,e.contentItemTemplate))}));var h,d=(new Date).getMilliseconds();t.isNullOrUndefined(this.doubleClick)||(!t.isNullOrUndefined(h)&&d-h<500&&this.doubleClickOnTreeMap(e),h=d)},o.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:me,treemap:this,mouseEvent:e};this.trigger(me,t)},o.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:fe,treemap:this,mouseEvent:e};this.trigger(fe,t)},o.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),this.notify(t.Browser.touchStartEvent,e)},o.prototype.mouseMoveOnTreeMap=function(e){var i,r,o=e.target.id,l={cancel:!1,name:ye,treemap:this,mouseEvent:e};this.trigger(ye,l);var n;o.indexOf("_Item_Index")>-1&&(n=m(r=this.layout.renderItems[parseFloat(o.split("_Item_Index_")[1])]).values,this.element.style.cursor=!r.isLeafItem&&n&&n.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:ue,treemap:this,item:r,mouseEvent:e},this.trigger(ue,i)),this.notify(t.Browser.touchMoveEvent,e)},o.prototype.calculateSelectedTextLevels=function(e,t){for(var i,r,o,l=t.levelOrderName.split("#"),n=0,a=Object.keys(l);n<a.length;n++)l[r=a[n]]===e&&(i=parseInt(r,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:l}},o.prototype.calculatePreviousLevelChildItems=function(e,i,r){for(var o,l,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++){(l=p[d]).levelOrderName.split("#")[0]===e.levelText[0]&&(o=0===a?t.isNullOrUndefined(n)?n:e.levelText[a]:r?n:n+"#"+e.levelText[a])===l.levelOrderName&&(this.drilledItems.push({name:l.levelOrderName,data:l}),r=!0,++a<=i.groupIndex&&(n=o=o+"#"+e.levelText[a]))}return r},o.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var r,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((r=this.drilledItems[i].data.parent).isDrilled=!0,o[r[this.drilledItems[i].data.groupName]]=[r],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},o.prototype.mouseEndOnTreeMap=function(e){var i,r,o,l,n,a,s,h=this,d=e.target,p=d.id,g=!1,c={},u=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(),l=parseFloat(p.split("_Item_Index_")[1]),n=this.layout.renderItems[l];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&&m(n).values&&m(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:se,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(se,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(u)){var r=document.getElementById(u);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 o=document.getElementById(f);o.parentNode.removeChild(o)}t.isNullOrUndefined(e.childItems)||e.cancel?(h.layout.calculateLayoutItems(c,i),h.layout.renderLayoutItems()):h.layout.onDemandProcess(e.childItems)}}),o={cancel:!1,name:he,treemap:this,renderItems:this.layout.renderItems},this.trigger(he,o),!g&&t.isNullOrUndefined(a)&&this.drilledItems.push({name:n.levelOrderName,data:n})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},o.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Q(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},o.prototype.selectItem=function(e,i){t.isNullOrUndefined(i)&&(i=!0);for(var r="",o=0;o<e.length;o++)o!==e.length-1?r+=e[o]+"#":r+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(r,i)},o.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this]}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this]}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this]}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this]}),this.allowPrint&&e.push({member:"Print",args:[this,Xe]}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Je]}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,Ye]}),e},o.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,r=0,o=Object.keys(e);r<o.length;r++){switch(o[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())}},o.prototype.getModuleName=function(){return"treemap"},o.prototype.destroy=function(){this.unWireEVents(),oe("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this)},o.prototype.removeSvg=function(){if(oe(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)}},o.prototype.getPersistData=function(){return""},Qe([t.Property(!1)],o.prototype,"allowPrint",void 0),Qe([t.Property(!1)],o.prototype,"allowImageExport",void 0),Qe([t.Property(!1)],o.prototype,"allowPdfExport",void 0),Qe([t.Property(null)],o.prototype,"width",void 0),Qe([t.Property(null)],o.prototype,"height",void 0),Qe([t.Complex({},Ce)],o.prototype,"border",void 0),Qe([t.Complex({},Le)],o.prototype,"margin",void 0),Qe([t.Property(null)],o.prototype,"background",void 0),Qe([t.Property("Material")],o.prototype,"theme",void 0),Qe([t.Complex({},Te)],o.prototype,"titleSettings",void 0),Qe([t.Property("Squarified")],o.prototype,"layoutType",void 0),Qe([t.Property(null)],o.prototype,"dataSource",void 0),Qe([t.Property(null)],o.prototype,"query",void 0),Qe([t.Property(null)],o.prototype,"weightValuePath",void 0),Qe([t.Property("")],o.prototype,"rangeColorValuePath",void 0),Qe([t.Property("")],o.prototype,"equalColorValuePath",void 0),Qe([t.Property(null)],o.prototype,"colorValuePath",void 0),Qe([t.Property([])],o.prototype,"palette",void 0),Qe([t.Property("TopLeftBottomRight")],o.prototype,"renderDirection",void 0),Qe([t.Property(!1)],o.prototype,"enableDrillDown",void 0),Qe([t.Property(!1)],o.prototype,"enableBreadcrumb",void 0),Qe([t.Property(" - ")],o.prototype,"breadcrumbConnector",void 0),Qe([t.Property(!1)],o.prototype,"drillDownView",void 0),Qe([t.Complex({},Me)],o.prototype,"initialDrillDown",void 0),Qe([t.Complex({},Pe)],o.prototype,"leafItemSettings",void 0),Qe([t.Collection([],ze)],o.prototype,"levels",void 0),Qe([t.Complex({},Be)],o.prototype,"highlightSettings",void 0),Qe([t.Complex({},Re)],o.prototype,"selectionSettings",void 0),Qe([t.Complex({},_e)],o.prototype,"tooltipSettings",void 0),Qe([t.Complex({},De)],o.prototype,"legendSettings",void 0),Qe([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),Qe([t.Property(null)],o.prototype,"description",void 0),Qe([t.Property(1)],o.prototype,"tabIndex",void 0),Qe([t.Property(null)],o.prototype,"format",void 0),Qe([t.Event()],o.prototype,"load",void 0),Qe([t.Event()],o.prototype,"beforePrint",void 0),Qe([t.Event()],o.prototype,"loaded",void 0),Qe([t.Event()],o.prototype,"itemRendering",void 0),Qe([t.Event()],o.prototype,"drillStart",void 0),Qe([t.Event()],o.prototype,"drillEnd",void 0),Qe([t.Event()],o.prototype,"itemSelected",void 0),Qe([t.Event()],o.prototype,"itemHighlight",void 0),Qe([t.Event()],o.prototype,"tooltipRendering",void 0),Qe([t.Event()],o.prototype,"itemClick",void 0),Qe([t.Event()],o.prototype,"itemMove",void 0),Qe([t.Event()],o.prototype,"click",void 0),Qe([t.Event()],o.prototype,"doubleClick",void 0),Qe([t.Event()],o.prototype,"rightClick",void 0),Qe([t.Event()],o.prototype,"mouseMove",void 0),Qe([t.Event()],o.prototype,"resize",void 0),Qe([t.Event()],o.prototype,"legendItemRendering",void 0),Qe([t.Event()],o.prototype,"legendRendering",void 0),o=Qe([t.NotifyPropertyChanges],o)}(t.Component),Ke=function(){return function(){}}(),et=function(){function e(e){this.page=0,this.legendBorderRect=new He(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new He(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:be,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger(be,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]),(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 o=r.position,l=r.title.text,s=r.titleStyle,h=r.mode,d=0,p=0,g=0,c=0,u=r.shapeHeight,m=r.shapeWidth,f=[],y=[],v="None"===r.orientation?"Top"===o||"Bottom"===o||"Auto"===o&&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,x=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;s.fontFamily=i.themeStyle.fontFamily||s.fontFamily,s.fontWeight=s.fontWeight||i.themeStyle.titleFontWeight,s.size=i.themeStyle.legendFontSize||s.size;var S=n(l,s),w=0,I=0,C=r.shapePadding,L=r.textStyle;if(L.size=L.size||i.themeStyle.legendFontSize,L.fontFamily=L.fontFamily||i.themeStyle.fontFamily,L.fontWeight=L.fontWeight||i.themeStyle.fontWeight,"Default"===h){b=t.isNullOrUndefined(b)?i.areaRect.width:b,x=t.isNullOrUndefined(x)?i.areaRect.height:x;for(var O=0,F=0;F<this.legendCollections.length;F++){var N=this.legendCollections[F];t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var T=n(N.legendName,L);if(this.textMaxWidth=Math.max(this.textMaxWidth,T.width),0===F)w=d=10+m/2,I=p=10+S.height+(u>T.height?u/2:T.height/4);else{var E=T.height>u?T.height:u;if("Horizontal"===v){var D=y[O-1].x+y[O-1].width+10+m;if(D+C+T.width>b){var M=(y[O-1].y>f[O-1].y+u/2?y[O-1].y:f[O-1].y+u/2)+10;M+E>x?(this.getPageChanged(),O=0,f=[],y=[],d=w,p=I):(d=f[0].x,p=M+E/2)}else d=D-m/2,p=f[O-1].y}else{var P=y[O-1].y>f[O-1].y+u/2?y[O-1].y:f[O-1].y+u/2;if(P+10+E>x){var _=y[O-1].x+this.textMaxWidth+10;_+C+T.width>b?(d=w,p=I,y=[],f=[],this.getPageChanged(),O=0):(d=_+m/2,p=f[0].y)}else d=f[O-1].x,p=P+10+u/2}}g=d+m/2+C,c=p+T.height/4,f.push({x:d,y:p}),y.push({x:g,y:c,width:T.width,height:T.height/2}),this.totalPages[this.page].Collection.push({DisplayText:N.legendName,element:N.gradientElement,Shape:{x:d,y:p},Text:{x:g,y:c},Fill:N.legendFill,Data:N.legendData,Rect:{x:f[O].x-m/2,y:f[O].y-u/2<c-T.height?f[O].y-u/2:c-T.height,width:Math.abs(f[O].x-m/2-(g+T.width)),height:u>T.height?u:T.height}}),O++}var R=this.totalPages[0].Collection;R.forEach(function(t,i){var r=new He(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(w=r.x,I=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(w-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(I-(r.y+r.height)))}),b=this.widthIncrement<b?this.widthIncrement:b,x=this.heightIncrement<x?this.heightIncrement:x,this.legendItemRect={x:R[0].Rect.x,y:R[0].Rect.y,width:b,height:x}}else{var B=this.legendCollections.length,z="Horizontal"===v?t.isNullOrUndefined(b)?i.areaRect.width/B:b/B:t.isNullOrUndefined(b)?25:b,U="Horizontal"===v?t.isNullOrUndefined(x)?25:x:t.isNullOrUndefined(x)?i.areaRect.height/B:x/B;w=0,I=S.height+10;var H=r.labelPosition,k=0,A=0,W=r.labelDisplayMode,j=0,G=0;for(F=0;F<this.legendCollections.length;F++){w="Horizontal"===v?w+z:w,I="Horizontal"===v?I:I+U;var V=this.legendCollections[F].legendName,q=new Ue(0,0);"None"===W?q=n(V,L):"Trim"===W?q=n(V=a("Horizontal"===v?z:U,V,L),L):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"===H?I+U+q.height/2+10:I-10):(g="After"===H?w-q.width/2-10:w+z+q.width/2+10,c=I+U/2+q.height/4)),0===F&&(k="Horizontal"===v?w:"After"===H?g-q.width/2:w,A="Horizontal"===v?"After"===H?I:c-q.height/2:I),F===B-1&&(b="Horizontal"===v?Math.abs(w+z-k):z+G+10,x="Horizontal"===v?U+j/2+10:Math.abs(I+U-A)),this.legendRenderingCollections.push({fill:this.legendCollections[F].legendFill,x:w,y:I,width:z,height:U,element:this.legendCollections[F].gradientElement,text:V,textX:g,textY:c,textWidth:q.width,textHeight:q.height,data:this.legendCollections[F].legendData})}this.legendItemRect={x:k,y:A,width:b,height:x}}}},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=m(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 o=m(e).values,l=0;l<o.length;l++)if(o[l].Name===this.treemap.initialDrillDown.groupName){o[l].isDrilled=!o[l].isDrilled,e=o[l],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,r=this.treemap.palette.length>0?this.treemap.palette[l%this.treemap.palette.length]:o[l].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!t.isNullOrUndefined(this.treemap.drilledLegendItems)){var n=this.treemap.drilledLegendItems;if(r=n.data.options.fill,n.data.isDrilled)i=m(n.data).values;else{i=m(n.data.parent).values}}else i=m(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,o,l,n,a,s,h,d,p,g,c,u,m,f,y,v,b,x,S=!1,w=this.treemap.leafItemSettings,I=this.treemap.levels,C=this.treemap.legendSettings.position,L=!1,O=0;this.outOfRangeLegend=null;for(var F=0;F<e.length;F++){r="",f=!1,y=!1,L=!1,l=e[F].data,h=e[F].groupIndex,s=(a=0===this.treemap.levels.length||h===this.treemap.levels.length)?w.colorMapping:I[h].colorMapping;for(var N=0;N<s.length;N++){var T=s[N];if(p=null,o=Number(l[this.treemap.rangeColorValuePath]),d=l[this.treemap.equalColorValuePath],T.value=t.isNullOrUndefined(T.value)?T.value:T.value.toString(),!t.isNullOrUndefined(T.from)&&!t.isNullOrUndefined(T.to)&&o>=T.from&&o<=T.to&&T.showLegend?(S=!0,y=!0,u=T.from+" - "+T.to,n=t.isNullOrUndefined(T.label)?T.from+" - "+T.to:T.label,r=t.isNullOrUndefined(T.color)?r:T.color,i=this.isAddNewLegendData(u)):!t.isNullOrUndefined(T.value)&&d===T.value&&T.showLegend&&(S=!0,f=!0,u=T.value.toString(),n=t.isNullOrUndefined(T.label)?T.value.toString():T.label,r=t.isNullOrUndefined(T.color)?r:"[object Array]"===Object.prototype.toString.call(T.color)?T.color[0]:T.color,i=this.isAddNewLegendData(u)),S&&t.isNullOrUndefined(T.value)&&T.maxOpacity&&T.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var E=[];if(L=!0,"[object Array]"===Object.prototype.toString.call(T.color))for(var D=0;D<T.color.length;D++){var M={colorStop:(D*(100/(T.color.length-1))+"%").toString(),color:T.color[D]};E.push(M)}else{M={colorStop:"0%",color:r};var 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(T.color)&&(p.childNodes[0].setAttribute("stop-opacity",T.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",T.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}m=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&S&&!m?(S=!1,r="[object Array]"===Object.prototype.toString.call(T.color)&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(T.value)?this.legendGradientColor(T,O):r,this.legendCollections.push({actualValue:u,levelIndex:a?-1:N,leafIndex:a?N:-1,legendName:n,legendFill:r,legendData:[],groupIndex:a?-1:h,gradientElement:t.isNullOrUndefined(p)?t.isNullOrUndefined(T.value)?this.legendLinearGradient:null:p,name:e[F].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[F]),O++):S&&!m&&(S=!1,this.legendCollections[i.value].legendData.push(e[F])),y||L||f||t.isNullOrUndefined(T.from)&&t.isNullOrUndefined(T.to)&&t.isNullOrUndefined(T.minOpacity)&&t.isNullOrUndefined(T.maxOpacity)&&t.isNullOrUndefined(T.value)&&!t.isNullOrUndefined(T.color)&&(v="[object Array]"===Object.prototype.toString.call(T.color)?T.color[0]:T.color,b=t.isNullOrUndefined(T.label)?"Others":T.label,t.isNullOrUndefined(this.outOfRangeLegend)&&(this.legendCollections.push({actualValue:b,legendData:[],legendName:b,legendFill:v}),x=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[x-1],O++),this.legendCollections[x-1].legendData.push(e[F]))}}},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,o=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 l=0;l<this.legendRenderingCollections.length;l++){var n=this.treemap.element.id+"_Legend_Index_"+l,a=this.treemap.element.id+"_Legend_Index_"+l+"_Text",s=this.legendRenderingCollections[l];e=(t=s.element)?"url(#"+t.id+")":s.fill;var h=new He(s.x,s.y,s.width,s.height),p=new je(s.textX,s.textY),g=new ke(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 We(a,p.x,p.y,"middle",s.text,"",""),o,o.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(r.drawRectangle(g))}H(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,r){var o=e.Shape,l=e.Text,a=n(e.DisplayText,r.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),l.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+a.width+t)-Math.abs(this.legendBorderRect.x-l.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)-r.shapeHeight/2,l.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-l.y)),{shapeLocation:o,textLocation:l}},e.prototype.drawLegendItem=function(e){var i,r,o=this,l=this.treemap,a=l.legendSettings,s=new Ue(a.shapeWidth,a.shapeHeight),h=l.renderer,p=a.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var g="HorizontalLine"===a.shape||"VerticalLine"===a.shape||"Cross"===a.shape,c=g?t.isNullOrUndefined(a.fill)?"#000000":a.fill:p.color,u=g&&0===p.width?1:p.width,m=function(t){var n=f.totalPages[e].Collection[t],p=h.createGroup({id:l.element.id+"_Legend_Index_"+t}),m=n.DisplayText,y=l.element.id+"_Legend_Shape_Index_"+t,v=l.element.id+"_Legend_Text_Index_"+t,b=n.Shape,x=n.Text;l.enableRtl&&(i=f.defaultLegendRtlLocation(n,10,l,a),b=i.shapeLocation,x=i.textLocation),r={cancel:!1,name:ve,treemap:l,fill:n.Fill,shape:a.shape,imageUrl:a.imageUrl},l.trigger(ve,r,function(e){var t=new Ae(y,e.fill,u,g?n.Fill:c,a.opacity,"");p.appendChild(J(b,e.shape,s,e.imageUrl,t,m)),d(new We(v,x.x,x.y,"start",m,"",""),a.textStyle,a.textStyle.color||l.themeStyle.legendTextColor,p),o.legendGroup.appendChild(p)})},f=this,y=0;y<this.totalPages[e].Collection.length;y++)m(y);var v=void 0;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,x=a.textStyle,S=n(b,x),w=this.legendItemRect.x+this.legendItemRect.width-S.width-20-10,I=this.legendItemRect.x+this.legendItemRect.width,C=this.legendItemRect.y+this.legendItemRect.height+2.5+10,L=I-10-S.width/2-5;v=h.createGroup({id:l.element.id+"_Legend_Paging_Group"});var O=h.createGroup({id:l.element.id+"_Legend_Left_Paging_Group"}),F=h.createGroup({id:l.element.id+"_Legend_Right_Paging_Group"}),N=" M "+I+" "+C+" L "+(I-10)+" "+(C-5)+" L "+(I-10)+" "+(C+5)+" z ",T=" M "+w+" "+C+" L "+(w+10)+" "+(C-5)+" L "+(w+10)+" "+(C+5)+" z ",E=new Ae(l.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",T);O.appendChild(h.drawPath(E));var D=new ke(l.element.id+"_Left_Page_Rect","transparent",{},1,new He(w-5,C-10,20,20),"");O.appendChild(h.drawRectangle(D)),this.wireEvents(O);var M=new Ae(l.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",N);F.appendChild(h.drawPath(M));var P=new ke(l.element.id+"_Right_Page_Rect","transparent",{},1,new He(I-10,C-5,10,10),"");F.appendChild(h.drawRectangle(P)),this.wireEvents(F),v.appendChild(O),v.appendChild(F);var _={id:l.element.id+"_Paging_Text",x:L,y:C+S.height/4,fill:"#a6a6a6","font-size":"14px","font-style":x.fontStyle,"font-family":x.fontFamily,"font-weight":x.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":""};v.appendChild(h.createText(_,b)),this.legendGroup.appendChild(v)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,r=t.titleStyle,o=n(a(this.legendItemRect.width+20,i,r),r);this.legendBorderRect=new He(this.legendItemRect.x-10,this.legendItemRect.y-10-o.height,this.legendItemRect.width+20,this.legendItemRect.height+20+o.height+("Interactive"===t.mode?0:0!==this.page?10:0));var l=new ke(e.element.id+"_Legend_Border",t.background,t.border,1,this.legendBorderRect,""),s=e.renderer.drawRectangle(l);s.style.pointerEvents="none",this.legendGroup.appendChild(s),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=this.treemap.legendSettings,t=e.titleStyle,i=e.title.text,r=a(this.legendItemRect.width+20,i,t),o=n(r,t);i&&d(new We(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-o.height/2-5,"middle",r,""),t,t.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup)},e.prototype.renderInteractivePointer=function(e){var i=this.treemap,r=e.target,o=i.element.id+"_Interactive_Legend";r=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):r;var l,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;l=i.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];for(var u=i.svgObject.getBoundingClientRect(),m=0;m<this.legendCollections.length;m++){a=this.legendCollections[m],s=(c=document.getElementById(i.element.id+"_Legend_Index_"+m)).getBoundingClientRect();var f=new He(Math.abs(s.left-u.left),Math.abs(s.top-u.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===l.levelOrderName){this.drawInteractivePointer(n,d,p,o,g,f);break}}}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,r,o,l){var n,a,s;n="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=l.x+l.width/2)+" "+(s=l.y+l.height)+" L "+(a-10)+" "+(s+10)+" L "+(a+10)+" "+(s+10)+" Z ":" M "+(a=l.x+l.width/2)+" "+(s=l.y)+" L "+(a-10)+" "+(s-10)+" L "+(a+10)+" "+(s-10)+" Z ":e.invertedPointer?" M "+(a=l.x)+" "+(s=l.y+l.height/2)+" L "+(a-10)+" "+(s-10)+" L "+(a-10)+" "+(s+10)+" z ":" M "+(a=l.x+l.width)+" "+(s=l.y+l.height/2)+" L "+(a+10)+" "+(s-10)+" L "+(a+10)+" "+(s+10)+" z ";var h=new Ae(r,t,o,i,1,"",n);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(h))},e.prototype.getLegendAlignment=function(e,i,r,o){var l,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,u="Auto"===o.position?g>c?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(u){case"Top":case"Bottom":a.height=d-r,l=g/2-i/2,n="Top"===u?h:h+a.height+10,a.y="Top"===u?h+r+10:h;break;case"Left":case"Right":a.width=p-i,l="Left"===u?s:s+a.width,n=c/2-r/2,a.x="Left"===u?s+i:s}switch(o.alignment){case"Near":"Top"===u||"Bottom"===u?l=a.x:n=a.y;break;case"Far":"Top"===u||"Bottom"===u?l=g-i:n=c-r}this.treemap.totalRect=a,this.translate=new je(l,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(){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()},e.prototype.legendGradientColor=function(e,i){var r,o="http://www.w3.org/2000/svg";if(!t.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var l=this.treemap.renderer.createDefs(),n=document.createElementNS(o,"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(o,"stop");g.setAttribute("offset",d*p+"%"),g.setAttribute("stop-color",e.color[d]),g.setAttribute("stop-opacity",1..toString()),n.appendChild(g)}l.appendChild(n),this.legendLinearGradient=n;var c="url(#linear_"+i+")";this.defsElement.appendChild(n),r=c}return r},e}(),tt=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,o,l,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){l=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var u=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var m=void 0;if(this.treemap.legendSettings.visible){var y=this.treemap.treeMapLegendModule.legendCollections;m=te(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+m):document.getElementById(this.treemap.element.id+"_Legend_Index_"+m),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:y[m].legendFill,oldOpacity:y[m].opacity,oldBorderColor:y[m].borderColor,oldBorderWidth:y[m].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(var v=0;v<l.childElementCount;v++){n=l.childNodes[v],o=!0,r=s.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])];for(var b=0;b<u.length;b++)if(n.id===u[b].id){o=!1;break}a.indexOf(r.levelOrderName)>-1&&o&&(g.push(n),d.push(r))}k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var x=0;x<g.length;x++)A((n=g[x]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:pe,treemap:s,items:d,elements:g},s.trigger(pe,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 S,w=void 0,I=void 0,C=document.getElementById(h);"highlight"===this.shapeTarget&&$(this.legendHighlightCollection),this.shapeTarget="highlight";m="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var L=this.treemap.treeMapLegendModule.legendCollections[m].legendData.length,O=(y=this.treemap.treeMapLegendModule.legendCollections,parseInt(h[h.length-1],10));for(v=0;v<L;v++)for(b=0;b<this.treemap.layout.renderItems.length;b++)if(this.treemap.treeMapLegendModule.legendCollections[m].legendData[v].levelOrderName===this.treemap.layout.renderItems[b].levelOrderName){w=b,I=this.treemap.layout.renderItems[b].groupIndex;var F=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+w+"_RectPath");0===v&&(this.legendHighlightCollection=[],ie(this.legendHighlightCollection,O,b,C,F,this.treemap.layout.renderItems,y),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection={Elements:[]}),K(C,p.fill,p.opacity,p.border.color,p.border.width.toString()),K(F,p.fill,p.opacity,p.border.color,p.border.width.toString()),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection.Elements.push(F)}}}else c&&this.shapeElement&&this.shapeElement.getAttribute("id")===c.legendSelectId||(c?this.shapeElement!==c.shapeElement:this.treemap.legendSettings.visible)&&k(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}(),it=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 o,l,n,a,s=[],h=i.id,d=i.innerHTML,g=[],c=r.selectionSettings,u=this.treemap.treeMapHighlightModule,m=r.element.id+"_TreeMap_"+r.layoutType+"_Layout";if(h.indexOf("_Item_Index")>-1)if(e.preventDefault(),this.treemap.selectionId!==h&&this.legendSelect){l=document.getElementById(m),o=r.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var y=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var v=this.treemap.treeMapLegendModule.legendCollections.length,b=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),u&&(u.shapeTarget="selection",u.shapeHighlightCollection=[]),y=te(v,o,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y):document.getElementById(this.treemap.element.id+"_Legend_Index_"+y),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:b[y].legendFill,oldOpacity:b[y].opacity,oldBorderColor:b[y].borderColor,oldBorderWidth:b[y].borderWidth}),K(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()))}a=f(o,[],c.mode,r);for(var x=0;x<l.childElementCount;x++)n=l.childNodes[x],o=r.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],a.indexOf(o.levelOrderName)>-1&&(g.push(n),r.levelSelection.push(n.id),s.push(o));k(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),w=0;w<g.length;w++){if(n=g[w],S.length>0)for(var I=0;I<S.length;I++)S[I].id===n.id&&S[I].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:de,treemap:r,items:s,elements:g,text:d,contentItemTemplate:d},r.trigger(de,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=[],k(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){b=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var C,L=void 0,O=void 0;this.legendSelectId=h,this.legendSelect=!1;var F=parseInt(h[h.length-1],10),N=document.getElementById(h);$(this.legendSelectionCollection),u&&(u.shapeTarget="selection");y="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var T=this.treemap.treeMapLegendModule.legendCollections[y].legendData.length;for(w=0;w<T;w++)for(var E=0;E<this.treemap.layout.renderItems.length;E++)if(this.treemap.treeMapLegendModule.legendCollections[y].legendData[w].levelOrderName===this.treemap.layout.renderItems[E].levelOrderName){L=E,O=this.treemap.layout.renderItems[E].groupIndex;var D=document.getElementById(this.treemap.element.id+"_Level_Index_"+O+"_Item_Index_"+L+"_RectPath");0===w&&(ie(this.legendSelectionCollection,F,E,N,D,this.treemap.layout.renderItems,b),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection={Elements:[]}),K(N,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),u&&(u.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 o=this.treemap.selectionSettings,l=[],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,[],o.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&&(l.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 u=this.treemap.treeMapLegendModule.legendCollections.length,m=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),a=te(u,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:m[a].legendFill,oldOpacity:m[a].opacity,oldBorderColor:m[a].borderColor,oldBorderWidth:m[a].borderWidth}),K(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}k(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<l.length;b++)if(n=l[b],v.length>0)for(var x=0;x<v.length;x++)v[x].id===n.id&&v[x].classList.remove("treeMapHighLight"),A(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options.fill:o.fill,A(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection")}else Q(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],k(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}(),rt=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){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]])}return i},ot=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,o,l,n,a=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(l=e).changedTouches[0].pageX,r=l.changedTouches[0].pageY,o=l.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,r=e.pageY,o=e.target);var s,h,d,p,g=o.id,c={},u={},m=[];g.indexOf("_Item_Index")>-1?(c=this.treemap.layout.renderItems[parseFloat(g.split("_Item_Index_")[1])],t.isNullOrUndefined(c)||(s=c.weight,u=c.data,t.isNullOrUndefined(c.options)||(p=c.options.fill),m=this.treemap.enableRtl?[t.SanitizeHtmlHelper.sanitize(W(this.tooltipSettings.format,u,this.treemap))||t.SanitizeHtmlHelper.sanitize(j(s,this.treemap)+" : "+this.treemap.weightValuePath.toString())]:[t.SanitizeHtmlHelper.sanitize(W(this.tooltipSettings.format,u,this.treemap))||t.SanitizeHtmlHelper.sanitize(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=L(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.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.treemap.themeStyle.tooltipFontColor||this.tooltipSettings.textStyle.color,this.tooltipSettings.textStyle.opacity=this.treemap.themeStyle.tooltipTextOpacity||this.tooltipSettings.textStyle.opacity,n={cancel:!1,name:ge,item:c,options:{location:d,text:m,data:u,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:o,eventArgs:e},this.treemap.trigger(ge,n,function(e){a.addTooltip(n,p,h)}))):(this.removeTooltip(),this.treemap.clearTemplate())},e.prototype.addTooltip=function(e,r,o,l){var n,a;if(t.isNullOrUndefined(e))n=l.cancel,a=l;else{n=e.cancel,a=rt(e,["cancel"]).options}n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({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}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(o),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}();e.TreeMap=$e,e.LevelsData=Ke,e.Border=Ce,e.Margin=Le,e.Font=Oe,e.CommonTitleSettings=Fe,e.SubTitleSettings=Ne,e.TitleSettings=Te,e.ColorMapping=Ee,e.LegendSettings=De,e.InitialDrillSettings=Me,e.LeafItemSettings=Pe,e.TooltipSettings=_e,e.SelectionSettings=Re,e.HighlightSettings=Be,e.LevelSettings=ze,e.load="load",e.loaded="loaded",e.beforePrint=ne,e.itemRendering=ae,e.drillStart=se,e.drillEnd=he,e.itemSelected=de,e.itemHighlight=pe,e.tooltipRendering=ge,e.itemClick=ce,e.itemMove=ue,e.click="click",e.doubleClick=me,e.rightClick=fe,e.mouseMove=ye,e.legendItemRendering=ve,e.legendRendering=be,e.resize=xe,e.defaultFont=Se,e.getThemeStyle=le,e.Size=Ue,e.stringToNumber=l,e.Rect=He,e.RectOption=ke,e.PathOption=Ae,e.measureText=n,e.TextOption=We,e.textTrim=a,e.Location=je,e.findPosition=s,e.createTextStyle=h,e.renderTextElement=d,e.setItemTemplateContent=p,e.getElement=g,e.itemsToOrder=c,e.isContainsData=u,e.findChildren=m,e.findHightLightItems=f,e.getTemplateFunction=y,e.convertElement=v,e.findLabelLocation=b,e.measureElement=x,e.getArea=S,e.getShortestEdge=w,e.convertToContainer=I,e.convertToRect=C,e.getMousePosition=L,e.colorMap=O,e.deSaturationColor=F,e.colorCollections=N,e.rgbToHex=T,e.getColorByValue=E,e.getGradientColor=D,e.getPercentageColor=M,e.getPercentage=P,e.wordWrap=_,e.textWrap=R,e.hide=B,e.orderByArea=z,e.maintainSelection=U,e.legendMaintain=H,e.removeClassNames=k,e.applyOptions=A,e.textFormatter=W,e.formatValue=j,e.ColorValue=Ge,e.convertToHexCode=G,e.componentToHex=V,e.convertHexToColor=q,e.colorNameToHex=X,e.drawSymbol=J,e.renderLegendShape=Y,e.isParentItem=Z,e.TreeMapAjax=Ve,e.removeShape=Q,e.removeLegend=$,e.setColor=K,e.removeSelectionWithHighlight=ee,e.getLegendIndex=te,e.pushCollection=ie,e.triggerDownload=re,e.removeElement=oe,e.TreeMapLegend=et,e.LayoutPanel=qe,e.TreeMapHighlight=tt,e.TreeMapSelection=it,e.TreeMapTooltip=ot,e.ImageExport=Je,e.PdfExport=Ye,e.Print=Xe,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-treemap.umd.min.js.map
|