@syncfusion/ej2-treemap 30.1.37 → 30.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/ej2-treemap.min.js +2 -2
  2. package/dist/ej2-treemap.umd.min.js +2 -2
  3. package/dist/ej2-treemap.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treemap.es2015.js +4 -0
  5. package/dist/es6/ej2-treemap.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treemap.es5.js +4 -0
  7. package/dist/es6/ej2-treemap.es5.js.map +1 -1
  8. package/dist/global/ej2-treemap.min.js +2 -2
  9. package/dist/global/ej2-treemap.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +17 -51
  12. package/src/treemap/treemap.d.ts +1 -0
  13. package/src/treemap/treemap.js +4 -0
  14. package/dist/ts/index.d.ts +0 -4
  15. package/dist/ts/index.ts +0 -4
  16. package/dist/ts/treemap/index.d.ts +0 -19
  17. package/dist/ts/treemap/index.ts +0 -19
  18. package/dist/ts/treemap/layout/legend.d.ts +0 -137
  19. package/dist/ts/treemap/layout/legend.ts +0 -1095
  20. package/dist/ts/treemap/layout/render-panel.d.ts +0 -47
  21. package/dist/ts/treemap/layout/render-panel.ts +0 -758
  22. package/dist/ts/treemap/model/base-model.d.ts +0 -795
  23. package/dist/ts/treemap/model/base.d.ts +0 -671
  24. package/dist/ts/treemap/model/base.ts +0 -798
  25. package/dist/ts/treemap/model/constants.d.ts +0 -117
  26. package/dist/ts/treemap/model/constants.ts +0 -118
  27. package/dist/ts/treemap/model/image-export.d.ts +0 -34
  28. package/dist/ts/treemap/model/image-export.ts +0 -117
  29. package/dist/ts/treemap/model/interface.d.ts +0 -555
  30. package/dist/ts/treemap/model/interface.ts +0 -583
  31. package/dist/ts/treemap/model/pdf-export.d.ts +0 -36
  32. package/dist/ts/treemap/model/pdf-export.ts +0 -105
  33. package/dist/ts/treemap/model/print.d.ts +0 -45
  34. package/dist/ts/treemap/model/print.ts +0 -106
  35. package/dist/ts/treemap/model/theme.d.ts +0 -19
  36. package/dist/ts/treemap/model/theme.ts +0 -450
  37. package/dist/ts/treemap/treemap-model.d.ts +0 -374
  38. package/dist/ts/treemap/treemap.d.ts +0 -724
  39. package/dist/ts/treemap/treemap.ts +0 -1817
  40. package/dist/ts/treemap/user-interaction/highlight-selection.d.ts +0 -118
  41. package/dist/ts/treemap/user-interaction/highlight-selection.ts +0 -799
  42. package/dist/ts/treemap/user-interaction/tooltip.d.ts +0 -42
  43. package/dist/ts/treemap/user-interaction/tooltip.ts +0 -228
  44. package/dist/ts/treemap/utils/enum.d.ts +0 -256
  45. package/dist/ts/treemap/utils/enum.ts +0 -263
  46. package/dist/ts/treemap/utils/helper.d.ts +0 -543
  47. package/dist/ts/treemap/utils/helper.ts +0 -1453
@@ -1,10 +1,10 @@
1
1
  /*!
2
2
  * filename: ej2-treemap.min.js
3
- * version : 30.1.37
3
+ * version : 30.2.4
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 o={766:t=>{t.exports=e},74:e=>{e.exports=i},461:e=>{e.exports=l},727:e=>{e.exports=t}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{Border:()=>O,ColorMapping:()=>E,ColorValue:()=>_e,CommonTitleSettings:()=>M,Font:()=>T,HighlightSettings:()=>R,ImageExport:()=>Ke,InitialDrillSettings:()=>P,LayoutPanel:()=>Ye,LeafItemSettings:()=>B,LegendSettings:()=>D,LevelSettings:()=>U,LevelsData:()=>nt,Location:()=>J,Margin:()=>L,PathOption:()=>V,PdfExport:()=>tt,Print:()=>$e,Rect:()=>W,RectOption:()=>j,SelectionSettings:()=>H,Size:()=>k,SubTitleSettings:()=>N,TextOption:()=>q,Theme:()=>Je,TitleSettings:()=>_,TooltipSettings:()=>z,TreeMap:()=>ot,TreeMapAjax:()=>Ue,TreeMapHighlight:()=>at,TreeMapLegend:()=>rt,TreeMapSelection:()=>st,TreeMapTooltip:()=>ht,applyOptions:()=>Te,beforePrint:()=>n,click:()=>f,colorCollections:()=>ue,colorMap:()=>ce,colorNameToHex:()=>Be,componentToHex:()=>De,convertElement:()=>ne,convertHexToColor:()=>Pe,convertToContainer:()=>he,convertToHexCode:()=>Ee,convertToRect:()=>pe,createTextStyle:()=>Z,deSaturationColor:()=>me,defaultFont:()=>C,doubleClick:()=>y,drawSymbol:()=>ze,drillEnd:()=>h,drillStart:()=>d,findChildren:()=>ie,findHightLightItems:()=>le,findLabelLocation:()=>re,findPosition:()=>Y,formatValue:()=>Ne,getArea:()=>se,getColorByValue:()=>ye,getElement:()=>K,getGradientColor:()=>ve,getLegendIndex:()=>Ve,getMousePosition:()=>ge,getPercentage:()=>xe,getPercentageColor:()=>Se,getShortestEdge:()=>de,getTemplateFunction:()=>oe,getThemeStyle:()=>Qe,hide:()=>Ce,isContainsData:()=>te,isParentItem:()=>Re,itemClick:()=>m,itemHighlight:()=>g,itemMove:()=>u,itemRendering:()=>s,itemSelected:()=>p,itemsToOrder:()=>ee,legendItemRendering:()=>x,legendMaintain:()=>Oe,legendRendering:()=>b,load:()=>l,loaded:()=>o,maintainSelection:()=>we,measureElement:()=>ae,measureText:()=>G,mouseMove:()=>S,orderByArea:()=>Fe,pushCollection:()=>Ge,removeClassNames:()=>Le,removeElement:()=>Xe,removeLegend:()=>Ae,removeSelectionWithHighlight:()=>je,removeShape:()=>ke,renderLegendShape:()=>He,renderTextElement:()=>Q,resize:()=>I,rgbToHex:()=>fe,rightClick:()=>v,setColor:()=>We,setItemTemplateContent:()=>$,stringToNumber:()=>A,textFormatter:()=>Me,textTrim:()=>X,textWrap:()=>Ie,tooltipRendering:()=>c,triggerDownload:()=>qe,wordWrap:()=>be});var e,t=r(766),i=r(727),l="load",o="loaded",n="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",C="Roboto, Segoe UI, Noto, Sans-serif",F=(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 o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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 F(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 F(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)(C)],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),M=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)("")],i.prototype,"text",void 0),w([(0,t.Property)("")],i.prototype,"description",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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}(M),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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)({},N)],i.prototype,"subtitleSettings",void 0),i}(M),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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 F(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)({},M)],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 F(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 F(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)([],E)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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),H=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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)([],E)],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,o,n){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=n},V=function(e,t,i,l,o,n,r){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=r};function G(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,o,n,r,a){void 0===n&&(n=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=n,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a};function X(e,t,i){var l=t,o=G(t,i).width;if(o>e)for(var n=t.length-1;n>=0;--n)if((o=G(l=t.substring(0,n)+"...",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 o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}var n="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new J(o,n)}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,o,n,r){void 0===r&&(r=!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:o},p="string"==typeof e.text?e.text:r?e.text[e.text.length-1]:e.text[0],g=new i.SvgRenderer("");if(!(0,t.isNullOrUndefined)(p)&&!(0,t.isNullOrUndefined)(e.connectorText)&&p.includes(e.connectorText[1]))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=G(u,l);h.x=0!==m?h.x+f.width:h.x+f.width+5,n.appendChild(d)}else d=Z(g,h,p),n.appendChild(d);if("string"!=typeof e.text&&e.text.length>1){for(var y=1,v=e.text.length;y<v;y++)s=G(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);n.appendChild(d)}return d}function $(e,i,l){var o,n=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+n+"_LabelTemplate"),(0,t.isNullOrUndefined)(o)||(o.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 o=!1,n="",r=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:r.labelPath?r.labelPath:l.weightValuePath]||"undefined";if(e[a]===s&&(n+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}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 o=ie(e).values;if(o&&o.length>0){for(var n=0;n<o.length;n++)-1===t.indexOf(o[n].levelOrderName)&&t.push(o[n].levelOrderName);for(var r=0;r<o.length;r++)le(o[r],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(n=0;n<l.layout.renderItems.length;n++)(s=l.layout.renderItems[n]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function oe(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 ne(e,i,l){var o=(0,t.createElement)("div",{id:i});o.style.cssText="position: absolute;pointer-events: auto;";for(var n=e.length;n>0;)o.appendChild(e[0]),n--;for(var r=o.innerHTML,a=Object.keys(l),s=0;s<a.length;s++){var d=RegExp;r=r.replace(new d("{{:"+a[s]+"}}","g"),l[a[s].toString()])}return o.innerHTML=r,o}function re(e,t,i,l,o){var n=new J(0,0),r="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return n.x=Math.abs(r-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?n.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)):n.y=Math.abs(e.y+e.height-i.height+5),n}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(),o=i.ownerDocument.defaultView.pageXOffset,n=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=l.left+o-a,d=l.top+n-r;return new J(e-s,t-d)}function ce(e,i,l){var o,n,r=[];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),o="[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,o="[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)&&o&&(n=me(e[a],l)),(""===o||(0,t.isNullOrUndefined)(o))&&(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)&&(o="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),n=(0,t.isNullOrUndefined)(n)?"1":n,r.push(o)}for(var h=r.length-1;h>=0;h--)h=(o=r[h])?-1:h;return{fill:o,opacity:n}}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,o=t.from,n=t.to,r=0,a=n-o;if(r=(e-o)/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:o+g*s,color:t.color[g]},h.push(p);for(var c=0;c<h.length;c++)o<=e&&e<=h[c].b&&0===c?(l="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s):h[c].b<=e&&e<=n&&c===h.length-1&&(i="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=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),r=Math.abs(e-h[c+1].b)/s)}return Se(r,i,l)}function Se(e,t,i){var l=i.split("#")[1],o=t.split("#")[1],n=xe(e,parseInt(o.substr(0,2),16),parseInt(l.substr(0,2),16)),r=xe(e,parseInt(o.substr(2,2),16),parseInt(l.substr(2,2),16)),a=xe(e,parseInt(o.substr(4,2),16),parseInt(l.substr(4,2),16));return new _e(n,r,a)}function xe(e,t,i){var l=i-t;return Math.round(t+l*e)}function be(e,t,i){for(var l,o=t.split(" "),n="",r=[],a=0,s=o.length;a<s;a++)l=o[a],G(n.concat(l),i).width<e?n=n.concat((""===n?"":" ")+l):""!==n?(r.push(X(e,n,i)),n=l):(r.push(X(e,l,i)),l=""),n&&a===s-1&&r.push(X(e,n,i));return r}function Ie(e,t,i){var l=[],o=0,n=G(t,i).width,r=t.length;if(e>=n)return l.push(t),l;for(var a=t.length;a>o;a--){var s=t.slice(o,a);if((n=G(s,i).width)<=e){if(l.push(s),r===(o+=s.length))return l;a=r+1}}return l}function Ce(e,t,i,l){var o=G(i,l);return o.width>e||o.height>t?" ":i}function Fe(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 o=0;o<l.length;o++)t.getAttribute("id")===l[o]||t.children[0].id===l[o]?t.childElementCount>0&&-1===t.children[0].id.indexOf("_Group")&&(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 o=0;o<l.length;o++)if("Interactive"===e.legendSettings.mode){for(var n=0;n<i.childElementCount;n++)if(i.childNodes[n].id===l[o]||parseFloat(i.childNodes[n].id.split("Index_")[1])===parseFloat(l[o].split("Index_")[1])){var r=i.childNodes[n];r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),r.setAttribute("stroke",e.selectionSettings.border.color)):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null))}}else{var a=document.getElementById(l[o]);(0,t.isNullOrUndefined)(a)||(a.setAttribute("fill",e.selectionSettings.fill),a.setAttribute("opacity",e.selectionSettings.opacity),-1===a.id.indexOf("Text")?(a.setAttribute("stroke",e.selectionSettings.border.color),a.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(a.setAttribute("stroke",null),a.setAttribute("stroke-width",null)))}}function Le(e,i,l){for(var o,n={},r=0;r<e.length;r++)o=(0,t.isNullOrUndefined)(e[r].childNodes[0])?e[r]:e[r].childNodes[0],n=l.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options,Te(o,n),e[r].classList.remove(i),r-=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 Me(e,i,l){if((0,t.isNullOrUndefined)(e))return null;for(var o=0,n=Object.keys(i);o<n.length;o++){var r=n[o];e=e.split("${"+r+"}").join(Ne(i[r],l).toString())}return e}function Ne(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 Ee(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 Ee(new _e(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function ze(e,t,l,o,n){var r=new i.SvgRenderer(""),a=He(e,l,t,n,o);return r["draw"+a.functionName](a.renderOption)}function He(e,i,l,o,n){var r,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)(o,{rx:s/2,ry:d/2,cx:h,cy:p});break;case"VerticalLine":r="M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Diamond":r="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)(o,{d:r});break;case"Rectangle":r="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)(o,{d:r});break;case"Triangle":r="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)(o,{d:r});break;case"InvertedTriangle":r="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)(o,{d:r});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)),r=0===f?"M "+(h+m)+" "+(p+u)+" ":r.concat("L "+(h+m)+" "+(p+u)+" ");r=r.concat("Z"),(0,t.merge)(o,{d:r});break;case"Star":r="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)(o,{d:r});break;case"Cross":r="M "+g+" "+p+" L "+(h+s/2)+" "+p+" M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Image":a="Image",(0,t.merge)(o,{href:n,height:d,width:s,x:g,y:c})}return{renderOption:o,functionName:a}}function Re(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}var Ue=function(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o};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 o=e[l],n=parseFloat(o.legendEle.id.split("_Index_")[1]),r=o.legendEle.id.indexOf("Text")>-1?o.legendEle.id.replace("_Text",""):o.legendEle.id,a="Interactive"===i.legendSettings.mode?document.getElementById(r):document.getElementById(i.element.id+"_Legend_Shape_Index_"+n),s="Interactive"===i.legendSettings.mode?document.getElementById(r+"_Text"):document.getElementById(i.element.id+"_Legend_Text_Index_"+n);(0,t.isNullOrUndefined)(a)||We(a,o.oldFill,o.oldOpacity,"none","0px"),(0,t.isNullOrUndefined)(s)||We(s,i.legendSettings.textStyle.color||i.themeStyle.legendTextColor,o.oldOpacity,null,null);for(var d=(0,t.isNullOrUndefined)(o.ShapeCollection)?0:o.ShapeCollection.Elements.length,h=0;h<d;h++){var p=document.getElementById(o.ShapeCollection.Elements[h].id);(0,t.isNullOrUndefined)(p)||We(p,o.shapeOldFill,o.shapeOldOpacity,o.shapeOldBorderColor,o.shapeOldBorderWidth)}}}function We(e,i,l,o,n){e.setAttribute("fill",i),e.setAttribute("opacity",l),(0,t.isNullOrUndefined)(o)||e.setAttribute("stroke",o),(0,t.isNullOrUndefined)(n)||e.setAttribute("stroke-width",n)}function je(e,t,i){Ae(e,i),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ve(e,i,l){for(var o,n=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,r=!1,a=0;a<e&&!r;a++){var s=l.treeMapLegendModule.legendCollections[a].legendData.length;if(s>0){for(var d=0;d<s;d++)if(!(0,t.isNullOrUndefined)(n)&&l.leafItemSettings.colorMapping.length>0?l.treeMapLegendModule.legendCollections[a].legendData[d].data[n]===i.data[n]:l.treeMapLegendModule.legendCollections[a].legendData[d].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].legendName)>-1){o=a,r=!0;break}}else if(l.palette&&l.palette.length>0&&(l.treeMapLegendModule.legendCollections[a].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].levelOrderName)>-1)&&l.treeMapLegendModule.legendCollections[a].legendName===i.name){o=a;break}}return o}function Ge(e,t,i,l,o,n,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:o,shapeOldFill:n[i].options.fill,shapeOldOpacity:n[i].options.opacity,shapeOldBorderColor:n[i].options.border.color,shapeOldBorderWidth:n[i].options.border.width})}function qe(e,i,l,o){(0,t.createElement)("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:l}}).dispatchEvent(new MouseEvent(o?"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,o=this.treemap.drilledItems[l].data,n={};n[this.treemap.drilledItems[l].data.groupName]=[o],(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[l].data.groupIndex),this.calculateLayoutItems(n||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=ie(e).values;if(o&&o.length>0&&0===t.length){for(var n=0;n<o.length;n++)o[n].groupIndex===i.initialDrillDown.groupIndex&&o[n].name===i.initialDrillDown.groupName&&(o[n].isDrilled=!0,l[o[n].groupName]=[o[n]],t.push(l));for(var r=0;r<o.length;r++)this.getDrilldownData(o[r],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,o,n,r=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,o=0===a.length||l===a.length?r.gap:a[l].groupGap,n=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+o/2,i.y+(n+o/2),i.width-o,Math.abs(i.height-(o+n))),this.computeSliceAndDiceDimensional(s[d],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var l,o=i.height*i.width,n=this.treemap.levels,r=0,a=0;e.forEach((function(e){a+=e.weight})),e.forEach((function(e){e.weightArea=o*e.weight/a}));var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(ee);for(var d=0;d<e.length;d++){var h=e[d];h.isLeafItem=0===n.length||(this.treemap.isHierarchicalData||(0,t.isNullOrUndefined)(this.treemap.leafItemSettings.labelPath)?h.groupIndex===n.length-1:h.groupIndex===this.treemap.levels.length),s?(l=o/a*e[d].weight/i.height,r<=i.width&&(e[d].rect=new W(r+i.x,i.y,l,i.height))):(l=o/a*e[d].weight/i.width,r<=i.height&&(e[d].rect=new W(i.x,r+i.y,i.width,l))),r+=l,this.renderItems.push(e[d])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,n,r,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++)o=(l=d[h]).groupIndex,i=l.rect,n=(l.isLeafItem?a.padding:s[o].groupPadding)/2,r=this.treemap.isHierarchicalData?0===o&&l.isLeafItem?0:s[o]&&s[o].showHeader?s[o].headerHeight:0:0===s.length?0:s[o]&&s[o].showHeader?s[o].headerHeight:0,i=new W(i.x+n,i.y+(r+n),i.width-n,i.height-n),!l.isLeafItem&&l.weight>0&&this.computeSquarifyDimensional(d[h],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,se(i)),t.sort(Fe),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o){var n=this.getCoordinates(t,i);return m=l.concat(n)}var r=de(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,r)){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=(n=this.getCoordinates(t,i),l.concat(n));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,o=-1/0,n=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),a>o&&(o=a),n+=a}return Math.max(Math.pow(t,2)*o/Math.pow(n,2),Math.pow(n,2)/(Math.pow(t,2)*l))},e.prototype.cutArea=function(e,t){var i=he(e),l=i.width,o=i.height,n=i.x,r=i.y;if(l>=o){var a=t/o;return pe({x:n+a,y:r,width:l-a,height:o})}var s=t/l;return pe({x:n,y:r+s,width:l,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var l,o=he(i),n=o.width,r=o.height,a=o.x,s=o.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/r,v=g/n,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=Re(this.parentData[0],I))?this.treemap.areaRect:I.parent.rect,m=I.isLeafItem?p.padding:h[l].groupPadding,n>=r){var C=x+I.itemArea/y;I.rect={x:S,y:x,width:S+y,height:C},x=C}else{var F=S+I.itemArea/v;I.rect={x:S,y:x,width:F,height:x+v},S=F}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=[],o=0;o<i;o+=1){for(var n=e.length,r=0,a=0;a<n;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<n;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 o={};(0,t.isNullOrUndefined)(i.groupName)?o=i:o[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 n=this.treemap.levels.length,r=0;r<n;r++){n===e[0].groupIndex?this.treemap.levels[n]=this.treemap.levels[r]:this.treemap.levels.splice(n-1,1)}this.calculateLayoutItems(o,l),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,l,o,n,r=this,a=this.treemap;this.renderer=a.renderer;var d,h,p,g,c,m,u,f,y,v,S,x,b,I,C,F=a.element.id,w=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",T=document.getElementById(a.element.id+"_Secondary_Element"),M=a.levels;this.layoutGroup=this.renderer.createGroup({id:F+"_TreeMap_"+w+"_Layout"});var N=(0,t.createElement)("div",{id:a.element.id+"_Label_Template_Group",className:"template"});N.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 _,E,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=F+"_Level_Index_"+d+"_Item_Index_"+w,b=z.renderer.createGroup({id:y+"_Group"}),S=(D?P.gap:M[d].groupGap)/2;var B,H=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=H.x+H.width-p.width-Math.abs(H.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=H.y+H.height-p.height-Math.abs(H.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=H.x+H.width-p.width-Math.abs(H.x-p.x),p.y=H.y+H.height-p.height-Math.abs(H.y-p.y)),l=z.getItemColor(D,m),c=l.fill,f=l.opacity,g=D?P.labelFormat:M[d].headerFormat,i=D?P.showLabels:M[d].showHeader,d===z.treemap.currentLevel)if(z.treemap.enableBreadcrumb){E="#"+z.treemap.breadcrumbConnector+"#",B=m.levelOrderName.replace(/#/gi,E),B=0!==d?"#"+B:B}else B=m.name;else z.treemap.enableBreadcrumb&&(m.isDrilled=!1),B=m.name;u=Me(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 R=D?P.labelStyle.fontFamily:M[d].headerStyle.fontFamily;R=R||z.treemap.themeStyle.labelFontFamily;var U=D?P.labelStyle.size:M[d].headerStyle.size;U=U||z.treemap.themeStyle.labelFontSize;var k=D?P.labelStyle.fontWeight:M[d].headerStyle.fontWeight;k=k||z.treemap.themeStyle.fontWeight;var A=D?P.labelStyle.color:M[d].headerStyle.color,W=D?P.labelStyle.fontStyle:M[d].headerStyle.fontStyle,j=D?P.labelStyle.opacity:M[d].headerStyle.opacity;x={fontFamily:R,size:U,fontWeight:k,color:A,fontStyle:W,opacity:j},C=D?P.border:M[d].border,e=D?P.labelPosition:"Near"===M[d].headerAlignment?"TopLeft":"Center"===M[d].headerAlignment?"TopCenter":"TopRight",h=D?P.templatePosition:M[d].templatePosition,I=D?P.labelTemplate:M[d].headerTemplate,m.options={border:C,opacity:f,fill:c},o={cancel:!1,name:s,treemap:z.treemap,text:u,currentItem:m,RenderItems:z.renderItems,options:m.options,textColor:x.color},z.treemap.trigger(s,o,(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",n=new V(y+"_RectPath",c,C.width,C.color,f,null,L);var a=r.renderer.drawPath(n);b.appendChild(a),i&&(o.text!==u&&(o.text=Me(o.text,m.data,r.treemap)||B),x.color=o.textColor?o.textColor:x.color,r.renderItemText(o.text.toString(),b,x,p,O,y,c,e,E)),I&&(v=r.renderTemplate(T,y,p,h,I,m,D),(0,t.isNullOrUndefined)(v)||(N.appendChild(v),r.treemap.renderReactTemplates())),b.setAttribute("aria-label",m.name),r.treemap.enableDrillDown&&!D||r.treemap.selectionSettings.enable||r.treemap.highlightSettings.enable?(b.setAttribute("role","button"),b.setAttribute("tabindex",r.treemap.tabIndex.toString()),b.style.outline="none",b.style.cursor=r.treemap.highlightSettings.enable&&!r.treemap.selectionSettings.enable&&r.treemap.enableDrillDown&&m.groupIndex===r.treemap.levels.length-1?"default":!r.treemap.highlightSettings.enable||r.treemap.selectionSettings.enable||r.treemap.enableDrillDown?"pointer":"default"):b.setAttribute("role","region"),we(r.treemap,b,"treeMapSelection"),r.layoutGroup.appendChild(b)}}))},z=this,H=0;H<this.renderItems.length;H++)B(H);N.childNodes.length>0&&T.appendChild(N),this.treemap.svgObject.appendChild(this.layoutGroup),we(this.treemap,this.layoutGroup,"treeMapSelection")},e.prototype.renderItemText=function(e,i,l,o,n,r,a,s,d){var h,p,g,c,m=[],u=0;if(p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(o,e,l,n),h=G(p&&p[0]||g[0],l),this.treemap.enableRtl){var f=G(e,l),y=e.search("[+]")||e.search("[-]");if(o.width<f.width&&y>0){var v=e.substring(y-1,e.length),S=G("[+]",l);g[0]=X(o.width-S.width-5,g[0],l)+v}}var x=re(o,s,h,"Text",this.treemap);if(!(0,t.isNullOrUndefined)(p)){for(var b=[],I=null,C=[],F=0;F<p.length;F++)u+=(h=G(I=X(o.width-5,p[F],l),l)).height,C.push(h.width),b.push(I);g=b,h.width=Math.max.apply(null,C),h.height=u}if("WrapByWord"===n||"Wrap"===n||"Trim"===n){for(var w=0;w<g.length;w++)u+=(h=G(g[w],l)).height,o.height-5>u&&m.push(g[w]);if("Wrap"===n&&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(r+"_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,o=e?l.leafItemSettings.fill:l.levels[i.groupIndex].fill,n=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 r=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)||(o=(0,t.isNullOrUndefined)(s.fill)?l.leafItemSettings.fill:s.fill,n=s.opacity)}else for(var d=0;d<r.length;d++)r[d].levelOrderName===i.levelOrderName.split("#")[0]&&(o=(0,t.isNullOrUndefined)(o)?(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:r[d].data[l.colorValuePath]:o);return{fill:o,opacity:n}},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,o,n,r,a){var s,d=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if((0,t.isNullOrUndefined)(n.prototype)&&"string"==typeof n)for(var p=Object.keys(r.data),g=0;g<p.length;g++){var c=RegExp;n=n.replace(new c("{{:"+p[g]+"}}","g"),r.data[p[g].toString()])}if(this.treemap.enableHtmlSanitizer&&"string"==typeof n&&(n=t.SanitizeHtmlHelper.sanitize(n)),!(0,t.isNullOrUndefined)(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=re(l,o,ae(s=ne(oe(n)(r.data,this.treemap,n,this.treemap.element.id+h,!1),d,r.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 o,n=e.width-10;switch(l){case"Hide":o=[Ce(n,e.height,t,i)];break;case"Trim":o=[X(n+3,t,i)];break;case"WrapByWord":o=be(n,t,i);break;case"Wrap":o=Ie(n,t,i)}return o},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}(),Ze=r(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:C,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:C,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:C,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 o={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:n};e.trigger(n,o,(function(){o.cancel||(0,t.print)(o.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 o=e.element.cloneNode(!0),n=o.getElementsByTagName("svg")[0];if(!(0,t.isNullOrUndefined)(n)&&(n=n.childNodes[0],!(0,t.isNullOrUndefined)(n))){var r=n.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)"!==r&&"transparent"!==r?"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)"!==r&&"transparent"!==r||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)")}l.appendChild(o)}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,o){return new Promise((function(n,r){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)o?qe(l,i,c,p):n(null);else{var m=new Image,u=a.getContext("2d");m.onload=function(){u.drawImage(m,0,0),window.URL.revokeObjectURL(c),o?qe(l,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?n(a.toDataURL("image/jpeg")):"PNG"===i&&n(a.toDataURL("image/png"))},m.src=c}}))},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),et=r(461),tt=function(){function e(e){}return e.prototype.export=function(e,i,l,o,n){return new Promise((function(i,r){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});o=(0,t.isNullOrUndefined)(o)?et.PdfPageOrientation.Landscape:o;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,r=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=o,r=r.slice(r.indexOf(",")+1),t.pages.add().graphics.drawImage(new et.PdfBitmap(r),0,0,e.availableSize.width-60,e.availableSize.height),n?(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 o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ot=function(e){function n(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(n,e),n.prototype.preRender=function(){var e=this;this.trigger(l,{treemap:this},(function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()}))},n.prototype.render=function(){this.renderElements()},n.prototype.renderElements=function(){this.treemapLevelData=new nt,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()},n.prototype.processDataManager=function(){var e,i,l,o,n=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){n.dataSource=e.result,n.renderTreeMapElements()}))):this.dataSource instanceof Ue?(o=this.dataSource,(l=new t.Fetch(o.dataOptions,o.type,o.contentType)).onSuccess=function(e){if((0,t.isNullOrUndefined)(e.type)||"application/octet-stream"!==e.type)n.dataSource=e,n.renderTreeMapElements();else{var i=new FileReader,l=n;i.onload=function(){e=JSON.parse(i.result.toString()),l.dataSource=e,l.renderTreeMapElements()},i.readAsText(e)}},l.send(o.sendData)):this.renderTreeMapElements()},n.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(o,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},n.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})},n.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)},n.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)}},n.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)},n.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)},n.prototype.renderTitle=function(e,i,l,o){var n,r={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(r.fontFamily=r.fontFamily||this.themeStyle.fontFamily,r.fontWeight=r.fontWeight||this.themeStyle.titleFontWeight,r.size=r.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){(0,t.isNullOrUndefined)(o)&&(o=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text,d=X(a,s,r),h=G(d,r),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,r,r.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);m.setAttribute("aria-label",e.description||s),m.setAttribute("role","region"),m.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(n=this.availableSize.height-c.y-10-this.margin.bottom,this.areaRect=new W(this.margin.left,c.y+10,a,n)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",c,o):this.svgObject.appendChild(o)}else n=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new W(this.margin.left,this.margin.top,a,n)},n.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 o=0;o<this.dataSource.length;o++){var n=ie(this.dataSource[o]).values;this.isHierarchicalData&&n&&n.length>0?n.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[o][e]&&l[e].push({groupIndex:0,name:this.dataSource[o][e],levelOrderName:this.dataSource[o][e].toString(),data:this.dataSource[o],weight:this.dataSource[o][this.weightValuePath]})}this.treemapLevelData.levelsData.push(l)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=(0,t.extend)([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(o=0;o<this.treemapLevelData.hierarchyData.length;o++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[o],o);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][e],"Parent")}},n.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)}},n.prototype.processHierarchicalData=function(e,i){var l,o,n,r=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if((l=(a=ie(e))?a.values:null)&&l.length>0){n=a.key;for(var d=0;d<this.levels.length;d++)n===this.levels[d].groupPath&&(o=d);for(var h=0;h<l.length;h++){l[h].name=l[h][s],l[h].levelOrderName=(0===o?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)(o)?g===this.levels.length?this.levels.length:g:o,0!==o&&(l[h].parent=e),l[h].groupName=n,l[h].data=l[h],l[h].isDrilled=!1,l[h].weight=l[h][this.weightValuePath]}l.forEach((function(e){r.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}}},n.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},n.prototype.export=function(e,i,l,o){var n=this;return(0,t.isNullOrUndefined)(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise((function(t,r){t(n.pdfExportModule.export(n,e,i,l,o))})):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise((function(t,l){t(n.imageExportModule.export(n,e,i,o))})):null},n.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 o={};o.level=l,o[e]=[],this.treemapLevelData.levelsData.push(o);for(var n=0;n<this.dataSource.length;n++){var r={},a="";if(!(0,t.isNullOrUndefined)(e)){var s=this.dataSource[n][e];if(0!==l)for(var d=0;d<=l;d++){var h=this.levels[d]?this.levels[d].groupPath:e;a+=this.dataSource[n][h]+(d===l?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(r.name=s,r.levelOrderName=(a||s)+"",r.groupIndex=l,r.isDrilled=!1,r.groupName=e,r.data=this.dataSource[n],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(r),i.push(a||s))}}}},n.prototype.reOrderLevelData=function(e){for(var i,l=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,n=this.treemapLevelData.levelsData[e][l],r=this.treemapLevelData.levelsData[e-1][o],a=0;a<n.length;a++){i=n[a].levelOrderName;for(var s=0;s<r.length;s++)if(r[s][l]=(0,t.isNullOrUndefined)(r[s][l])?[]:r[s][l],this.IsChildHierarchy(i.split("#"),r[s].levelOrderName.split("#"))){(0,t.isNullOrUndefined)(n[a].parent)&&(n[a].parent=r[s]),r[s][l].push(n[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)},n.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},n.prototype.findTotalWeight=function(e,t){for(var i,l,o,n=this,r={},a=function(a){i=0,o=e[a].groupName,l=e[a].levelOrderName.split("#"),s.dataSource.forEach((function(t){te(l,e[a].levelOrderName,t,n)&&(i+=parseFloat(t[n.weightValuePath]))})),"Parent"===t&&(r[o]=e,e[a].parent=r),e[a].weight=i},s=this,d=0;d<e.length;d++)a(d)},n.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),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focusout",this.focusHandler),window.removeEventListener("resize",this.resizeEvent)},n.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),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focusout",this.focusHandler,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},n.prototype.setCulture=function(){this.intl=new t.Internationalization},n.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},n.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))}},n.prototype.clickOnTreeMap=function(e){var i,l,o=this,n=e.target,r=n.id,a=n.innerHTML,s={cancel:!1,name:f,treemap:this,mouseEvent:e};this.trigger(f,s),r.indexOf("_Item_Index")>-1&&(e.preventDefault(),l=parseFloat(r.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)(o.leafItemSettings.labelTemplate)?(e.text=Me(e.text,e.item.data,e.treemap),n.textContent=e.text):$(r,n,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)},n.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:y,treemap:this,mouseEvent:e};this.trigger(y,t)},n.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:v,treemap:this,mouseEvent:e};this.trigger(v,t)},n.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),"touchstart"!==e.type&&"mousedown"!==e.type||(this.removeFocus("none"),e.preventDefault()),this.notify(t.Browser.touchStartEvent,e)},n.prototype.mouseMoveOnTreeMap=function(e){var i,l,o,n=e.target.id,r={cancel:!1,name:S,treemap:this,mouseEvent:e};this.trigger(S,r),this.removeFocus("none"),n.indexOf("_Item_Index")>-1?(o=ie(l=this.layout.renderItems[parseFloat(n.split("_Item_Index_")[1])]).values,this.element.style.cursor=!l.isLeafItem&&o&&o.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)},n.prototype.calculateSelectedTextLevels=function(e,t){for(var i,l,o,n=t.levelOrderName.split("#"),r=0,a=Object.keys(n);r<a.length;r++)n[l=a[r]]===e&&(i=parseInt(l,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:n}},n.prototype.calculatePreviousLevelChildItems=function(e,i,l){for(var o,n,r,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,d=0;d<s;d++)r=0===d?e.levelText[d]:r+"#"+e.levelText[d];a=s>1?s:a;for(var h=0,p=Object.values(this.layout.renderItems);h<p.length;h++){(n=p[h]).levelOrderName.split("#")[0]===e.levelText[0]&&(o=0===a?(0,t.isNullOrUndefined)(r)?r:e.levelText[a]:l?r:r+"#"+e.levelText[a])===n.levelOrderName&&(this.drilledItems.push({name:n.levelOrderName,data:n}),l=!0,++a<=i.groupIndex&&(r=o=o+"#"+e.levelText[a]))}return l},n.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var l,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((l=this.drilledItems[i].data.parent).isDrilled=!0,o[l[this.drilledItems[i].data.groupName]]=[l],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},n.prototype.mouseEndOnTreeMap=function(e){var i,l,o,n,r,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(),n=parseFloat(c.split("_Item_Index_")[1]),r=this.layout.renderItems[n];var v=g.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(v,r),a=s.drillLevel,this.drillDownView||-1===v.search("[+]")||(m=this.calculatePreviousLevelChildItems(s,r,m))),0!==this.levels.length&&!r.isLeafItem&&ie(r).values&&ie(r).values.length>0){if(this.drilledItems.length>0){r=m?this.drilledItems[this.drilledItems.length-1].data:r;for(var S=0;S<this.drilledItems.length;S++){if(!(0,t.isNullOrUndefined)(a)){var x=this.drilledItems.length;if(u=this.compareSelectedLabelWithDrillDownItems(s,r,S),x!==this.drilledItems.length){S-=1;break}}if(r.levelOrderName===this.drilledItems[S].name&&!m&&(0,t.isNullOrUndefined)(a)){0===r.groupIndex&&r.parent[r.groupName]instanceof Array?(r.isDrilled=!r.isDrilled,r.isDrilled?u[r.groupName]=[r]:u=r.parent):(r.isDrilled=!1,r.parent.isDrilled=!0,r=r.parent,u[r.groupName]=[r]),this.drilledItems.splice(S,1),S-=1;break}S===this.drilledItems.length-1&&(0,t.isNullOrUndefined)(a)&&(r.isDrilled=!0,u[r.groupName]=[r])}}else r.isDrilled=!0,u[r.groupName]=[r];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:r.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.name:r.name,rightClick:3===e.which,childItems:null,item:u},this.trigger(d,l,(function(e){if(p.currentLevel=r.isDrilled&&(0,t.isNullOrUndefined)(a)?r.groupIndex:!(0,t.isNullOrUndefined)(a)&&p.enableBreadcrumb&&r.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:r.levelOrderName,data:r},p.treeMapLegendModule.renderLegend()),i=(0,t.isNullOrUndefined)(p.totalRect)?i:p.totalRect),document.getElementById(y)){var o=document.getElementById(y);o.parentNode.removeChild(o)}(0,t.isNullOrUndefined)(e.childItems)||e.cancel?(p.layout.calculateLayoutItems(u,i),p.layout.renderLayoutItems()):p.layout.onDemandProcess(e.childItems)}})),o={cancel:!1,name:h,treemap:this,renderItems:this.layout.renderItems},this.trigger(h,o),!m&&(0,t.isNullOrUndefined)(a)&&this.drilledItems.push({name:r.levelOrderName,data:r})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},n.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=""),this.removeFocus("")},n.prototype.keyUpHandler=function(e){if("Tab"===e.code){var t=e.target.id,i=document.getElementById(t);if(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)if(this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapHighlightModule&&this.highlightSettings.enable){i.style.setProperty("outline","none"),i.classList.add("keyboard-focused");var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapHighlightModule.highlightOnMouseMove(l)}else this.removeFocus(""),i.style.outline="2px solid black",i.classList.add("keyboard-focused");else Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&Ae(this.treeMapHighlightModule.shapeHighlightCollection,this),this.removeFocus("none")}},n.prototype.keyDownHandler=function(e){var t=e.target.id,i=document.getElementById(t);if("Enter"===e.code){if(this.selectionSettings.enable&&(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)){var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapSelectionModule.selectionOnMouseDown(l)}this.enableDrillDown&&i.childElementCount>0&&this.mouseEndOnTreeMap(e)}},n.prototype.focusHandler=function(e){var t=e.target.id;(!this.element.contains(e.relatedTarget)||t.indexOf("Item_Index")>-1&&e.relatedTarget.id.indexOf("Legend")>-1||t.indexOf("Legend")>-1&&e.relatedTarget.id.indexOf("Item_Index")>-1)&&(this.treeMapHighlightModule&&this.highlightSettings.enable?(Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),Ae(this.treeMapHighlightModule.legendHighlightCollection,this),this.treeMapHighlightModule.highLightId=""):this.removeFocus("none"))},n.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},n.prototype.selectItem=function(e,i){(0,t.isNullOrUndefined)(i)&&(i=!0);for(var l="",o=0;o<e.length;o++)o!==e.length-1?l+=e[o]+"#":l+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(l,i)},n.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},n.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,l=0,o=Object.keys(e);l<o.length;l++){switch(o[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())}},n.prototype.getModuleName=function(){return"treemap"},n.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},n.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)}},n.prototype.getPersistData=function(){return""},lt([(0,t.Property)(!1)],n.prototype,"allowPrint",void 0),lt([(0,t.Property)(!1)],n.prototype,"allowImageExport",void 0),lt([(0,t.Property)(!1)],n.prototype,"allowPdfExport",void 0),lt([(0,t.Property)(null)],n.prototype,"width",void 0),lt([(0,t.Property)(null)],n.prototype,"height",void 0),lt([(0,t.Complex)({},O)],n.prototype,"border",void 0),lt([(0,t.Complex)({},L)],n.prototype,"margin",void 0),lt([(0,t.Property)(null)],n.prototype,"background",void 0),lt([(0,t.Property)("Material")],n.prototype,"theme",void 0),lt([(0,t.Complex)({},_)],n.prototype,"titleSettings",void 0),lt([(0,t.Property)("Squarified")],n.prototype,"layoutType",void 0),lt([(0,t.Property)(null)],n.prototype,"dataSource",void 0),lt([(0,t.Property)(null)],n.prototype,"query",void 0),lt([(0,t.Property)(null)],n.prototype,"weightValuePath",void 0),lt([(0,t.Property)("")],n.prototype,"rangeColorValuePath",void 0),lt([(0,t.Property)("")],n.prototype,"equalColorValuePath",void 0),lt([(0,t.Property)(null)],n.prototype,"colorValuePath",void 0),lt([(0,t.Property)([])],n.prototype,"palette",void 0),lt([(0,t.Property)("TopLeftBottomRight")],n.prototype,"renderDirection",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableDrillDown",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableBreadcrumb",void 0),lt([(0,t.Property)(" - ")],n.prototype,"breadcrumbConnector",void 0),lt([(0,t.Property)(!1)],n.prototype,"drillDownView",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableHtmlSanitizer",void 0),lt([(0,t.Complex)({},P)],n.prototype,"initialDrillDown",void 0),lt([(0,t.Complex)({},B)],n.prototype,"leafItemSettings",void 0),lt([(0,t.Collection)([],U)],n.prototype,"levels",void 0),lt([(0,t.Complex)({},R)],n.prototype,"highlightSettings",void 0),lt([(0,t.Complex)({},H)],n.prototype,"selectionSettings",void 0),lt([(0,t.Complex)({},z)],n.prototype,"tooltipSettings",void 0),lt([(0,t.Complex)({},D)],n.prototype,"legendSettings",void 0),lt([(0,t.Property)(!1)],n.prototype,"useGroupingSeparator",void 0),lt([(0,t.Property)(null)],n.prototype,"description",void 0),lt([(0,t.Property)(0)],n.prototype,"tabIndex",void 0),lt([(0,t.Property)(null)],n.prototype,"format",void 0),lt([(0,t.Event)()],n.prototype,"load",void 0),lt([(0,t.Event)()],n.prototype,"beforePrint",void 0),lt([(0,t.Event)()],n.prototype,"loaded",void 0),lt([(0,t.Event)()],n.prototype,"itemRendering",void 0),lt([(0,t.Event)()],n.prototype,"drillStart",void 0),lt([(0,t.Event)()],n.prototype,"drillEnd",void 0),lt([(0,t.Event)()],n.prototype,"itemSelected",void 0),lt([(0,t.Event)()],n.prototype,"itemHighlight",void 0),lt([(0,t.Event)()],n.prototype,"tooltipRendering",void 0),lt([(0,t.Event)()],n.prototype,"itemClick",void 0),lt([(0,t.Event)()],n.prototype,"itemMove",void 0),lt([(0,t.Event)()],n.prototype,"click",void 0),lt([(0,t.Event)()],n.prototype,"doubleClick",void 0),lt([(0,t.Event)()],n.prototype,"rightClick",void 0),lt([(0,t.Event)()],n.prototype,"mouseMove",void 0),lt([(0,t.Event)()],n.prototype,"resize",void 0),lt([(0,t.Event)()],n.prototype,"legendItemRendering",void 0),lt([(0,t.Event)()],n.prototype,"legendRendering",void 0),n=lt([t.NotifyPropertyChanges],n)}(t.Component),nt=function(){},rt=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 o=l.position,n=i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l.title.text):l.title.text,r=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"===o||"Bottom"===o||"Auto"===o&&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;r.fontFamily=r.fontFamily||i.themeStyle.fontFamily,r.fontWeight=r.fontWeight||i.themeStyle.titleFontWeight,r.size=r.size||i.themeStyle.subtitleFontSize;var S=G(n,r),x=0,b=0,I=l.shapePadding,C=l.textStyle;if(C.size=C.size||i.themeStyle.legendFontSize,C.fontFamily=C.fontFamily||i.themeStyle.fontFamily,C.fontWeight=C.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 F=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=G(i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(O.legendName):O.legendName,C);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 M=u[F-1].x+u[F-1].width+10+c;if(M+I+L.width>y){var N=(u[F-1].y>m[F-1].y+g/2?u[F-1].y:m[F-1].y+g/2)+10;N+T>v?(this.getPageChanged(),F=0,m=[],u=[],s=x,d=b):(s=m[0].x,d=N+T/2)}else s=M-c/2,d=m[F-1].y}else{var _=u[F-1].y>m[F-1].y+g/2?u[F-1].y:m[F-1].y+g/2;if(_+10+T>v){var E=u[F-1].x+this.textMaxWidth+10;E+I+L.width>y?(s=x,d=b,u=[],m=[],this.getPageChanged(),F=0):(s=E+c/2,d=m[0].y)}else s=m[F-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[F].x-c/2,y:m[F].y-g/2<p-L.height?m[F].y-g/2:p-L.height,width:Math.abs(m[F].x-c/2-(h+L.width)),height:g>L.height?g:L.height}}),F++}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 H=10,R=l.labelPosition,U=0,A=0,j=l.labelDisplayMode,V=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=G(J,C):"Trim"===j?Y=G(J=X("Horizontal"===f?B:z,J,C),C):J="",V=Math.max(V,Y.height),q=Math.max(q,Y.width),Y.width>0&&Y.height>0&&("Horizontal"===f?(h=x+B/2,p="After"===R?b+z+Y.height/2+H:b-H):(h="After"===R?x-Y.width/2-H:x+B+Y.width/2+H,p=b+z/2+Y.height/4)),0===w&&(U="Horizontal"===f?x:"After"===R?h-Y.width/2:x,A="Horizontal"===f?"After"===R?b:p-Y.height/2:b),w===P-1&&(y="Horizontal"===f?Math.abs(x+B-U):B+q+H,v="Horizontal"===f?z+V/2+H: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:U,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,o;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 n=ie(e).values,r=0;r<n.length;r++)if(n[r].Name===this.treemap.initialDrillDown.groupName){n[r].isDrilled=!n[r].isDrilled,e=n[r],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,l=this.treemap.palette.length>0?this.treemap.palette[r%this.treemap.palette.length]:n[r].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(r=0;r<a.length;r++){l=this.treemap.palette.length>0?this.treemap.palette[r%this.treemap.palette.length]:a[r].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])&&(o=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,o)||this.legendCollections.push({legendName:o,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(Fe),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,o,n,r,a,s,d,h,p,g,c,m,u,f,y,v,S,x,b=!1,I=this.treemap.leafItemSettings,C=this.treemap.levels,F=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,n=e[L].data,d=e[L].groupIndex,s=(a=0===this.treemap.levels.length||d===this.treemap.levels.length)?I.colorMapping:C[d].colorMapping;for(var T=0;T<s.length;T++){var M=s[T];if(p=null,o=Number(n[this.treemap.rangeColorValuePath]),h=n[this.treemap.equalColorValuePath],M.value=(0,t.isNullOrUndefined)(M.value)?M.value:M.value.toString(),!(0,t.isNullOrUndefined)(M.from)&&!(0,t.isNullOrUndefined)(M.to)&&o>=M.from&&o<=M.to&&M.showLegend?(b=!0,y=!0,m=M.from+" - "+M.to,r=(0,t.isNullOrUndefined)(M.label)?M.from+" - "+M.to:M.label,l=(0,t.isNullOrUndefined)(M.color)?l:M.color,i=this.isAddNewLegendData(m)):!(0,t.isNullOrUndefined)(M.value)&&h===M.value&&M.showLegend&&(b=!0,f=!0,m=M.value.toString(),r=(0,t.isNullOrUndefined)(M.label)?M.value.toString():M.label,l=(0,t.isNullOrUndefined)(M.color)?l:"[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,i=this.isAddNewLegendData(m)),b&&(0,t.isNullOrUndefined)(M.value)&&M.maxOpacity&&M.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var N=[];if(w=!0,"[object Array]"===Object.prototype.toString.call(M.color))for(var _=0;_<M.color.length;_++){var E={colorStop:(_*(100/(M.color.length-1))+"%").toString(),color:M.color[_]};N.push(E)}else{E={colorStop:"0%",color:l};var D={colorStop:"100%",color:l};N.push(E),N.push(D)}g="Top"===F||"Bottom"===F?"100%":"0%",c="Top"===F||"Bottom"===F?"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,N).childNodes[0],"[object Array]"!==Object.prototype.toString.call(M.color)&&(p.childNodes[0].setAttribute("stop-opacity",M.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",M.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}if(u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,r),i&&i.process&&b&&!u?(b=!1,l="[object Array]"===Object.prototype.toString.call(M.color)&&(0,t.isNullOrUndefined)(p)&&(0,t.isNullOrUndefined)(M.value)?this.legendGradientColor(M,O):l,this.legendCollections.push({actualValue:m,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:r,legendFill:l,legendData:[],groupIndex:a?-1:d,gradientElement:(0,t.isNullOrUndefined)(p)?(0,t.isNullOrUndefined)(M.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)(M.from)&&(0,t.isNullOrUndefined)(M.to)&&(0,t.isNullOrUndefined)(M.minOpacity)&&(0,t.isNullOrUndefined)(M.maxOpacity)&&(0,t.isNullOrUndefined)(M.value)&&!(0,t.isNullOrUndefined)(M.color)){v="[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,S=(0,t.isNullOrUndefined)(M.label)?"Others":M.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].actualValue===(M.label||"Others")){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,o=this.treemap.renderer,n=l.textStyle;if(this.legendGroup=o.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===l.mode)this.drawLegendItem(this.currentPage);else for(var r=0;r<this.legendRenderingCollections.length;r++){var a=this.treemap.element.id+"_Legend_Index_"+r,s=this.treemap.element.id+"_Legend_Index_"+r+"_Text",d=this.legendRenderingCollections[r];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,"",""),n,n.color||this.treemap.themeStyle.legendTextColor,this.legendGroup);var m=o.drawRectangle(g);m.setAttribute("tabindex",this.treemap.tabIndex.toString()),m.style.outline="",this.legendGroup.appendChild(m)}Oe(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,l){var o=e.Shape,n=e.Text,r=G(e.DisplayText,l.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),n.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+r.width+t)-Math.abs(this.legendBorderRect.x-n.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)-l.shapeHeight/2,n.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-n.y)),{shapeLocation:o,textLocation:n}},e.prototype.drawLegendItem=function(e){var i,l,o=this,n=this.treemap,r=10,a=n.legendSettings,s=new k(a.shapeWidth,a.shapeHeight),d=n.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:n.element.id+"_Legend_Index_"+h});y.setAttribute("aria-label",f+" Legend"),y.setAttribute("role","region"),y.setAttribute("tabindex",u.treemap.tabIndex.toString()),y.style.outline="none";var v=n.element.id+"_Legend_Shape_Index_"+h,S=n.element.id+"_Legend_Text_Index_"+h,b=m.Shape,I=m.Text;n.enableRtl&&(i=u.defaultLegendRtlLocation(m,r,n,a),b=i.shapeLocation,I=i.textLocation),l={cancel:!1,name:x,treemap:n,fill:m.Fill,shape:a.shape,imageUrl:a.imageUrl},n.trigger(x,l,(function(e){var t=new V(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||n.themeStyle.legendTextColor,y),o.legendGroup.appendChild(y)}))},u=this,f=0;f<this.totalPages[e].Collection.length;f++)m(f);var y=void 0,v=r;if(0!==this.page){var S=e+1+"/"+this.totalPages.length,b=a.textStyle,I=G(S,b),C=this.legendItemRect.x+this.legendItemRect.width-I.width-20-r,F=this.legendItemRect.x+this.legendItemRect.width,w=this.legendItemRect.y+this.legendItemRect.height+2.5+r,O=F-v-I.width/2-5;y=d.createGroup({id:n.element.id+"_Legend_Paging_Group"});var L=d.createGroup({id:n.element.id+"_Legend_Left_Paging_Group"}),T=d.createGroup({id:n.element.id+"_Legend_Right_Paging_Group"}),M=" M "+F+" "+w+" L "+(F-v)+" "+(w-5)+" L "+(F-v)+" "+(w+5)+" z ",N=" M "+C+" "+w+" L "+(C+v)+" "+(w-5)+" L "+(C+v)+" "+(w+5)+" z ",_=new V(n.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);L.appendChild(d.drawPath(_));var E=new j(n.element.id+"_Left_Page_Rect","transparent",{},1,new W(C-5,w-10,20,20),"");L.appendChild(d.drawRectangle(E)),this.wireEvents(L);var D=new V(n.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",M);T.appendChild(d.drawPath(D));var P=new j(n.element.id+"_Right_Page_Rect","transparent",{},1,new W(F-v,w-5,v,r),"");T.appendChild(d.drawRectangle(P)),this.wireEvents(T),y.appendChild(L),y.appendChild(T);var B={id:n.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,o=t.titleStyle,n=G(X(this.legendItemRect.width+20,i,o),o);this.legendBorderRect=new W(this.legendItemRect.x-l,this.legendItemRect.y-l-n.height,this.legendItemRect.width+20,this.legendItemRect.height+20+n.height+("Interactive"===t.mode?0:0!==this.page?l:0));var r={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,r,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,o=X(this.legendItemRect.width+20,l,i),n=G(o,i);if(l){var r=Q(new q(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-n.height/2-5,"middle",o,""),i,i.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);r.setAttribute("role","region"),r.setAttribute("aria-label",l)}},e.prototype.renderInteractivePointer=function(e){var i,l=this.treemap,o=e.target,n=l.element.id+"_Interactive_Legend",r=!1;o=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):o;var a=l.legendSettings;if(o.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(o.id.split("_Item_Index_")[1])];for(var u=l.svgObject.getBoundingClientRect(),f=0;f<this.legendCollections.length&&!r;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,n,c,y),r=!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,n,c,y),r=!0;break}}else 0===this.treemap.leafItemSettings.colorMapping.length&&this.treemap.palette&&i.levelOrderName.indexOf(s.levelOrderName)>-1&&(this.drawInteractivePointer(a,p,g,n,c,y),r=!0)}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,l,o,n){var r,a,s,d=10,h=10;r="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=n.x+n.width/2)+" "+(s=n.y+n.height)+" L "+(a-h)+" "+(s+d)+" L "+(a+h)+" "+(s+d)+" Z ":" M "+(a=n.x+n.width/2)+" "+(s=n.y)+" L "+(a-h)+" "+(s-d)+" L "+(a+h)+" "+(s-d)+" Z ":e.invertedPointer?" M "+(a=n.x)+" "+(s=n.y+n.height/2)+" L "+(a-h)+" "+(s-d)+" L "+(a-h)+" "+(s+d)+" z ":" M "+(a=n.x+n.width)+" "+(s=n.y+n.height/2)+" L "+(a+h)+" "+(s-d)+" L "+(a+h)+" "+(s+d)+" z ";var p=new V(l,t,o,i,1,"",r);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(p))},e.prototype.getLegendAlignment=function(e,i,l,o){var n,r,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"===o.position?g>c?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(m){case"Top":case"Bottom":a.height=h-l,n=g/2-i/2,r="Top"===m?d:d+a.height+10,a.y="Top"===m?d+l+10:d;break;case"Left":case"Right":a.width=p-i,n="Left"===m?s:s+a.width,r=c/2-l/2,a.x="Left"===m?s+i:s}switch(o.alignment){case"Near":"Top"===m||"Bottom"===m?n=a.x:r=a.y;break;case"Far":"Top"===m||"Bottom"===m?n=g-i:r=c-l}this.treemap.totalRect=a,this.translate=new J(n,r)}},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,o="http://www.w3.org/2000/svg";if(!(0,t.isNullOrUndefined)(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var n=this.treemap.renderer.createDefs(),r=document.createElementNS(o,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",d="Top"===a||"Bottom"===a?"0":"100";r.setAttribute("id","linear_"+i),r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2",s+"%"),r.setAttribute("y2",d+"%");for(var h=0;h<e.color.length;h++){var p=100/(e.color.length-1),g=document.createElementNS(o,"stop");g.setAttribute("offset",h*p+"%"),g.setAttribute("stop-color",e.color[h]),g.setAttribute("stop-opacity",1..toString()),r.appendChild(g)}n.appendChild(r),this.legendLinearGradient=r;var c="url(#linear_"+i+")";this.defsElement.appendChild(r),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 t=e.target;return this.highlightOnMouseMove(t)},e.prototype.highlightOnMouseMove=function(e){var i,l,o,n,r,a,s,d=this.treemap,h=e.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||this.legendHighlightCollection[0]&&this.legendHighlightCollection[0].ShapeCollection.Elements.length>1){r=document.getElementById(d.element.id+"_TreeMap_"+d.layoutType+"_Layout");var b=document.getElementsByClassName("treeMapSelection");o=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var I=void 0;if(this.treemap.legendSettings.visible){var C=this.treemap.treeMapLegendModule.legendCollections,F=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]):Ve(F,o,d),(0,t.isNullOrUndefined)(I)&&(Ae(this.legendHighlightCollection,d),Ae(this.shapeHighlightCollection,d),this.legendHighlightCollection=[],d.treeMapLegendModule.removeInteractivePointer()),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)if(u&&this.shapeElement.id===(u&&u.shapeElement?u.shapeElement.id:null))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:C[I].legendFill,oldOpacity:C[I].opacity,oldBorderColor:C[I].borderColor,oldBorderWidth:C[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,null,null),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.target="highlight"}s=le(o,[],c.mode,d);for(y=0;y<r.childElementCount;y++){a=r.childNodes[y],n=!0;var w=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,O=d.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];o=d.layout.renderItems[parseFloat(a.id.split("_Item_Index_")[1])];for(v=0;v<b.length;v++)if(a.id===b[v].id||a.id===b[v].parentElement.id){n=!1;break}s.indexOf(o.levelOrderName)>-1&&n&&((0,t.isNullOrUndefined)(w)||(o.data[w]===O.data[w]||"Item"!==c.mode&&d.levels.length>0))&&(m.push(a),p.push(o))}Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d);for(var L=0;L<m.length;L++)Te((a=m[L]).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 T=u&&u.legendSelectId?parseFloat(u.legendSelectId.split("Index_")[1]):u&&u.shapeSelectId?parseFloat(u.shapeSelectId.split("Index_")[1]):null,M="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&&M!==T){var N,_=void 0,E=void 0,D=(w=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,document.getElementById(h));"highlight"===this.shapeTarget&&(Ae(this.legendHighlightCollection,this.treemap),this.legendHighlightCollection=[]),this.shapeTarget="highlight";var P=this.treemap.treeMapLegendModule.legendCollections[M].legendData.length;for(C=this.treemap.treeMapLegendModule.legendCollections,y=0;y<P;y++)for(v=0;v<this.treemap.layout.renderItems.length;v++)if(!(0,t.isNullOrUndefined)(w)&&d.leafItemSettings.colorMapping.length>0&&0===d.levels.length?d.treeMapLegendModule.legendCollections[M].legendData[y].data[w]===d.layout.renderItems[v].data[w]:d.treeMapLegendModule.legendCollections[M].legendData[y].levelOrderName===d.layout.renderItems[v].levelOrderName){_=v,E=this.treemap.layout.renderItems[v].groupIndex;var B=document.getElementById(this.treemap.element.id+"_Level_Index_"+E+"_Item_Index_"+_+"_RectPath");0!==y&&0!==this.legendHighlightCollection.length||(this.legendHighlightCollection=[],Ge(this.legendHighlightCollection,M,v,D,B,this.treemap.layout.renderItems,C),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection={Elements:[]});var z=void 0;D.id.indexOf("Text")>-1?(z="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+M),We(D,c.fill,c.opacity,null,null),We(z,c.fill,c.opacity,c.border.color,c.border.width.toString())):(We("Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+M),c.fill,c.opacity,null,null),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString())),We(B,c.fill,c.opacity,c.border.color,c.border.width.toString()),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection.Elements.push(B)}if(0===P&&this.treemap.palette&&this.treemap.palette.length>0)for(v=0;v<this.treemap.layout.renderItems.length;v++)if((this.treemap.treeMapLegendModule.legendCollections[M].levelOrderName===this.treemap.layout.renderItems[v].levelOrderName||this.treemap.layout.renderItems[v].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[M].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&d.palette&&d.palette.length>0)||this.treemap.layout.renderItems[v].parent.isDrilled||M===v)){_=v,E=this.treemap.layout.renderItems[v].groupIndex;B=document.getElementById(this.treemap.element.id+"_Level_Index_"+E+"_Item_Index_"+_+"_RectPath");Ge(this.legendHighlightCollection,M,v,D,B,this.treemap.layout.renderItems,C),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection={Elements:[]};var H=void 0;D.id.indexOf("Text")>-1?(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+M),We(D,c.fill,c.opacity,null,null),We(H,c.fill,c.opacity,c.border.color,c.border.width.toString())):(We(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+M),c.fill,c.opacity,null,null),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString())),We(B,c.fill,c.opacity,c.border.color,c.border.width.toString()),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection.Elements.push(B)}}else Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d),Ae(this.legendHighlightCollection,d),this.legendHighlightCollection=[]}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 t=e.target;e.preventDefault(),this.selectionOnMouseDown(t)},e.prototype.selectionOnMouseDown=function(e){var i,l=this.treemap;e.setAttribute("tabindex","-1"),e.style.outline="none",e.id.includes("Legend_Shape_Index")||e.focus();var o,n,r,a,s=[],d=e.id,h=e.innerHTML,g=[],c=l.selectionSettings,m=this.treemap.treeMapHighlightModule,u=l.element.id+"_TreeMap_"+l.layoutType+"_Layout",f=(o=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])])&&!o.isLeafItem&&l.enableDrillDown&&(e.textContent.indexOf("[+]")>-1||e.textContent.indexOf("[-]")>-1||!(0,t.isNullOrUndefined)(e.nextElementSibling)&&(e.nextSibling.textContent.indexOf("[+]")>-1||e.nextSibling.textContent.indexOf("[-]")>-1));if(d.indexOf("_Item_Index")>-1&&!f)if(this.treemap.selectionId!==d&&(!l.selectionId||parseFloat(l.selectionId.split("_Item_Index_")[1])!==parseFloat(d.split("_Item_Index_")[1]))||this.legendSelectionCollection[0]&&this.legendSelectionCollection[0].ShapeCollection.Elements.length>1){l.levelSelection=[],l.legendId=[],this.shapeSelectId="",Ae(this.legendSelectionCollection,l),this.legendSelectionCollection=[],n=document.getElementById(u);var y=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var v=this.treemap.treeMapLegendModule.legendCollections.length,S=this.treemap.treeMapLegendModule.legendCollections;if(this.shapeElement=void 0,Ae(this.shapeSelectionCollection,l),m&&(m.shapeTarget="selection",m.shapeHighlightCollection=[]),y=!l.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0&&0===l.leafItemSettings.colorMapping.length&&0===l.levels.length?parseFloat(d.split("_Item_Index_")[1]):Ve(v,o,l),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y):document.getElementById(this.treemap.element.id+"_Legend_Index_"+y),null!==this.shapeElement)this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:S[y].legendFill,oldOpacity:S[y].opacity,oldBorderColor:S[y].borderColor,oldBorderWidth:S[y].borderWidth}),We(z="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y):document.getElementById(this.treemap.element.id+"_Legend_Index_"+y+"_Text"),c.fill,c.opacity,null,null),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.legendId.push(this.shapeElement.id),l.legendId.push(z.id)}a=le(o,[],c.mode,l);for(var x=0;x<n.childElementCount;x++){r=n.childNodes[x];var b=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])];o=l.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];var I=""!==l.rangeColorValuePath?l.rangeColorValuePath:null;a.indexOf(o.levelOrderName)>-1&&((0,t.isNullOrUndefined)(I)||(o.data[I]===b.data[I]||"Item"!==c.mode&&l.levels.length>0))&&(g.push(r),d.indexOf("_RectPath")>-1&&l.levelSelection.push(r.id),s.push(o))}Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId=d;for(var C=document.getElementsByClassName("treeMapHighLight"),F=0;F<g.length;F++){if(r=g[F],C.length>0)for(var w=0;w<C.length;w++)C[w].id===r.id&&C[w].classList.remove("treeMapHighLight"),Te(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");else Te(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");i={cancel:!1,name:p,treemap:l,items:s,elements:g,text:h,contentItemTemplate:h},l.trigger(p,i,(function(t){t.contentItemTemplate!==h&&$(d,e,t.contentItemTemplate)}))}}else Ae(this.legendSelectionCollection,l),Ae(this.shapeSelectionCollection,l),this.treemap.legendId=[],this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.levelSelection=[],this.legendSelectId="",(this.legendSelect||this.shapeSelect)&&(Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="");else if(d.indexOf("_Legend_Shape")>-1||d.indexOf("_Legend_Index")>-1||d.indexOf("_Legend_Text_")>-1){S=this.treemap.treeMapLegendModule.legendCollections;var O=(0,t.isNullOrUndefined)(this.legendSelectId)?null:parseFloat(this.legendSelectId.split("_Index_")[1]);if(this.treemap.legendSettings.visible&&O!==parseFloat(d.split("_Index_")[1])){var L,T=void 0,M=void 0;l.legendId=[],l.levelSelection=[],this.legendSelectId=d,this.legendSelect=!1;var N=isNaN(parseInt(d[d.length-1],10))?parseInt(d[d.length-6],10):parseInt(d[d.length-1],10),_=document.getElementById(d);Ae(this.legendSelectionCollection,l),Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),Ae(this.shapeSelectionCollection,l),this.legendSelectionCollection=[],m&&(m.shapeTarget="selection",m.legendHighlightCollection=[]);I=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,y="Default"===this.treemap.legendSettings.mode?-1===d.indexOf("Text")?parseFloat(d.split("_Legend_Shape_Index_")[1]):parseFloat(d.split("_Legend_Text_Index_")[1]):parseFloat(d.split("_Legend_Index_")[1]);var E=this.treemap.treeMapLegendModule.legendCollections[y].legendData.length;for(F=0;F<E;F++)for(var D=0;D<this.treemap.layout.renderItems.length;D++)if(!(0,t.isNullOrUndefined)(I)&&l.leafItemSettings.colorMapping.length>0&&0===l.levels.length?l.treeMapLegendModule.legendCollections[y].legendData[F].data[I]===l.layout.renderItems[D].data[I]:this.treemap.treeMapLegendModule.legendCollections[y].legendData[F].levelOrderName===this.treemap.layout.renderItems[D].levelOrderName){T=D,M=this.treemap.layout.renderItems[D].groupIndex;var P=document.getElementById(this.treemap.element.id+"_Level_Index_"+M+"_Item_Index_"+T+"_RectPath");this.treemap.selectionId=P.id,0!==F&&0!==this.legendSelectionCollection.length||(Ge(this.legendSelectionCollection,N,D,_,P,this.treemap.layout.renderItems,S),L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection={Elements:[]}),this.treemap.selectionId=P.id;var B=void 0,z=void 0;_.id.indexOf("Text")>-1?(We(B="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y),c.fill,c.opacity,c.border.color,c.border.width.toString()),We(_,c.fill,c.opacity,null,null),this.legendSelectId=B.id,this.shapeElement=B,l.legendId.push(_.id),l.legendId.push(B.id)):(We(z="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y),c.fill,c.opacity,null,null),We(_,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.shapeElement=_,l.legendId.push(_.id),l.legendId.push(z.id)),We(P,c.fill,c.opacity,c.border.color,c.border.width.toString()),L=this.legendSelectionCollection.length,l.levelSelection.push(P.id),this.legendSelectionCollection[L-1].ShapeCollection.Elements.push(P)}if(0===E&&this.treemap.palette&&this.treemap.palette.length>0)for(w=0;w<this.treemap.layout.renderItems.length;w++)if((this.treemap.treeMapLegendModule.legendCollections[y].levelOrderName===this.treemap.layout.renderItems[w].levelOrderName||this.treemap.layout.renderItems[w].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[y].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0)||this.treemap.layout.renderItems[w].parent.isDrilled||y===w)){T=w,M=this.treemap.layout.renderItems[w].groupIndex;P=document.getElementById(this.treemap.element.id+"_Level_Index_"+M+"_Item_Index_"+T+"_RectPath");Ge(this.legendSelectionCollection,y,w,_,P,this.treemap.layout.renderItems,S),this.treemap.selectionId=P.id,L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection={Elements:[]};var H=void 0;_.id.indexOf("Text")>-1?(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y),We(_,c.fill,c.opacity,null,null),We(H,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=H.id,this.shapeElement=H):(We(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y),c.fill,c.opacity,null,null),We(_,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=d,this.shapeElement=_),We(P,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.levelSelection.push(P.id),-1===l.legendId.indexOf(H.id)&&l.legendId.push(H.id),-1===l.legendId.indexOf(_.id)&&l.legendId.push(_.id),L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection.Elements.push(P)}}else Ae(this.legendSelectionCollection,this.treemap),Ae(this.shapeSelectionCollection,this.treemap),this.legendSelectionCollection=[],m&&(m.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.shapeElement=null,this.shapeSelectId="",(this.legendSelect||this.shapeSelect)&&(Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="")}else f&&(Ae(this.legendSelectionCollection,this.treemap),this.legendSelectionCollection=[],this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.treemap.selectionId="",this.shapeElement=null)},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 o=this.treemap.selectionSettings,n=[],r=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,[],o.mode,this.treemap),g=0;g<h.childElementCount;g++)r=h.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(n.push(r),this.treemap.levelSelection.push(r.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=Ve(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,o.fill,o.opacity,o.border.color,o.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<n.length;v++)if(r=n[v],y.length>0)for(var S=0;S<y.length;S++)y[S].id===r.id&&y[S].classList.remove("treeMapHighLight"),Te(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(r.id.split("Item_Index_")[1],10)].options.fill:o.fill,Te(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.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 o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&(i[l[o]]=e[l[o]])}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,o,n,r,a,s=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(n=e).changedTouches[0].pageX,l=n.changedTouches[0].pageY,o=n.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,l=e.pageY,o=e.target);var d,h,p,g=o.id,m={},u={},f=[];if(g.indexOf("_Item_Index")>-1&&-1===e.type.indexOf("key")){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:Me(this.tooltipSettings.format,u,this.treemap))||Ne(a,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Me(this.tooltipSettings.format,u,this.treemap))||this.treemap.weightValuePath.toString()+" : "+Ne(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]);r={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:o,eventArgs:e},this.treemap.trigger(c,r,(function(e){s.addTooltip(r,p,d)}))}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,l,o,n){var r,a;(0,t.isNullOrUndefined)(e)?(r=n.cancel,a=n):(r=e.cancel,a=dt(e,["cancel"]).options);r?(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(o),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(){(0,t.isNullOrUndefined)(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,Xe(this.treemap.element.id+"_TreeMapTooltip")),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 o={766:t=>{t.exports=e},74:e=>{e.exports=i},461:e=>{e.exports=l},727:e=>{e.exports=t}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{Border:()=>O,ColorMapping:()=>E,ColorValue:()=>_e,CommonTitleSettings:()=>M,Font:()=>T,HighlightSettings:()=>R,ImageExport:()=>Ke,InitialDrillSettings:()=>P,LayoutPanel:()=>Ye,LeafItemSettings:()=>B,LegendSettings:()=>D,LevelSettings:()=>U,LevelsData:()=>nt,Location:()=>J,Margin:()=>L,PathOption:()=>V,PdfExport:()=>tt,Print:()=>$e,Rect:()=>W,RectOption:()=>j,SelectionSettings:()=>H,Size:()=>k,SubTitleSettings:()=>N,TextOption:()=>q,Theme:()=>Je,TitleSettings:()=>_,TooltipSettings:()=>z,TreeMap:()=>ot,TreeMapAjax:()=>Ue,TreeMapHighlight:()=>at,TreeMapLegend:()=>rt,TreeMapSelection:()=>st,TreeMapTooltip:()=>ht,applyOptions:()=>Te,beforePrint:()=>n,click:()=>f,colorCollections:()=>ue,colorMap:()=>ce,colorNameToHex:()=>Be,componentToHex:()=>De,convertElement:()=>ne,convertHexToColor:()=>Pe,convertToContainer:()=>he,convertToHexCode:()=>Ee,convertToRect:()=>pe,createTextStyle:()=>Z,deSaturationColor:()=>me,defaultFont:()=>C,doubleClick:()=>y,drawSymbol:()=>ze,drillEnd:()=>h,drillStart:()=>d,findChildren:()=>ie,findHightLightItems:()=>le,findLabelLocation:()=>re,findPosition:()=>Y,formatValue:()=>Ne,getArea:()=>se,getColorByValue:()=>ye,getElement:()=>K,getGradientColor:()=>ve,getLegendIndex:()=>Ve,getMousePosition:()=>ge,getPercentage:()=>xe,getPercentageColor:()=>Se,getShortestEdge:()=>de,getTemplateFunction:()=>oe,getThemeStyle:()=>Qe,hide:()=>Ce,isContainsData:()=>te,isParentItem:()=>Re,itemClick:()=>m,itemHighlight:()=>g,itemMove:()=>u,itemRendering:()=>s,itemSelected:()=>p,itemsToOrder:()=>ee,legendItemRendering:()=>x,legendMaintain:()=>Oe,legendRendering:()=>b,load:()=>l,loaded:()=>o,maintainSelection:()=>we,measureElement:()=>ae,measureText:()=>G,mouseMove:()=>S,orderByArea:()=>Fe,pushCollection:()=>Ge,removeClassNames:()=>Le,removeElement:()=>Xe,removeLegend:()=>Ae,removeSelectionWithHighlight:()=>je,removeShape:()=>ke,renderLegendShape:()=>He,renderTextElement:()=>Q,resize:()=>I,rgbToHex:()=>fe,rightClick:()=>v,setColor:()=>We,setItemTemplateContent:()=>$,stringToNumber:()=>A,textFormatter:()=>Me,textTrim:()=>X,textWrap:()=>Ie,tooltipRendering:()=>c,triggerDownload:()=>qe,wordWrap:()=>be});var e,t=r(766),i=r(727),l="load",o="loaded",n="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",C="Roboto, Segoe UI, Noto, Sans-serif",F=(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 o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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 F(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 F(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)(C)],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),M=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)("")],i.prototype,"text",void 0),w([(0,t.Property)("")],i.prototype,"description",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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}(M),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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)({},N)],i.prototype,"subtitleSettings",void 0),i}(M),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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 F(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)({},M)],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 F(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 F(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)([],E)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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),H=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(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)([],E)],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,o,n){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=n},V=function(e,t,i,l,o,n,r){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=r};function G(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,o,n,r,a){void 0===n&&(n=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=n,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a};function X(e,t,i){var l=t,o=G(t,i).width;if(o>e)for(var n=t.length-1;n>=0;--n)if((o=G(l=t.substring(0,n)+"...",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 o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}var n="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new J(o,n)}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,o,n,r){void 0===r&&(r=!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:o},p="string"==typeof e.text?e.text:r?e.text[e.text.length-1]:e.text[0],g=new i.SvgRenderer("");if(!(0,t.isNullOrUndefined)(p)&&!(0,t.isNullOrUndefined)(e.connectorText)&&p.includes(e.connectorText[1]))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=G(u,l);h.x=0!==m?h.x+f.width:h.x+f.width+5,n.appendChild(d)}else d=Z(g,h,p),n.appendChild(d);if("string"!=typeof e.text&&e.text.length>1){for(var y=1,v=e.text.length;y<v;y++)s=G(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);n.appendChild(d)}return d}function $(e,i,l){var o,n=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+n+"_LabelTemplate"),(0,t.isNullOrUndefined)(o)||(o.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 o=!1,n="",r=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:r.labelPath?r.labelPath:l.weightValuePath]||"undefined";if(e[a]===s&&(n+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}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 o=ie(e).values;if(o&&o.length>0){for(var n=0;n<o.length;n++)-1===t.indexOf(o[n].levelOrderName)&&t.push(o[n].levelOrderName);for(var r=0;r<o.length;r++)le(o[r],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(n=0;n<l.layout.renderItems.length;n++)(s=l.layout.renderItems[n]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function oe(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 ne(e,i,l){var o=(0,t.createElement)("div",{id:i});o.style.cssText="position: absolute;pointer-events: auto;";for(var n=e.length;n>0;)o.appendChild(e[0]),n--;for(var r=o.innerHTML,a=Object.keys(l),s=0;s<a.length;s++){var d=RegExp;r=r.replace(new d("{{:"+a[s]+"}}","g"),l[a[s].toString()])}return o.innerHTML=r,o}function re(e,t,i,l,o){var n=new J(0,0),r="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return n.x=Math.abs(r-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?n.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)):n.y=Math.abs(e.y+e.height-i.height+5),n}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(),o=i.ownerDocument.defaultView.pageXOffset,n=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=l.left+o-a,d=l.top+n-r;return new J(e-s,t-d)}function ce(e,i,l){var o,n,r=[];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),o="[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,o="[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)&&o&&(n=me(e[a],l)),(""===o||(0,t.isNullOrUndefined)(o))&&(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)&&(o="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),n=(0,t.isNullOrUndefined)(n)?"1":n,r.push(o)}for(var h=r.length-1;h>=0;h--)h=(o=r[h])?-1:h;return{fill:o,opacity:n}}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,o=t.from,n=t.to,r=0,a=n-o;if(r=(e-o)/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:o+g*s,color:t.color[g]},h.push(p);for(var c=0;c<h.length;c++)o<=e&&e<=h[c].b&&0===c?(l="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s):h[c].b<=e&&e<=n&&c===h.length-1&&(i="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=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),r=Math.abs(e-h[c+1].b)/s)}return Se(r,i,l)}function Se(e,t,i){var l=i.split("#")[1],o=t.split("#")[1],n=xe(e,parseInt(o.substr(0,2),16),parseInt(l.substr(0,2),16)),r=xe(e,parseInt(o.substr(2,2),16),parseInt(l.substr(2,2),16)),a=xe(e,parseInt(o.substr(4,2),16),parseInt(l.substr(4,2),16));return new _e(n,r,a)}function xe(e,t,i){var l=i-t;return Math.round(t+l*e)}function be(e,t,i){for(var l,o=t.split(" "),n="",r=[],a=0,s=o.length;a<s;a++)l=o[a],G(n.concat(l),i).width<e?n=n.concat((""===n?"":" ")+l):""!==n?(r.push(X(e,n,i)),n=l):(r.push(X(e,l,i)),l=""),n&&a===s-1&&r.push(X(e,n,i));return r}function Ie(e,t,i){var l=[],o=0,n=G(t,i).width,r=t.length;if(e>=n)return l.push(t),l;for(var a=t.length;a>o;a--){var s=t.slice(o,a);if((n=G(s,i).width)<=e){if(l.push(s),r===(o+=s.length))return l;a=r+1}}return l}function Ce(e,t,i,l){var o=G(i,l);return o.width>e||o.height>t?" ":i}function Fe(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 o=0;o<l.length;o++)t.getAttribute("id")===l[o]||t.children[0].id===l[o]?t.childElementCount>0&&-1===t.children[0].id.indexOf("_Group")&&(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 o=0;o<l.length;o++)if("Interactive"===e.legendSettings.mode){for(var n=0;n<i.childElementCount;n++)if(i.childNodes[n].id===l[o]||parseFloat(i.childNodes[n].id.split("Index_")[1])===parseFloat(l[o].split("Index_")[1])){var r=i.childNodes[n];r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),r.setAttribute("stroke",e.selectionSettings.border.color)):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null))}}else{var a=document.getElementById(l[o]);(0,t.isNullOrUndefined)(a)||(a.setAttribute("fill",e.selectionSettings.fill),a.setAttribute("opacity",e.selectionSettings.opacity),-1===a.id.indexOf("Text")?(a.setAttribute("stroke",e.selectionSettings.border.color),a.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(a.setAttribute("stroke",null),a.setAttribute("stroke-width",null)))}}function Le(e,i,l){for(var o,n={},r=0;r<e.length;r++)o=(0,t.isNullOrUndefined)(e[r].childNodes[0])?e[r]:e[r].childNodes[0],n=l.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options,Te(o,n),e[r].classList.remove(i),r-=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 Me(e,i,l){if((0,t.isNullOrUndefined)(e))return null;for(var o=0,n=Object.keys(i);o<n.length;o++){var r=n[o];e=e.split("${"+r+"}").join(Ne(i[r],l).toString())}return e}function Ne(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 Ee(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 Ee(new _e(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function ze(e,t,l,o,n){var r=new i.SvgRenderer(""),a=He(e,l,t,n,o);return r["draw"+a.functionName](a.renderOption)}function He(e,i,l,o,n){var r,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)(o,{rx:s/2,ry:d/2,cx:h,cy:p});break;case"VerticalLine":r="M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Diamond":r="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)(o,{d:r});break;case"Rectangle":r="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)(o,{d:r});break;case"Triangle":r="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)(o,{d:r});break;case"InvertedTriangle":r="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)(o,{d:r});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)),r=0===f?"M "+(h+m)+" "+(p+u)+" ":r.concat("L "+(h+m)+" "+(p+u)+" ");r=r.concat("Z"),(0,t.merge)(o,{d:r});break;case"Star":r="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)(o,{d:r});break;case"Cross":r="M "+g+" "+p+" L "+(h+s/2)+" "+p+" M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Image":a="Image",(0,t.merge)(o,{href:n,height:d,width:s,x:g,y:c})}return{renderOption:o,functionName:a}}function Re(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}var Ue=function(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o};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 o=e[l],n=parseFloat(o.legendEle.id.split("_Index_")[1]),r=o.legendEle.id.indexOf("Text")>-1?o.legendEle.id.replace("_Text",""):o.legendEle.id,a="Interactive"===i.legendSettings.mode?document.getElementById(r):document.getElementById(i.element.id+"_Legend_Shape_Index_"+n),s="Interactive"===i.legendSettings.mode?document.getElementById(r+"_Text"):document.getElementById(i.element.id+"_Legend_Text_Index_"+n);(0,t.isNullOrUndefined)(a)||We(a,o.oldFill,o.oldOpacity,"none","0px"),(0,t.isNullOrUndefined)(s)||We(s,i.legendSettings.textStyle.color||i.themeStyle.legendTextColor,o.oldOpacity,null,null);for(var d=(0,t.isNullOrUndefined)(o.ShapeCollection)?0:o.ShapeCollection.Elements.length,h=0;h<d;h++){var p=document.getElementById(o.ShapeCollection.Elements[h].id);(0,t.isNullOrUndefined)(p)||We(p,o.shapeOldFill,o.shapeOldOpacity,o.shapeOldBorderColor,o.shapeOldBorderWidth)}}}function We(e,i,l,o,n){e.setAttribute("fill",i),e.setAttribute("opacity",l),(0,t.isNullOrUndefined)(o)||e.setAttribute("stroke",o),(0,t.isNullOrUndefined)(n)||e.setAttribute("stroke-width",n)}function je(e,t,i){Ae(e,i),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ve(e,i,l){for(var o,n=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,r=!1,a=0;a<e&&!r;a++){var s=l.treeMapLegendModule.legendCollections[a].legendData.length;if(s>0){for(var d=0;d<s;d++)if(!(0,t.isNullOrUndefined)(n)&&l.leafItemSettings.colorMapping.length>0?l.treeMapLegendModule.legendCollections[a].legendData[d].data[n]===i.data[n]:l.treeMapLegendModule.legendCollections[a].legendData[d].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].legendName)>-1){o=a,r=!0;break}}else if(l.palette&&l.palette.length>0&&(l.treeMapLegendModule.legendCollections[a].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].levelOrderName)>-1)&&l.treeMapLegendModule.legendCollections[a].legendName===i.name){o=a;break}}return o}function Ge(e,t,i,l,o,n,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:o,shapeOldFill:n[i].options.fill,shapeOldOpacity:n[i].options.opacity,shapeOldBorderColor:n[i].options.border.color,shapeOldBorderWidth:n[i].options.border.width})}function qe(e,i,l,o){(0,t.createElement)("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:l}}).dispatchEvent(new MouseEvent(o?"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,o=this.treemap.drilledItems[l].data,n={};n[this.treemap.drilledItems[l].data.groupName]=[o],(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[l].data.groupIndex),this.calculateLayoutItems(n||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=ie(e).values;if(o&&o.length>0&&0===t.length){for(var n=0;n<o.length;n++)o[n].groupIndex===i.initialDrillDown.groupIndex&&o[n].name===i.initialDrillDown.groupName&&(o[n].isDrilled=!0,l[o[n].groupName]=[o[n]],t.push(l));for(var r=0;r<o.length;r++)this.getDrilldownData(o[r],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,o,n,r=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,o=0===a.length||l===a.length?r.gap:a[l].groupGap,n=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+o/2,i.y+(n+o/2),i.width-o,Math.abs(i.height-(o+n))),this.computeSliceAndDiceDimensional(s[d],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var l,o=i.height*i.width,n=this.treemap.levels,r=0,a=0;e.forEach(function(e){a+=e.weight}),e.forEach(function(e){e.weightArea=o*e.weight/a});var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(ee);for(var d=0;d<e.length;d++){var h=e[d];h.isLeafItem=0===n.length||(this.treemap.isHierarchicalData||(0,t.isNullOrUndefined)(this.treemap.leafItemSettings.labelPath)?h.groupIndex===n.length-1:h.groupIndex===this.treemap.levels.length),s?(l=o/a*e[d].weight/i.height,r<=i.width&&(e[d].rect=new W(r+i.x,i.y,l,i.height))):(l=o/a*e[d].weight/i.width,r<=i.height&&(e[d].rect=new W(i.x,r+i.y,i.width,l))),r+=l,this.renderItems.push(e[d])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,n,r,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++)o=(l=d[h]).groupIndex,i=l.rect,n=(l.isLeafItem?a.padding:s[o].groupPadding)/2,r=this.treemap.isHierarchicalData?0===o&&l.isLeafItem?0:s[o]&&s[o].showHeader?s[o].headerHeight:0:0===s.length?0:s[o]&&s[o].showHeader?s[o].headerHeight:0,i=new W(i.x+n,i.y+(r+n),i.width-n,i.height-n),!l.isLeafItem&&l.weight>0&&this.computeSquarifyDimensional(d[h],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,se(i)),t.sort(Fe),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o){var n=this.getCoordinates(t,i);return m=l.concat(n)}var r=de(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,r)){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=(n=this.getCoordinates(t,i),l.concat(n));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,o=-1/0,n=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),a>o&&(o=a),n+=a}return Math.max(Math.pow(t,2)*o/Math.pow(n,2),Math.pow(n,2)/(Math.pow(t,2)*l))},e.prototype.cutArea=function(e,t){var i=he(e),l=i.width,o=i.height,n=i.x,r=i.y;if(l>=o){var a=t/o;return pe({x:n+a,y:r,width:l-a,height:o})}var s=t/l;return pe({x:n,y:r+s,width:l,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var l,o=he(i),n=o.width,r=o.height,a=o.x,s=o.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/r,v=g/n,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=Re(this.parentData[0],I))?this.treemap.areaRect:I.parent.rect,m=I.isLeafItem?p.padding:h[l].groupPadding,n>=r){var C=x+I.itemArea/y;I.rect={x:S,y:x,width:S+y,height:C},x=C}else{var F=S+I.itemArea/v;I.rect={x:S,y:x,width:F,height:x+v},S=F}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=[],o=0;o<i;o+=1){for(var n=e.length,r=0,a=0;a<n;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<n;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 o={};(0,t.isNullOrUndefined)(i.groupName)?o=i:o[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 n=this.treemap.levels.length,r=0;r<n;r++){n===e[0].groupIndex?this.treemap.levels[n]=this.treemap.levels[r]:this.treemap.levels.splice(n-1,1)}this.calculateLayoutItems(o,l),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,l,o,n,r=this,a=this.treemap;this.renderer=a.renderer;var d,h,p,g,c,m,u,f,y,v,S,x,b,I,C,F=a.element.id,w=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",T=document.getElementById(a.element.id+"_Secondary_Element"),M=a.levels;this.layoutGroup=this.renderer.createGroup({id:F+"_TreeMap_"+w+"_Layout"});var N=(0,t.createElement)("div",{id:a.element.id+"_Label_Template_Group",className:"template"});N.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 _,E,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=F+"_Level_Index_"+d+"_Item_Index_"+w,b=z.renderer.createGroup({id:y+"_Group"}),S=(D?P.gap:M[d].groupGap)/2;var B,H=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=H.x+H.width-p.width-Math.abs(H.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=H.y+H.height-p.height-Math.abs(H.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=H.x+H.width-p.width-Math.abs(H.x-p.x),p.y=H.y+H.height-p.height-Math.abs(H.y-p.y)),l=z.getItemColor(D,m),c=l.fill,f=l.opacity,g=D?P.labelFormat:M[d].headerFormat,i=D?P.showLabels:M[d].showHeader,d===z.treemap.currentLevel)if(z.treemap.enableBreadcrumb){E="#"+z.treemap.breadcrumbConnector+"#",B=m.levelOrderName.replace(/#/gi,E),B=0!==d?"#"+B:B}else B=m.name;else z.treemap.enableBreadcrumb&&(m.isDrilled=!1),B=m.name;u=Me(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 R=D?P.labelStyle.fontFamily:M[d].headerStyle.fontFamily;R=R||z.treemap.themeStyle.labelFontFamily;var U=D?P.labelStyle.size:M[d].headerStyle.size;U=U||z.treemap.themeStyle.labelFontSize;var k=D?P.labelStyle.fontWeight:M[d].headerStyle.fontWeight;k=k||z.treemap.themeStyle.fontWeight;var A=D?P.labelStyle.color:M[d].headerStyle.color,W=D?P.labelStyle.fontStyle:M[d].headerStyle.fontStyle,j=D?P.labelStyle.opacity:M[d].headerStyle.opacity;x={fontFamily:R,size:U,fontWeight:k,color:A,fontStyle:W,opacity:j},C=D?P.border:M[d].border,e=D?P.labelPosition:"Near"===M[d].headerAlignment?"TopLeft":"Center"===M[d].headerAlignment?"TopCenter":"TopRight",h=D?P.templatePosition:M[d].templatePosition,I=D?P.labelTemplate:M[d].headerTemplate,m.options={border:C,opacity:f,fill:c},o={cancel:!1,name:s,treemap:z.treemap,text:u,currentItem:m,RenderItems:z.renderItems,options:m.options,textColor:x.color},z.treemap.trigger(s,o,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",n=new V(y+"_RectPath",c,C.width,C.color,f,null,L);var a=r.renderer.drawPath(n);b.appendChild(a),i&&(o.text!==u&&(o.text=Me(o.text,m.data,r.treemap)||B),x.color=o.textColor?o.textColor:x.color,r.renderItemText(o.text.toString(),b,x,p,O,y,c,e,E)),I&&(v=r.renderTemplate(T,y,p,h,I,m,D),(0,t.isNullOrUndefined)(v)||(N.appendChild(v),r.treemap.renderReactTemplates())),b.setAttribute("aria-label",m.name),r.treemap.enableDrillDown&&!D||r.treemap.selectionSettings.enable||r.treemap.highlightSettings.enable?(b.setAttribute("role","button"),b.setAttribute("tabindex",r.treemap.tabIndex.toString()),b.style.outline="none",b.style.cursor=r.treemap.highlightSettings.enable&&!r.treemap.selectionSettings.enable&&r.treemap.enableDrillDown&&m.groupIndex===r.treemap.levels.length-1?"default":!r.treemap.highlightSettings.enable||r.treemap.selectionSettings.enable||r.treemap.enableDrillDown?"pointer":"default"):b.setAttribute("role","region"),we(r.treemap,b,"treeMapSelection"),r.layoutGroup.appendChild(b)}})},z=this,H=0;H<this.renderItems.length;H++)B(H);N.childNodes.length>0&&T.appendChild(N),this.treemap.svgObject.appendChild(this.layoutGroup),we(this.treemap,this.layoutGroup,"treeMapSelection")},e.prototype.renderItemText=function(e,i,l,o,n,r,a,s,d){var h,p,g,c,m=[],u=0;if(p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(o,e,l,n),h=G(p&&p[0]||g[0],l),this.treemap.enableRtl){var f=G(e,l),y=e.search("[+]")||e.search("[-]");if(o.width<f.width&&y>0){var v=e.substring(y-1,e.length),S=G("[+]",l);g[0]=X(o.width-S.width-5,g[0],l)+v}}var x=re(o,s,h,"Text",this.treemap);if(!(0,t.isNullOrUndefined)(p)){for(var b=[],I=null,C=[],F=0;F<p.length;F++)u+=(h=G(I=X(o.width-5,p[F],l),l)).height,C.push(h.width),b.push(I);g=b,h.width=Math.max.apply(null,C),h.height=u}if("WrapByWord"===n||"Wrap"===n||"Trim"===n){for(var w=0;w<g.length;w++)u+=(h=G(g[w],l)).height,o.height-5>u&&m.push(g[w]);if("Wrap"===n&&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(r+"_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,o=e?l.leafItemSettings.fill:l.levels[i.groupIndex].fill,n=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 r=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)||(o=(0,t.isNullOrUndefined)(s.fill)?l.leafItemSettings.fill:s.fill,n=s.opacity)}else for(var d=0;d<r.length;d++)r[d].levelOrderName===i.levelOrderName.split("#")[0]&&(o=(0,t.isNullOrUndefined)(o)?(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:r[d].data[l.colorValuePath]:o);return{fill:o,opacity:n}},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,o,n,r,a){var s,d=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if((0,t.isNullOrUndefined)(n.prototype)&&"string"==typeof n)for(var p=Object.keys(r.data),g=0;g<p.length;g++){var c=RegExp;n=n.replace(new c("{{:"+p[g]+"}}","g"),r.data[p[g].toString()])}if(this.treemap.enableHtmlSanitizer&&"string"==typeof n&&(n=t.SanitizeHtmlHelper.sanitize(n)),!(0,t.isNullOrUndefined)(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=re(l,o,ae(s=ne(oe(n)(r.data,this.treemap,n,this.treemap.element.id+h,!1),d,r.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 o,n=e.width-10;switch(l){case"Hide":o=[Ce(n,e.height,t,i)];break;case"Trim":o=[X(n+3,t,i)];break;case"WrapByWord":o=be(n,t,i);break;case"Wrap":o=Ie(n,t,i)}return o},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}(),Ze=r(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:C,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:C,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:C,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 o={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:n};e.trigger(n,o,function(){o.cancel||(0,t.print)(o.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 o=e.element.cloneNode(!0),n=o.getElementsByTagName("svg")[0];if(!(0,t.isNullOrUndefined)(n)&&(n=n.childNodes[0],!(0,t.isNullOrUndefined)(n))){var r=n.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)"!==r&&"transparent"!==r?"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)"!==r&&"transparent"!==r||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)")}l.appendChild(o)}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,o){return new Promise(function(n,r){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)o?qe(l,i,c,p):n(null);else{var m=new Image,u=a.getContext("2d");m.onload=function(){u.drawImage(m,0,0),window.URL.revokeObjectURL(c),o?qe(l,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?n(a.toDataURL("image/jpeg")):"PNG"===i&&n(a.toDataURL("image/png"))},m.src=c}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),et=r(461),tt=function(){function e(e){}return e.prototype.export=function(e,i,l,o,n){return new Promise(function(i,r){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});o=(0,t.isNullOrUndefined)(o)?et.PdfPageOrientation.Landscape:o;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,r=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=o,r=r.slice(r.indexOf(",")+1),t.pages.add().graphics.drawImage(new et.PdfBitmap(r),0,0,e.availableSize.width-60,e.availableSize.height),n?(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 o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ot=function(e){function n(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(n,e),n.prototype.preRender=function(){var e=this;this.trigger(l,{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},n.prototype.render=function(){this.renderElements()},n.prototype.renderElements=function(){this.treemapLevelData=new nt,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()},n.prototype.processDataManager=function(){var e,i,l,o,n=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){n.dataSource=e.result,n.renderTreeMapElements()})):this.dataSource instanceof Ue?(o=this.dataSource,(l=new t.Fetch(o.dataOptions,o.type,o.contentType)).onSuccess=function(e){if((0,t.isNullOrUndefined)(e.type)||"application/octet-stream"!==e.type)n.dataSource=e,n.renderTreeMapElements();else{var i=new FileReader,l=n;i.onload=function(){e=JSON.parse(i.result.toString()),l.dataSource=e,l.renderTreeMapElements()},i.readAsText(e)}},l.send(o.sendData)):this.renderTreeMapElements()},n.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(o,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},n.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})},n.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)},n.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)}},n.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)},n.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)},n.prototype.renderTitle=function(e,i,l,o){var n,r={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(r.fontFamily=r.fontFamily||this.themeStyle.fontFamily,r.fontWeight=r.fontWeight||this.themeStyle.titleFontWeight,r.size=r.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){(0,t.isNullOrUndefined)(o)&&(o=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text,d=X(a,s,r),h=G(d,r),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,r,r.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);m.setAttribute("aria-label",e.description||s),m.setAttribute("role","region"),m.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(n=this.availableSize.height-c.y-10-this.margin.bottom,this.areaRect=new W(this.margin.left,c.y+10,a,n)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",c,o):this.svgObject.appendChild(o)}else n=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new W(this.margin.left,this.margin.top,a,n)},n.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 o=0;o<this.dataSource.length;o++){var n=ie(this.dataSource[o]).values;this.isHierarchicalData&&n&&n.length>0?n.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[o][e]&&l[e].push({groupIndex:0,name:this.dataSource[o][e],levelOrderName:this.dataSource[o][e].toString(),data:this.dataSource[o],weight:this.dataSource[o][this.weightValuePath]})}this.treemapLevelData.levelsData.push(l)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=(0,t.extend)([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(o=0;o<this.treemapLevelData.hierarchyData.length;o++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[o],o);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][e],"Parent")}},n.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)}},n.prototype.processHierarchicalData=function(e,i){var l,o,n,r=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if((l=(a=ie(e))?a.values:null)&&l.length>0){n=a.key;for(var d=0;d<this.levels.length;d++)n===this.levels[d].groupPath&&(o=d);for(var h=0;h<l.length;h++){l[h].name=l[h][s],l[h].levelOrderName=(0===o?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)(o)?g===this.levels.length?this.levels.length:g:o,0!==o&&(l[h].parent=e),l[h].groupName=n,l[h].data=l[h],l[h].isDrilled=!1,l[h].weight=l[h][this.weightValuePath]}l.forEach(function(e){r.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}}},n.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},n.prototype.export=function(e,i,l,o){var n=this;return(0,t.isNullOrUndefined)(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,r){t(n.pdfExportModule.export(n,e,i,l,o))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,l){t(n.imageExportModule.export(n,e,i,o))}):null},n.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 o={};o.level=l,o[e]=[],this.treemapLevelData.levelsData.push(o);for(var n=0;n<this.dataSource.length;n++){var r={},a="";if(!(0,t.isNullOrUndefined)(e)){var s=this.dataSource[n][e];if(0!==l)for(var d=0;d<=l;d++){var h=this.levels[d]?this.levels[d].groupPath:e;a+=this.dataSource[n][h]+(d===l?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(r.name=s,r.levelOrderName=(a||s)+"",r.groupIndex=l,r.isDrilled=!1,r.groupName=e,r.data=this.dataSource[n],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(r),i.push(a||s))}}}},n.prototype.reOrderLevelData=function(e){for(var i,l=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,n=this.treemapLevelData.levelsData[e][l],r=this.treemapLevelData.levelsData[e-1][o],a=0;a<n.length;a++){i=n[a].levelOrderName;for(var s=0;s<r.length;s++)if(r[s][l]=(0,t.isNullOrUndefined)(r[s][l])?[]:r[s][l],this.IsChildHierarchy(i.split("#"),r[s].levelOrderName.split("#"))){(0,t.isNullOrUndefined)(n[a].parent)&&(n[a].parent=r[s]),r[s][l].push(n[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)},n.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},n.prototype.findTotalWeight=function(e,t){for(var i,l,o,n=this,r={},a=function(a){i=0,o=e[a].groupName,l=e[a].levelOrderName.split("#"),s.dataSource.forEach(function(t){te(l,e[a].levelOrderName,t,n)&&(i+=parseFloat(t[n.weightValuePath]))}),"Parent"===t&&(r[o]=e,e[a].parent=r),e[a].weight=i},s=this,d=0;d<e.length;d++)a(d)},n.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),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focusout",this.focusHandler),window.removeEventListener("resize",this.resizeEvent)},n.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),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focusout",this.focusHandler,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent),this.setStyle(this.element)},n.prototype.setStyle=function(e){e.style.overflow="hidden"},n.prototype.setCulture=function(){this.intl=new t.Internationalization},n.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},n.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))}},n.prototype.clickOnTreeMap=function(e){var i,l,o=this,n=e.target,r=n.id,a=n.innerHTML,s={cancel:!1,name:f,treemap:this,mouseEvent:e};this.trigger(f,s),r.indexOf("_Item_Index")>-1&&(e.preventDefault(),l=parseFloat(r.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)(o.leafItemSettings.labelTemplate)?(e.text=Me(e.text,e.item.data,e.treemap),n.textContent=e.text):$(r,n,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)},n.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:y,treemap:this,mouseEvent:e};this.trigger(y,t)},n.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:v,treemap:this,mouseEvent:e};this.trigger(v,t)},n.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),"touchstart"!==e.type&&"mousedown"!==e.type||(this.removeFocus("none"),e.preventDefault()),this.notify(t.Browser.touchStartEvent,e)},n.prototype.mouseMoveOnTreeMap=function(e){var i,l,o,n=e.target.id,r={cancel:!1,name:S,treemap:this,mouseEvent:e};this.trigger(S,r),this.removeFocus("none"),n.indexOf("_Item_Index")>-1?(o=ie(l=this.layout.renderItems[parseFloat(n.split("_Item_Index_")[1])]).values,this.element.style.cursor=!l.isLeafItem&&o&&o.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)},n.prototype.calculateSelectedTextLevels=function(e,t){for(var i,l,o,n=t.levelOrderName.split("#"),r=0,a=Object.keys(n);r<a.length;r++)n[l=a[r]]===e&&(i=parseInt(l,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:n}},n.prototype.calculatePreviousLevelChildItems=function(e,i,l){for(var o,n,r,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,d=0;d<s;d++)r=0===d?e.levelText[d]:r+"#"+e.levelText[d];a=s>1?s:a;for(var h=0,p=Object.values(this.layout.renderItems);h<p.length;h++){(n=p[h]).levelOrderName.split("#")[0]===e.levelText[0]&&(o=0===a?(0,t.isNullOrUndefined)(r)?r:e.levelText[a]:l?r:r+"#"+e.levelText[a])===n.levelOrderName&&(this.drilledItems.push({name:n.levelOrderName,data:n}),l=!0,++a<=i.groupIndex&&(r=o=o+"#"+e.levelText[a]))}return l},n.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var l,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((l=this.drilledItems[i].data.parent).isDrilled=!0,o[l[this.drilledItems[i].data.groupName]]=[l],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},n.prototype.mouseEndOnTreeMap=function(e){var i,l,o,n,r,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(),n=parseFloat(c.split("_Item_Index_")[1]),r=this.layout.renderItems[n];var v=g.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(v,r),a=s.drillLevel,this.drillDownView||-1===v.search("[+]")||(m=this.calculatePreviousLevelChildItems(s,r,m))),0!==this.levels.length&&!r.isLeafItem&&ie(r).values&&ie(r).values.length>0){if(this.drilledItems.length>0){r=m?this.drilledItems[this.drilledItems.length-1].data:r;for(var S=0;S<this.drilledItems.length;S++){if(!(0,t.isNullOrUndefined)(a)){var x=this.drilledItems.length;if(u=this.compareSelectedLabelWithDrillDownItems(s,r,S),x!==this.drilledItems.length){S-=1;break}}if(r.levelOrderName===this.drilledItems[S].name&&!m&&(0,t.isNullOrUndefined)(a)){0===r.groupIndex&&r.parent[r.groupName]instanceof Array?(r.isDrilled=!r.isDrilled,r.isDrilled?u[r.groupName]=[r]:u=r.parent):(r.isDrilled=!1,r.parent.isDrilled=!0,r=r.parent,u[r.groupName]=[r]),this.drilledItems.splice(S,1),S-=1;break}S===this.drilledItems.length-1&&(0,t.isNullOrUndefined)(a)&&(r.isDrilled=!0,u[r.groupName]=[r])}}else r.isDrilled=!0,u[r.groupName]=[r];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:r.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.name:r.name,rightClick:3===e.which,childItems:null,item:u},this.trigger(d,l,function(e){if(p.currentLevel=r.isDrilled&&(0,t.isNullOrUndefined)(a)?r.groupIndex:!(0,t.isNullOrUndefined)(a)&&p.enableBreadcrumb&&r.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:r.levelOrderName,data:r},p.treeMapLegendModule.renderLegend()),i=(0,t.isNullOrUndefined)(p.totalRect)?i:p.totalRect),document.getElementById(y)){var o=document.getElementById(y);o.parentNode.removeChild(o)}(0,t.isNullOrUndefined)(e.childItems)||e.cancel?(p.layout.calculateLayoutItems(u,i),p.layout.renderLayoutItems()):p.layout.onDemandProcess(e.childItems)}}),o={cancel:!1,name:h,treemap:this,renderItems:this.layout.renderItems},this.trigger(h,o),!m&&(0,t.isNullOrUndefined)(a)&&this.drilledItems.push({name:r.levelOrderName,data:r})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},n.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=""),this.removeFocus("")},n.prototype.keyUpHandler=function(e){if("Tab"===e.code){var t=e.target.id,i=document.getElementById(t);if(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)if(this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapHighlightModule&&this.highlightSettings.enable){i.style.setProperty("outline","none"),i.classList.add("keyboard-focused");var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapHighlightModule.highlightOnMouseMove(l)}else this.removeFocus(""),i.style.outline="2px solid black",i.classList.add("keyboard-focused");else Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&Ae(this.treeMapHighlightModule.shapeHighlightCollection,this),this.removeFocus("none")}},n.prototype.keyDownHandler=function(e){var t=e.target.id,i=document.getElementById(t);if("Enter"===e.code){if(this.selectionSettings.enable&&(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)){var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapSelectionModule.selectionOnMouseDown(l)}this.enableDrillDown&&i.childElementCount>0&&this.mouseEndOnTreeMap(e)}},n.prototype.focusHandler=function(e){var t=e.target.id;(!this.element.contains(e.relatedTarget)||t.indexOf("Item_Index")>-1&&e.relatedTarget.id.indexOf("Legend")>-1||t.indexOf("Legend")>-1&&e.relatedTarget.id.indexOf("Item_Index")>-1)&&(this.treeMapHighlightModule&&this.highlightSettings.enable?(Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),Ae(this.treeMapHighlightModule.legendHighlightCollection,this),this.treeMapHighlightModule.highLightId=""):this.removeFocus("none"))},n.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},n.prototype.selectItem=function(e,i){(0,t.isNullOrUndefined)(i)&&(i=!0);for(var l="",o=0;o<e.length;o++)o!==e.length-1?l+=e[o]+"#":l+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(l,i)},n.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},n.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,l=0,o=Object.keys(e);l<o.length;l++){switch(o[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())}},n.prototype.getModuleName=function(){return"treemap"},n.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},n.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)}},n.prototype.getPersistData=function(){return""},lt([(0,t.Property)(!1)],n.prototype,"allowPrint",void 0),lt([(0,t.Property)(!1)],n.prototype,"allowImageExport",void 0),lt([(0,t.Property)(!1)],n.prototype,"allowPdfExport",void 0),lt([(0,t.Property)(null)],n.prototype,"width",void 0),lt([(0,t.Property)(null)],n.prototype,"height",void 0),lt([(0,t.Complex)({},O)],n.prototype,"border",void 0),lt([(0,t.Complex)({},L)],n.prototype,"margin",void 0),lt([(0,t.Property)(null)],n.prototype,"background",void 0),lt([(0,t.Property)("Material")],n.prototype,"theme",void 0),lt([(0,t.Complex)({},_)],n.prototype,"titleSettings",void 0),lt([(0,t.Property)("Squarified")],n.prototype,"layoutType",void 0),lt([(0,t.Property)(null)],n.prototype,"dataSource",void 0),lt([(0,t.Property)(null)],n.prototype,"query",void 0),lt([(0,t.Property)(null)],n.prototype,"weightValuePath",void 0),lt([(0,t.Property)("")],n.prototype,"rangeColorValuePath",void 0),lt([(0,t.Property)("")],n.prototype,"equalColorValuePath",void 0),lt([(0,t.Property)(null)],n.prototype,"colorValuePath",void 0),lt([(0,t.Property)([])],n.prototype,"palette",void 0),lt([(0,t.Property)("TopLeftBottomRight")],n.prototype,"renderDirection",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableDrillDown",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableBreadcrumb",void 0),lt([(0,t.Property)(" - ")],n.prototype,"breadcrumbConnector",void 0),lt([(0,t.Property)(!1)],n.prototype,"drillDownView",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableHtmlSanitizer",void 0),lt([(0,t.Complex)({},P)],n.prototype,"initialDrillDown",void 0),lt([(0,t.Complex)({},B)],n.prototype,"leafItemSettings",void 0),lt([(0,t.Collection)([],U)],n.prototype,"levels",void 0),lt([(0,t.Complex)({},R)],n.prototype,"highlightSettings",void 0),lt([(0,t.Complex)({},H)],n.prototype,"selectionSettings",void 0),lt([(0,t.Complex)({},z)],n.prototype,"tooltipSettings",void 0),lt([(0,t.Complex)({},D)],n.prototype,"legendSettings",void 0),lt([(0,t.Property)(!1)],n.prototype,"useGroupingSeparator",void 0),lt([(0,t.Property)(null)],n.prototype,"description",void 0),lt([(0,t.Property)(0)],n.prototype,"tabIndex",void 0),lt([(0,t.Property)(null)],n.prototype,"format",void 0),lt([(0,t.Event)()],n.prototype,"load",void 0),lt([(0,t.Event)()],n.prototype,"beforePrint",void 0),lt([(0,t.Event)()],n.prototype,"loaded",void 0),lt([(0,t.Event)()],n.prototype,"itemRendering",void 0),lt([(0,t.Event)()],n.prototype,"drillStart",void 0),lt([(0,t.Event)()],n.prototype,"drillEnd",void 0),lt([(0,t.Event)()],n.prototype,"itemSelected",void 0),lt([(0,t.Event)()],n.prototype,"itemHighlight",void 0),lt([(0,t.Event)()],n.prototype,"tooltipRendering",void 0),lt([(0,t.Event)()],n.prototype,"itemClick",void 0),lt([(0,t.Event)()],n.prototype,"itemMove",void 0),lt([(0,t.Event)()],n.prototype,"click",void 0),lt([(0,t.Event)()],n.prototype,"doubleClick",void 0),lt([(0,t.Event)()],n.prototype,"rightClick",void 0),lt([(0,t.Event)()],n.prototype,"mouseMove",void 0),lt([(0,t.Event)()],n.prototype,"resize",void 0),lt([(0,t.Event)()],n.prototype,"legendItemRendering",void 0),lt([(0,t.Event)()],n.prototype,"legendRendering",void 0),n=lt([t.NotifyPropertyChanges],n)}(t.Component),nt=function(){},rt=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 o=l.position,n=i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l.title.text):l.title.text,r=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"===o||"Bottom"===o||"Auto"===o&&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;r.fontFamily=r.fontFamily||i.themeStyle.fontFamily,r.fontWeight=r.fontWeight||i.themeStyle.titleFontWeight,r.size=r.size||i.themeStyle.subtitleFontSize;var S=G(n,r),x=0,b=0,I=l.shapePadding,C=l.textStyle;if(C.size=C.size||i.themeStyle.legendFontSize,C.fontFamily=C.fontFamily||i.themeStyle.fontFamily,C.fontWeight=C.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 F=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=G(i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(O.legendName):O.legendName,C);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 M=u[F-1].x+u[F-1].width+10+c;if(M+I+L.width>y){var N=(u[F-1].y>m[F-1].y+g/2?u[F-1].y:m[F-1].y+g/2)+10;N+T>v?(this.getPageChanged(),F=0,m=[],u=[],s=x,d=b):(s=m[0].x,d=N+T/2)}else s=M-c/2,d=m[F-1].y}else{var _=u[F-1].y>m[F-1].y+g/2?u[F-1].y:m[F-1].y+g/2;if(_+10+T>v){var E=u[F-1].x+this.textMaxWidth+10;E+I+L.width>y?(s=x,d=b,u=[],m=[],this.getPageChanged(),F=0):(s=E+c/2,d=m[0].y)}else s=m[F-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[F].x-c/2,y:m[F].y-g/2<p-L.height?m[F].y-g/2:p-L.height,width:Math.abs(m[F].x-c/2-(h+L.width)),height:g>L.height?g:L.height}}),F++}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 H=10,R=l.labelPosition,U=0,A=0,j=l.labelDisplayMode,V=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=G(J,C):"Trim"===j?Y=G(J=X("Horizontal"===f?B:z,J,C),C):J="",V=Math.max(V,Y.height),q=Math.max(q,Y.width),Y.width>0&&Y.height>0&&("Horizontal"===f?(h=x+B/2,p="After"===R?b+z+Y.height/2+H:b-H):(h="After"===R?x-Y.width/2-H:x+B+Y.width/2+H,p=b+z/2+Y.height/4)),0===w&&(U="Horizontal"===f?x:"After"===R?h-Y.width/2:x,A="Horizontal"===f?"After"===R?b:p-Y.height/2:b),w===P-1&&(y="Horizontal"===f?Math.abs(x+B-U):B+q+H,v="Horizontal"===f?z+V/2+H: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:U,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,o;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 n=ie(e).values,r=0;r<n.length;r++)if(n[r].Name===this.treemap.initialDrillDown.groupName){n[r].isDrilled=!n[r].isDrilled,e=n[r],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,l=this.treemap.palette.length>0?this.treemap.palette[r%this.treemap.palette.length]:n[r].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(r=0;r<a.length;r++){l=this.treemap.palette.length>0?this.treemap.palette[r%this.treemap.palette.length]:a[r].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])&&(o=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,o)||this.legendCollections.push({legendName:o,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(Fe),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,o,n,r,a,s,d,h,p,g,c,m,u,f,y,v,S,x,b=!1,I=this.treemap.leafItemSettings,C=this.treemap.levels,F=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,n=e[L].data,d=e[L].groupIndex,s=(a=0===this.treemap.levels.length||d===this.treemap.levels.length)?I.colorMapping:C[d].colorMapping;for(var T=0;T<s.length;T++){var M=s[T];if(p=null,o=Number(n[this.treemap.rangeColorValuePath]),h=n[this.treemap.equalColorValuePath],M.value=(0,t.isNullOrUndefined)(M.value)?M.value:M.value.toString(),!(0,t.isNullOrUndefined)(M.from)&&!(0,t.isNullOrUndefined)(M.to)&&o>=M.from&&o<=M.to&&M.showLegend?(b=!0,y=!0,m=M.from+" - "+M.to,r=(0,t.isNullOrUndefined)(M.label)?M.from+" - "+M.to:M.label,l=(0,t.isNullOrUndefined)(M.color)?l:M.color,i=this.isAddNewLegendData(m)):!(0,t.isNullOrUndefined)(M.value)&&h===M.value&&M.showLegend&&(b=!0,f=!0,m=M.value.toString(),r=(0,t.isNullOrUndefined)(M.label)?M.value.toString():M.label,l=(0,t.isNullOrUndefined)(M.color)?l:"[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,i=this.isAddNewLegendData(m)),b&&(0,t.isNullOrUndefined)(M.value)&&M.maxOpacity&&M.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var N=[];if(w=!0,"[object Array]"===Object.prototype.toString.call(M.color))for(var _=0;_<M.color.length;_++){var E={colorStop:(_*(100/(M.color.length-1))+"%").toString(),color:M.color[_]};N.push(E)}else{E={colorStop:"0%",color:l};var D={colorStop:"100%",color:l};N.push(E),N.push(D)}g="Top"===F||"Bottom"===F?"100%":"0%",c="Top"===F||"Bottom"===F?"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,N).childNodes[0],"[object Array]"!==Object.prototype.toString.call(M.color)&&(p.childNodes[0].setAttribute("stop-opacity",M.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",M.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}if(u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,r),i&&i.process&&b&&!u?(b=!1,l="[object Array]"===Object.prototype.toString.call(M.color)&&(0,t.isNullOrUndefined)(p)&&(0,t.isNullOrUndefined)(M.value)?this.legendGradientColor(M,O):l,this.legendCollections.push({actualValue:m,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:r,legendFill:l,legendData:[],groupIndex:a?-1:d,gradientElement:(0,t.isNullOrUndefined)(p)?(0,t.isNullOrUndefined)(M.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)(M.from)&&(0,t.isNullOrUndefined)(M.to)&&(0,t.isNullOrUndefined)(M.minOpacity)&&(0,t.isNullOrUndefined)(M.maxOpacity)&&(0,t.isNullOrUndefined)(M.value)&&!(0,t.isNullOrUndefined)(M.color)){v="[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,S=(0,t.isNullOrUndefined)(M.label)?"Others":M.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].actualValue===(M.label||"Others")){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,o=this.treemap.renderer,n=l.textStyle;if(this.legendGroup=o.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===l.mode)this.drawLegendItem(this.currentPage);else for(var r=0;r<this.legendRenderingCollections.length;r++){var a=this.treemap.element.id+"_Legend_Index_"+r,s=this.treemap.element.id+"_Legend_Index_"+r+"_Text",d=this.legendRenderingCollections[r];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,"",""),n,n.color||this.treemap.themeStyle.legendTextColor,this.legendGroup);var m=o.drawRectangle(g);m.setAttribute("tabindex",this.treemap.tabIndex.toString()),m.style.outline="",this.legendGroup.appendChild(m)}Oe(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,l){var o=e.Shape,n=e.Text,r=G(e.DisplayText,l.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),n.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+r.width+t)-Math.abs(this.legendBorderRect.x-n.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)-l.shapeHeight/2,n.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-n.y)),{shapeLocation:o,textLocation:n}},e.prototype.drawLegendItem=function(e){var i,l,o=this,n=this.treemap,r=10,a=n.legendSettings,s=new k(a.shapeWidth,a.shapeHeight),d=n.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:n.element.id+"_Legend_Index_"+h});y.setAttribute("aria-label",f+" Legend"),y.setAttribute("role","region"),y.setAttribute("tabindex",u.treemap.tabIndex.toString()),y.style.outline="none";var v=n.element.id+"_Legend_Shape_Index_"+h,S=n.element.id+"_Legend_Text_Index_"+h,b=m.Shape,I=m.Text;n.enableRtl&&(i=u.defaultLegendRtlLocation(m,r,n,a),b=i.shapeLocation,I=i.textLocation),l={cancel:!1,name:x,treemap:n,fill:m.Fill,shape:a.shape,imageUrl:a.imageUrl},n.trigger(x,l,function(e){var t=new V(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||n.themeStyle.legendTextColor,y),o.legendGroup.appendChild(y)})},u=this,f=0;f<this.totalPages[e].Collection.length;f++)m(f);var y=void 0,v=r;if(0!==this.page){var S=e+1+"/"+this.totalPages.length,b=a.textStyle,I=G(S,b),C=this.legendItemRect.x+this.legendItemRect.width-I.width-20-r,F=this.legendItemRect.x+this.legendItemRect.width,w=this.legendItemRect.y+this.legendItemRect.height+2.5+r,O=F-v-I.width/2-5;y=d.createGroup({id:n.element.id+"_Legend_Paging_Group"});var L=d.createGroup({id:n.element.id+"_Legend_Left_Paging_Group"}),T=d.createGroup({id:n.element.id+"_Legend_Right_Paging_Group"}),M=" M "+F+" "+w+" L "+(F-v)+" "+(w-5)+" L "+(F-v)+" "+(w+5)+" z ",N=" M "+C+" "+w+" L "+(C+v)+" "+(w-5)+" L "+(C+v)+" "+(w+5)+" z ",_=new V(n.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);L.appendChild(d.drawPath(_));var E=new j(n.element.id+"_Left_Page_Rect","transparent",{},1,new W(C-5,w-10,20,20),"");L.appendChild(d.drawRectangle(E)),this.wireEvents(L);var D=new V(n.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",M);T.appendChild(d.drawPath(D));var P=new j(n.element.id+"_Right_Page_Rect","transparent",{},1,new W(F-v,w-5,v,r),"");T.appendChild(d.drawRectangle(P)),this.wireEvents(T),y.appendChild(L),y.appendChild(T);var B={id:n.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,o=t.titleStyle,n=G(X(this.legendItemRect.width+20,i,o),o);this.legendBorderRect=new W(this.legendItemRect.x-l,this.legendItemRect.y-l-n.height,this.legendItemRect.width+20,this.legendItemRect.height+20+n.height+("Interactive"===t.mode?0:0!==this.page?l:0));var r={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,r,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,o=X(this.legendItemRect.width+20,l,i),n=G(o,i);if(l){var r=Q(new q(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-n.height/2-5,"middle",o,""),i,i.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);r.setAttribute("role","region"),r.setAttribute("aria-label",l)}},e.prototype.renderInteractivePointer=function(e){var i,l=this.treemap,o=e.target,n=l.element.id+"_Interactive_Legend",r=!1;o=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):o;var a=l.legendSettings;if(o.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(o.id.split("_Item_Index_")[1])];for(var u=l.svgObject.getBoundingClientRect(),f=0;f<this.legendCollections.length&&!r;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,n,c,y),r=!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,n,c,y),r=!0;break}}else 0===this.treemap.leafItemSettings.colorMapping.length&&this.treemap.palette&&i.levelOrderName.indexOf(s.levelOrderName)>-1&&(this.drawInteractivePointer(a,p,g,n,c,y),r=!0)}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,l,o,n){var r,a,s,d=10,h=10;r="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=n.x+n.width/2)+" "+(s=n.y+n.height)+" L "+(a-h)+" "+(s+d)+" L "+(a+h)+" "+(s+d)+" Z ":" M "+(a=n.x+n.width/2)+" "+(s=n.y)+" L "+(a-h)+" "+(s-d)+" L "+(a+h)+" "+(s-d)+" Z ":e.invertedPointer?" M "+(a=n.x)+" "+(s=n.y+n.height/2)+" L "+(a-h)+" "+(s-d)+" L "+(a-h)+" "+(s+d)+" z ":" M "+(a=n.x+n.width)+" "+(s=n.y+n.height/2)+" L "+(a+h)+" "+(s-d)+" L "+(a+h)+" "+(s+d)+" z ";var p=new V(l,t,o,i,1,"",r);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(p))},e.prototype.getLegendAlignment=function(e,i,l,o){var n,r,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"===o.position?g>c?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(m){case"Top":case"Bottom":a.height=h-l,n=g/2-i/2,r="Top"===m?d:d+a.height+10,a.y="Top"===m?d+l+10:d;break;case"Left":case"Right":a.width=p-i,n="Left"===m?s:s+a.width,r=c/2-l/2,a.x="Left"===m?s+i:s}switch(o.alignment){case"Near":"Top"===m||"Bottom"===m?n=a.x:r=a.y;break;case"Far":"Top"===m||"Bottom"===m?n=g-i:r=c-l}this.treemap.totalRect=a,this.translate=new J(n,r)}},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,o="http://www.w3.org/2000/svg";if(!(0,t.isNullOrUndefined)(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var n=this.treemap.renderer.createDefs(),r=document.createElementNS(o,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",d="Top"===a||"Bottom"===a?"0":"100";r.setAttribute("id","linear_"+i),r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2",s+"%"),r.setAttribute("y2",d+"%");for(var h=0;h<e.color.length;h++){var p=100/(e.color.length-1),g=document.createElementNS(o,"stop");g.setAttribute("offset",h*p+"%"),g.setAttribute("stop-color",e.color[h]),g.setAttribute("stop-opacity",1..toString()),r.appendChild(g)}n.appendChild(r),this.legendLinearGradient=r;var c="url(#linear_"+i+")";this.defsElement.appendChild(r),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 t=e.target;return this.highlightOnMouseMove(t)},e.prototype.highlightOnMouseMove=function(e){var i,l,o,n,r,a,s,d=this.treemap,h=e.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||this.legendHighlightCollection[0]&&this.legendHighlightCollection[0].ShapeCollection.Elements.length>1){r=document.getElementById(d.element.id+"_TreeMap_"+d.layoutType+"_Layout");var b=document.getElementsByClassName("treeMapSelection");o=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var I=void 0;if(this.treemap.legendSettings.visible){var C=this.treemap.treeMapLegendModule.legendCollections,F=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]):Ve(F,o,d),(0,t.isNullOrUndefined)(I)&&(Ae(this.legendHighlightCollection,d),Ae(this.shapeHighlightCollection,d),this.legendHighlightCollection=[],d.treeMapLegendModule.removeInteractivePointer()),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)if(u&&this.shapeElement.id===(u&&u.shapeElement?u.shapeElement.id:null))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:C[I].legendFill,oldOpacity:C[I].opacity,oldBorderColor:C[I].borderColor,oldBorderWidth:C[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,null,null),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.target="highlight"}s=le(o,[],c.mode,d);for(y=0;y<r.childElementCount;y++){a=r.childNodes[y],n=!0;var w=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,O=d.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];o=d.layout.renderItems[parseFloat(a.id.split("_Item_Index_")[1])];for(v=0;v<b.length;v++)if(a.id===b[v].id||a.id===b[v].parentElement.id){n=!1;break}s.indexOf(o.levelOrderName)>-1&&n&&((0,t.isNullOrUndefined)(w)||(o.data[w]===O.data[w]||"Item"!==c.mode&&d.levels.length>0))&&(m.push(a),p.push(o))}Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d);for(var L=0;L<m.length;L++)Te((a=m[L]).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 T=u&&u.legendSelectId?parseFloat(u.legendSelectId.split("Index_")[1]):u&&u.shapeSelectId?parseFloat(u.shapeSelectId.split("Index_")[1]):null,M="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&&M!==T){var N,_=void 0,E=void 0,D=(w=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,document.getElementById(h));"highlight"===this.shapeTarget&&(Ae(this.legendHighlightCollection,this.treemap),this.legendHighlightCollection=[]),this.shapeTarget="highlight";var P=this.treemap.treeMapLegendModule.legendCollections[M].legendData.length;for(C=this.treemap.treeMapLegendModule.legendCollections,y=0;y<P;y++)for(v=0;v<this.treemap.layout.renderItems.length;v++)if(!(0,t.isNullOrUndefined)(w)&&d.leafItemSettings.colorMapping.length>0&&0===d.levels.length?d.treeMapLegendModule.legendCollections[M].legendData[y].data[w]===d.layout.renderItems[v].data[w]:d.treeMapLegendModule.legendCollections[M].legendData[y].levelOrderName===d.layout.renderItems[v].levelOrderName){_=v,E=this.treemap.layout.renderItems[v].groupIndex;var B=document.getElementById(this.treemap.element.id+"_Level_Index_"+E+"_Item_Index_"+_+"_RectPath");0!==y&&0!==this.legendHighlightCollection.length||(this.legendHighlightCollection=[],Ge(this.legendHighlightCollection,M,v,D,B,this.treemap.layout.renderItems,C),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection={Elements:[]});var z=void 0;D.id.indexOf("Text")>-1?(z="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+M),We(D,c.fill,c.opacity,null,null),We(z,c.fill,c.opacity,c.border.color,c.border.width.toString())):(We("Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+M),c.fill,c.opacity,null,null),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString())),We(B,c.fill,c.opacity,c.border.color,c.border.width.toString()),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection.Elements.push(B)}if(0===P&&this.treemap.palette&&this.treemap.palette.length>0)for(v=0;v<this.treemap.layout.renderItems.length;v++)if((this.treemap.treeMapLegendModule.legendCollections[M].levelOrderName===this.treemap.layout.renderItems[v].levelOrderName||this.treemap.layout.renderItems[v].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[M].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&d.palette&&d.palette.length>0)||this.treemap.layout.renderItems[v].parent.isDrilled||M===v)){_=v,E=this.treemap.layout.renderItems[v].groupIndex;B=document.getElementById(this.treemap.element.id+"_Level_Index_"+E+"_Item_Index_"+_+"_RectPath");Ge(this.legendHighlightCollection,M,v,D,B,this.treemap.layout.renderItems,C),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection={Elements:[]};var H=void 0;D.id.indexOf("Text")>-1?(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+M),We(D,c.fill,c.opacity,null,null),We(H,c.fill,c.opacity,c.border.color,c.border.width.toString())):(We(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+M),c.fill,c.opacity,null,null),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString())),We(B,c.fill,c.opacity,c.border.color,c.border.width.toString()),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection.Elements.push(B)}}else Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d),Ae(this.legendHighlightCollection,d),this.legendHighlightCollection=[]}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 t=e.target;e.preventDefault(),this.selectionOnMouseDown(t)},e.prototype.selectionOnMouseDown=function(e){var i,l=this.treemap;e.setAttribute("tabindex","-1"),e.style.outline="none",e.id.includes("Legend_Shape_Index")||e.focus();var o,n,r,a,s=[],d=e.id,h=e.innerHTML,g=[],c=l.selectionSettings,m=this.treemap.treeMapHighlightModule,u=l.element.id+"_TreeMap_"+l.layoutType+"_Layout",f=(o=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])])&&!o.isLeafItem&&l.enableDrillDown&&(e.textContent.indexOf("[+]")>-1||e.textContent.indexOf("[-]")>-1||!(0,t.isNullOrUndefined)(e.nextElementSibling)&&(e.nextSibling.textContent.indexOf("[+]")>-1||e.nextSibling.textContent.indexOf("[-]")>-1));if(d.indexOf("_Item_Index")>-1&&!f)if(this.treemap.selectionId!==d&&(!l.selectionId||parseFloat(l.selectionId.split("_Item_Index_")[1])!==parseFloat(d.split("_Item_Index_")[1]))||this.legendSelectionCollection[0]&&this.legendSelectionCollection[0].ShapeCollection.Elements.length>1){l.levelSelection=[],l.legendId=[],this.shapeSelectId="",Ae(this.legendSelectionCollection,l),this.legendSelectionCollection=[],n=document.getElementById(u);var y=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var v=this.treemap.treeMapLegendModule.legendCollections.length,S=this.treemap.treeMapLegendModule.legendCollections;if(this.shapeElement=void 0,Ae(this.shapeSelectionCollection,l),m&&(m.shapeTarget="selection",m.shapeHighlightCollection=[]),y=!l.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0&&0===l.leafItemSettings.colorMapping.length&&0===l.levels.length?parseFloat(d.split("_Item_Index_")[1]):Ve(v,o,l),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y):document.getElementById(this.treemap.element.id+"_Legend_Index_"+y),null!==this.shapeElement)this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:S[y].legendFill,oldOpacity:S[y].opacity,oldBorderColor:S[y].borderColor,oldBorderWidth:S[y].borderWidth}),We(z="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y):document.getElementById(this.treemap.element.id+"_Legend_Index_"+y+"_Text"),c.fill,c.opacity,null,null),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.legendId.push(this.shapeElement.id),l.legendId.push(z.id)}a=le(o,[],c.mode,l);for(var x=0;x<n.childElementCount;x++){r=n.childNodes[x];var b=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])];o=l.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];var I=""!==l.rangeColorValuePath?l.rangeColorValuePath:null;a.indexOf(o.levelOrderName)>-1&&((0,t.isNullOrUndefined)(I)||(o.data[I]===b.data[I]||"Item"!==c.mode&&l.levels.length>0))&&(g.push(r),d.indexOf("_RectPath")>-1&&l.levelSelection.push(r.id),s.push(o))}Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId=d;for(var C=document.getElementsByClassName("treeMapHighLight"),F=0;F<g.length;F++){if(r=g[F],C.length>0)for(var w=0;w<C.length;w++)C[w].id===r.id&&C[w].classList.remove("treeMapHighLight"),Te(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");else Te(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");i={cancel:!1,name:p,treemap:l,items:s,elements:g,text:h,contentItemTemplate:h},l.trigger(p,i,function(t){t.contentItemTemplate!==h&&$(d,e,t.contentItemTemplate)})}}else Ae(this.legendSelectionCollection,l),Ae(this.shapeSelectionCollection,l),this.treemap.legendId=[],this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.levelSelection=[],this.legendSelectId="",(this.legendSelect||this.shapeSelect)&&(Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="");else if(d.indexOf("_Legend_Shape")>-1||d.indexOf("_Legend_Index")>-1||d.indexOf("_Legend_Text_")>-1){S=this.treemap.treeMapLegendModule.legendCollections;var O=(0,t.isNullOrUndefined)(this.legendSelectId)?null:parseFloat(this.legendSelectId.split("_Index_")[1]);if(this.treemap.legendSettings.visible&&O!==parseFloat(d.split("_Index_")[1])){var L,T=void 0,M=void 0;l.legendId=[],l.levelSelection=[],this.legendSelectId=d,this.legendSelect=!1;var N=isNaN(parseInt(d[d.length-1],10))?parseInt(d[d.length-6],10):parseInt(d[d.length-1],10),_=document.getElementById(d);Ae(this.legendSelectionCollection,l),Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),Ae(this.shapeSelectionCollection,l),this.legendSelectionCollection=[],m&&(m.shapeTarget="selection",m.legendHighlightCollection=[]);I=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,y="Default"===this.treemap.legendSettings.mode?-1===d.indexOf("Text")?parseFloat(d.split("_Legend_Shape_Index_")[1]):parseFloat(d.split("_Legend_Text_Index_")[1]):parseFloat(d.split("_Legend_Index_")[1]);var E=this.treemap.treeMapLegendModule.legendCollections[y].legendData.length;for(F=0;F<E;F++)for(var D=0;D<this.treemap.layout.renderItems.length;D++)if(!(0,t.isNullOrUndefined)(I)&&l.leafItemSettings.colorMapping.length>0&&0===l.levels.length?l.treeMapLegendModule.legendCollections[y].legendData[F].data[I]===l.layout.renderItems[D].data[I]:this.treemap.treeMapLegendModule.legendCollections[y].legendData[F].levelOrderName===this.treemap.layout.renderItems[D].levelOrderName){T=D,M=this.treemap.layout.renderItems[D].groupIndex;var P=document.getElementById(this.treemap.element.id+"_Level_Index_"+M+"_Item_Index_"+T+"_RectPath");this.treemap.selectionId=P.id,0!==F&&0!==this.legendSelectionCollection.length||(Ge(this.legendSelectionCollection,N,D,_,P,this.treemap.layout.renderItems,S),L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection={Elements:[]}),this.treemap.selectionId=P.id;var B=void 0,z=void 0;_.id.indexOf("Text")>-1?(We(B="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y),c.fill,c.opacity,c.border.color,c.border.width.toString()),We(_,c.fill,c.opacity,null,null),this.legendSelectId=B.id,this.shapeElement=B,l.legendId.push(_.id),l.legendId.push(B.id)):(We(z="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y),c.fill,c.opacity,null,null),We(_,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.shapeElement=_,l.legendId.push(_.id),l.legendId.push(z.id)),We(P,c.fill,c.opacity,c.border.color,c.border.width.toString()),L=this.legendSelectionCollection.length,l.levelSelection.push(P.id),this.legendSelectionCollection[L-1].ShapeCollection.Elements.push(P)}if(0===E&&this.treemap.palette&&this.treemap.palette.length>0)for(w=0;w<this.treemap.layout.renderItems.length;w++)if((this.treemap.treeMapLegendModule.legendCollections[y].levelOrderName===this.treemap.layout.renderItems[w].levelOrderName||this.treemap.layout.renderItems[w].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[y].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0)||this.treemap.layout.renderItems[w].parent.isDrilled||y===w)){T=w,M=this.treemap.layout.renderItems[w].groupIndex;P=document.getElementById(this.treemap.element.id+"_Level_Index_"+M+"_Item_Index_"+T+"_RectPath");Ge(this.legendSelectionCollection,y,w,_,P,this.treemap.layout.renderItems,S),this.treemap.selectionId=P.id,L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection={Elements:[]};var H=void 0;_.id.indexOf("Text")>-1?(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y),We(_,c.fill,c.opacity,null,null),We(H,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=H.id,this.shapeElement=H):(We(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y),c.fill,c.opacity,null,null),We(_,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=d,this.shapeElement=_),We(P,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.levelSelection.push(P.id),-1===l.legendId.indexOf(H.id)&&l.legendId.push(H.id),-1===l.legendId.indexOf(_.id)&&l.legendId.push(_.id),L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection.Elements.push(P)}}else Ae(this.legendSelectionCollection,this.treemap),Ae(this.shapeSelectionCollection,this.treemap),this.legendSelectionCollection=[],m&&(m.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.shapeElement=null,this.shapeSelectId="",(this.legendSelect||this.shapeSelect)&&(Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="")}else f&&(Ae(this.legendSelectionCollection,this.treemap),this.legendSelectionCollection=[],this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.treemap.selectionId="",this.shapeElement=null)},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 o=this.treemap.selectionSettings,n=[],r=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,[],o.mode,this.treemap),g=0;g<h.childElementCount;g++)r=h.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(n.push(r),this.treemap.levelSelection.push(r.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=Ve(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,o.fill,o.opacity,o.border.color,o.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<n.length;v++)if(r=n[v],y.length>0)for(var S=0;S<y.length;S++)y[S].id===r.id&&y[S].classList.remove("treeMapHighLight"),Te(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(r.id.split("Item_Index_")[1],10)].options.fill:o.fill,Te(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.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 o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&(i[l[o]]=e[l[o]])}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,o,n,r,a,s=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(n=e).changedTouches[0].pageX,l=n.changedTouches[0].pageY,o=n.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,l=e.pageY,o=e.target);var d,h,p,g=o.id,m={},u={},f=[];if(g.indexOf("_Item_Index")>-1&&-1===e.type.indexOf("key")){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:Me(this.tooltipSettings.format,u,this.treemap))||Ne(a,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Me(this.tooltipSettings.format,u,this.treemap))||this.treemap.weightValuePath.toString()+" : "+Ne(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]);r={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:o,eventArgs:e},this.treemap.trigger(c,r,function(e){s.addTooltip(r,p,d)})}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,l,o,n){var r,a;(0,t.isNullOrUndefined)(e)?(r=n.cancel,a=n):(r=e.cancel,a=dt(e,["cancel"]).options);r?(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(o),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(){(0,t.isNullOrUndefined)(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,Xe(this.treemap.element.id+"_TreeMapTooltip")),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},e}()})(),a})());