@syncfusion/ej2-treemap 28.1.33 → 28.1.39

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