iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 33.3 kB
JavaScript
/*! For license information please see 3707.8cc6e1e54ee8fb8e.js.LICENSE.txt */
export const __webpack_ids__=["3707"];export const __webpack_modules__={10445:function(e,t,a){a.d(t,{X:()=>h});var n=a(9065),o=a(15093),i=(a(54835),a(57243)),r=a(4077);class s extends r.A{constructor(){super(...arguments),this.elevated=!1,this.href="",this.target=""}get primaryId(){return this.href?"link":"button"}get rippleDisabled(){return!this.href&&(this.disabled||this.softDisabled)}getContainerClasses(){return{...super.getContainerClasses(),disabled:!this.href&&(this.disabled||this.softDisabled),elevated:this.elevated,link:!!this.href}}renderPrimaryAction(e){const{ariaLabel:t}=this;return this.href?i.dy` <a class="primary action" id="link" aria-label="${t||i.Ld}" href="${this.href}" target="${this.target||i.Ld}">${e}</a> `:i.dy` <button class="primary action" id="button" aria-label="${t||i.Ld}" aria-disabled="${this.softDisabled||i.Ld}" ?disabled="${this.disabled&&!this.alwaysFocusable}" type="button">${e}</button> `}renderOutline(){return this.elevated?i.dy`<md-elevation part="elevation"></md-elevation>`:super.renderOutline()}}(0,n.__decorate)([(0,o.Cb)({type:Boolean})],s.prototype,"elevated",void 0),(0,n.__decorate)([(0,o.Cb)()],s.prototype,"href",void 0),(0,n.__decorate)([(0,o.Cb)()],s.prototype,"target",void 0);const d=i.iv`:host{--_container-height:var(--md-assist-chip-container-height, 32px);--_disabled-label-text-color:var(--md-assist-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity:var(--md-assist-chip-disabled-label-text-opacity, 0.38);--_elevated-container-color:var(--md-assist-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_elevated-container-elevation:var(--md-assist-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color:var(--md-assist-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color:var(--md-assist-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation:var(--md-assist-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity:var(--md-assist-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation:var(--md-assist-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation:var(--md-assist-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation:var(--md-assist-chip-elevated-pressed-container-elevation, 1);--_focus-label-text-color:var(--md-assist-chip-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color:var(--md-assist-chip-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color:var(--md-assist-chip-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity:var(--md-assist-chip-hover-state-layer-opacity, 0.08);--_label-text-color:var(--md-assist-chip-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font:var(--md-assist-chip-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height:var(--md-assist-chip-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size:var(--md-assist-chip-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight:var(--md-assist-chip-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color:var(--md-assist-chip-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-color:var(--md-assist-chip-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity:var(--md-assist-chip-pressed-state-layer-opacity, 0.12);--_disabled-outline-color:var(--md-assist-chip-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity:var(--md-assist-chip-disabled-outline-opacity, 0.12);--_focus-outline-color:var(--md-assist-chip-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_outline-color:var(--md-assist-chip-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width:var(--md-assist-chip-outline-width, 1px);--_disabled-leading-icon-color:var(--md-assist-chip-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity:var(--md-assist-chip-disabled-leading-icon-opacity, 0.38);--_focus-leading-icon-color:var(--md-assist-chip-focus-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-leading-icon-color:var(--md-assist-chip-hover-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-icon-color:var(--md-assist-chip-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size:var(--md-assist-chip-icon-size, 18px);--_pressed-leading-icon-color:var(--md-assist-chip-pressed-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start:var(--md-assist-chip-container-shape-start-start, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-start-end:var(--md-assist-chip-container-shape-start-end, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-end-end:var(--md-assist-chip-container-shape-end-end, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-end-start:var(--md-assist-chip-container-shape-end-start, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_leading-space:var(--md-assist-chip-leading-space, 16px);--_trailing-space:var(--md-assist-chip-trailing-space, 16px);--_icon-label-space:var(--md-assist-chip-icon-label-space, 8px);--_with-leading-icon-leading-space:var(--md-assist-chip-with-leading-icon-leading-space, 8px)} {.link .outline{border-color:ActiveText}}`;var l=a(29126),c=a(21016);let h=class extends s{};h.styles=[c.W,l.W,d],h=(0,n.__decorate)([(0,o.Mo)("md-assist-chip")],h)},4077:function(e,t,a){a.d(t,{A:()=>d});var n=a(9065),o=(a(57618),a(23111),a(57243)),i=a(15093),r=a(35359);const s=(0,a(13823).T)(o.oi);class d extends s{get rippleDisabled(){return this.disabled||this.softDisabled}constructor(){super(),this.disabled=!1,this.softDisabled=!1,this.alwaysFocusable=!1,this.label="",this.hasIcon=!1,o.sk||this.addEventListener("click",this.handleClick.bind(this))}focus(e){this.disabled&&!this.alwaysFocusable||super.focus(e)}render(){return o.dy` <div class="container ${(0,r.$)(this.getContainerClasses())}"> ${this.renderContainerContent()} </div> `}updated(e){e.has("disabled")&&void 0!==e.get("disabled")&&this.dispatchEvent(new Event("update-focus",{bubbles:!0}))}getContainerClasses(){return{disabled:this.disabled||this.softDisabled,"has-icon":this.hasIcon}}renderContainerContent(){return o.dy` ${this.renderOutline()} <md-focus-ring part="focus-ring" for="${this.primaryId}"></md-focus-ring> <md-ripple for="${this.primaryId}" ?disabled="${this.rippleDisabled}"></md-ripple> ${this.renderPrimaryAction(this.renderPrimaryContent())} `}renderOutline(){return o.dy`<span class="outline"></span>`}renderLeadingIcon(){return o.dy`<slot name="icon" ="${this.handleIconChange}"></slot>`}renderPrimaryContent(){return o.dy` <span class="leading icon" aria-hidden="true"> ${this.renderLeadingIcon()} </span> <span class="label"> <span class="label-text" id="label"> ${this.label?this.label:o.dy`<slot></slot>`} </span> </span> <span class="touch"></span> `}handleIconChange(e){const t=e.target;this.hasIcon=t.assignedElements({flatten:!0}).length>0}handleClick(e){if(this.softDisabled||this.disabled&&this.alwaysFocusable)return e.stopImmediatePropagation(),void e.preventDefault()}}d.shadowRootOptions={...o.oi.shadowRootOptions,delegatesFocus:!0},(0,n.__decorate)([(0,i.Cb)({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),(0,n.__decorate)([(0,i.Cb)({type:Boolean,attribute:"soft-disabled",reflect:!0})],d.prototype,"softDisabled",void 0),(0,n.__decorate)([(0,i.Cb)({type:Boolean,attribute:"always-focusable"})],d.prototype,"alwaysFocusable",void 0),(0,n.__decorate)([(0,i.Cb)()],d.prototype,"label",void 0),(0,n.__decorate)([(0,i.Cb)({type:Boolean,reflect:!0,attribute:"has-icon"})],d.prototype,"hasIcon",void 0)},29126:function(e,t,a){a.d(t,{W:()=>n});const n=a(57243).iv`.elevated{--md-elevation-level:var(--_elevated-container-elevation);--md-elevation-shadow-color:var(--_elevated-container-shadow-color)}.elevated::before{background:var(--_elevated-container-color)}.elevated:hover{--md-elevation-level:var(--_elevated-hover-container-elevation)}.elevated:focus-within{--md-elevation-level:var(--_elevated-focus-container-elevation)}.elevated:active{--md-elevation-level:var(--_elevated-pressed-container-elevation)}.elevated.disabled{--md-elevation-level:var(--_elevated-disabled-container-elevation)}.elevated.disabled::before{background:var(--_elevated-disabled-container-color);opacity:var(--_elevated-disabled-container-opacity)} {.elevated md-elevation{border:1px solid CanvasText}.elevated.disabled md-elevation{border-color:GrayText}}`},21016:function(e,t,a){a.d(t,{W:()=>n});const n=a(57243).iv`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);display:inline-flex;height:var(--_container-height);cursor:pointer;-webkit-tap-highlight-color:transparent;--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}:host(:is([disabled],[soft-disabled])){pointer-events:none}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}md-focus-ring{--md-focus-ring-shape-start-start:var(--_container-shape-start-start);--md-focus-ring-shape-start-end:var(--_container-shape-start-end);--md-focus-ring-shape-end-end:var(--_container-shape-end-end);--md-focus-ring-shape-end-start:var(--_container-shape-end-start)}.container{border-radius:inherit;box-sizing:border-box;display:flex;height:100%;position:relative;width:100%}.container::before{border-radius:inherit;content:"";inset:0;pointer-events:none;position:absolute}.container:not(.disabled){cursor:pointer}.container.disabled{pointer-events:none}.cell{display:flex}.action{align-items:baseline;appearance:none;background:0 0;border:none;border-radius:inherit;display:flex;outline:0;padding:0;position:relative;text-decoration:none}.primary.action{min-width:0;padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space)}.has-icon .primary.action{padding-inline-start:var(--_with-leading-icon-leading-space)}.touch{height:48px;inset:50% 0 0;position:absolute;transform:translateY(-50%);width:100%}:host([touch-target=none]) .touch{display:none}.outline{border:var(--_outline-width) solid var(--_outline-color);border-radius:inherit;inset:0;pointer-events:none;position:absolute}:where(:focus) .outline{border-color:var(--_focus-outline-color)}:where(.disabled) .outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}md-ripple{border-radius:inherit}.icon,.label,.touch{z-index:1}.label{align-items:center;color:var(--_label-text-color);display:flex;font-family:var(--_label-text-font);font-size:var(--_label-text-size);font-weight:var(--_label-text-weight);height:100%;line-height:var(--_label-text-line-height);overflow:hidden;user-select:none}.label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(:hover) .label{color:var(--_hover-label-text-color)}:where(:focus) .label{color:var(--_focus-label-text-color)}:where(:active) .label{color:var(--_pressed-label-text-color)}:where(.disabled) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.icon{align-self:center;display:flex;fill:currentColor;position:relative}.icon ::slotted(:first-child){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size)}.leading.icon{color:var(--_leading-icon-color)}.leading.icon ::slotted(*),.leading.icon svg{margin-inline-end:var(--_icon-label-space)}:where(:hover) .leading.icon{color:var(--_hover-leading-icon-color)}:where(:focus) .leading.icon{color:var(--_focus-leading-icon-color)}:where(:active) .leading.icon{color:var(--_pressed-leading-icon-color)}:where(.disabled) .leading.icon{color:var(--_disabled-leading-icon-color);opacity:var(--_disabled-leading-icon-opacity)} {:where(.disabled) :is(.label,.outline,.leading.icon){color:GrayText;opacity:1}}a,button{text-transform:inherit}a,button:not(:disabled,[aria-disabled=true]){cursor:inherit}`},5376:function(e,t,a){a.d(t,{X:()=>r});var n=a(34151),o=a(76808),i=a(14276);function r(e,t,a){const r=(0,i._)(e,t)/o.yJ;return(0,n.u)(a?.roundingMethod)(r)}},30502:function(e,t,a){a.d(t,{N:()=>oe});a(22139);var n=a(9065),o=a(2916),i=a(46547),r=a(30950),s=a(42933),d=a(73372),l=a(50261),c=a(33666),h=a(89523),u=a(6836),p=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},g=function(e){function t(t){return e.call(this,t)||this}return(0,n.__extends)(t,e),t.prototype.getDefaultShape=function(){return new p},t.prototype.buildPath=function(e,t){var a=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+a,t.y2),e.bezierCurveTo(t.cpx2+a,t.cpy2,t.cpx1+a,t.cpy1,t.x1+a,t.y1)):(e.lineTo(t.x2,t.y2+a),e.bezierCurveTo(t.cpx2,t.cpy2+a,t.cpx1,t.cpy1+a,t.x1,t.y1+a)),e.closePath()},t.prototype.highlight=function(){(0,d.fD)(this)},t.prototype.downplay=function(){(0,d.Mh)(this)},t}(o.ZP),v=function(e){function t(){var a=null!==e&&e.apply(this,arguments)||this;return a.type=t.type,a._focusAdjacencyDisabled=!1,a}return(0,n.__extends)(t,e),t.prototype.render=function(e,t,a){var n=this,o=e.getGraph(),r=this.group,l=e.layoutInfo,p=l.width,v=l.height,f=e.getData(),b=e.getData("edge"),m=e.get("orient");this._model=e,r.removeAll(),r.x=l.x,r.y=l.y,o.eachEdge((function(t){var a=new g,n=(0,h.A)(a);n.dataIndex=t.dataIndex,n.seriesIndex=e.seriesIndex,n.dataType="edge";var o,i,s,l,f,x,_,I,w=t.getModel(),L=w.getModel("lineStyle"),E=L.get("curveness"),D=t.node1.getLayout(),M=t.node1.getModel(),k=M.get("localX"),C=M.get("localY"),S=t.node2.getLayout(),T=t.node2.getModel(),A=T.get("localX"),V=T.get("localY"),N=t.getLayout();a.shape.extent=Math.max(1,N.dy),a.shape.orient=m,"vertical"===m?(o=(null!=k?k*p:D.x)+N.sy,i=(null!=C?C*v:D.y)+D.dy,s=(null!=A?A*p:S.x)+N.ty,f=o,x=i*(1-E)+(l=null!=V?V*v:S.y)*E,_=s,I=i*E+l*(1-E)):(o=(null!=k?k*p:D.x)+D.dx,i=(null!=C?C*v:D.y)+N.sy,f=o*(1-E)+(s=null!=A?A*p:S.x)*E,x=i,_=o*E+s*(1-E),I=l=(null!=V?V*v:S.y)+N.ty),a.setShape({x1:o,y1:i,x2:s,y2:l,cpx1:f,cpy1:x,cpx2:_,cpy2:I}),a.useStyle(L.getItemStyle()),y(a.style,m,t);var G=""+w.get("value"),z=(0,c.k3)(w,"edgeLabel");(0,c.ni)(a,z,{labelFetcher:{getFormattedLabel:function(t,a,n,o,i,r){return e.getFormattedLabel(t,a,"edge",o,(0,u.retrieve3)(i,z.normal&&z.normal.get("formatter"),G),r)}},labelDataIndex:t.dataIndex,defaultText:G}),a.setTextConfig({position:"inside"});var $=w.getModel("emphasis");(0,d.WO)(a,w,"lineStyle",(function(e){var a=e.getItemStyle();return y(a,m,t),a})),r.add(a),b.setItemGraphicEl(t.dataIndex,a);var j=$.get("focus");(0,d.k5)(a,"adjacency"===j?t.getAdjacentDataIndices():"trajectory"===j?t.getTrajectoryDataIndices():j,$.get("blurScope"),$.get("disabled"))})),o.eachNode((function(t){var a=t.getLayout(),n=t.getModel(),o=n.get("localX"),s=n.get("localY"),l=n.getModel("emphasis"),u=n.get(["itemStyle","borderRadius"])||0,g=new i.Z({shape:{x:null!=o?o*p:a.x,y:null!=s?s*v:a.y,width:a.dx,height:a.dy,r:u},style:n.getModel("itemStyle").getItemStyle(),z2:10});(0,c.ni)(g,(0,c.k3)(n),{labelFetcher:{getFormattedLabel:function(t,a){return e.getFormattedLabel(t,a,"node")}},labelDataIndex:t.dataIndex,defaultText:t.id}),g.disableLabelAnimation=!0,g.setStyle("fill",t.getVisual("color")),g.setStyle("decal",t.getVisual("style").decal),(0,d.WO)(g,n),r.add(g),f.setItemGraphicEl(t.dataIndex,g),(0,h.A)(g).dataType="node";var y=l.get("focus");(0,d.k5)(g,"adjacency"===y?t.getAdjacentDataIndices():"trajectory"===y?t.getTrajectoryDataIndices():y,l.get("blurScope"),l.get("disabled"))})),f.eachItemGraphicEl((function(t,o){f.getItemModel(o).get("draggable")&&(t.drift=function(t,i){n._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=i,this.dirty(),a.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:f.getRawIndex(o),localX:this.shape.x/p,localY:this.shape.y/v})},t.ondragend=function(){n._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move")})),!this._data&&e.isAnimationEnabled()&&r.setClipPath(function(e,t,a){var n=new i.Z({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return s.KZ(n,{shape:{width:e.width+20}},t,a),n}(r.getBoundingRect(),e,(function(){r.removeClipPath()}))),this._data=e.getData()},t.prototype.dispose=function(){},t.type="sankey",t}(l.Z);function y(e,t,a){switch(e.fill){case"source":e.fill=a.node1.getVisual("color"),e.decal=a.node1.getVisual("style").decal;break;case"target":e.fill=a.node2.getVisual("color"),e.decal=a.node2.getVisual("style").decal;break;case"gradient":var n=a.node1.getVisual("color"),o=a.node2.getVisual("color");(0,u.isString)(n)&&(0,u.isString)(o)&&(e.fill=new r.Z(0,0,+("horizontal"===t),+("vertical"===t),[{color:n,offset:0},{color:o,offset:1}]))}}const f=v;var b=a(83072),m=(a(92745),a(38439));function x(e){return"_EC_"+e}var _=function(){function e(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=null==e?""+t:""+e;var a=this._nodesMap;if(!a[x(e)]){var n=new I(e,t);return n.hostGraph=this,this.nodes.push(n),a[x(e)]=n,n}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[x(e)]},e.prototype.addEdge=function(e,t,a){var n=this._nodesMap,o=this._edgesMap;if(u.isNumber(e)&&(e=this.nodes[e]),u.isNumber(t)&&(t=this.nodes[t]),e instanceof I||(e=n[x(e)]),t instanceof I||(t=n[x(t)]),e&&t){var i=e.id+"-"+t.id,r=new w(e,t,a);return r.hostGraph=this,this._directed&&(e.outEdges.push(r),t.inEdges.push(r)),e.edges.push(r),e!==t&&t.edges.push(r),this.edges.push(r),o[i]=r,r}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof I&&(e=e.id),t instanceof I&&(t=t.id);var a=this._edgesMap;return this._directed?a[e+"-"+t]:a[e+"-"+t]||a[t+"-"+e]},e.prototype.eachNode=function(e,t){for(var a=this.nodes,n=a.length,o=0;o<n;o++)a[o].dataIndex>=0&&e.call(t,a[o],o)},e.prototype.eachEdge=function(e,t){for(var a=this.edges,n=a.length,o=0;o<n;o++)a[o].dataIndex>=0&&a[o].node1.dataIndex>=0&&a[o].node2.dataIndex>=0&&e.call(t,a[o],o)},e.prototype.breadthFirstTraverse=function(e,t,a,n){if(t instanceof I||(t=this._nodesMap[x(t)]),t){for(var o="out"===a?"outEdges":"in"===a?"inEdges":"edges",i=0;i<this.nodes.length;i++)this.nodes[i].__visited=!1;if(!e.call(n,t,null))for(var r=[t];r.length;){var s=r.shift(),d=s[o];for(i=0;i<d.length;i++){var l=d[i],c=l.node1===s?l.node2:l.node1;if(!c.__visited){if(e.call(n,c,s))return;r.push(c),c.__visited=!0}}}}},e.prototype.update=function(){for(var e=this.data,t=this.edgeData,a=this.nodes,n=this.edges,o=0,i=a.length;o<i;o++)a[o].dataIndex=-1;for(o=0,i=e.count();o<i;o++)a[e.getRawIndex(o)].dataIndex=o;t.filterSelf((function(e){var a=n[t.getRawIndex(e)];return a.node1.dataIndex>=0&&a.node2.dataIndex>=0}));for(o=0,i=n.length;o<i;o++)n[o].dataIndex=-1;for(o=0,i=t.count();o<i;o++)n[t.getRawIndex(o)].dataIndex=o},e.prototype.clone=function(){for(var t=new e(this._directed),a=this.nodes,n=this.edges,o=0;o<a.length;o++)t.addNode(a[o].id,a[o].dataIndex);for(o=0;o<n.length;o++){var i=n[o];t.addEdge(i.node1.id,i.node2.id,i.dataIndex)}return t},e}(),I=function(){function e(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==e?"":e,this.dataIndex=null==t?-1:t}return e.prototype.degree=function(){return this.edges.length},e.prototype.inDegree=function(){return this.inEdges.length},e.prototype.outDegree=function(){return this.outEdges.length},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var a=this.edges[t];a.dataIndex<0||(e.edge.push(a.dataIndex),e.node.push(a.node1.dataIndex,a.node2.dataIndex))}return e},e.prototype.getTrajectoryDataIndices=function(){for(var e=u.createHashMap(),t=u.createHashMap(),a=0;a<this.edges.length;a++){var n=this.edges[a];if(!(n.dataIndex<0)){e.set(n.dataIndex,!0);for(var o=[n.node1],i=[n.node2],r=0;r<o.length;){var s=o[r];r++,t.set(s.dataIndex,!0);for(var d=0;d<s.inEdges.length;d++)e.set(s.inEdges[d].dataIndex,!0),o.push(s.inEdges[d].node1)}for(r=0;r<i.length;){var l=i[r];r++,t.set(l.dataIndex,!0);for(d=0;d<l.outEdges.length;d++)e.set(l.outEdges[d].dataIndex,!0),i.push(l.outEdges[d].node2)}}}return{edge:e.keys(),node:t.keys()}},e}(),w=function(){function e(e,t,a){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=null==a?-1:a}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=u.createHashMap(),t=u.createHashMap();e.set(this.dataIndex,!0);for(var a=[this.node1],n=[this.node2],o=0;o<a.length;){var i=a[o];o++,t.set(i.dataIndex,!0);for(var r=0;r<i.inEdges.length;r++)e.set(i.inEdges[r].dataIndex,!0),a.push(i.inEdges[r].node1)}for(o=0;o<n.length;){var s=n[o];o++,t.set(s.dataIndex,!0);for(r=0;r<s.outEdges.length;r++)e.set(s.outEdges[r].dataIndex,!0),n.push(s.outEdges[r].node2)}return{edge:e.keys(),node:t.keys()}},e}();function L(e,t){return{getValue:function(a){var n=this[e][t];return n.getStore().get(n.getDimensionIndex(a||"value"),this.dataIndex)},setVisual:function(a,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,a,n)},getVisual:function(a){return this[e][t].getItemVisual(this.dataIndex,a)},setLayout:function(a,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,a,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}u.mixin(I,L("hostGraph","data")),u.mixin(w,L("hostGraph","edgeData"));const E=_;var D=a(31936),M=(0,D.Yf)();function k(e,t){if(M(n=this).mainData===n){var a=(0,u.extend)({},M(this).datas);a[this.dataType]=t,V(t,a,e)}else N(t,this.dataType,M(this).mainData,e);var n;return t}function C(e,t){return e.struct&&e.struct.update(),t}function S(e,t){return(0,u.each)(M(t).datas,(function(a,n){a!==t&&N(a.cloneShallow(),n,t,e)})),t}function T(e){var t=M(this).mainData;return null==e||null==t?t:M(t).datas[e]}function A(){var e=M(this).mainData;return null==e?[{data:e}]:(0,u.map)((0,u.keys)(M(e).datas),(function(t){return{type:t,data:M(e).datas[t]}}))}function V(e,t,a){M(e).datas={},(0,u.each)(t,(function(t,n){N(t,n,e,a)}))}function N(e,t,a,n){M(a).datas[t]=e,M(e).mainData=a,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=T,e.getLinkedDataAll=A}const G=function(e){var t=e.mainData,a=e.datas;a||(a={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,V(t,a,e),(0,u.each)(a,(function(a){(0,u.each)(t.TRANSFERABLE_METHODS,(function(t){a.wrapMethod(t,(0,u.curry)(k,e))}))})),t.wrapMethod("cloneShallow",(0,u.curry)(S,e)),(0,u.each)(t.CHANGABLE_METHODS,(function(a){t.wrapMethod(a,(0,u.curry)(C,e))})),(0,u.assert)(a[t.dataType]===t)};var z=a(82190),$=a(49051),j=a(77385);var B=a(30057),P=a(96810),R=function(e){function t(){var a=null!==e&&e.apply(this,arguments)||this;return a.type=t.type,a}return(0,n.__extends)(t,e),t.prototype.getInitialData=function(e,t){var a=e.edges||e.links||[],n=e.data||e.nodes||[],o=e.levels||[];this.levelModels=[];for(var i=this.levelModels,r=0;r<o.length;r++)null!=o[r].depth&&o[r].depth>=0&&(i[o[r].depth]=new B.Z(o[r],this,t));var s=function(e,t,a,n,o){for(var i=new E(n),r=0;r<e.length;r++)i.addNode(u.retrieve(e[r].id,e[r].name,r),r);var s=[],d=[],l=0;for(r=0;r<t.length;r++){var c=t[r],h=c.source,p=c.target;i.addEdge(h,p,l)&&(d.push(c),s.push(u.retrieve((0,D.U5)(c.id,null),h+" > "+p)),l++)}var g,v=a.get("coordinateSystem");if("cartesian2d"===v||"polar"===v)g=(0,j.Z)(e,a);else{var y=$.Z.get(v),f=y&&y.dimensions||[];u.indexOf(f,"value")<0&&f.concat(["value"]);var b=(0,z.Z)(e,{coordDimensions:f,encodeDefine:a.getEncode()}).dimensions;(g=new m.Z(b,a)).initData(e)}var x=new m.Z(["value"],a);return x.initData(d,s),o&&o(g,x),G({mainData:g,struct:i,structAttr:"graph",datas:{node:g,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),i.update(),i}(n,a,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){var a=e.parentModel,n=a.getData().getItemLayout(t);if(n){var o=n.depth,i=a.levelModels[o];i&&(e.parentModel=i)}return e})),t.wrapMethod("getItemModel",(function(e,t){var a=e.parentModel,n=a.getGraph().getEdgeByIndex(t).node1.getLayout();if(n){var o=n.depth,i=a.levelModels[o];i&&(e.parentModel=i)}return e}))}));return s.data},t.prototype.setNodePosition=function(e,t){var a=(this.option.data||this.option.nodes)[e];a.localX=t[0],a.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,a){function n(e){return isNaN(e)||null==e}if("edge"===a){var o=this.getDataParams(e,a),i=o.data,r=o.value,s=i.source+" -- "+i.target;return(0,P.TX)("nameValue",{name:s,value:r,noValue:n(r)})}var d=this.getGraph().getNodeByIndex(e).getLayout().value,l=this.getDataParams(e,a).data.name;return(0,P.TX)("nameValue",{name:null!=l?l+"":null,value:d,noValue:n(d)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,a){var n=e.prototype.getDataParams.call(this,t,a);if(null==n.value&&"node"===a){var o=this.getGraph().getNodeByIndex(t).getLayout().value;n.value=o}return n},t.type="series.sankey",t.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},t}(b.Z);const O=R;var F=a(34956);function Z(e,t){e.eachSeriesByType("sankey",(function(e){var a=e.get("nodeWidth"),n=e.get("nodeGap"),o=function(e,t){return F.ME(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=o;var i=o.width,r=o.height,s=e.getGraph(),d=s.nodes,l=s.edges;!function(e){u.each(e,(function(e){var t=ee(e.outEdges,Q),a=ee(e.inEdges,Q),n=e.getValue()||0,o=Math.max(t,a,n);e.setLayout({value:o},!0)}))}(d),function(e,t,a,n,o,i,r,s,d){(function(e,t,a,n,o,i,r){for(var s=[],d=[],l=[],c=[],h=0,p=0;p<t.length;p++)s[p]=1;for(p=0;p<e.length;p++)d[p]=e[p].inEdges.length,0===d[p]&&l.push(e[p]);var g=-1;for(;l.length;){for(var v=0;v<l.length;v++){var y=l[v],f=y.hostGraph.data.getRawDataItem(y.dataIndex),b=null!=f.depth&&f.depth>=0;b&&f.depth>g&&(g=f.depth),y.setLayout({depth:b?f.depth:h},!0),"vertical"===i?y.setLayout({dy:a},!0):y.setLayout({dx:a},!0);for(var m=0;m<y.outEdges.length;m++){var x=y.outEdges[m];s[t.indexOf(x)]=0;var _=x.node2;0==--d[e.indexOf(_)]&&c.indexOf(_)<0&&c.push(_)}}++h,l=c,c=[]}for(p=0;p<s.length;p++)if(1===s[p])throw new Error("Sankey is a DAG, the original data has cycle!");var I=g>h-1?g:h-1;r&&"left"!==r&&function(e,t,a,n){if("right"===t){for(var o=[],i=e,r=0;i.length;){for(var s=0;s<i.length;s++){var d=i[s];d.setLayout({skNodeHeight:r},!0);for(var l=0;l<d.inEdges.length;l++){var c=d.inEdges[l];o.indexOf(c.node1)<0&&o.push(c.node1)}}i=o,o=[],++r}u.each(e,(function(e){H(e)||e.setLayout({depth:Math.max(0,n-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){u.each(e,(function(e){H(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,n)}(e,r,0,I);var w="vertical"===i?(o-a)/I:(n-a)/I;!function(e,t,a){u.each(e,(function(e){var n=e.getLayout().depth*t;"vertical"===a?e.setLayout({y:n},!0):e.setLayout({x:n},!0)}))}(e,w,i)})(e,t,a,o,i,s,d),function(e,t,a,n,o,i,r){var s=function(e,t){var a=[],n="vertical"===t?"y":"x",o=(0,D.pv)(e,(function(e){return e.getLayout()[n]}));return o.keys.sort((function(e,t){return e-t})),u.each(o.keys,(function(e){a.push(o.buckets.get(e))})),a}(e,r);(function(e,t,a,n,o,i){var r=1/0;u.each(e,(function(e){var t=e.length,s=0;u.each(e,(function(e){s+=e.getLayout().value}));var d="vertical"===i?(n-(t-1)*o)/s:(a-(t-1)*o)/s;d<r&&(r=d)})),u.each(e,(function(e){u.each(e,(function(e,t){var a=e.getLayout().value*r;"vertical"===i?(e.setLayout({x:t},!0),e.setLayout({dx:a},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:a},!0))}))})),u.each(t,(function(e){var t=+e.getValue()*r;e.setLayout({dy:t},!0)}))})(s,t,a,n,o,r),X(s,o,a,n,r);for(var d=1;i>0;i--)W(s,d*=.99,r),X(s,o,a,n,r),te(s,d,r),X(s,o,a,n,r)}(e,t,i,o,n,r,s),function(e,t){var a="vertical"===t?"x":"y";u.each(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[a]-t.node2.getLayout()[a]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[a]-t.node1.getLayout()[a]}))})),u.each(e,(function(e){var t=0,a=0;u.each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),u.each(e.inEdges,(function(e){e.setLayout({ty:a},!0),a+=e.getLayout().dy}))}))}(e,s)}(d,l,a,n,i,r,0!==u.filter(d,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))}function H(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function X(e,t,a,n,o){var i="vertical"===o?"x":"y";u.each(e,(function(e){var r,s,d;e.sort((function(e,t){return e.getLayout()[i]-t.getLayout()[i]}));for(var l=0,c=e.length,h="vertical"===o?"dx":"dy",u=0;u<c;u++)(d=l-(s=e[u]).getLayout()[i])>0&&(r=s.getLayout()[i]+d,"vertical"===o?s.setLayout({x:r},!0):s.setLayout({y:r},!0)),l=s.getLayout()[i]+s.getLayout()[h]+t;if((d=l-t-("vertical"===o?n:a))>0){r=s.getLayout()[i]-d,"vertical"===o?s.setLayout({x:r},!0):s.setLayout({y:r},!0),l=r;for(u=c-2;u>=0;--u)(d=(s=e[u]).getLayout()[i]+s.getLayout()[h]+t-l)>0&&(r=s.getLayout()[i]-d,"vertical"===o?s.setLayout({x:r},!0):s.setLayout({y:r},!0)),l=s.getLayout()[i]}}))}function W(e,t,a){u.each(e.slice().reverse(),(function(e){u.each(e,(function(e){if(e.outEdges.length){var n=ee(e.outEdges,Y,a)/ee(e.outEdges,Q);if(isNaN(n)){var o=e.outEdges.length;n=o?ee(e.outEdges,U,a)/o:0}if("vertical"===a){var i=e.getLayout().x+(n-K(e,a))*t;e.setLayout({x:i},!0)}else{var r=e.getLayout().y+(n-K(e,a))*t;e.setLayout({y:r},!0)}}}))}))}function Y(e,t){return K(e.node2,t)*e.getValue()}function U(e,t){return K(e.node2,t)}function q(e,t){return K(e.node1,t)*e.getValue()}function J(e,t){return K(e.node1,t)}function K(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function Q(e){return e.getValue()}function ee(e,t,a){for(var n=0,o=e.length,i=-1;++i<o;){var r=+t(e[i],a);isNaN(r)||(n+=r)}return n}function te(e,t,a){u.each(e,(function(e){u.each(e,(function(e){if(e.inEdges.length){var n=ee(e.inEdges,q,a)/ee(e.inEdges,Q);if(isNaN(n)){var o=e.inEdges.length;n=o?ee(e.inEdges,J,a)/o:0}if("vertical"===a){var i=e.getLayout().x+(n-K(e,a))*t;e.setLayout({x:i},!0)}else{var r=e.getLayout().y+(n-K(e,a))*t;e.setLayout({y:r},!0)}}}))}))}var ae=a(44125);function ne(e){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph(),a=t.nodes,n=t.edges;if(a.length){var o=1/0,i=-1/0;u.each(a,(function(e){var t=e.getLayout().value;t<o&&(o=t),t>i&&(i=t)})),u.each(a,(function(t){var a=new ae.Z({type:"color",mappingMethod:"linear",dataExtent:[o,i],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),n=t.getModel().get(["itemStyle","color"]);null!=n?(t.setVisual("color",n),t.setVisual("style",{fill:n})):(t.setVisual("color",a),t.setVisual("style",{fill:a}))}))}n.length&&u.each(n,(function(e){var t=e.getModel().get("lineStyle");e.setVisual("style",t)}))}))}function oe(e){e.registerChartView(f),e.registerSeriesModel(O),e.registerLayout(Z),e.registerVisual(ne),e.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))}))}}};
//# sourceMappingURL=3707.8cc6e1e54ee8fb8e.js.map