if(!_.wordtree){_.wordtree=1;(function($){var E4=function(){$.Wp.call(this);$.R(this.xa,Pha)},F4=function(a,b){$.Ov.call(this);$.Qs(this,this,this.cg,this.rg,this.qx,this.cg,null,null);this.Vq=null;this.Vt=[];this.Tg=[];this.wM=this.RJ=null;this.Vf=[];this.vs=[];$.R(this.xa,[["minFontSize",4,1],["maxFontSize",4,1],["postfix",4,1],["fontFamily",4,1],["fontStyle",16,1],["fontWeight",4,1],["fontColor",16,1],["fontOpacity",16,1],["fontDecoration",16,1]]);this.data(a,b)},Qha=function(a,b){var c=b.getParent();if(c){for(var d=0;d<c.Wb();d++){var e=
c.Jd(d);e!=b&&e.j("hidden",!0)}Qha(a,c)}},Rha=function(a){for(var b=0;b<a.Tg.length;b++)a.Tg[b].j("hidden",!1)},Sha=function(a,b,c){if(c.length){for(var d=b.nl(),e=!1,f=0;f<b.Wb();f++)if(d[f].get("value")==c[0]){e=!0;break}e?(c.shift(),b=d[f]):(b=b.ec({value:c[0]}),c.shift());return Sha(a,b,c)}return b},Tha=function(a){a=a.split(/\s*(.+?(?:[?!]+|$|\.(?=\s+[A-Z]|$)))\s*/);return a=(0,$.Be)(a,function(a){return!!a.length})},G4=function(a){a=a.split(/([!?,;:.&"-]+|\S*[A-Z]\.|\S*(?:[^!?,;:.\s&-]))/);
return a=(0,$.Be)(a,function(a){return a.length&&" "!=a})},Uha=function(a,b){null!=a.na&&($.Xp(a.na,a.xd,a),a.na.ad());a.na=b;$.L(a.na,a.xd,a);a.u(4100,1)},Vha=function(a,b,c){if(b){var d=b.get("fontSize");if(null==d){if((d=b.getParent())&&(1==d.Wb()||c))return d=Vha(a,d,c),b.j("fontSize",d),d;c=a.i("maxFontSize");a=a.i("minFontSize");d=b.j("height")/1.5;d=$.Ya(d,a,c);b.j("fontSize",d)}return d}return 0},Wha=function(a,b){if(b){var c=b.Wb(),d=0;if(c)for(var e=0;e<c;e++)d+=Wha(a,b.Jd(e));else d=b.get("weight")||
1;b.j("leafCount",d).j("weight",d);return d}return 0},Xha=function(a,b,c,d,e,f){if(b){b.j("connectorInXPosition",c[0]).j("connectorInYPosition",c[1]).j("connectorOutXPosition",c[0]+a.AT(b)).j("connectorOutYPosition",c[1]);var h=a.Mf.$a();if(d<h){c=a.il();var k=b.Wb(),l=c.i("length"),m=c.i("offset");c=c.i("curveFactor");var n=a.i("minFontSize");if(k){if(1<k){var q=n/10;e+=q;f-=q}q=e;for(var r=!1,t,u=0;u<k;u++)if(t=b.Jd(u),t.j("hidden")){r=!0;break}if((f-e)/k<1.5*n&&1<k){k="+"+b.j("leafCount")+" "+
a.i("postfix");var v=(f+e)/2;m=d;d=a.Sw(m,v,k,b.j("fontSize")||n,a.i("fontFamily"),a.i("fontWeight"));v-=d.LF()/2;d.y(v);d.tag.node=b;d.tag.A_=!0;k=d.CR();m+k>=h&&d.visible(!1);a.GB(b.j("connectorOutXPosition"),b.j("connectorOutYPosition"),b.j("connectorOutXPosition")+20,(f+e)/2,c)}else for(r&&(d-=l+m),u=0;u<k;u++)if(t=b.Jd(u),!t.j("hidden")){m=t.j("leafCount");h=b.j("leafCount");h=r?f-e:(f-e)*Math.max(1,m)/Math.max(1,h);n=q;var w=0;q=n+h;m=d;v=n+h/2;var x=[m,v];t.j("height",h).j("nodePositionX",
m).j("nodePositionY",v);a.MJ(t,r);v=b.j("textHeight")/2;x[1]-=v;1!=t.Wb()&&(w+=l);m=a.AT(t);v=[x[0],x[1]+v];w+=x[0]+m;Xha(a,t,v,w,n,n+h);1<b.Wb()&&!r&&a.GB(b.j("connectorOutXPosition"),b.j("connectorOutYPosition"),t.j("connectorInXPosition"),t.j("connectorInYPosition"),c)}}}}},Yha=function(a,b){var c=new F4(a,b);c.Ia("wordtree");return c};$.H(E4,$.Wp);var H4={};$.ep(H4,[[0,"curveFactor",$.Rp],[0,"offset",$.Op],[0,"length",$.Op],[1,"stroke",$.xp]]);$.S(E4,H4);E4.prototype.ra=8201;
var Pha=[["curveFactor",0,8],["offset",0,8],["length",0,8],["stroke",0,8192]];E4.prototype.F=function(){var a=E4.B.F.call(this);$.Bp(this,H4,a);return a};E4.prototype.Y=function(a,b){E4.B.Y.call(this,a,b);$.tp(this,H4,a,b)};$.H(F4,$.Ov);F4.prototype.ra=$.Ov.prototype.ra;F4.prototype.qa=$.Ov.prototype.qa|4112;var I4=function(){var a={};$.ep(a,[[0,"minFontSize",$.Op],[0,"maxFontSize",$.Op],[0,"fontFamily",$.kp],[0,"fontStyle",$.Mj],[0,"fontWeight",$.ip],[0,"fontColor",$.lp],[0,"fontOpacity",$.mp],[0,"fontDecoration",$.Jj],[0,"postfix",function(a){if($.p(a))return null===a&&(a=this.ef("postfix")),String(a)}]]);return a}();$.S(F4,I4);$.g=F4.prototype;$.g.Qa=function(){return"wordtree"};
$.g.ej=function(){return!(this.na&&(!this.na||this.na.Wb()))};$.g.Ne=function(){return[]};$.g.et=function(){return[this]};$.g.yS=function(a,b){return function(c){return a*(1-c)+b*c}};$.g.Xj=function(a,b){return $.Os(this.data(),b)};$.g.il=function(a){this.En||(this.En=new E4,$.V(this,"connectors",this.En),$.L(this.En,this.Hea,this));return a?(this.En.K(a),this):this.En};
$.g.vB=function(a){this.jl||(this.jl=new $.$u);var b={};a&&(b.value={value:a.get("value"),type:"string"},b.weight={value:a.j("weight"),type:"number"});this.jl.lg(a);return $.Lt(this.jl,b)};$.g.vq=function(a){if(a){"array"==$.ka(a)&&(a=a[0]);if(!$.K(a,$.Bs)&&(a=this.data().Wo("value",a)[0],!a))return;this.RJ=a;Qha(this,a);this.u(20,1)}};$.g.Tw=function(){Rha(this);this.RJ&&this.RJ.getParent()&&this.vq(this.RJ.getParent());return this};
$.g.Hea=function(a){var b=0;$.W(a,8192)&&(b|=16);$.W(a,8)&&(b|=4);this.u(b,1)};$.g.xd=function(a){$.W(a,16)&&this.u(4100,9)};$.g.qx=function(a){a.button==$.ki&&(a=a.domTarget.tag)&&a.node&&(Rha(this),this.vq(a.node))};$.g.cg=function(a){var b=a.domTarget.tag;if(b&&b.node&&!b.A_){var c=b.node;b=this.Ya();$.iv(b,a.clientX,a.clientY,this.vB(c))}else this.Ya().Wc()};$.g.rg=function(){this.Ya().Wc()};
$.g.AV=function(a){if("implicit"==this.Zd){if($.p(a)){if(this.wM!=a||this.dZ){this.dZ=!1;if(null===a||/^[\s\xa0]*$/.test(a))a=this.sv[0][0];this.wM=a;for(var b=[],c=0;c<this.sv.length;c++){var d=(0,$.xa)(this.sv[c],a);-1!=d&&b.push($.Ia(this.sv[c],d))}b.length||(b[0]=[a]);a=b[0][0];$.U(this.data());this.data().Wb()&&this.data().ij(0);c={value:a};c=this.data().$f(c,0);for(d=0;d<b.length;d++){var e=b[d];e[0]==a&&(e.shift(),Sha(this,c,e))}this.data().da(!0)}return this}return this.wM}return this};
$.g.data=function(a,b){if($.p(a)){if($.K(a,$.ys)||$.K(a,$.vs))this.na!=a&&(this.na&&$.Xp(this.na,this.xd,this),this.na=a,$.L(this.na,this.xd,this),this.Zd="explicit",this.u(4100,1));else if("array"==$.ka(a)&&"object"==$.ka(a[0]))this.data($.Ms(a,b));else if(null===a)this.na&&($.Xp(this.na,this.xd),this.na.ad()),this.na=null,this.u(4100,1);else{this.Zd="implicit";this.Vf=a;if("array"==$.ka(a)&&a.length)if(this.sv=[],"array"==$.ka(a[0]))for(var c=0;c<a.length;c++)this.sv.push(G4(a[c][0]));else{if("string"==
$.ka(a[0]))for(c=0;c<a.length;c++)this.sv.push(G4(a[c]))}else if("string"==$.ka(a)){c=Tha(a);for(var d=[],e=0;e<c.length;e++)d.push(G4(c[e]));this.sv=d}else this.sv=[[a.toString()]];this.na||Uha(this,$.Ms());this.dZ=!0;this.AV(this.sv[0][0])}return this}return this.na};$.g.si=function(){var a;0<this.vs.length?a=this.vs.pop():a=new $.kh;return a};$.g.AT=function(a){if(a){var b=a.j("textWidth"),c=this.il().i("offset"),d=a.getParent();d&&1<d.Wb()&&(b+=c);1<a.Wb()&&(b+=c);return b}return 0};
$.g.depth=function(a){if(a){var b=a.Wb(),c=0,d=a.getParent();d&&(c=d.j("depth")+1);a.j("depth",c);for(c=0;c<b;c++)this.depth(a.Jd(c))}};$.g.Sw=function(a,b,c,d,e,f){var h=this.si();h.tag||(h.tag={});h.text(c);h.y(b);h.x(a);h.fontSize(d);h.fontFamily(e);h.fontWeight(f);h.width(null);h.visible(!0);this.Vt.push(h);return h};$.g.GB=function(a,b,c,d,e){var f=this.sB,h=this.yS(a,c),k=h(e);e=h(1-e);f.moveTo(a,b).fk(k,b,e,d,c,d)};
$.g.MJ=function(a,b){var c=0,d=a.getParent();d&&1<d.Wb()&&(c+=this.il().i("offset"));var e=a.get("value");1==a.Wb()&&(e+=" ");c=a.j("nodePositionX")+c;d=a.j("nodePositionY");var f=a.get("fontFamily")||this.i("fontFamily");var h=a.get("fontWeight")||this.i("fontWeight");var k=Vha(this,a,b);f=this.Sw(c,d,e,k,f,h);f.tag={node:a,type:"node",A_:!1};h=f.LF();e=f.CR();a.j("textHeight",h).j("textWidth",e);d-=h/2;h=c+e;k=this.Mf.$a();h>k&&f.width(e-(h-k)-.05*e);f.x(c).y(d)};
$.g.Ji=function(a){if(!this.zf())if(this.ta||(this.ta=this.Ua.Nd(),this.sB=new $.bg,this.ta.zIndex(30)),this.ej())this.ta.Ti();else{var b=this.Vq=this.na.Jd(0);this.J(4096)&&(Wha(this,this.Vq),this.depth(this.Vq),this.Tg.length=0,this.Tg=this.data().hv().bB(),this.I(4096));if(this.J(4)){this.ta.Ti();var c=a.left;var d=a.top;a=a.height;for(var e=this.il(),f=e.i("offset"),h=0;h<this.Vt.length;h++){var k=this.Vt[h];this.vs.push(k)}this.Vt.length=0;this.sB.clear();this.ta.suspend();k=[c+f,d+a/2];b.j("nodePositionX",
k[0]).j("nodePositionY",k[1]).j("height",a);this.MJ(b,!1);c=c+f+this.AT(b)+(1<b.Wb()?e.i("length"):0);Xha(this,b,k,c,d,d+a);this.sB.parent(this.ta);this.I(4);for(h=0;h<this.Vt.length;h++)this.Vt[h].parent(this.ta);this.ta.resume();this.u(16)}if(this.J(16)){this.ta.suspend();this.sB.stroke(this.il().i("stroke"));d=this.i("fontColor");c=this.i("fontDecoration");a=this.i("fontStyle");e=this.i("fontOpacity");for(f=0;f<this.Vt.length;f++){b=this.Vt[f];if(b.tag&&b.tag.node){var l=b.tag.node;var m=l.get("fontColor")||
d;var n=l.get("fontDecoration")||c;var q=l.get("fontStyle")||a;l=l.get("fontOpacity")||e}b.color(m);b.rq(n);b.fontStyle(q);b.opacity(l);b.bm(!1)}this.ta.resume();this.I(16)}}};$.g.F=function(){var a=F4.B.F.call(this);$.Bp(this,I4,a);"implicit"==this.Zd&&(a.wordTreeRawData=JSON.stringify(this.Vf),a.word=this.wM);a.treeData=this.data().iA(["hidden"]);a.connectors=this.il().F();return{chart:a}};
$.g.Y=function(a,b){F4.B.Y.call(this,a,b);$.tp(this,I4,a,b);"wordTreeRawData"in a?(this.data(JSON.parse(a.wordTreeRawData)),"word"in a&&this.AV(a.word),"treeData"in a&&Uha(this,$.As(a.treeData))):"treeData"in a&&this.data($.As(a.treeData));"connectors"in a&&this.il().ja(!!b,a.connectors)};$.g.R=function(){F4.B.R.call(this);$.jd(this.En,this.sB,this.Vt,this.vs,this.na,this.ta);this.na=this.sB=this.En=null;this.Vt.length=0;this.vs.length=0;this.ta=null};var J4=F4.prototype;J4.connectors=J4.il;
J4.word=J4.AV;J4.getType=J4.Qa;J4.drillTo=J4.vq;J4.drillUp=J4.Tw;J4.toCsv=J4.Xj;J4.noData=J4.zm;$.Fo.wordtree=Yha;$.F("anychart.wordtree",Yha);}).call(this,$)}
