mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 11:29:12 +02:00
2 lines
43 KiB
JavaScript
2 lines
43 KiB
JavaScript
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){},function(t,e,r){},function(t,e,r){"use strict";r.r(e);r(0);var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e){return"number"==typeof t?t:"string"==typeof t&&t.length>0&&!isNaN(parseInt(t))?parseInt(t):e}function i(t){return null==t||0===t.length}function s(t,e){return"string"==typeof t&&t.length>0?t:e}function a(t){return"boolean"==typeof t?t:"number"==typeof t?t>0:"string"==typeof t&&("1"===t||"true"===t)}function l(t,e,r){void 0===r&&(r=" "),"number"==typeof t&&(t=""+t),"number"==typeof r&&(r=""+r);var n=e-t.length;if(0===n)return t;if(n<0)return t.substr(Math.abs(n));if(n===r.length)return""+r+t;if(n<r.length)return""+r.substring(0,n)+t;for(var o=Math.floor(n/r.length),i=n-r.length*o,s="",a=0;a<o;a++)s+=r;return 0===i?""+s+t:""+s+r.substring(0,i)+t}function u(t){if(null==t.width||isNaN(parseInt(t.width))||null==t.height||isNaN(parseInt(t.height)))throw new TypeError("invalid size.");return{width:parseInt(t.width),height:parseInt(t.height)}}function c(t){var e=t.moduleId,r=t.moduleName;return n({moduleId:o(e,null),moduleName:"string"==typeof r&&r.length>0?r:null},function(t){var e=t.metaconsoleId,r=t.agentId,i=t.agentName,s={agentId:o(r,null),agentName:"string"==typeof i&&i.length>0?i:null};return null!=e?n({metaconsoleId:e},s):s}(t))}function p(t){var e=t.metaconsoleId,r=t.linkedLayoutId,i=t.linkedLayoutAgentId,s={linkedLayoutStatusType:"default"};switch(t.linkedLayoutStatusType){case"weight":var a=o(t.linkedLayoutStatusTypeWeight,null);if(null==a)throw new TypeError("invalid status calculation properties.");t.linkedLayoutStatusTypeWeight&&(s={linkedLayoutStatusType:"weight",linkedLayoutStatusTypeWeight:a});break;case"service":var l=o(t.linkedLayoutStatusTypeWarningThreshold,null),u=o(t.linkedLayoutStatusTypeCriticalThreshold,null);if(null==l||null==u)throw new TypeError("invalid status calculation properties.");s={linkedLayoutStatusType:"service",linkedLayoutStatusTypeWarningThreshold:l,linkedLayoutStatusTypeCriticalThreshold:u}}var c=n({linkedLayoutId:o(r,null),linkedLayoutAgentId:o(i,null)},s);return null!=e?n({metaconsoleId:e},c):c}function h(t,e){var r=t+": "+e+";";return["-webkit-"+r,"-moz-"+r,"-ms-"+r,"-o-"+r,""+r]}function f(t){return decodeURIComponent(escape(window.atob(t)))}var d=function(){return function(){var t=this;this.listeners=[],this.listenersOncer=[],this.on=function(e){return t.listeners.push(e),{dispose:function(){return t.off(e)}}},this.once=function(e){t.listenersOncer.push(e)},this.off=function(e){var r=t.listeners.indexOf(e);r>-1&&t.listeners.splice(r,1)},this.emit=function(e){t.listeners.forEach(function(t){return t(e)}),t.listenersOncer.forEach(function(t){return t(e)}),t.listenersOncer=[]},this.pipe=function(e){return t.on(function(t){return e.emit(t)})}}}(),m=function(){return(m=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){switch(t){case"up":case"right":case"down":case"left":return t;default:return"down"}};function b(t){if(null==t.id||isNaN(parseInt(t.id)))throw new TypeError("invalid id.");if(null==t.type||isNaN(parseInt(t.type)))throw new TypeError("invalid type.");return m({id:parseInt(t.id),type:parseInt(t.type),label:s(t.label,null),labelPosition:y(t.labelPosition),isLinkEnabled:a(t.isLinkEnabled),link:s(t.link,null),isOnTop:a(t.isOnTop),parentId:o(t.parentId,null),aclGroupId:o(t.aclGroupId,null)},u(t),function(t){return{x:o(t.x,0),y:o(t.y,0)}}(t))}var g,v=function(){function t(t){this.clickEventManager=new d,this.removeEventManager=new d,this.disposables=[],this.itemProps=t,this.elementRef=this.createContainerDomElement(),this.labelElementRef=this.createLabelDomElement(),this.childElementRef=this.createDomElement(),this.elementRef.append(this.childElementRef,this.labelElementRef),this.resizeElement(t.width,t.height),this.changeLabelPosition(t.labelPosition)}return t.prototype.createContainerDomElement=function(){var t,e=this;return this.props.isLinkEnabled?(t=document.createElement("a"),this.props.link&&(t.href=this.props.link)):t=document.createElement("div"),t.className="visual-console-item",t.style.zIndex=this.props.isOnTop?"2":"1",t.style.left=this.props.x+"px",t.style.top=this.props.y+"px",t.onclick=function(t){return e.clickEventManager.emit({data:e.props,nativeEvent:t})},t},t.prototype.createLabelDomElement=function(){var t=document.createElement("div");return t.className="visual-console-item-label",this.props.label&&this.props.label.length&&(t.innerHTML=this.props.label),t},Object.defineProperty(t.prototype,"props",{get:function(){return m({},this.itemProps)},set:function(t){var e=this.props;this.itemProps=t,this.shouldBeUpdated(e,t)&&this.render(e)},enumerable:!0,configurable:!0}),t.prototype.shouldBeUpdated=function(t,e){return t!==e},t.prototype.render=function(t){if(void 0===t&&(t=null),this.childElementRef.innerHTML=this.createDomElement().innerHTML,t&&!this.positionChanged(t,this.props)||this.moveElement(this.props.x,this.props.y),t&&!this.sizeChanged(t,this.props)||this.resizeElement(this.props.width,this.props.height),t&&t.label===this.props.label||(this.labelElementRef.innerHTML=this.createLabelDomElement().innerHTML),t&&(t.isLinkEnabled!==this.props.isLinkEnabled||this.props.isLinkEnabled&&t.link!==this.props.link)){var e=this.createContainerDomElement();e.innerHTML=this.elementRef.innerHTML,null!==this.elementRef.parentNode&&this.elementRef.parentNode.replaceChild(e,this.elementRef),this.elementRef=e}t&&t.labelPosition===this.props.labelPosition||this.changeLabelPosition(this.props.labelPosition)},t.prototype.remove=function(){this.removeEventManager.emit({data:this.props}),this.disposables.forEach(function(t){try{t.dispose()}catch(t){}}),this.elementRef.remove()},t.prototype.positionChanged=function(t,e){return t.x!==e.x||t.y!==e.y},t.prototype.changeLabelPosition=function(t){switch(t){case"up":this.elementRef.style.flexDirection="column-reverse";break;case"left":this.elementRef.style.flexDirection="row-reverse";break;case"right":this.elementRef.style.flexDirection="row";break;case"down":default:this.elementRef.style.flexDirection="column"}},t.prototype.moveElement=function(t,e){this.elementRef.style.left=t+"px",this.elementRef.style.top=e+"px"},t.prototype.move=function(t,e){this.moveElement(t,e),this.itemProps=m({},this.props,{x:t,y:e})},t.prototype.sizeChanged=function(t,e){return t.width!==e.width||t.height!==e.height},t.prototype.resizeElement=function(t,e){this.childElementRef.style.width=t>0?t+"px":null,this.childElementRef.style.height=e>0?e+"px":null},t.prototype.resize=function(t,e){this.resizeElement(t,e),this.itemProps=m({},this.props,{width:t,height:e})},t.prototype.onClick=function(t){var e=this.clickEventManager.on(t);return this.disposables.push(e),e},t.prototype.onRemove=function(t){var e=this.removeEventManager.on(t);return this.disposables.push(e),e},t}(),w=(g=function(t,e){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),A=function(){return(A=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},E=function(t){switch(t){case"default":case"enabled":case"disabled":return t;default:return"default"}};function k(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");return A({},b(t),{type:0,imageSrc:t.imageSrc,showLastValueTooltip:E(t.showLastValueTooltip),statusImageSrc:s(t.statusImageSrc,null),lastValue:s(t.lastValue,null)},c(t),p(t))}var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e.prototype.createDomElement=function(){var t=document.createElement("img");return t.className="static-graph",t.src=this.props.statusImageSrc||this.props.imageSrc,null!==this.props.lastValue&&"disabled"!==this.props.showLastValueTooltip&&(t.className="static-graph image forced_title",t.setAttribute("data-use_title_for_force_title","1"),t.setAttribute("data-title",this.props.lastValue),t.alt=this.props.lastValue),t},e}(v),_=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),x=function(){return(x=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function T(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");return x({},b(t),{type:5,imageSrc:t.imageSrc},p(t))}var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.createDomElement=function(){var t=document.createElement("img");return t.className="icon",t.src=this.props.imageSrc,t},e}(v),I=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),P=function(){return(P=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function N(t){if("string"!=typeof t.color||0===t.color.length)throw new TypeError("invalid color.");return P({},b(t),{type:20,color:t.color},c(t),p(t))}var j="http://www.w3.org/2000/svg",C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="color-cloud",t.append(this.createSvgElement()),t},e.prototype.createSvgElement=function(){var t="grad_"+this.props.id,e=document.createElementNS(j,"svg");e.setAttribute("viewBox","0 0 100 100");var r=document.createElementNS(j,"defs"),n=document.createElementNS(j,"radialGradient");n.setAttribute("id",t),n.setAttribute("cx","50%"),n.setAttribute("cy","50%"),n.setAttribute("r","50%"),n.setAttribute("fx","50%"),n.setAttribute("fy","50%");var o=document.createElementNS(j,"stop");o.setAttribute("offset","0%"),o.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0.9");var i=document.createElementNS(j,"stop");i.setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0");var s=document.createElementNS(j,"circle");return s.setAttribute("fill","url(#"+t+")"),s.setAttribute("cx","50%"),s.setAttribute("cy","50%"),s.setAttribute("r","50%"),n.append(o,i),r.append(n),e.append(r,s),e},e}(v),R=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),L=function(){return(L=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function z(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");if(null===o(t.groupId,null))throw new TypeError("invalid group Id.");return L({},b(t),{type:11,imageSrc:t.imageSrc,groupId:parseInt(t.groupId),statusImageSrc:s(t.statusImageSrc,null)},p(t))}var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.createDomElement=function(){var t=document.createElement("img");return t.className="group",null!=this.props.statusImageSrc&&(t.src=this.props.statusImageSrc),t},e}(v),D=(r(1),function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}()),H=function(){return(H=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},W=function(t){switch(t){case"analogic":case"digital":return t;default:return"analogic"}},B=function(t){switch(t){case"datetime":case"date":case"time":return t;default:return"datetime"}};function V(t){if("string"!=typeof t.clockTimezone||0===t.clockTimezone.length)throw new TypeError("invalid timezone.");return H({},b(t),{type:19,clockType:W(t.clockType),clockFormat:B(t.clockFormat),clockTimezone:t.clockTimezone,clockTimezoneOffset:o(t.clockTimezoneOffset,0),showClockTimezone:a(t.showClockTimezone),color:s(t.color,null)},p(t))}var F=function(t){function e(r){var n=t.call(this,r)||this;return n.intervalRef=null,n.startTick(function(){n.childElementRef.innerHTML=n.createClock().innerHTML},"analogic"===n.props.clockType?2e4:e.TICK_INTERVAL),n}return D(e,t),e.prototype.stopTick=function(){null!==this.intervalRef&&(window.clearInterval(this.intervalRef),this.intervalRef=null)},e.prototype.startTick=function(t,r){void 0===r&&(r=e.TICK_INTERVAL),this.stopTick(),this.intervalRef=window.setInterval(t,r)},e.prototype.createDomElement=function(){return this.createClock()},e.prototype.remove=function(){this.stopTick(),t.prototype.remove.call(this)},e.prototype.resizeElement=function(e,r){var n=this.getElementSize(e,r),o=n.width,i=n.height;t.prototype.resizeElement.call(this,o,i),"digital"===this.props.clockType&&(this.childElementRef.innerHTML=this.createClock().innerHTML)},e.prototype.createClock=function(){switch(this.props.clockType){case"analogic":return this.createAnalogicClock();case"digital":return this.createDigitalClock();default:throw new Error("invalid clock type.")}},e.prototype.createAnalogicClock=function(){var t="http://www.w3.org/2000/svg",e="#FFFFF0",r="#242124",n="#242124",o="#242124",i="#525252",s="#DC143C",a=this.getElementSize(),l=a.width,u=a.height,c=document.createElement("div");c.className="analogic-clock",c.style.width=l+"px",c.style.height=u+"px";var p=document.createElementNS(t,"svg");p.setAttribute("viewBox","0 0 100 100");var f=document.createElementNS(t,"g");f.setAttribute("class","clockface");var d=document.createElementNS(t,"circle");if(d.setAttribute("cx","50"),d.setAttribute("cy","50"),d.setAttribute("r","48"),d.setAttribute("fill",e),d.setAttribute("stroke",r),d.setAttribute("stroke-width","2"),d.setAttribute("stroke-linecap","round"),f.append(d),this.props.showClockTimezone){var m=document.createElementNS(t,"text");m.setAttribute("text-anchor","middle"),m.setAttribute("font-size","8"),m.setAttribute("transform","translate(30 50) rotate(90)"),m.setAttribute("fill",n),m.textContent=this.props.clockTimezone,f.append(m)}var y=document.createElementNS(t,"g");y.setAttribute("class","marks");var b=document.createElementNS(t,"g");b.setAttribute("class","mark"),b.setAttribute("transform","translate(50 50)");var g=document.createElementNS(t,"line");g.setAttribute("x1","36"),g.setAttribute("y1","0"),g.setAttribute("x2","46"),g.setAttribute("y2","0"),g.setAttribute("stroke",n),g.setAttribute("stroke-width","5");var v=document.createElementNS(t,"line");v.setAttribute("x1","36"),v.setAttribute("y1","0"),v.setAttribute("x2","46"),v.setAttribute("y2","0"),v.setAttribute("stroke",e),v.setAttribute("stroke-width","1"),b.append(g,v),y.append(b);for(var w=1;w<60;w++){var A=document.createElementNS(t,"line");A.setAttribute("y1","0"),A.setAttribute("y2","0"),A.setAttribute("stroke",n),A.setAttribute("transform","translate(50 50) rotate("+6*w+")"),w%5==0?(A.setAttribute("x1","38"),A.setAttribute("x2","46"),A.setAttribute("stroke-width",w%15==0?"2":"1")):(A.setAttribute("x1","42"),A.setAttribute("x2","46"),A.setAttribute("stroke-width","0.5")),y.append(A)}var E=document.createElementNS(t,"g");E.setAttribute("class","hour-hand"),E.setAttribute("transform","translate(50 50)");var k=document.createElementNS(t,"line");k.setAttribute("class","hour-hand-a"),k.setAttribute("x1","0"),k.setAttribute("y1","0"),k.setAttribute("x2","30"),k.setAttribute("y2","0"),k.setAttribute("stroke",i),k.setAttribute("stroke-width","4"),k.setAttribute("stroke-linecap","round");var O=document.createElementNS(t,"line");O.setAttribute("class","hour-hand-b"),O.setAttribute("x1","0"),O.setAttribute("y1","0"),O.setAttribute("x2","29.9"),O.setAttribute("y2","0"),O.setAttribute("stroke",o),O.setAttribute("stroke-width","3.1"),O.setAttribute("stroke-linecap","round"),E.append(k,O);var _=document.createElementNS(t,"g");_.setAttribute("class","minute-hand"),_.setAttribute("transform","translate(50 50)");var x=document.createElementNS(t,"line");x.setAttribute("class","minute-hand-a"),x.setAttribute("x1","0"),x.setAttribute("y1","0"),x.setAttribute("x2","40"),x.setAttribute("y2","0"),x.setAttribute("stroke",i),x.setAttribute("stroke-width","2"),x.setAttribute("stroke-linecap","round");var T=document.createElementNS(t,"line");T.setAttribute("class","minute-hand-b"),T.setAttribute("x1","0"),T.setAttribute("y1","0"),T.setAttribute("x2","39.9"),T.setAttribute("y2","0"),T.setAttribute("stroke",o),T.setAttribute("stroke-width","1.5"),T.setAttribute("stroke-linecap","round");var S=document.createElementNS(t,"circle");S.setAttribute("r","3"),S.setAttribute("fill",o),_.append(x,T,S);var I=document.createElementNS(t,"g");I.setAttribute("class","second-hand"),I.setAttribute("transform","translate(50 50)");var P=document.createElementNS(t,"line");P.setAttribute("x1","0"),P.setAttribute("y1","0"),P.setAttribute("x2","46"),P.setAttribute("y2","0"),P.setAttribute("stroke",s),P.setAttribute("stroke-width","1"),P.setAttribute("stroke-linecap","round");var N=document.createElementNS(t,"circle");N.setAttribute("r","2"),N.setAttribute("fill",s),I.append(P,N);var j=document.createElementNS(t,"circle");j.setAttribute("cx","50"),j.setAttribute("cy","50"),j.setAttribute("r","0.3"),j.setAttribute("fill",o);var C=this.getDate(),R=C.getSeconds(),L=C.getMinutes(),z=6*R,M=6*L+R/60*6,D=30*C.getHours()+L/60*30;return E.setAttribute("transform","translate(50 50) rotate("+D+")"),_.setAttribute("transform","translate(50 50) rotate("+M+")"),I.setAttribute("transform","translate(50 50) rotate("+z+")"),p.append(f,y,E,_,I,j),p.setAttribute("transform","rotate(-90)"),c.innerHTML="\n <style>\n @keyframes rotate-hour {\n from {\n "+h("transform","translate(50px, 50px) rotate("+D+"deg)").join("\n")+"\n }\n to {\n "+h("transform","translate(50px, 50px) rotate("+(D+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-minute {\n from {\n "+h("transform","translate(50px, 50px) rotate("+M+"deg)").join("\n")+"\n }\n to {\n "+h("transform","translate(50px, 50px) rotate("+(M+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-second {\n from {\n "+h("transform","translate(50px, 50px) rotate("+z+"deg)").join("\n")+"\n }\n to {\n "+h("transform","translate(50px, 50px) rotate("+(z+360)+"deg)").join("\n")+"\n }\n }\n </style>\n ",c.append(p),c},e.prototype.createDigitalClock=function(){var t=document.createElement("div");t.className="digital-clock";var e=this.getElementSize().width,r=6/this.props.clockTimezone.length,n=20*e/100,o=10*e/100,i=Math.min(20*r*e/100,e/100*10);if("datetime"===this.props.clockFormat){var s=document.createElement("span");s.className="date",s.textContent=this.getDigitalDate(),s.style.fontSize=o+"px",this.props.color&&(s.style.color=this.props.color),t.append(s)}var a=document.createElement("span");if(a.className="time",a.textContent=this.getDigitalTime(),a.style.fontSize=n+"px",this.props.color&&(a.style.color=this.props.color),t.append(a),this.props.showClockTimezone){var l=document.createElement("span");l.className="timezone",l.textContent=this.props.clockTimezone,l.style.fontSize=i+"px",this.props.color&&(l.style.color=this.props.color),t.append(l)}return t},e.prototype.getDate=function(){var t=new Date,e=60*this.props.clockTimezoneOffset*1e3,r=60*t.getTimezoneOffset()*1e3,n=t.getTime()+e+r;return new Date(n)},e.prototype.getDigitalDate=function(t){void 0===t&&(t=null);var e=t||this.getDate();return l(e.getDate(),2,0)+"/"+l(e.getMonth()+1,2,0)+"/"+l(e.getFullYear(),4,0)},e.prototype.getDigitalTime=function(t){void 0===t&&(t=null);var e=t||this.getDate();return l(e.getHours(),2,0)+":"+l(e.getMinutes(),2,0)+":"+l(e.getSeconds(),2,0)},e.prototype.getElementSize=function(t,e){switch(void 0===t&&(t=this.props.width),void 0===e&&(e=this.props.height),this.props.clockType){case"analogic":var r=100;return t>0&&e>0?r=Math.min(t,e):t>0?r=t:e>0&&(r=e),{width:r,height:r};case"digital":return t>0&&e>0?e=t/2<e?t/2:e:t>0?e=t/2:e>0?t=2*e:(t=100,e=50),{width:t,height:e};default:throw new Error("invalid clock type.")}},e.TICK_INTERVAL=1e3,e}(v),U=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),G=function(){return(G=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Y(t){return G({},b(t),{type:12,label:null,isLinkEnabled:!1,parentId:null,aclGroupId:null,borderWidth:o(t.borderWidth,0),borderColor:s(t.borderColor,null),fillColor:s(t.fillColor,null)})}var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return U(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");if(t.className="box",t.style.boxSizing="border-box",this.props.fillColor&&(t.style.backgroundColor=this.props.fillColor),this.props.borderWidth>0){t.style.borderStyle="solid";var e=Math.min(this.props.width,this.props.height)/2,r=Math.min(this.props.borderWidth,e);t.style.borderWidth=r+"px",this.props.borderColor&&(t.style.borderColor=this.props.borderColor)}return t},e}(v),K=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),q=function(){return(q=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function J(t){var e=q({},b(q({},t,{width:1,height:1})),{type:13,label:null,isLinkEnabled:!1,parentId:null,aclGroupId:null,x:0,y:0,width:0,height:0,startPosition:{x:o(t.startX,0),y:o(t.startY,0)},endPosition:{x:o(t.endX,0),y:o(t.endY,0)},lineWidth:o(t.lineWidth||t.borderWidth,1),color:s(t.borderColor||t.color,null)});return q({},e,Q.extractBoxSizeAndPosition(e))}var Q=function(t){function e(r){return t.call(this,q({},r,e.extractBoxSizeAndPosition(r)))||this}return K(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");t.className="line";var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");r.setAttribute("width",(this.props.width+this.props.lineWidth).toString()),r.setAttribute("height",(this.props.height+this.props.lineWidth).toString());var n=document.createElementNS(e,"line");return n.setAttribute("x1",""+(this.props.startPosition.x-this.props.x+this.props.lineWidth/2)),n.setAttribute("y1",""+(this.props.startPosition.y-this.props.y+this.props.lineWidth/2)),n.setAttribute("x2",""+(this.props.endPosition.x-this.props.x+this.props.lineWidth/2)),n.setAttribute("y2",""+(this.props.endPosition.y-this.props.y+this.props.lineWidth/2)),n.setAttribute("stroke",this.props.color||"black"),n.setAttribute("stroke-width",this.props.lineWidth.toString()),r.append(n),t.append(r),t},e.extractBoxSizeAndPosition=function(t){return{width:Math.abs(t.startPosition.x-t.endPosition.x),height:Math.abs(t.startPosition.y-t.endPosition.y),x:Math.min(t.startPosition.x,t.endPosition.x),y:Math.min(t.startPosition.y,t.endPosition.y)}},e}(v),Z=Q,$=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tt=function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function et(t){return tt({},b(t),{type:4},p(t))}var rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="label",t.innerHTML=this.props.label||"",t},e.prototype.createLabelDomElement=function(){var t=document.createElement("div");return t.className="visual-console-item-label",t},e}(v),nt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ot=function(){return(ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},it=function(t){switch(t){case"string":case"image":return t;default:return"string"}},st=function(t){switch(t){case"none":case"avg":case"max":case"min":return t;default:return"none"}};function at(t){if("string"!=typeof t.value||0===t.value.length)throw new TypeError("invalid value");var e=st(t.processValue);return ot({},b(t),{type:2,valueType:it(t.valueType),value:t.value},"none"===e?{processValue:e}:{processValue:e,period:o(t.period,0)},c(t),p(t))}var lt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nt(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");if(t.className="simple-value","image"===this.props.valueType){var e=document.createElement("img");e.src=this.props.value,t.append(e)}else{var r=this.props.value;this.props.label&&(r=this.props.label.replace(/\(?_VALUE_\)?/i,r)),t.innerHTML=r}return t},e.prototype.createLabelDomElement=function(){var t=document.createElement("div");return t.className="visual-console-item-label",t},e}(v),ut=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ct=function(){return(ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function pt(t){if(i(t.html)&&i(t.encodedHtml))throw new TypeError("missing html content.");return ct({},b(t),{type:14,maxTime:o(t.maxTime,null),html:i(t.html)?f(t.encodedHtml):t.html},c(t))}var ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ut(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.innerHTML=this.props.html,t},e}(v),ft=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dt=function(){return(dt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function mt(t){switch(t){case"progress-bar":case"bubble":case"circular-progress-bar":case"circular-progress-bar-alt":return t;default:case 3:return"progress-bar";case 9:return"bubble";case 15:return"circular-progress-bar";case 16:return"circular-progress-bar-alt"}}function yt(t){switch(t){case"percent":case"value":return t;default:return"percent"}}function bt(t){return dt({},b(t),{type:3,percentileType:mt(t.percentileType||t.type),valueType:yt(t.valueType),minValue:o(t.minValue,null),maxValue:o(t.maxValue,null),color:s(t.color,null),labelColor:s(t.labelColor,null),value:(e=t.value,r=null,"number"==typeof e?e:"string"==typeof e&&e.length>0&&!isNaN(parseFloat(e))?parseFloat(e):r),unit:s(t.unit,null)},c(t),p(t));var e,r}var gt="http://www.w3.org/2000/svg",vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ft(e,t),e.prototype.createDomElement=function(){var t={background:"#000000",progress:this.props.color||"#F0F0F0",text:this.props.labelColor||"#444444"},e=this.getProgress(),r=document.createElement("div"),n=document.createElementNS(gt,"svg");switch(this.props.percentileType){case"progress-bar":var o=document.createElementNS(gt,"rect");o.setAttribute("fill",t.background),o.setAttribute("fill-opacity","0.5"),o.setAttribute("width","100"),o.setAttribute("height","20"),o.setAttribute("rx","5"),o.setAttribute("ry","5");var i=document.createElementNS(gt,"rect");i.setAttribute("fill",t.progress),i.setAttribute("fill-opacity","1"),i.setAttribute("width",""+e),i.setAttribute("height","20"),i.setAttribute("rx","5"),i.setAttribute("ry","5"),(a=document.createElementNS(gt,"text")).setAttribute("text-anchor","middle"),a.setAttribute("alignment-baseline","middle"),a.setAttribute("font-size","12"),a.setAttribute("font-family","arial"),a.setAttribute("font-weight","bold"),a.setAttribute("transform","translate(50 11)"),a.setAttribute("fill",t.text),"value"===this.props.valueType?a.textContent=this.props.unit?this.props.value+" "+this.props.unit:""+this.props.value:a.textContent=e+"%",n.setAttribute("viewBox","0 0 100 20"),n.append(o,i,a);break;case"bubble":case"circular-progress-bar":case"circular-progress-bar-alt":var s=document.createElementNS(gt,"circle");s.setAttribute("transform","translate(50 50)"),s.setAttribute("fill",t.background),s.setAttribute("fill-opacity","0.5"),s.setAttribute("r","50");var a,l=document.createElementNS(gt,"circle");if(l.setAttribute("transform","translate(50 50)"),l.setAttribute("fill",t.progress),l.setAttribute("fill-opacity","1"),l.setAttribute("r",""+e/2),(a=document.createElementNS(gt,"text")).setAttribute("text-anchor","middle"),a.setAttribute("alignment-baseline","middle"),a.setAttribute("font-size","16"),a.setAttribute("font-family","arial"),a.setAttribute("font-weight","bold"),a.setAttribute("fill",t.text),"value"===this.props.valueType)if(this.props.unit&&this.props.unit.length>0){var u=document.createElementNS(gt,"tspan");u.setAttribute("x","0"),u.setAttribute("dy","1em"),u.textContent=""+this.props.value;var c=document.createElementNS(gt,"tspan");c.setAttribute("x","0"),c.setAttribute("dy","1em"),c.textContent=""+this.props.unit,a.append(u,c),a.setAttribute("transform","translate(50 33)")}else a.textContent=""+this.props.value,a.setAttribute("transform","translate(50 50)");else a.textContent=e+"%",a.setAttribute("transform","translate(50 50)");n.setAttribute("viewBox","0 0 100 100"),n.append(s,l,a)}return r.append(n),r},e.prototype.getProgress=function(){var t=this.props.minValue||0,e=this.props.maxValue||100,r=this.props.value||100;return r<=t?0:r>=e?100:(r-t)/(e-t)*100},e}(v),wt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),At=function(){return(At=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Et(t){if(i(t.html)&&i(t.encodedHtml))throw new TypeError("missing html content.");return At({},b(t),{type:17,html:i(t.html)?f(t.encodedHtml):t.html},c(t),p(t))}var kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wt(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.innerHTML=this.props.html,t},e}(v),Ot=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_t=function(){return(_t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function xt(t){if(i(t.html)&&i(t.encodedHtml))throw new TypeError("missing html content.");return _t({},b(t),{type:18,html:i(t.html)?f(t.encodedHtml):t.html},c(t))}var Tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.innerHTML=this.props.html,t},e}(v),St=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),It=function(){return(It=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Pt(t){if(i(t.html)&&i(t.encodedHtml))throw new TypeError("missing html content.");return It({},b(t),{type:1,html:i(t.html)?f(t.encodedHtml):t.html},c(t),p(t))}var Nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return St(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.innerHTML=this.props.html,t},e}(v),jt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ct=function(){return(Ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Rt(t){if(null!==t.imageSrc){if("string"!=typeof t.statusImageSrc||0===t.imageSrc.statusImageSrc)throw new TypeError("invalid status image src.")}else if(i(t.encodedTitle))throw new TypeError("missing encode tittle content.");if(null===o(t.serviceId,null))throw new TypeError("invalid service id.");return Ct({},b(t),{type:10,serviceId:t.serviceId,imageSrc:s(t.imageSrc,null),statusImageSrc:s(t.statusImageSrc,null),encodedTitle:s(t.encodedTitle,null)})}var Lt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return jt(e,t),e.prototype.createDomElement=function(){var t=document.createElement("img");if(null!==this.props.statusImageSrc)t.className="icon",t.src=this.props.statusImageSrc;else if(null!==this.props.encodedTitle){var e=document.createElement("div");return e.innerHTML=f(this.props.encodedTitle),e}return t},e}(v),zt=function(){return(zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Mt(t){var e=o(t.type,null);if(null==e)throw new TypeError("missing item type.");switch(e){case 0:return new O(k(t));case 1:return new Nt(Pt(t));case 2:case 6:case 7:case 8:return new lt(at(t));case 3:case 9:case 15:case 16:return new vt(bt(t));case 4:return new rt(et(t));case 5:return new S(T(t));case 10:return new Lt(Rt(t));case 11:return new M(z(t));case 12:return new X(Y(t));case 13:return new Z(J(t));case 14:return new ht(pt(t));case 17:return new kt(Et(t));case 18:return new Tt(xt(t));case 19:return new F(V(t));case 20:return new C(N(t));default:throw new TypeError("item not found")}}var Dt=function(){function t(t,e,r){var n=this;this.elementsById={},this.elementIds=[],this.relations={},this.clickEventManager=new d,this.disposables=[],this.handleElementClick=function(t){n.clickEventManager.emit(t)},this.handleElementRemove=function(t){n.elementIds=n.elementIds.filter(function(e){return e!==t.data.id}),delete n.elementsById[t.data.id],n.clearRelations(t.data.id)},this.containerRef=t,this._props=function(t){var e=t.id,r=t.name,n=t.groupId,i=t.backgroundURL,l=t.backgroundColor,c=t.isFavorite,p=t.relationLineWidth;if(null==e||isNaN(parseInt(e)))throw new TypeError("invalid Id.");if("string"!=typeof r||0===r.length)throw new TypeError("invalid name.");if(null==n||isNaN(parseInt(n)))throw new TypeError("invalid group Id.");return zt({id:parseInt(e),name:r,groupId:parseInt(n),backgroundURL:s(i,null),backgroundColor:s(l,null),isFavorite:a(c),relationLineWidth:o(p,0)},u(t))}(e),this.render(),(r=r.sort(function(t,e){return null==t.isOnTop||null==e.isOnTop||null==t.id||null==e.id?0:t.isOnTop&&!e.isOnTop?1:!t.isOnTop&&e.isOnTop?-1:t.id<e.id?1:-1})).forEach(function(t){try{var e=Mt(t);n.elementsById[e.props.id]=e,n.elementIds.push(e.props.id),e.onClick(n.handleElementClick),e.onRemove(n.handleElementRemove),n.containerRef.append(e.elementRef)}catch(t){console.log("Error creating a new element:",t.message)}}),this.buildRelations()}return Object.defineProperty(t.prototype,"elements",{get:function(){var t=this;return this.elementIds.map(function(e){return t.elementsById[e]}).filter(function(t){return null!=t})},enumerable:!0,configurable:!0}),t.prototype.updateElements=function(t){var e=this,r=t.map(function(t){return t.id||null}).filter(function(t){return null!=t});this.elementIds.filter(function(t){return r.indexOf(t)<0}).forEach(function(t){null!=e.elementsById[t]&&(e.elementsById[t].remove(),delete e.elementsById[t])}),this.elementIds=r,t.forEach(function(t){if(t.id)if(null==e.elementsById[t.id])try{var r=Mt(t);e.elementsById[r.props.id]=r,r.onClick(e.handleElementClick),r.onRemove(e.handleElementRemove),e.containerRef.append(r.elementRef)}catch(t){console.log("Error creating a new element:",t.message)}else try{e.elementsById[t.id].props=function(t){var e=o(t.type,null);if(null==e)throw new TypeError("missing item type.");switch(e){case 0:return k(t);case 1:return Pt(t);case 2:case 6:case 7:case 8:return at(t);case 3:case 9:case 15:case 16:return bt(t);case 4:return et(t);case 5:return T(t);case 10:return Rt(t);case 11:return z(t);case 12:return Y(t);case 13:return J(t);case 14:return pt(t);case 17:return Et(t);case 18:return xt(t);case 19:return V(t);case 20:return N(t);default:throw new TypeError("decoder not found")}}(t)}catch(t){console.log("Error updating an element:",t.message)}}),this.buildRelations()},Object.defineProperty(t.prototype,"props",{get:function(){return zt({},this._props)},set:function(t){var e=this.props;this._props=t,this.render(e)},enumerable:!0,configurable:!0}),t.prototype.render=function(t){void 0===t&&(t=null),t?(t.backgroundURL!==this.props.backgroundURL&&(this.containerRef.style.backgroundImage="url("+this.props.backgroundURL+")"),t.backgroundColor!==this.props.backgroundColor&&(this.containerRef.style.backgroundColor=this.props.backgroundColor),this.sizeChanged(t,this.props)&&this.resizeElement(this.props.width,this.props.height)):(this.containerRef.style.backgroundImage="url("+this.props.backgroundURL+")",this.containerRef.style.backgroundColor=this.props.backgroundColor,this.resizeElement(this.props.width,this.props.height))},t.prototype.sizeChanged=function(t,e){return t.width!==e.width||t.height!==e.height},t.prototype.resizeElement=function(t,e){this.containerRef.style.width=t+"px",this.containerRef.style.height=e+"px"},t.prototype.resize=function(t,e){this.props=zt({},this.props,{width:t,height:e})},t.prototype.remove=function(){this.disposables.forEach(function(t){return t.dispose()}),this.elements.forEach(function(t){return t.remove()}),this.elementsById={},this.elementIds=[],this.clearRelations(),this.containerRef.innerHTML=""},t.prototype.buildRelations=function(){var t=this;this.clearRelations(),this.elements.forEach(function(e){if(null!==e.props.parentId){var r=t.elementsById[e.props.parentId],n=t.elementsById[e.props.id];r&&n&&t.addRelationLine(r,n)}})},t.prototype.clearRelations=function(t){if(null!=t)for(var e in this.relations){var r=e.split("|"),n=Number.parseInt(r[0]),o=Number.parseInt(r[1]);t!==n&&t!==o||(this.relations[e].remove(),delete this.relations[e])}else for(var e in this.relations)this.relations[e].remove(),delete this.relations[e]},t.prototype.getRelationLine=function(t,e){var r=t+"|"+e;return this.relations[r]||null},t.prototype.addRelationLine=function(t,e){var r=t.props.id+"|"+e.props.id;null!=this.relations[r]&&this.relations[r].remove();var n=t.props.x+t.elementRef.clientWidth/2,o=t.props.y+(t.elementRef.clientHeight-t.labelElementRef.clientHeight)/2,i=e.props.x+e.elementRef.clientWidth/2,s=e.props.y+(e.elementRef.clientHeight-e.labelElementRef.clientHeight)/2,a=new Z(J({id:0,type:13,startX:n,startY:o,endX:i,endY:s,width:0,height:0,lineWidth:this.props.relationLineWidth,color:"#CCCCCC"}));return this.relations[r]=a,a.elementRef.style.zIndex="0",this.containerRef.append(a.elementRef),a},t.prototype.onClick=function(t){var e=this.clickEventManager.on(t);return this.disposables.push(e),e},t}();window.VisualConsole=Dt}]);
|
|
//# sourceMappingURL=vc.main.66fed557.min.js.map
|