UNPKG

iobroker.lovelace

Version:

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

1 lines 8.98 kB
export const __rspack_esm_id=72701;export const __rspack_esm_ids=[72701];export const __webpack_modules__={54202(t,e,n){n.d(e,{A:()=>v});n(44114);var a=n(52577),d=n(56145);function o(t){return"_EC_"+t}var i=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[o(t)]){var a=new r(t,e);return a.hostGraph=this,this.nodes.push(a),n[o(t)]=a,a}},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[o(t)]},t.prototype.addEdge=function(t,e,n){var d=this._nodesMap,i=this._edgesMap;if(a.isNumber(t)&&(t=this.nodes[t]),a.isNumber(e)&&(e=this.nodes[e]),t instanceof r||(t=d[o(t)]),e instanceof r||(e=d[o(e)]),t&&e){var u=t.id+"-"+e.id,h=new s(t,e,n);return h.hostGraph=this,this._directed&&(t.outEdges.push(h),e.inEdges.push(h)),t.edges.push(h),t!==e&&e.edges.push(h),this.edges.push(h),i[u]=h,h}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof r&&(t=t.id),e instanceof r&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,a=n.length,d=0;d<a;d++)n[d].dataIndex>=0&&t.call(e,n[d],d)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,a=n.length,d=0;d<a;d++)n[d].dataIndex>=0&&n[d].node1.dataIndex>=0&&n[d].node2.dataIndex>=0&&t.call(e,n[d],d)},t.prototype.breadthFirstTraverse=function(t,e,n,a){if(e instanceof r||(e=this._nodesMap[o(e)]),e){for(var d="out"===n?"outEdges":"in"===n?"inEdges":"edges",i=0;i<this.nodes.length;i++)this.nodes[i].__visited=!1;if(!t.call(a,e,null))for(var s=[e];s.length;){var u=s.shift(),h=u[d];for(i=0;i<h.length;i++){var c=h[i],g=c.node1===u?c.node2:c.node1;if(!g.__visited){if(t.call(a,g,u))return;s.push(g),g.__visited=!0}}}}},t.prototype.update=function(){for(var t=this.data,e=this.edgeData,n=this.nodes,a=this.edges,d=0,o=n.length;d<o;d++)n[d].dataIndex=-1;for(d=0,o=t.count();d<o;d++)n[t.getRawIndex(d)].dataIndex=d;e.filterSelf(function(t){var n=a[e.getRawIndex(t)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0});for(d=0,o=a.length;d<o;d++)a[d].dataIndex=-1;for(d=0,o=e.count();d<o;d++)a[e.getRawIndex(d)].dataIndex=d},t.prototype.clone=function(){for(var e=new t(this._directed),n=this.nodes,a=this.edges,d=0;d<n.length;d++)e.addNode(n[d].id,n[d].dataIndex);for(d=0;d<a.length;d++){var o=a[d];e.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return e},t}(),r=function(){function t(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==t?"":t,this.dataIndex=null==e?-1:e}return t.prototype.degree=function(){return this.edges.length},t.prototype.inDegree=function(){return this.inEdges.length},t.prototype.outDegree=function(){return this.outEdges.length},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var n=this.edges[e];n.dataIndex<0||(t.edge.push(n.dataIndex),t.node.push(n.node1.dataIndex,n.node2.dataIndex))}return t},t.prototype.getTrajectoryDataIndices=function(){for(var t=a.createHashMap(),e=a.createHashMap(),n=0,d=this.edges.length;n<d;n++){var o=this.edges[n];if(!(o.dataIndex<0)){t.set(o.dataIndex,!0);for(var i=[o.node1],r=[o.node2],s=0;s<i.length;){var u=i[s];s++,e.set(u.dataIndex,!0);for(var h=u.inEdges,c=0,g=h.length,p=void 0,f=void 0;c<g;c++)(f=(p=h[c]).dataIndex)>=0&&!t.hasKey(f)&&(t.set(f,!0),i.push(p.node1))}for(s=0;s<r.length;){var l=r[s];s++,e.set(l.dataIndex,!0);for(var v=l.outEdges,I=(c=0,v.length),x=void 0,y=void 0;c<I;c++)(y=(x=v[c]).dataIndex)>=0&&!t.hasKey(y)&&(t.set(y,!0),r.push(x.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),s=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=a.createHashMap(),e=a.createHashMap();t.set(this.dataIndex,!0);for(var n=[this.node1],d=[this.node2],o=0;o<n.length;){var i=n[o];o++,e.set(i.dataIndex,!0);for(var r=0,s=i.inEdges.length,u=void 0,h=void 0;r<s;r++)(h=(u=i.inEdges[r]).dataIndex)>=0&&!t.hasKey(h)&&(t.set(h,!0),n.push(u.node1))}for(o=0;o<d.length;){var c=d[o];o++,e.set(c.dataIndex,!0);r=0,s=c.outEdges.length;for(var g=void 0,p=void 0;r<s;r++)(p=(g=c.outEdges[r]).dataIndex)>=0&&!t.hasKey(p)&&(t.set(p,!0),d.push(g.node2))}return{edge:t.keys(),node:e.keys()}},t}();function u(t,e){return{getValue:function(n){var a=this[t][e];return a.getStore().get(a.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,a){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,a)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,a){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,a)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}a.mixin(r,u("hostGraph","data")),a.mixin(s,u("hostGraph","edgeData"));const h=i;var c=n(7770),g=n(6166),p=n(71034),f=n(87717),l=n(6471);function v(t,e,n,o,i){for(var r=new h(o),s=0;s<t.length;s++)r.addNode(a.retrieve(t[s].id,t[s].name,s),s);var u=[],v=[],I=0;for(s=0;s<e.length;s++){var x=e[s],y=x.source,m=x.target;r.addEdge(y,m,I)&&(v.push(x),u.push(a.retrieve((0,l.vS)(x.id,null),y+" > "+m)),I++)}var _,E=n.get("coordinateSystem");if("cartesian2d"===E||"polar"===E||"matrix"===E)_=(0,f.A)(t,n);else{var D=p.Ay.get(E),A=D&&D.dimensions||[];a.indexOf(A,"value")<0&&A.concat(["value"]);var M=(0,g.A)(t,{coordDimensions:A,encodeDefine:n.getEncode()}).dimensions;(_=new d.A(M,n)).initData(t)}var w=new d.A(["value"],n);return w.initData(v,u),i&&i(_,w),(0,c.A)({mainData:_,struct:r,structAttr:"graph",datas:{node:_,edge:w},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r}},42605(t,e,n){n.d(e,{Bs:()=>g,LZ:()=>f,QB:()=>h,ao:()=>l,jg:()=>u});var a=n(66834),d=n(11975),o=n(26322),i=n(35723),r=n(6471),s=n(52577);function u(t,e,n,i,r,u,h,c){function g(n){var a=t.mainType,i=(0,o.payloadDisableAnimation)((0,s.defaults)({type:p(a,t.subType,d.Ev)},n));c&&(i.componentType=a),i[a+"Id"]=t.id,e.dispatchAction(i)}(0,a.Nl)(t)?(n.enable((0,s.retrieve2)(t.get("roam"),h),{api:e,zInfo:{component:t},triggerInfo:{roamTrigger:t.get("roamTrigger"),isInSelf:i,isInClip:function(t,e,n){return!r||r.contain(e,n)}}}),n.off("pan").off("zoom").on("pan",function(t){u&&u("pan"),g({dx:t.dx,dy:t.dy})}).on("zoom",function(t){u&&u("zoom"),g({zoom:t.scale,originX:t.originX,originY:t.originY})})):n.disable()}function h(t){return function(e,n,a){return c.copy(t.getBoundingRect()),c.applyTransform(t.getComputedTransform()),c.contain(n,a)}}var c=new i.Ay(0,0,0,0);function g(t,e,n){var o=p(e,n,d.Ev);t.registerAction({type:o,event:o,update:"none"},function(t,d,o){d.eachComponent((0,r.dr)(t,e,n),function(e){(0,a.X$)(t,e),(0,a.jR)(t,e,d,o)})})}function p(t,e,n){return(t!==d.t7?t:"map"===e?"geo":e)+n}function f(t){return null!=t.zoom}function l(t,e,n,d,o,i,r){var s=new a.Ay(null,(0,a.kx)(t.ecModel,e));return(0,a.Q3)(s,n,d,o,i),r?(0,a.Xj)(s,r.x,r.y,r.width,r.height):(0,a.Xj)(s,n,d,o,i),(0,a.dh)(s,t),s}},7770(t,e,n){n.d(e,{A:()=>g});var a=n(52577),d=(0,n(6471).$r)();function o(t,e){if(d(o=this).mainData===o){var n=(0,a.extend)({},d(this).datas);n[this.dataType]=e,h(e,n,t)}else c(e,this.dataType,d(this).mainData,t);var o;return e}function i(t,e){return t.struct&&t.struct.update(),e}function r(t,e){return(0,a.each)(d(e).datas,function(n,a){n!==e&&c(n.cloneShallow(),a,e,t)}),e}function s(t){var e=d(this).mainData;return null==t||null==e?e:d(e).datas[t]}function u(){var t=d(this).mainData;return null==t?[{data:t}]:(0,a.map)((0,a.keys)(d(t).datas),function(e){return{type:e,data:d(t).datas[e]}})}function h(t,e,n){d(t).datas={},(0,a.each)(e,function(e,a){c(e,a,t,n)})}function c(t,e,n,a){d(n).datas[e]=t,d(t).mainData=n,t.dataType=e,a.struct&&(t[a.structAttr]=a.struct,a.struct[a.datasAttr[e]]=t),t.getLinkedData=s,t.getLinkedDataAll=u}const g=function(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,h(e,n,t),(0,a.each)(n,function(n){(0,a.each)(e.TRANSFERABLE_METHODS,function(e){n.wrapMethod(e,(0,a.curry)(o,t))})}),e.wrapMethod("cloneShallow",(0,a.curry)(r,t)),(0,a.each)(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,(0,a.curry)(i,t))}),(0,a.assert)(n[e.dataType]===e)}}};