UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 30.2 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[89190],{77957:function(e,t,a){var i=a(76080),n=a(79504),o=a(47055),r=a(48981),s=a(56969),l=a(26198),u=a(2360),c=a(35370),d=Array,p=n([].push);e.exports=function(e,t,a,n){for(var g,f,h,y=r(e),v=o(y),m=i(t,a),_=u(null),S=l(v),b=0;S>b;b++)h=v[b],(f=s(m(h,b,y)))in _?p(_[f],h):_[f]=[h];if(n&&(g=n(y))!==d)for(f in _)_[f]=c(g,_[f]);return _}},3690:function(e,t,a){a(15823)("Uint16",function(e){return function(t,a,i){return e(this,t,a,i)}})},46058:function(e,t,a){var i=a(46518),n=a(77957),o=a(6469);i({target:"Array",proto:!0},{group:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),o("group")},13611:function(e,t,a){var i=a(46518),n=a(44576),o=a(62106),r=a(43724),s=TypeError,l=Object.defineProperty,u=n.self!==n;try{if(r){var c=Object.getOwnPropertyDescriptor(n,"self");!u&&c&&c.get&&c.enumerable||o(n,"self",{get:function(){return n},set:function(e){if(this!==n)throw new s("Illegal invocation");l(n,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:u},{self:n})}catch(d){}},52164:function(e,t,a){a.r(t),a.d(t,{install:function(){return Oe}});var i=a(6471),n=(a(44114),a(40445)),o=a(56145),r=a(52577),s=a(99904),l=a(54202),u=a(4088),c=a(5990),d=a(16890),p=a(62876),g=(a(27495),"--\x3e"),f=function(e){return e.get("autoCurveness")||null},h=function(e,t){var a=f(e),i=20,n=[];if(r.isNumber(a))i=a;else if(r.isArray(a))return void(e.__curvenessList=a);t>i&&(i=t);var o=i%2?i+2:i+3;n=[];for(var s=0;s<o;s++)n.push((s%2?s+1:s)/10*(s%2?-1:1));e.__curvenessList=n},y=function(e,t,a){var i=[e.id,e.dataIndex].join("."),n=[t.id,t.dataIndex].join(".");return[a.uid,i,n].join(g)},v=function(e){var t=e.split(g);return[t[0],t[2],t[1]].join(g)},m=function(e,t){var a=t.__edgeMap;return a[e]?a[e].length:0};function _(e,t,a,i){var n=f(t),o=r.isArray(n);if(!n)return null;var s=function(e,t){var a=y(e.node1,e.node2,t);return t.__edgeMap[a]}(e,t);if(!s)return null;for(var l=-1,u=0;u<s.length;u++)if(s[u]===a){l=u;break}var c=function(e,t){return m(y(e.node1,e.node2,t),t)+m(y(e.node2,e.node1,t),t)}(e,t);h(t,c),e.lineStyle=e.lineStyle||{};var d=y(e.node1,e.node2,t),p=t.__curvenessList,g=o||c%2?0:1;if(s.isForward)return p[g+l];var _=v(d),S=m(_,t),b=p[l+S+g];return i?o?n&&0===n[0]?(S+g)%2?b:-b:((S%2?0:1)+g)%2?b:-b:(S+g)%2?b:-b:p[l+S+g]}var S=a(16418),b=a(66834),L="graph",x=function(e){function t(){var a=null!==e&&e.apply(this,arguments)||this;return a.type=t.type,a.hasSymbolVisual=!0,a}return(0,n.C6)(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var a=this;function i(){return a._categoriesData}this.legendVisualProvider=new u.A(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),(0,i.M5)(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var a,i=e.edges||e.links||[],n=e.data||e.nodes||[],o=this;if(n&&i){f(a=this)&&(a.__curvenessList=[],a.__edgeMap={},h(a));var u=(0,l.A)(n,i,this,!0,function(e,t){e.wrapMethod("getItemModel",function(e){var t=o._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e});var a=s.A.prototype.getModel;function i(e,t){var i=a.call(this,e,t);return i.resolveParentPath=n,i}function n(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",function(e){return e.resolveParentPath=n,e.getModel=i,e})});return r.each(u.edges,function(e){!function(e,t,a,i){if(f(a)){var n=y(e,t,a),o=a.__edgeMap,r=o[v(n)];o[n]&&!r?o[n].isForward=!0:r&&o[n]&&(r.isForward=!0,o[n].isForward=!1),o[n]=o[n]||[],o[n].push(i)}}(e.node1,e.node2,this,e.dataIndex)},this),u.data}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,a){if("edge"===a){var i=this.getData(),n=this.getDataParams(e,a),o=i.graph.getEdgeByIndex(e),r=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=r&&l.push(r),null!=s&&l.push(s),(0,d.Qx)("nameValue",{name:l.join(" > "),value:n.value,noValue:null==n.value})}return(0,p.J)({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=r.map(this.option.categories||[],function(e){return null!=e.value?e:r.extend({value:0},e)}),t=new o.A(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e)})},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.prototype.__ownRoamView=function(){var e=this.coordinateSystem;return(0,b.yD)(e)&&e},t.type="series."+L,t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:S.A.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:S.A.color.primary}}},t}(c.A),I=x;function A(e){return e instanceof Array||(e=[e,e]),e}var w=(0,i.O9)(L,function(e){e.eachSeriesByType(L,function(e){var t=e.getGraph(),a=e.getEdgeData(),i=A(e.get("edgeSymbol")),n=A(e.get("edgeSymbolSize"));a.setVisual("fromSymbol",i&&i[0]),a.setVisual("toSymbol",i&&i[1]),a.setVisual("fromSymbolSize",n&&n[0]),a.setVisual("toSymbolSize",n&&n[1]),a.setVisual("style",e.getModel("lineStyle").getLineStyle()),a.each(function(e){var i=a.getItemModel(e),n=t.getEdgeByIndex(e),o=A(i.getShallow("symbol",!0)),s=A(i.getShallow("symbolSize",!0)),l=i.getModel("lineStyle").getLineStyle(),u=a.ensureUniqueItemVisual(e,"style");switch((0,r.extend)(u,l),u.stroke){case"source":var c=n.node1.getVisual("style");u.stroke=c&&c.fill;break;case"target":c=n.node2.getVisual("style");u.stroke=c&&c.fill}o[0]&&n.setVisual("fromSymbol",o[0]),o[1]&&n.setVisual("toSymbol",o[1]),s[0]&&n.setVisual("fromSymbolSize",s[0]),s[1]&&n.setVisual("toSymbolSize",s[1])})})});var N=a(81658);function M(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var a=e.getGraph();a.eachNode(function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])}),D(a,e)}}function D(e,t){e.eachEdge(function(e,a){var i=r.retrieve3(e.getModel().get(["lineStyle","curveness"]),-_(e,t,a,!0),0),n=N.clone(e.node1.getLayout()),o=N.clone(e.node2.getLayout()),s=[n,o];+i&&s.push([(n[0]+o[0])/2-(n[1]-o[1])*i,(n[1]+o[1])/2-(o[0]-n[0])*i]),e.setLayout(s)})}var T=(0,i.O9)(L,function(e,t){e.eachSeriesByType(L,function(e){var t=e.get("layout"),a=e.coordinateSystem;if(a&&"view"!==a.type){var i=e.getData(),n=[];(0,r.each)(a.dimensions,function(e){n=n.concat(i.mapDimensionsAll(e))});for(var o=0;o<i.count();o++){for(var s=[],l=!1,u=0;u<n.length;u++){var c=i.get(n[u],o);isNaN(c)||(l=!0),s.push(c)}l?i.setItemLayout(o,a.dataToPoint(s)):i.setItemLayout(o,[NaN,NaN])}D(i.graph,e)}else t&&"none"!==t||M(e)})});function V(e){var t=e.coordinateSystem;return(0,b.yD)(t)?(0,b.YP)(t,e):1}function E(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var C=Math.PI,P=[];function k(e,t,a,i){var n=e.coordinateSystem;if(!n||"view"===n.type){var o=n.getBoundingRect(),s=e.getData(),l=s.graph,u=o.width/2+o.x,c=o.height/2+o.y,d=Math.min(o.width,o.height)/2,p=s.count();if(s.setLayout({cx:u,cy:c}),p){if(a){var g=n.pointToData(i),f=g[0],h=g[1],y=[f-u,h-c];N.normalize(y,y),N.scale(y,y,d),a.setLayout([u+y[0],c+y[1]],!0),z(a,e.get(["circular","rotateLabel"]),u,c)}O[t](e,l,s,d,u,c,p),l.eachEdge(function(t,a){var i,n=r.retrieve3(t.getModel().get(["lineStyle","curveness"]),_(t,e,a),0),o=N.clone(t.node1.getLayout()),s=N.clone(t.node2.getLayout()),l=(o[0]+s[0])/2,d=(o[1]+s[1])/2;+n&&(i=[u*(n*=3)+l*(1-n),c*n+d*(1-n)]),t.setLayout([o,s,i])})}}}var O={value:function(e,t,a,i,n,o,r){var s=0,l=a.getSum("value"),u=2*Math.PI/(l||r);t.eachNode(function(e){var t=e.getValue("value"),a=u*(l?t:1)/2;s+=a,e.setLayout([i*Math.cos(s)+n,i*Math.sin(s)+o]),s+=a})},symbolSize:function(e,t,a,i,n,o,r){var s=0;P.length=r;var l=V(e);t.eachNode(function(e){var t=E(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=l;var a=Math.asin(t/2/i);isNaN(a)&&(a=C/2),P[e.dataIndex]=a,s+=2*a});var u=(2*C-s)/r/2,c=0;t.eachNode(function(e){var t=u+P[e.dataIndex];c+=t,(!e.getLayout()||!e.getLayout().fixed)&&e.setLayout([i*Math.cos(c)+n,i*Math.sin(c)+o]),c+=t})}};function z(e,t,a,i){var n=e.getGraphicEl();if(n){var o=e.getModel().get(["label","rotate"])||0,s=n.getSymbolPath();if(t){var l=e.getLayout(),u=Math.atan2(l[1]-i,l[0]-a);u<0&&(u=2*Math.PI+u);var c=l[0]<a;c&&(u-=Math.PI);var d=c?"left":"right";s.setTextConfig({rotation:-u,position:d,origin:"center"});var p=s.ensureState("emphasis");r.extend(p.textConfig||(p.textConfig={}),{position:d})}else s.setTextConfig({rotation:o*=Math.PI/180})}}var R=(0,i.O9)(L,function(e){e.eachSeriesByType("graph",function(e){"circular"===e.get("layout")&&k(e,"symbolSize")})});var B=N.scaleAndAdd;var G=a(88877),j=(0,i.O9)(L,function(e){e.eachSeriesByType(L,function(e){var t=e.coordinateSystem;if(!t||"view"===t.type)if("force"===e.get("layout")){var a=e.preservedPoints||{},i=e.getGraph(),n=i.data,o=i.edgeData,s=e.getModel("force"),l=s.get("initLayout");e.preservedPoints?n.each(function(e){var t=n.getId(e);n.setItemLayout(e,a[t]||[NaN,NaN])}):l&&"none"!==l?"circular"===l&&k(e,"value"):M(e);var u=n.getDataExtent("value"),c=o.getDataExtent("value"),d=s.get("repulsion"),p=s.get("edgeLength"),g=r.isArray(d)?d:[d,d],f=r.isArray(p)?p:[p,p];f=[f[1],f[0]];var h=n.mapArray("value",function(e,t){var a=n.getItemLayout(t),i=(0,G.Cb)(e,u,g);return isNaN(i)&&(i=(g[0]+g[1])/2),{w:i,rep:i,fixed:n.getItemModel(t).get("fixed"),p:!a||isNaN(a[0])||isNaN(a[1])?null:a}}),y=o.mapArray("value",function(t,a){var n=i.getEdgeByIndex(a),o=(0,G.Cb)(t,c,f);isNaN(o)&&(o=(f[0]+f[1])/2);var s=n.getModel(),l=r.retrieve3(n.getModel().get(["lineStyle","curveness"]),-_(n,e,a,!0),0);return{n1:h[n.node1.dataIndex],n2:h[n.node2.dataIndex],d:o,curveness:l,ignoreForceLayout:s.get("ignoreForceLayout")}}),v=t.getBoundingRect(),m=function(e,t,a){for(var i=e,n=t,o=a.rect,r=o.width,s=o.height,l=[o.x+r/2,o.y+s/2],u=null==a.gravity?.1:a.gravity,c=0;c<i.length;c++){var d=i[c];d.p||(d.p=N.create(r*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),d.pp=N.clone(d.p),d.edges=null}var p,g,f=null==a.friction?.6:a.friction,h=f;return{warmUp:function(){h=.8*f},setFixed:function(e){i[e].fixed=!0},setUnfixed:function(e){i[e].fixed=!1},beforeStep:function(e){p=e},afterStep:function(e){g=e},step:function(e){p&&p(i,n);for(var t=[],a=i.length,o=0;o<n.length;o++){var r=n[o];if(!r.ignoreForceLayout){var s=r.n1,c=r.n2;N.sub(t,c.p,s.p);var d=N.len(t)-r.d,f=c.w/(s.w+c.w);isNaN(f)&&(f=0),N.normalize(t,t),!s.fixed&&B(s.p,s.p,t,f*d*h),!c.fixed&&B(c.p,c.p,t,-(1-f)*d*h)}}for(o=0;o<a;o++)(_=i[o]).fixed||(N.sub(t,l,_.p),B(_.p,_.p,t,u*h));for(o=0;o<a;o++){s=i[o];for(var y=o+1;y<a;y++){c=i[y],N.sub(t,c.p,s.p),0===(d=N.len(t))&&(N.set(t,Math.random()-.5,Math.random()-.5),d=1);var v=(s.rep+c.rep)/d/d;!s.fixed&&B(s.pp,s.pp,t,v),!c.fixed&&B(c.pp,c.pp,t,-v)}}var m=[];for(o=0;o<a;o++){var _;(_=i[o]).fixed||(N.sub(m,_.p,_.pp),B(_.p,_.p,m,h),N.copy(_.pp,_.p))}var S=(h*=.992)<.01;g&&g(i,n,S),e&&e(S)}}}(h,y,{rect:v,gravity:s.get("gravity"),friction:s.get("friction")});m.beforeStep(function(e,t){for(var a=0,n=e.length;a<n;a++)e[a].fixed&&N.copy(e[a].p,i.getNodeByIndex(a).getLayout())}),m.afterStep(function(e,t,o){for(var r=0,s=e.length;r<s;r++)e[r].fixed||i.getNodeByIndex(r).setLayout(e[r].p),a[n.getId(r)]=e[r].p;for(r=0,s=t.length;r<s;r++){var l=t[r],u=i.getEdgeByIndex(r),c=l.n1.p,d=l.n2.p,p=u.getLayout();(p=p?p.slice():[])[0]=p[0]||[],p[1]=p[1]||[],N.copy(p[0],c),N.copy(p[1],d),+l.curveness&&(p[2]=[(c[0]+d[0])/2-(c[1]-d[1])*l.curveness,(c[1]+d[1])/2-(d[0]-c[0])*l.curveness]),u.setLayout(p)}}),e.forceLayout=m,e.preservedPoints=a,m.step()}else e.forceLayout=null})});var F=a(83354),U=a(51474),Y=a(71034),X=a(42605);function W(e,t){var a=[];return e.eachSeriesByType("graph",function(e){(0,Y.m7)({targetModel:e,coordSysType:"view",coordSysProvider:function(){var i=e.getData(),n=i.mapArray(function(e){var t=i.getItemModel(e);return[+t.get("x"),+t.get("y")]}),o=[],s=[];U.Cr(n,o,s),s[0]-o[0]===0&&(s[0]+=1,o[0]-=1);s[1]-o[1]===0&&(s[1]+=1,o[1]-=1);var l=(s[0]-o[0])/(s[1]-o[1]),u=function(e,t,a){var i=(0,F.Lj)(e,t),n=(0,r.extend)(e.getBoxLayoutParams(),{aspect:a}),o=(0,F.dV)(n,i.refContainer);return(0,F.FJ)(e,o,a)}(e,t,l);isNaN(l)&&(o=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var c=s[0]-o[0],d=s[1]-o[1],p=(0,X.ao)(e,t,o[0],o[1],c,d,u);return a.push(p),p},isDefaultDataCoordSys:!0})}),a}a(46058);var q=a(59689),H=a(22785),K=a(26322),Z=a(41144),J=a(46700),Q=a(61618),$=a(79231),ee=J.A.prototype,te=Q.A.prototype,ae=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(0,n.C6)(t,e)}(ae);function ie(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var ne=function(e){function t(t){var a=e.call(this,t)||this;return a.type="ec-line",a}return(0,n.C6)(t,e),t.prototype.getDefaultStyle=function(){return{stroke:S.A.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new ae},t.prototype.buildPath=function(e,t){ie(t)?ee.buildPath.call(this,e,t):te.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return ie(this.shape)?ee.pointAt.call(this,e):te.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,a=ie(t)?[t.x2-t.x1,t.y2-t.y1]:te.tangentAt.call(this,e);return N.normalize(a,a)},t}($.Ay),oe=a(52557),re=a(9078),se=a(79825),le=["fromSymbol","toSymbol"];function ue(e){return"_"+e+"Type"}function ce(e,t,a){var i=t.getItemVisual(a,e);if(!i||"none"===i)return i;var n=t.getItemVisual(a,e+"Size"),o=t.getItemVisual(a,e+"Rotate"),r=t.getItemVisual(a,e+"Offset"),s=t.getItemVisual(a,e+"KeepAspect"),l=Z.xU(n);return i+l+Z.hV(r||0,l)+(o||"")+(s||"")}function de(e,t,a){var i=t.getItemVisual(a,e);if(i&&"none"!==i){var n=t.getItemVisual(a,e+"Size"),o=t.getItemVisual(a,e+"Rotate"),r=t.getItemVisual(a,e+"Offset"),s=t.getItemVisual(a,e+"KeepAspect"),l=Z.xU(n),u=Z.hV(r||0,l),c=Z.v5(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,c.name=e,c}}function pe(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var a=t[2];a?(e.cpx1=a[0],e.cpy1=a[1]):(e.cpx1=NaN,e.cpy1=NaN)}var ge=function(e){function t(t,a,i){var n=e.call(this)||this;return n._createLine(t,a,i),n}return(0,n.C6)(t,e),t.prototype._createLine=function(e,t,a){var i=e.hostModel,n=e.getItemLayout(t),o=e.getItemVisual(t,"z2"),s=function(e){var t=new ne({name:"line",subPixelOptimize:!0});return pe(t.shape,e),t}(n);s.shape.percent=0,oe.LW(s,{z2:(0,r.retrieve2)(o,0),shape:{percent:1}},i,t),this.add(s),(0,r.each)(le,function(a){var i=de(a,e,t);this.add(i),this[ue(a)]=ce(a,e,t)},this),this._updateCommonStl(e,t,a)},t.prototype.updateData=function(e,t,a){var i=e.hostModel,n=this.childOfName("line"),o=e.getItemLayout(t),s={shape:{}};pe(s.shape,o),oe.oi(n,s,i,t),(0,r.each)(le,function(a){var i=ce(a,e,t),n=ue(a);if(this[n]!==i){this.remove(this.childOfName(a));var o=de(a,e,t);this.add(o)}this[n]=i},this),this._updateCommonStl(e,t,a)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,a){var i=e.hostModel,n=this.childOfName("line"),o=a&&a.emphasisLineStyle,s=a&&a.blurLineStyle,l=a&&a.selectLineStyle,u=a&&a.labelStatesModels,c=a&&a.emphasisDisabled,d=a&&a.focus,p=a&&a.blurScope;if(!a||e.hasItemOption){var g=e.getItemModel(t),f=g.getModel("emphasis");o=f.getModel("lineStyle").getLineStyle(),s=g.getModel(["blur","lineStyle"]).getLineStyle(),l=g.getModel(["select","lineStyle"]).getLineStyle(),c=f.get("disabled"),d=f.get("focus"),p=f.get("blurScope"),u=(0,se.lx)(g)}var h=e.getItemVisual(t,"style"),y=h.stroke;n.useStyle(h),n.style.fill=null,n.style.strokeNoScale=!0,n.ensureState("emphasis").style=o,n.ensureState("blur").style=s,n.ensureState("select").style=l,(0,r.each)(le,function(e){var t=this.childOfName(e);if(t){t.setColor(y),t.style.opacity=h.opacity;for(var a=0;a<re.BV.length;a++){var i=re.BV[a],o=n.getState(i);if(o){var r=o.style||{},s=t.ensureState(i),l=s.style||(s.style={});null!=r.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=r.stroke),null!=r.opacity&&(l.opacity=r.opacity)}}t.markRedraw()}},this);var v=i.getRawValue(t);(0,se.qM)(this,u,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,a){return i.getFormattedLabel(t,a,e.dataType)}},inheritColor:y||S.A.color.neutral99,defaultOpacity:h.opacity,defaultText:(null==v?e.getName(t):isFinite(v)?(0,G.LI)(v,10):v)+""});var m=this.getTextContent();if(m){var _=u.normal;m.__align=m.style.align,m.__verticalAlign=m.style.verticalAlign,m.__position=_.get("position")||"middle";var b=_.get("distance");(0,r.isArray)(b)||(b=[b,b]),m.__labelDistance=b}this.setTextConfig({position:null,local:!0,inside:!1}),(0,re.Lm)(this,d,p,c)},t.prototype.highlight=function(){(0,re.HY)(this)},t.prototype.downplay=function(){(0,re.SD)(this)},t.prototype.updateLayout=function(e,t){this.childOfName("line").stopAnimation(),this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");pe(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),a=e.childOfName("toSymbol"),i=e.getTextContent();if(t||a||i&&!i.ignore){for(var n=1,o=this.parent;o;)o.scaleX&&(n/=o.scaleX),o=o.parent;var r=e.childOfName("line");if(this.__dirty||r.__dirty){var s=r.shape.percent,l=r.pointAt(0),u=r.pointAt(s),c=N.sub([],u,l);if(N.normalize(c,c),t&&(t.setPosition(l),x(t,0),t.scaleX=t.scaleY=n*s,t.markRedraw()),a&&(a.setPosition(u),x(a,1),a.scaleX=a.scaleY=n*s,a.markRedraw()),i&&!i.ignore){i.x=i.y=0,i.originX=i.originY=0;var d=void 0,p=void 0,g=i.__labelDistance,f=g[0]*n,h=g[1]*n,y=s/2,v=r.tangentAt(y),m=[v[1],-v[0]],_=r.pointAt(y);m[1]>0&&(m[0]=-m[0],m[1]=-m[1]);var S=v[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(v[1],v[0]);u[0]<l[0]&&(b=Math.PI+b),i.rotation=b}var L=void 0;switch(i.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":L=-h,p="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":L=h,p="top";break;default:L=0,p="middle"}switch(i.__position){case"end":i.x=c[0]*f+u[0],i.y=c[1]*h+u[1],d=c[0]>.8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*f+l[0],i.y=-c[1]*h+l[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*S+l[0],i.y=l[1]+L,d=v[0]<0?"right":"left",i.originX=-f*S,i.originY=-L;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+L,d="center",i.originY=-L;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*S+u[0],i.y=u[1]+L,d=v[0]>=0?"right":"left",i.originX=f*S,i.originY=-L}i.scaleX=i.scaleY=n,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||d})}}}function x(e,t){var a=e.__specifiedRotation;if(null==a){var i=r.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",a)}},t}(H.A);function fe(e){var t=e.hostModel,a=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:a.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:a.get("disabled"),blurScope:a.get("blurScope"),focus:a.get("focus"),labelStatesModels:(0,se.lx)(t)}}function he(e){return isNaN(e[0])||isNaN(e[1])}function ye(e){return e&&!he(e[0])&&!he(e[1])}var ve=function(){function e(e){this.group=new H.A,this._LineCtor=e||ge}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var a=this,i=a.group,n=a._lineData;a._lineData=e,n||i.removeAll();var o=fe(e);e.diff(n).add(function(a){t._doAdd(e,a,o)}).update(function(a,i){t._doUpdate(n,e,i,a,o)}).remove(function(e){i.remove(n.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,a){t.updateLayout(e,a)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=fe(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,a){function i(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=a,e.ensureState("emphasis").hoverLayer=K.HOVER_LAYER_FOR_INCREMENTAL)}this._progressiveEls=[];for(var n=e.start;n<e.end;n++){if(ye(t.getItemLayout(n))){var o=new this._LineCtor(t,n,this._seriesScope);o.traverse(i),this.group.add(o),t.setItemGraphicEl(n,o),this._progressiveEls.push(o)}}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){K.traverseElements(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,a){if(ye(e.getItemLayout(t))){var i=new this._LineCtor(e,t,a);e.setItemGraphicEl(t,i),this.group.add(i)}},e.prototype._doUpdate=function(e,t,a,i,n){var o=e.getItemGraphicEl(a);ye(t.getItemLayout(i))?(o?o.updateData(t,i,n):o=new this._LineCtor(t,i,n),t.setItemGraphicEl(i,o),this.group.add(o)):this.group.remove(o)},e}(),me=a(16329),_e=a(11054),Se=[],be=[],Le=[],xe=_e.k3,Ie=N.distSquare,Ae=Math.abs;function we(e,t,a){for(var i,n=e[0],o=e[1],r=e[2],s=1/0,l=a*a,u=.1,c=.1;c<=.9;c+=.1){Se[0]=xe(n[0],o[0],r[0],c),Se[1]=xe(n[1],o[1],r[1],c),(g=Ae(Ie(Se,t)-l))<s&&(s=g,i=c)}for(var d=0;d<32;d++){var p=i+u;be[0]=xe(n[0],o[0],r[0],i),be[1]=xe(n[1],o[1],r[1],i),Le[0]=xe(n[0],o[0],r[0],p),Le[1]=xe(n[1],o[1],r[1],p);var g=Ie(be,t)-l;if(Ae(g)<.01)break;var f=Ie(Le,t)-l;u/=2,g<0?f>=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function Ne(e,t){var a=[],i=_e.kx,n=[[],[],[]],o=[[],[]],r=[];t/=2,e.eachEdge(function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),c=e.getVisual("toSymbol");l.__original||(l.__original=[N.clone(l[0]),N.clone(l[1])],l[2]&&l.__original.push(N.clone(l[2])));var d=l.__original;if(null!=l[2]){if(N.copy(n[0],d[0]),N.copy(n[1],d[2]),N.copy(n[2],d[1]),u&&"none"!==u){var p=E(e.node1),g=we(n,d[0],p*t);i(n[0][0],n[1][0],n[2][0],g,a),n[0][0]=a[3],n[1][0]=a[4],i(n[0][1],n[1][1],n[2][1],g,a),n[0][1]=a[3],n[1][1]=a[4]}if(c&&"none"!==c){p=E(e.node2),g=we(n,d[1],p*t);i(n[0][0],n[1][0],n[2][0],g,a),n[1][0]=a[1],n[2][0]=a[2],i(n[0][1],n[1][1],n[2][1],g,a),n[1][1]=a[1],n[2][1]=a[2]}N.copy(l[0],n[0]),N.copy(l[1],n[2]),N.copy(l[2],n[1])}else{if(N.copy(o[0],d[0]),N.copy(o[1],d[1]),N.sub(r,o[1],o[0]),N.normalize(r,r),u&&"none"!==u){p=E(e.node1);N.scaleAndAdd(o[0],o[0],r,p*t)}if(c&&"none"!==c){p=E(e.node2);N.scaleAndAdd(o[1],o[1],r,-p*t)}N.copy(l[0],o[0]),N.copy(l[1],o[1])}})}var Me=a(27275),De=a(90057),Te=(0,i.$r)();var Ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=L,t}return(0,n.C6)(t,e),t.prototype.init=function(e,t){var a=new q.A,i=new ve,n=this.group,o=new H.A;this._controller=new me.A(t.getZr()),o.add(a.group),o.add(i.group),n.add(o),this._symbolDraw=a,this._lineDraw=i,this._mainGroup=o,this._firstRender=!0},t.prototype.render=function(e,t,a){var i=this,n=(0,b.Nl)(e),o=!1;this._model=e,this._api=a,this._active=!0;var r=this._mainGroup,s=this._getThumbnailInfo();s&&s.bridge.reset(a);var l=this._symbolDraw,u=this._lineDraw;n&&(0,b.nT)(r,b.ZD,n,this._firstRender?null:e),Ne(e.getGraph(),V(e));var c=e.getData();l.updateData(c);var d=e.getEdgeData();u.updateData(d),this._updateNodeAndLinkScale(),n&&(0,X.jg)(e,a,this._controller,function(t,a,i){return e.coordinateSystem.containPoint([a,i])},null),clearTimeout(this._layoutTimeout);var p=e.forceLayout,g=e.get(["force","layoutAnimation"]);p&&(o=!0,this._startForceLayoutIteration(p,a,g));var f=e.get("layout");c.graph.eachNode(function(t){var n=t.dataIndex,o=t.getGraphicEl(),r=t.getModel();if(o){o.off("drag").off("dragend");var s=r.get("draggable");s&&o.on("drag",function(r){switch(f){case"force":p.warmUp(),!i._layouting&&i._startForceLayoutIteration(p,a,g),p.setFixed(n),c.setItemLayout(n,[o.x,o.y]);break;case"circular":c.setItemLayout(n,[o.x,o.y]),t.setLayout({fixed:!0},!0),k(e,"symbolSize",t,[r.offsetX,r.offsetY]),i.updateLayout(e);break;default:c.setItemLayout(n,[o.x,o.y]),D(e.getGraph(),e),i.updateLayout(e)}}).on("dragend",function(){p&&p.setUnfixed(n)}),o.setDraggable(s,!!r.get("cursor")),"adjacency"===r.get(["emphasis","focus"])&&((0,De.z)(o).focus=t.getAdjacentDataIndices())}}),c.graph.eachEdge(function(e){var t=e.getGraphicEl(),a=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===a&&((0,De.z)(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})});var h="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),y=c.getLayout("cx"),v=c.getLayout("cy");c.graph.eachNode(function(e){z(e,h,y,v)}),this._firstRender=!1,o||this._renderThumbnail(e,a,this._symbolDraw,this._lineDraw)},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},t.prototype._startForceLayoutIteration=function(e,t,a){var i=this,n=!1;!function o(){e.step(function(e){i.updateLayout(i._model),!e&&n||(n=!0,i._renderThumbnail(i._model,t,i._symbolDraw,i._lineDraw)),(i._layouting=!e)&&(a?i._layoutTimeout=setTimeout(o,16):o())})}()},t.prototype.__updateOnOwnRoam=function(e,t,a){var i=(0,b.Nl)(t);this._active&&i&&((0,b.nT)(this._mainGroup,b.ZD,i,null),(0,X.LZ)(e)&&(this._updateNodeAndLinkScale(),Ne(t.getGraph(),V(t)),this._lineDraw.updateLayout(),a.updateLabelLayout()),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),a=V(e);t.eachItemGraphicEl(function(e,t){e&&e.setSymbolScale(a)})},t.prototype.updateLayout=function(e){this._active&&(Ne(e.getGraph(),V(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},t.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},t.prototype._getThumbnailInfo=function(){var e=this._model,t=e.coordinateSystem;if("view"===t.type){var a=function(e){if(e)return Te(e).bridge}(e);if(a)return{bridge:a,coordSys:t}}},t.prototype._updateThumbnailWindow=function(){var e=this._getThumbnailInfo();e&&e.bridge.updateWindow((0,b.rj)(null,e.coordSys),this._api)},t.prototype._renderThumbnail=function(e,t,a,i){var n=this._getThumbnailInfo();if(n){var o=new H.A,s=a.group.children(),l=i.group.children(),u=new H.A,c=new H.A;o.add(c),o.add(u);for(var d=0;d<s.length;d++){var p=(_=s[d]).children()[0],g=_.x,f=_.y,h=(0,r.clone)(p.shape),y=(0,r.extend)(h,{width:p.scaleX,height:p.scaleY,x:g-p.scaleX/2,y:f-p.scaleY/2}),v=(0,r.clone)(p.style),m=new p.constructor({shape:y,style:v,z2:151});c.add(m)}for(d=0;d<l.length;d++){var _,S=(_=l[d]).children()[0],L=(v=(0,r.clone)(S.style),y=(0,r.clone)(S.shape),new ne({style:v,shape:y,z2:151}));u.add(L)}n.bridge.renderContent({api:t,roamType:e.get("roam"),viewportRect:null,group:o,targetTrans:(0,b.rj)(null,n.coordSys)})}},t.type=L,t}(Me.A),Ee=Ve,Ce=(0,i.O9)(L,function(e){var t=e.findComponents({mainType:"legend"});if(!t||!t.length)return;e.eachSeriesByType(L,function(e){var a=e.getCategoriesData(),i=e.getGraph().data,n=a.mapArray(a.getName);i.filterSelf(function(e){var a=i.getItemModel(e).getShallow("category");if(null!=a){(0,r.isNumber)(a)&&(a=n[a]);for(var o=0;o<t.length;o++)if(!t[o].isSelected(a))return!1}return!0})})});var Pe=(0,i.O9)(L,function(e){var t={};e.eachSeriesByType(L,function(e){var a=e.getCategoriesData(),i=e.getData(),n={};a.each(function(i){var o=a.getName(i);n["ec-"+o]=i;var r=a.getItemModel(i),s=r.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(o,t)),a.setItemVisual(i,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=r.getShallow(l[u],!0);null!=c&&a.setItemVisual(i,l[u],c)}}),a.count()&&i.each(function(e){var t=i.getItemModel(e).getShallow("category");if(null!=t){(0,r.isString)(t)&&(t=n["ec-"+t]);var o=a.getItemVisual(t,"style"),s=i.ensureUniqueItemVisual(e,"style");(0,r.extend)(s,o);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++)i.setItemVisual(e,l[u],a.getItemVisual(t,l[u]))}})})});var ke=a(11975);function Oe(e){e.registerChartView(Ee),e.registerSeriesModel(I),e.registerProcessor(Ce),e.registerVisual(Pe),e.registerVisual(w),e.registerLayout(T),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,R),e.registerLayout(j),e.registerCoordinateSystem("graphView",{dimensions:b.Ay.dimensions,create:W}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},r.noop),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},r.noop),(0,X.Bs)(e,ke.t7,L)}},4088:function(e,t){var a=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}();t.A=a}}]);