2 lines
109 KiB
JavaScript
2 lines
109 KiB
JavaScript
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=14)}([function(t,e,n){"use strict";n.d(e,"n",function(){return r}),n.d(e,"m",function(){return o}),n.d(e,"s",function(){return s}),n.d(e,"k",function(){return a}),n.d(e,"l",function(){return l}),n.d(e,"o",function(){return u}),n.d(e,"r",function(){return h}),n.d(e,"j",function(){return p}),n.d(e,"i",function(){return d}),n.d(e,"h",function(){return _}),n.d(e,"p",function(){return m}),n.d(e,"d",function(){return f}),n.d(e,"f",function(){return y}),n.d(e,"g",function(){return b}),n.d(e,"q",function(){return v}),n.d(e,"c",function(){return E}),n.d(e,"a",function(){return w}),n.d(e,"b",function(){return O}),n.d(e,"t",function(){return k}),n.d(e,"e",function(){return M});n(9),n(4),n(5),n(12);var i=function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function r(t,e){return"number"==typeof t?t:"string"==typeof t&&t.length>0&&!isNaN(parseInt(t))?parseInt(t):e}function o(t,e){return"number"==typeof t?t:"string"==typeof t&&t.length>0&&!isNaN(parseFloat(t))?parseFloat(t):e}function s(t){return null==t||0===t.length}function a(t,e){return"string"==typeof t&&t.length>0?t:e}function l(t){return"boolean"==typeof t?t:"number"==typeof t?t>0:"string"==typeof t&&("1"===t||"true"===t)}function c(t,e,n){void 0===n&&(n=" "),"number"==typeof t&&(t=""+t),"number"==typeof n&&(n=""+n);var i=e-t.length;if(0===i)return t;if(i<0)return t.substr(Math.abs(i));if(i===n.length)return""+n+t;if(i<n.length)return""+n.substring(0,i)+t;for(var r=Math.floor(i/n.length),o=i-n.length*r,s="",a=0;a<r;a++)s+=n;return 0===o?""+s+t:""+s+n.substring(0,o)+t}function u(t){return{x:r(t.x,0),y:r(t.y,0)}}function h(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 p(t){return i({moduleId:r(t.moduleId,null),moduleName:a(t.moduleName,null),moduleDescription:a(t.moduleDescription,null)},function(t){var e={agentId:r(t.agentId,null),agentName:a(t.agentName,null),agentAlias:a(t.agentAlias,null),agentDescription:a(t.agentDescription,null),agentAddress:a(t.agentAddress,null)};return null!=t.metaconsoleId?i({metaconsoleId:t.metaconsoleId},e):e}(t))}function d(t){var e={linkedLayoutStatusType:"default"};switch(t.linkedLayoutStatusType){case"weight":var n=r(t.linkedLayoutStatusTypeWeight,null);if(null==n)throw new TypeError("invalid status calculation properties.");t.linkedLayoutStatusTypeWeight&&(e={linkedLayoutStatusType:"weight",linkedLayoutStatusTypeWeight:n});break;case"service":var o=r(t.linkedLayoutStatusTypeWarningThreshold,null),s=r(t.linkedLayoutStatusTypeCriticalThreshold,null);if(null==o||null==s)throw new TypeError("invalid status calculation properties.");e={linkedLayoutStatusType:"service",linkedLayoutStatusTypeWarningThreshold:o,linkedLayoutStatusTypeCriticalThreshold:s}}return i({linkedLayoutId:r(t.linkedLayoutId,null),linkedLayoutNodeId:r(t.linkedLayoutNodeId,null)},e)}function _(t){var e,n,i=(e=t.receivedAt,n=null,e instanceof Date?e:"number"==typeof e?new Date(1e3*e):"string"!=typeof e||Number.isNaN(new Date(e).getTime())?n:new Date(e));if(null===i)throw new TypeError("invalid meta structure");var r=null;return t.error instanceof Error?r=t.error:"string"==typeof t.error&&(r=new Error(t.error)),{receivedAt:i,error:r,editMode:l(t.editMode),isFromCache:l(t.isFromCache),isFetching:!1,isUpdating:!1,isBeingMoved:!1,isBeingResized:!1,isSelected:!1,lineMode:!1}}function m(t,e){var n=t+": "+e+";";return["-webkit-"+n,"-moz-"+n,"-ms-"+n,"-o-"+n,""+n]}function f(t){return decodeURIComponent(escape(window.atob(t)))}function y(t,e){if(void 0===e&&(e=null),e&&Intl&&Intl.DateTimeFormat){return Intl.DateTimeFormat(e,{day:"2-digit",month:"2-digit",year:"numeric"}).format(t)}return c(t.getDate(),2,0)+"/"+c(t.getMonth()+1,2,0)+"/"+c(t.getFullYear(),4,0)}function b(t){return c(t.getHours(),2,0)+":"+c(t.getMinutes(),2,0)+":"+c(t.getSeconds(),2,0)}function v(t,e){return t.reduce(function(t,e){var n=e.macro,i=e.value;return t.replace(n,i)},e)}function g(t,e){var n=0;return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var o=Date.now();if(!(o-n<t))return n=o,e.apply(void 0,i)}}function E(t,e){var n=null;return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];null!==n&&window.clearTimeout(n),n=window.setTimeout(function(){e.apply(void 0,i),n=null},t)}}function x(t,e){for(var n=0,i=0;t&&!Number.isNaN(t.offsetLeft)&&!Number.isNaN(t.offsetTop)&&t!==e;)n+=t.offsetLeft-t.scrollLeft,i+=t.offsetTop-t.scrollTop,t=t.offsetParent;return{top:i,left:n}}function w(t,e,n){var i=n||t.parentElement,r=t.draggable,o=0,s=0,a=0,l=0,c=0,u=0,h=i.getBoundingClientRect(),p=x(i),d=p.top,_=d+h.height,m=p.left,f=m+h.width,y=t.getBoundingClientRect(),b=window.getComputedStyle(t).borderWidth||"0",v=2*Number.parseInt(b),w=E(32,e),O=g(16,e),k=function(t){var e=0,n=0,i=t.pageX,r=t.pageY,p=i-a,b=r-l,g=h.width-y.width+v,E=h.height-y.height+v,x=i<m||0===o&&p>0&&i<m+c,k=i>f||p+o+y.width-v>h.width||o===g&&p<0&&i>m+g+c,M=r<d||0===s&&b>0&&r<d+u,A=r>_||b+s+y.height-v>h.height||s===E&&b<0&&r>d+E+u;(e=x?0:k?g:p+o)<0&&(e=0),(n=M?0:A?E:b+s)<0&&(n=0),a=i,l=r,e===o&&n===s||(O(e,n),w(e,n),o=e,s=n)},M=function(){o=0,s=0,a=0,l=0,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",M),t.draggable=r,document.body.style.userSelect="auto"},A=function(e){if(2!==e.button){e.stopPropagation(),t.draggable=!1;var n=x(t,i);o=n.left,s=n.top,a=e.pageX,l=e.pageY,c=e.offsetX,u=e.offsetY,h=i.getBoundingClientRect(),p=x(i),d=p.top,_=d+h.height,m=p.left,f=m+h.width,y=t.getBoundingClientRect(),b=window.getComputedStyle(t).borderWidth||"0",v=2*Number.parseInt(b),document.addEventListener("mousemove",k),document.addEventListener("mouseup",M),document.body.style.userSelect="none"}};return t.addEventListener("mousedown",A),function(){t.removeEventListener("mousedown",A),M()}}function O(t,e){var n=document.createElement("div");n.className="resize-draggable",t.appendChild(n);var i=t.parentElement,r=t.draggable,o=0,s=0,a=0,l=0,c=0,u=i.getBoundingClientRect(),h=x(i),p=h.top,d=p+u.height,_=h.left,m=_+u.width,f=x(t),y=f.top,b=f.left,v=window.getComputedStyle(t).borderWidth||"0",w=Number.parseInt(v),O=E(32,e),k=g(16,e),M=function(t){var e=o+(t.pageX-a),n=s+(t.pageY-l);e===o&&n===s||e<o&&t.pageX>b+(o-c)||(e<15?e=15:e+b-w/2>=m&&(e=m-b),n<15?n=15:n+y-w/2>=d&&(n=d-y),k(e,n),O(e,n),o=e,s=n,a=t.pageX,l=t.pageY)},A=function(){o=0,s=0,a=0,l=0,c=0,0,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",A),t.draggable=r,document.body.style.userSelect="auto"};return n.addEventListener("mousedown",function(e){e.stopPropagation(),t.draggable=!1;var n=t.getBoundingClientRect(),r=n.width,v=n.height;o=r,s=v,a=e.pageX,l=e.pageY,c=e.offsetX,e.offsetY,u=i.getBoundingClientRect(),h=x(i),p=h.top,d=p+u.height,_=h.left,m=_+u.width,f=x(t),y=f.top,b=f.left,document.addEventListener("mousemove",M),document.addEventListener("mouseup",A),document.body.style.userSelect="none"}),function(){n.remove(),A()}}function k(t){return t}function M(t,e,n){return void 0===e&&(e=140),void 0===n&&(n="…"),t.trim().length>e?t.substr(0,e).trim()+n:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return l});var i=n(0),r=n(2),o=n(3),s=function(){return(s=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},a=function(t){switch(t){case"up":case"right":case"down":case"left":return t;default:return"down"}};function l(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 s({id:parseInt(t.id),type:parseInt(t.type),label:Object(i.k)(t.label,null),labelPosition:a(t.labelPosition),isLinkEnabled:Object(i.l)(t.isLinkEnabled),link:Object(i.k)(t.link,null),isOnTop:Object(i.l)(t.isOnTop),parentId:Object(i.n)(t.parentId,null),aclGroupId:Object(i.n)(t.aclGroupId,null),cacheExpiration:Object(i.n)(t.cacheExpiration,null)},Object(i.r)(t),Object(i.o)(t))}var c=function(){function t(t,e,n){var o=this;void 0===n&&(n=!1),this.elementRef=document.createElement("div"),this.labelElementRef=document.createElement("div"),this.childElementRef=document.createElement("div"),this.clickEventManager=new r.a,this.dblClickEventManager=new r.a,this.movedEventManager=new r.a,this.movementFinishedEventManager=new r.a,this.resizedEventManager=new r.a,this.resizeFinishedEventManager=new r.a,this.removeEventManager=new r.a,this.selectionChangedEventManager=new r.a,this.disposables=[],this.debouncedMovementSave=Object(i.c)(500,function(t,e){o._metadata.isBeingMoved=!1;var n={x:o.props.x,y:o.props.y},i={x:t,y:e};o.positionChanged(n,i)&&(o.move(t,e),o.movementFinishedEventManager.emit({item:o,prevPosition:n,newPosition:i}))}),this.removeMovement=null,this.debouncedResizementSave=Object(i.c)(500,function(t,e){o._metadata.isBeingResized=!1;var n={width:o.props.width,height:o.props.height},i={width:t,height:e};o.sizeChanged(n,i)&&(o.resize(t,e),o.resizeFinishedEventManager.emit({item:o,prevSize:n,newSize:i}))}),this.removeResizement=null,this.itemProps=t,this._metadata=e,n||this.init()}return t.prototype.initMovementListener=function(t){var e=this;this.removeMovement=Object(i.a)(t,function(t,n){var i={x:e.props.x,y:e.props.y},r={x:t,y:n};e.meta=s({},e.meta,{isSelected:!0}),e.positionChanged(i,r)&&(e._metadata.isBeingMoved=!0,e.moveElement(t,n),e.movedEventManager.emit({item:e,prevPosition:i,newPosition:r}),e.debouncedMovementSave(t,n))})},t.prototype.stopMovementListener=function(){this.removeMovement&&(this.removeMovement(),this.removeMovement=null)},t.prototype.initResizementListener=function(t){var e=this;this.removeResizement=Object(i.b)(t,function(t,n){if(e._metadata.isBeingResized=!0,e.props.label&&e.props.label.length>0){var i=e.labelElementRef.getBoundingClientRect(),r=i.width,o=i.height;switch(e.props.labelPosition){case"up":case"down":n-=o;break;case"left":case"right":t-=r}}var s={width:e.props.width,height:e.props.height},a={width:t,height:n};e.sizeChanged(s,a)&&(e.resizeElement(t,n),e.resizedEventManager.emit({item:e,prevSize:s,newSize:a}),e.debouncedResizementSave(t,n))})},t.prototype.stopResizementListener=function(){this.removeResizement&&(this.removeResizement(),this.removeResizement=null)},t.prototype.init=function(){this.elementRef=this.createContainerDomElement(),this.labelElementRef=this.createLabelDomElement(),this.childElementRef=this.createDomElement(),this.elementRef.appendChild(this.childElementRef),this.elementRef.appendChild(this.labelElementRef),this.resizeElement(this.itemProps.width,this.itemProps.height),this.changeLabelPosition(this.itemProps.labelPosition)},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.className="textDecorationNone"):(t=document.createElement("div")).className="textDecorationNone",t.classList.add("visual-console-item"),this.props.isOnTop&&t.classList.add("is-on-top"),t.style.left=this.props.x+"px",t.style.top=this.props.y+"px",t.addEventListener("dblclick",function(t){e.meta.isBeingMoved||e.meta.isBeingResized||(e.unSelectItem(),e.selectItem(),e.dblClickEventManager.emit({item:e,nativeEvent:t}))}),t.addEventListener("click",function(t){if(e.meta.editMode)t.preventDefault(),t.stopPropagation();else if(e.itemProps.isLinkEnabled&&null!=e.itemProps.link){var n=document.createElement("div");n.className="div-visual-console-spinner";var i=document.createElement("div");i.className="visual-console-spinner",n.appendChild(i);var r=document.getElementById("visual-console-container");null!=r&&(r.classList.add("is-updating"),r.appendChild(n))}e.meta.isBeingMoved||e.meta.isBeingResized||e.clickEventManager.emit({item:e,nativeEvent:t})}),this.meta.editMode&&t.classList.add("is-editing"),this.meta.isFetching&&t.classList.add("is-fetching"),this.meta.isUpdating&&t.classList.add("is-updating"),this.meta.isSelected&&t.classList.add("is-selected"),t},t.prototype.createLabelDomElement=function(){var t=document.createElement("div");t.className="visual-console-item-label";var e=this.getLabelWithMacrosReplaced();if(e.length>0){var n=document.createElement("table"),i=document.createElement("tr"),r=document.createElement("tr"),o=document.createElement("tr"),s=document.createElement("td");switch(s.innerHTML=e,i.appendChild(s),n.appendChild(r),n.appendChild(i),n.appendChild(o),n.style.textAlign="center",this.props.labelPosition){case"up":case"down":this.props.width>0&&(n.style.width=this.props.width+"px",n.style.height=null);break;case"left":case"right":this.props.height>0&&(n.style.width=null,n.style.height=this.props.height+"px")}t.appendChild(n)}return t},t.prototype.getLabelWithMacrosReplaced=function(){var t=this.props;return Object(i.q)([{macro:"_date_",value:Object(i.f)(new Date)},{macro:"_time_",value:Object(i.g)(new Date)},{macro:"_agent_",value:null!=t.agentAlias?t.agentAlias:""},{macro:"_agentdescription_",value:null!=t.agentDescription?t.agentDescription:""},{macro:"_address_",value:null!=t.agentAddress?t.agentAddress:""},{macro:"_module_",value:null!=t.moduleName?t.moduleName:""},{macro:"_moduledescription_",value:null!=t.moduleDescription?t.moduleDescription:""}],this.props.label||"")},t.prototype.updateDomElement=function(t){t.innerHTML=this.createDomElement().innerHTML},Object.defineProperty(t.prototype,"props",{get:function(){return s({},this.itemProps)},set:function(t){this.setProps(t)},enumerable:!0,configurable:!0}),t.prototype.setProps=function(t){var e=this.props;this.itemProps=t,this.shouldBeUpdated(e,t)&&this.render(e,this._metadata)},Object.defineProperty(t.prototype,"meta",{get:function(){return s({},this._metadata)},set:function(t){this.setMeta(t)},enumerable:!0,configurable:!0}),t.prototype.setMeta=function(t){var e=this._metadata;this._metadata=s({},e,t),void 0!==t.isSelected&&e.isSelected!==t.isSelected&&this.selectionChangedEventManager.emit({selected:t.isSelected}),this.render(this.itemProps,e)},t.prototype.shouldBeUpdated=function(t,e){return t!==e},t.prototype.render=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.updateDomElement(this.childElementRef),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);var n=this.labelElementRef.innerHTML,i=this.createLabelDomElement().innerHTML;if(n!==i&&(this.labelElementRef.innerHTML=i),t&&t.labelPosition===this.props.labelPosition||this.changeLabelPosition(this.props.labelPosition),t&&t.isOnTop===this.props.isOnTop||(this.props.isOnTop?this.elementRef.classList.add("is-on-top"):this.elementRef.classList.remove("is-on-top")),t&&t.isLinkEnabled!==this.props.isLinkEnabled){var r=this.createContainerDomElement();r.innerHTML=this.elementRef.innerHTML;for(var o=this.elementRef.attributes,s=0;s<o.length;s++)if("id"!==o[s].nodeName){var a=this.elementRef.getAttributeNode(o[s].nodeName);null!==a&&r.setAttributeNode(a.cloneNode())}null!==this.elementRef.parentNode&&this.elementRef.parentNode.replaceChild(r,this.elementRef),this.elementRef=r}if(t&&this.props.isLinkEnabled&&t.link!==this.props.link&&null!==this.props.link&&this.elementRef.setAttribute("href",this.props.link),e&&e.editMode===this.meta.editMode||(this.meta.editMode?this.elementRef.classList.add("is-editing"):this.elementRef.classList.remove("is-editing")),e&&e.isFetching===this.meta.isFetching||(this.meta.isFetching?this.elementRef.classList.add("is-fetching"):this.elementRef.classList.remove("is-fetching")),!e||e.isUpdating!==this.meta.isUpdating)if(this.meta.isUpdating){this.elementRef.classList.add("is-updating");var l=document.createElement("div");l.className="div-visual-console-spinner";var c=document.createElement("div");c.className="visual-console-spinner",l.appendChild(c),this.elementRef.appendChild(l)}else{this.elementRef.classList.remove("is-updating");var u=this.elementRef.querySelector(".div-visual-console-spinner");if(null!==u){var h=u.parentElement;null!==h&&h.removeChild(u)}}e&&e.isSelected===this.meta.isSelected||(this.meta.isSelected?this.elementRef.classList.add("is-selected"):this.elementRef.classList.remove("is-selected"))},t.prototype.remove=function(){this.removeEventManager.emit({item:this}),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"}var e=this.labelElementRef.getElementsByTagName("table"),n=e.length>0?e.item(0):null;if(n)switch(this.props.labelPosition){case"up":case"down":this.props.width>0&&(n.style.width=this.props.width+"px",n.style.height=null);break;case"left":case"right":this.props.height>0&&(n.style.width=null,n.style.height=this.props.height+"px")}},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=s({},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){if(this.childElementRef.style.width=t>0?t+"px":null,this.childElementRef.style.height=e>0?e+"px":null,this.props.label&&this.props.label.length>0){var n=this.labelElementRef.getElementsByTagName("table"),i=n.length>0?n.item(0):null;if(i)switch(this.props.labelPosition){case"up":case"down":i.style.width=t>0?t+"px":null;break;case"left":case"right":i.style.height=e>0?e+"px":null}}},t.prototype.resize=function(t,e){this.resizeElement(t,e),this.itemProps=s({},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.onDblClick=function(t){var e=this.dblClickEventManager.on(t);return this.disposables.push(e),e},t.prototype.onMoved=function(t){var e=this.movedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onMovementFinished=function(t){var e=this.movementFinishedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onResized=function(t){var e=this.resizedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onResizeFinished=function(t){var e=this.resizeFinishedEventManager.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.prototype.onSelectionChanged=function(t){var e=this.selectionChangedEventManager.on(t);return this.disposables.push(e),e},t.prototype.selectItem=function(){this.meta=s({},this.meta,{isSelected:!0}),this.initMovementListener(this.elementRef),13!==this.props.type&&this.initResizementListener(this.elementRef)},t.prototype.unSelectItem=function(){this.meta=s({},this.meta,{isSelected:!1}),this.stopMovementListener(),13!==this.props.type&&this.stopResizementListener()},t.prototype.getFormContainer=function(){return t.getFormContainer(this.props)},t.getFormContainer=function(t){var e=t.type?function(t){var e="";switch(t){case 0:e=Object(i.t)("Static image");break;case 1:e=Object(i.t)("Module graph");break;case 2:e=Object(i.t)("Simple value");break;case 3:e=Object(i.t)("Percentile item");break;case 4:e=Object(i.t)("Label");break;case 5:e=Object(i.t)("Icon");break;case 6:case 7:case 8:e=Object(i.t)("Simple value");break;case 9:e=Object(i.t)("Percentile item");break;case 10:e=Object(i.t)("Service");break;case 11:e=Object(i.t)("Group");break;case 12:e=Object(i.t)("Box");break;case 13:e=Object(i.t)("Line");break;case 14:e=Object(i.t)("Event history graph");break;case 15:case 16:e=Object(i.t)("Percentile item");break;case 17:e=Object(i.t)("Serialized pie graph");break;case 18:e=Object(i.t)("Bars graph");break;case 19:e=Object(i.t)("Clock");break;case 20:e=Object(i.t)("Color cloud");break;default:e=Object(i.t)("Item")}return e}(t.type):Object(i.t)("Item");return new o.FormContainer(e,[],[])},t}();e.a=c},function(t,e,n){"use strict";var i=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 n=t.listeners.indexOf(e);n>-1&&t.listeners.splice(n,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)})}}}();e.a=i},function(t,e,n){"use strict";n.r(e),n.d(e,"InputGroup",function(){return o}),n.d(e,"FormContainer",function(){return s});var i=n(2),r=function(){return(r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o=function(){function t(t,e){this._name="",this.currentData={},this.dataRequestedEventManager=new i.a,this.name=t,this.initialData=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){if(0===t.length)throw new RangeError("empty name");this._name=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return r({},this.currentData)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){if(null==this._element){var t=document.createElement("div");t.className="input-group input-group-"+this.name;var e=this.createContent();e instanceof Array?e.forEach(t.appendChild):t.appendChild(e),this._element=t}return this._element},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.currentData={}},t.prototype.updateData=function(t){this.currentData=r({},this.currentData,t)},t.prototype.requestData=function(t,e,n){this.dataRequestedEventManager.emit({identifier:t,params:e,done:n})},t.prototype.onDataRequested=function(t){return this.dataRequestedEventManager.on(t)},t}(),s=function(){function t(t,e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n=[]),this.inputGroupsByName={},this.enabledInputGroupNames=[],this.submitEventManager=new i.a,this.itemDataRequestedEventManager=new i.a,this.handleItemDataRequested=this.itemDataRequestedEventManager.emit,this.title=t,e.length>0&&(this.inputGroupsByName=e.reduce(function(t,e){return e.onDataRequested(r.handleItemDataRequested),t[e.name]=e,t},this.inputGroupsByName)),n.length>0&&(this.enabledInputGroupNames=this.enabledInputGroupNames.concat(n.filter(function(t){return null!=r.inputGroupsByName[t]})))}return t.prototype.getInputGroup=function(t){return this.inputGroupsByName[t]||null},t.prototype.addInputGroup=function(t,e){return void 0===e&&(e=null),t.onDataRequested(this.handleItemDataRequested),this.inputGroupsByName[t.name]=t,this.enabledInputGroupNames=this.enabledInputGroupNames.filter(function(e){return e!==t.name}),null!==e?e<=0?this.enabledInputGroupNames=[t.name].concat(this.enabledInputGroupNames):e>=this.enabledInputGroupNames.length?this.enabledInputGroupNames=this.enabledInputGroupNames.concat([t.name]):this.enabledInputGroupNames=this.enabledInputGroupNames.slice(0,e).concat([t.name],this.enabledInputGroupNames.slice(e)):this.enabledInputGroupNames=this.enabledInputGroupNames.concat([t.name]),this},t.prototype.removeInputGroup=function(t){return delete this.inputGroupsByName[t],this.enabledInputGroupNames=this.enabledInputGroupNames.filter(function(e){return e!==t}),this},t.prototype.getFormElement=function(t){var e=this;void 0===t&&(t="update");var n=document.createElement("form");n.id="visual-console-item-edition",n.className="visual-console-item-edition",n.addEventListener("submit",function(t){t.preventDefault(),e.submitEventManager.emit({nativeEvent:t,data:e.enabledInputGroupNames.reduce(function(t,n){return e.inputGroupsByName[n]&&(t=r({},t,e.inputGroupsByName[n].data)),t},{})})});var i=document.createElement("div");return i.className="input-groups",this.enabledInputGroupNames.forEach(function(t){e.inputGroupsByName[t]&&i.appendChild(e.inputGroupsByName[t].element)}),n.appendChild(i),n},t.prototype.reset=function(){var t=this;this.enabledInputGroupNames.forEach(function(e){t.inputGroupsByName[e]&&t.inputGroupsByName[e].reset()})},t.prototype.onSubmit=function(t){return this.submitEventManager.on(t)},t.prototype.onInputGroupDataRequested=function(t){return this.itemDataRequestedEventManager.on(t)},t}()},function(t,e,n){"use strict";n(11);var i="http://www.w3.org/2000/svg";e.a=function(t,e,n){var r=void 0===n?{}:n,o=r.size,s=r.color,a=r.spin,l=r.pulse,c=document.createElement("figure");c.title=e,c.className="fa fa-"+t.iconName,o&&c.classList.add("fa-"+o),a?c.classList.add("fa-spin"):l&&c.classList.add("fa-pulse");var u=document.createElementNS(i,"svg");u.setAttribute("viewBox","0 0 "+t.icon[0]+" "+t.icon[1]),s&&u.setAttribute("fill",s);var h=document.createElementNS(i,"path"),p="string"==typeof t.icon[4]?t.icon[4]:t.icon[4][0];return h.setAttribute("d",p),u.appendChild(h),c.appendChild(u),c}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return r}),n.d(e,"c",function(){return o}),n.d(e,"d",function(){return s});var i={prefix:"fas",iconName:"list-alt",icon:[512,512,[],"f022","M464 480H48c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v352c0 26.51-21.49 48-48 48zM128 120c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zm0 96c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zm0 96c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zm288-136v-32c0-6.627-5.373-12-12-12H204c-6.627 0-12 5.373-12 12v32c0 6.627 5.373 12 12 12h200c6.627 0 12-5.373 12-12zm0 96v-32c0-6.627-5.373-12-12-12H204c-6.627 0-12 5.373-12 12v32c0 6.627 5.373 12 12 12h200c6.627 0 12-5.373 12-12zm0 96v-32c0-6.627-5.373-12-12-12H204c-6.627 0-12 5.373-12 12v32c0 6.627 5.373 12 12 12h200c6.627 0 12-5.373 12-12z"]},r={prefix:"fas",iconName:"pencil-alt",icon:[512,512,[],"f303","M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"]},o={prefix:"fas",iconName:"plus-circle",icon:[512,512,[],"f055","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"]},s={prefix:"fas",iconName:"trash-alt",icon:[448,512,[],"f2ed","M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"]}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",function(){return eventsHistoryPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),__extends=(extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function eventsHistoryPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t),{type:14,maxTime:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.n)(t.maxTime,null),html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml):t.html},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.j)(t))}var EventsHistory=function(_super){function EventsHistory(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(EventsHistory,_super),EventsHistory.prototype.createDomElement=function(){var element=document.createElement("div");element.className="events-history",element.innerHTML=this.props.html;for(var scripts=element.getElementsByTagName("script"),_loop_1=function(i){0===scripts[i].src.length&&setTimeout(function(){try{eval(scripts[i].innerHTML.trim())}catch(t){}},0)},i=0;i<scripts.length;i++)_loop_1(i);return element},EventsHistory.prototype.updateDomElement=function(element){element.innerHTML=this.props.html;var aux=document.createElement("div");aux.innerHTML=this.props.html;for(var scripts=aux.getElementsByTagName("script"),i=0;i<scripts.length;i++)0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},EventsHistory}(_Item__WEBPACK_IMPORTED_MODULE_1__.a);__webpack_exports__.a=EventsHistory},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",function(){return donutGraphPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),__extends=(extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function donutGraphPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t),{type:17,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml):t.html,legendBackgroundColor:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.legendBackgroundColor)?"#000000":t.legendBackgroundColor},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.j)(t),Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t))}var DonutGraph=function(_super){function DonutGraph(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DonutGraph,_super),DonutGraph.prototype.createDomElement=function(){var element=document.createElement("div");element.className="donut-graph",element.innerHTML=this.props.html;for(var scripts=element.getElementsByTagName("script"),_loop_1=function(i){setTimeout(function(){0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},0)},i=0;i<scripts.length;i++)_loop_1(i);return element},DonutGraph.prototype.updateDomElement=function(element){element.innerHTML=this.props.html;var aux=document.createElement("div");aux.innerHTML=this.props.html;for(var scripts=aux.getElementsByTagName("script"),i=0;i<scripts.length;i++)0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},DonutGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.a);__webpack_exports__.a=DonutGraph},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",function(){return moduleGraphPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),__extends=(extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__assign=function(){return(__assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},parseBackgroundType=function(t){switch(t){case"white":case"black":case"transparent":return t;default:return"transparent"}},parseGraphType=function(t){switch(t){case"line":case"area":return t;default:return"line"}};function moduleGraphPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t),{type:1,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml):t.html,backgroundType:parseBackgroundType(t.backgroundType),period:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.n)(t.period,null),graphType:parseGraphType(t.graphType),customGraphId:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.n)(t.customGraphId,null)},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.j)(t),Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t))}var ModuleGraph=function(_super){function ModuleGraph(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ModuleGraph,_super),ModuleGraph.prototype.createDomElement=function(){var element=document.createElement("div");element.innerHTML=this.props.html,element.className="module-graph";for(var legendP=element.getElementsByTagName("p"),i=0;i<legendP.length;i++)legendP[i].style.margin="0px";for(var overviewGraphs=element.getElementsByClassName("overview_graph"),i=0;i<overviewGraphs.length;i++)overviewGraphs[i].remove();for(var scripts=element.getElementsByTagName("script"),_loop_1=function(i){0===scripts[i].src.length&&setTimeout(function(){try{eval(scripts[i].innerHTML.trim())}catch(t){}},0)},i=0;i<scripts.length;i++)_loop_1(i);return element},ModuleGraph.prototype.updateDomElement=function(element){element.innerHTML=this.props.html;for(var legendP=element.getElementsByTagName("p"),i=0;i<legendP.length;i++)legendP[i].style.margin="0px";for(var overviewGraphs=element.getElementsByClassName("overview_graph"),i=0;i<overviewGraphs.length;i++)overviewGraphs[i].remove();for(var scripts=element.getElementsByTagName("script"),i=0;i<scripts.length;i++)0===scripts[i].src.length&&eval(scripts[i].innerHTML.trim())},ModuleGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.a);__webpack_exports__.a=ModuleGraph},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARpJREFUeNqUU8ENwjAMTCsGyAiwAIIN2hdfmACYgLIACBYAJgA26JcXbABigo7QEbhDFxSFEIlIp7Sxz/Y5jjGJtb30B0TKJ4uQCmwLYByYauC8Gj1r/zAPyEdsV6AFhnDOCH4DDXCkD2C/KhCZWUuQHr8kMQiDwWfyqQAGEmchmedA5f5lI7HA+cyXsAY2kcxT2YwXhFIO7jyXHpZ2CktWmb2Imj3QpaRcZBc51FxJWhiYTWa1tmPSyyZsretBo2zW/LeKdwCV3kQGJzWhlNWCe3O3cGZXf1TRBmSrGziEg3TXZ6kmxTKTvFPj337+KJfa7xqs2Bu5SvvcJckiGSo9JqOrMspoNStLv8Is0ajCdRrrxmAxaS8BBgA1e3UUTVCKKgAAAABJRU5ErkJggg=="},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(10);var i,r=n(0),o=n(1),s=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},l=function(t){switch(t){case"default":case"enabled":case"disabled":return t;default:return"default"}};function c(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");return a({},Object(o.b)(t),{type:0,imageSrc:t.imageSrc,showLastValueTooltip:l(t.showLastValueTooltip),statusImageSrc:Object(r.k)(t.statusImageSrc,null),lastValue:Object(r.k)(t.lastValue,null)},Object(r.j)(t),Object(r.i)(t))}var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.createDomElement=function(){var t=this.props.statusImageSrc||this.props.imageSrc,e=document.createElement("div");return e.className="static-graph",e.style.backgroundImage="url("+t+")",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="contain",e.style.backgroundPosition="center",null!==this.props.lastValue&&"disabled"!==this.props.showLastValueTooltip&&(e.className="static-graph image forced_title",e.setAttribute("data-use_title_for_force_title","1"),e.setAttribute("data-title",this.props.lastValue)),e},e.prototype.updateDomElement=function(t){var e=this.props.statusImageSrc||this.props.imageSrc;t.style.backgroundImage="url("+e+")"},e}(o.a),h=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(){return(p=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function d(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");if("string"!=typeof t.image||0===t.image.length)throw new TypeError("invalid image.");return p({},Object(o.b)(t),{type:5,image:t.image,imageSrc:t.imageSrc},Object(r.i)(t))}var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="icon "+this.props.image,t.style.backgroundImage="url("+this.props.imageSrc+")",t.style.backgroundRepeat="no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center",t},e.prototype.updateDomElement=function(t){t.style.backgroundImage="url("+this.props.imageSrc+")"},e}(o.a),m=n(3),f=n(4),y=n(5),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),v=function(){return(v=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function g(t){if("string"!=typeof t.color||0===t.color.length)throw new TypeError("invalid color.");return v({},Object(o.b)(t),{type:20,color:t.color,defaultColor:t.defaultColor,colorRanges:t.colorRanges},Object(r.j)(t),Object(r.i)(t))}var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("div");e.className="div-input-group";var n=document.createElement("label");n.textContent=Object(r.t)("Default color"),e.appendChild(n);var i=document.createElement("input");return i.type="color",i.required=!0,i.value=""+(this.currentData.defaultColor||this.initialData.defaultColor||"#000000"),i.addEventListener("change",function(e){t.updateData({defaultColor:e.target.value})}),e.appendChild(i),e},e}(m.InputGroup),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("div");e.className="div-input-group div-ranges-input-group";var n=this.createLabel("Ranges");e.appendChild(n);var i=document.createElement("div"),r=document.createElement("div");e.appendChild(r),e.appendChild(i);var o,s=this.currentData.colorRanges||this.initialData.colorRanges||[];return(o=function(e){r.innerHTML="",e.forEach(function(e,n){return r.appendChild(t.rangeContainer(e,function(e){return function(n){var i=t.currentData.colorRanges||t.initialData.colorRanges||[];t.updateData({colorRanges:i.slice(0,e).concat([n],i.slice(e+1))})}}(n),function(e){return function(){var n=t.currentData.colorRanges||t.initialData.colorRanges||[],i=n.slice(0,e).concat(n.slice(e+1));t.updateData({colorRanges:i}),o(i)}}(n)))})})(s),i.appendChild(this.initialRangeContainer(function(e){var n=(t.currentData.colorRanges||t.initialData.colorRanges||[]).concat([e]);t.updateData({colorRanges:n}),o(n)})),e},e.prototype.initialRangeContainer=function(t){var e={color:"#ffffff"},n=v({},e),i=document.createElement("div"),o=document.createElement("div"),s=this.createLabel("From Value"),a=this.createInputNumber(null,function(t){n.fromValue=t});o.appendChild(s),o.appendChild(a),i.appendChild(o);var l=document.createElement("div"),c=this.createLabel("To Value"),u=this.createInputNumber(null,function(t){n.toValue=t});o.appendChild(c),o.appendChild(u),i.appendChild(l);var h=document.createElement("div"),p=this.createLabel("Color"),d=this.createInputColor(e.color,function(t){n.color=t});o.appendChild(p),o.appendChild(d),i.appendChild(h);var _=document.createElement("a");_.appendChild(Object(f.a)(y.c,Object(r.t)("Create color range"),{size:"small",color:"#565656"}));return _.addEventListener("click",function(){var i;void 0!==(i=n).color&&void 0!==i.toValue&&void 0!==i.fromValue&&t(n),n=e,console.log(n),a.value=""+(n.fromValue||""),u.value=""+(n.toValue||""),d.value=""+n.color}),i.appendChild(_),i},e.prototype.rangeContainer=function(t,e,n){var i=v({},t),o=document.createElement("div"),s=document.createElement("div"),a=this.createLabel("From Value"),l=this.createInputNumber(t.fromValue,function(t){i.fromValue=t,e(v({},i))});s.appendChild(a),s.appendChild(l),o.appendChild(s);var c=document.createElement("div"),u=this.createLabel("To Value"),h=this.createInputNumber(t.toValue,function(t){i.toValue=t,e(v({},i))});s.appendChild(u),s.appendChild(h),o.appendChild(c);var p=document.createElement("div"),d=this.createLabel("Color"),_=this.createInputColor(t.color,function(t){i.color=t,e(v({},i))});s.appendChild(d),s.appendChild(_),o.appendChild(p);var m=document.createElement("a");return m.appendChild(Object(f.a)(y.d,Object(r.t)("Delete color range"),{size:"small",color:"#565656"})),m.addEventListener("click",n),o.appendChild(m),o},e.prototype.createLabel=function(t){var e=document.createElement("label");return e.textContent=Object(r.t)(t),e},e.prototype.createInputNumber=function(t,e){var n=document.createElement("input");return n.type="number",null!==t&&(n.value=""+t),n.addEventListener("change",function(t){var n=parseInt(t.target.value);isNaN(n)||e(n)}),n},e.prototype.createInputColor=function(t,e){var n=document.createElement("input");return n.type="color",null!==t&&(n.value=t),n.addEventListener("change",function(t){return e(t.target.value)}),n},e}(m.InputGroup),w="http://www.w3.org/2000/svg",O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="color-cloud",t.append(this.createSvgElement()),t},e.prototype.resizeElement=function(e){t.prototype.resizeElement.call(this,e,e)},e.prototype.createSvgElement=function(){var t="grad_"+this.props.id,e=document.createElementNS(w,"svg");e.setAttribute("viewBox","0 0 100 100");var n=document.createElementNS(w,"defs"),i=document.createElementNS(w,"radialGradient");i.setAttribute("id",t),i.setAttribute("cx","50%"),i.setAttribute("cy","50%"),i.setAttribute("r","50%"),i.setAttribute("fx","50%"),i.setAttribute("fy","50%");var r=document.createElementNS(w,"stop");r.setAttribute("offset","0%"),r.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0.9");var o=document.createElementNS(w,"stop");o.setAttribute("offset","100%"),o.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0");var s=document.createElementNS(w,"circle");return s.setAttribute("fill","url(#"+t+")"),s.setAttribute("cx","50%"),s.setAttribute("cy","50%"),s.setAttribute("r","50%"),i.append(r,o),n.append(i),e.append(n,s),e},e.prototype.getFormContainer=function(){return e.getFormContainer(this.props)},e.getFormContainer=function(e){var n=t.getFormContainer.call(this,e);return n.removeInputGroup("label"),n.addInputGroup(new E("color-cloud",e),3),n.addInputGroup(new x("ranges-cloud",e),4),n},e}(o.a),k=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),M=function(){return(M=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function A(t){if(("string"!=typeof t.imageSrc||0===t.imageSrc.length)&&null===t.encodedHtml)throw new TypeError("invalid image src.");if(null===Object(r.n)(t.groupId,null))throw new TypeError("invalid group Id.");var e=Object(r.l)(t.showStatistics),n=e?function(t){return Object(r.s)(t.html)?Object(r.s)(t.encodedHtml)?null:Object(r.d)(t.encodedHtml):t.html}(t):null;return M({},Object(o.b)(t),{type:11,groupId:parseInt(t.groupId),imageSrc:Object(r.k)(t.imageSrc,null),statusImageSrc:Object(r.k)(t.statusImageSrc,null),showStatistics:e,html:n},Object(r.i)(t))}var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="group",this.props.showStatistics||null===this.props.statusImageSrc?this.props.showStatistics&&null!=this.props.html&&(t.style.backgroundImage="none",t.innerHTML=this.props.html):(t.style.backgroundImage="url("+this.props.statusImageSrc+")",t.style.backgroundRepeat="no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center"),t},e.prototype.updateDomElement=function(t){this.props.showStatistics||null===this.props.statusImageSrc?this.props.showStatistics&&null!=this.props.html&&(t.style.backgroundImage="none",t.innerHTML=this.props.html):(t.style.backgroundImage="url("+this.props.statusImageSrc+")",t.style.backgroundRepeat="no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center",t.innerHTML="")},e}(o.a),C=(n(13),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}()),j=function(){return(j=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},P=function(t){switch(t){case"analogic":case"digital":return t;default:return"analogic"}},I=function(t){switch(t){case"datetime":case"time":return t;default:return"datetime"}};function S(t){if("string"!=typeof t.clockTimezone||0===t.clockTimezone.length)throw new TypeError("invalid timezone.");return j({},Object(o.b)(t),{type:19,clockType:P(t.clockType),clockFormat:I(t.clockFormat),clockTimezone:t.clockTimezone,clockTimezoneOffset:Object(r.n)(t.clockTimezoneOffset,0),showClockTimezone:Object(r.l)(t.showClockTimezone),color:Object(r.k)(t.color,null)},Object(r.i)(t))}var R=function(t){function e(n,i){var r=t.call(this,n,i)||this;return r.intervalRef=null,r.startTick(function(){r.childElementRef.innerHTML=r.createClock().innerHTML},"analogic"===r.props.clockType?2e4:e.TICK_INTERVAL),r}return C(e,t),e.prototype.stopTick=function(){null!==this.intervalRef&&(window.clearInterval(this.intervalRef),this.intervalRef=null)},e.prototype.startTick=function(t,n){void 0===n&&(n=e.TICK_INTERVAL),this.stopTick(),this.intervalRef=window.setInterval(t,n)},e.prototype.createDomElement=function(){return this.createClock()},e.prototype.updateDomElement=function(e){var n=this.getElementSize(this.props.width,this.props.height),i=n.width,r=n.height;"digital"===this.props.clockType?(!1===this.meta.isBeingResized&&t.prototype.resizeElement.call(this,this.props.width,this.props.height),e.classList.replace("analogic-clock","digital-clock")):(!1===this.meta.isBeingResized&&t.prototype.resizeElement.call(this,i,r),e.classList.replace("digital-clock","analogic-clock")),e.innerHTML=this.createDomElement().innerHTML},e.prototype.remove=function(){this.stopTick(),t.prototype.remove.call(this)},e.prototype.resizeElement=function(e,n){var i=this.getElementSize(e,n),r=i.width,o=i.height;"digital"===this.props.clockType?t.prototype.resizeElement.call(this,e,n):t.prototype.resizeElement.call(this,r,o)},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",n="#242124",i="#242124",o="#242124",s="#525252",a="#DC143C",l=this.getElementSize(),c=l.width,u=l.height,h=10*c/100,p=document.createElement("div");p.className="analogic-clock",p.style.width=c+"px",p.style.height=u+"px";var d=document.createElementNS(t,"svg");d.setAttribute("viewBox","0 0 100 100");var _=document.createElementNS(t,"g");_.setAttribute("class","clockface");var m=document.createElementNS(t,"circle");m.setAttribute("cx","50"),m.setAttribute("cy","50"),m.setAttribute("r","48"),m.setAttribute("fill",e),m.setAttribute("stroke",n),m.setAttribute("stroke-width","2"),m.setAttribute("stroke-linecap","round"),_.append(m);var f=this.getHumanTimezone();if(f.length>0){var y=document.createElementNS(t,"text");y.setAttribute("text-anchor","middle"),y.setAttribute("font-size","8"),y.setAttribute("transform","translate(30 50) rotate(90)"),y.setAttribute("fill",i),y.textContent=f,_.append(y)}var b=document.createElementNS(t,"g");b.setAttribute("class","marks");var v=document.createElementNS(t,"g");v.setAttribute("class","mark"),v.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",i),g.setAttribute("stroke-width","5");var E=document.createElementNS(t,"line");E.setAttribute("x1","36"),E.setAttribute("y1","0"),E.setAttribute("x2","46"),E.setAttribute("y2","0"),E.setAttribute("stroke",e),E.setAttribute("stroke-width","1"),v.append(g,E),b.append(v);for(var x=1;x<60;x++){var w=document.createElementNS(t,"line");w.setAttribute("y1","0"),w.setAttribute("y2","0"),w.setAttribute("stroke",i),w.setAttribute("transform","translate(50 50) rotate("+6*x+")"),x%5==0?(w.setAttribute("x1","38"),w.setAttribute("x2","46"),w.setAttribute("stroke-width",x%15==0?"2":"1")):(w.setAttribute("x1","42"),w.setAttribute("x2","46"),w.setAttribute("stroke-width","0.5")),b.append(w)}var O=document.createElementNS(t,"g");O.setAttribute("class","hour-hand"),O.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",s),k.setAttribute("stroke-width","4"),k.setAttribute("stroke-linecap","round");var M=document.createElementNS(t,"line");M.setAttribute("class","hour-hand-b"),M.setAttribute("x1","0"),M.setAttribute("y1","0"),M.setAttribute("x2","29.9"),M.setAttribute("y2","0"),M.setAttribute("stroke",o),M.setAttribute("stroke-width","3.1"),M.setAttribute("stroke-linecap","round"),O.append(k,M);var A=document.createElementNS(t,"g");A.setAttribute("class","minute-hand"),A.setAttribute("transform","translate(50 50)");var T=document.createElementNS(t,"line");T.setAttribute("class","minute-hand-a"),T.setAttribute("x1","0"),T.setAttribute("y1","0"),T.setAttribute("x2","40"),T.setAttribute("y2","0"),T.setAttribute("stroke",s),T.setAttribute("stroke-width","2"),T.setAttribute("stroke-linecap","round");var C=document.createElementNS(t,"line");C.setAttribute("class","minute-hand-b"),C.setAttribute("x1","0"),C.setAttribute("y1","0"),C.setAttribute("x2","39.9"),C.setAttribute("y2","0"),C.setAttribute("stroke",o),C.setAttribute("stroke-width","1.5"),C.setAttribute("stroke-linecap","round");var j=document.createElementNS(t,"circle");j.setAttribute("r","3"),j.setAttribute("fill",o),A.append(T,C,j);var P=document.createElementNS(t,"g");P.setAttribute("class","second-hand"),P.setAttribute("transform","translate(50 50)");var I=document.createElementNS(t,"line");I.setAttribute("x1","0"),I.setAttribute("y1","0"),I.setAttribute("x2","46"),I.setAttribute("y2","0"),I.setAttribute("stroke",a),I.setAttribute("stroke-width","1"),I.setAttribute("stroke-linecap","round");var S=document.createElementNS(t,"circle");S.setAttribute("r","2"),S.setAttribute("fill",a),P.append(I,S);var R=document.createElementNS(t,"circle");R.setAttribute("cx","50"),R.setAttribute("cy","50"),R.setAttribute("r","0.3"),R.setAttribute("fill",o);var N=this.getOriginDate(),L=N.getSeconds(),D=N.getMinutes(),z=6*L,B=6*D+L/60*6,G=30*N.getHours()+D/60*30;if(O.setAttribute("transform","translate(50 50) rotate("+G+")"),A.setAttribute("transform","translate(50 50) rotate("+B+")"),P.setAttribute("transform","translate(50 50) rotate("+z+")"),d.append(_,b,O,A,P,R),d.setAttribute("transform","rotate(-90)"),p.innerHTML="\n <style>\n @keyframes rotate-hour {\n from {\n "+Object(r.p)("transform","translate(50px, 50px) rotate("+G+"deg)").join("\n")+"\n }\n to {\n "+Object(r.p)("transform","translate(50px, 50px) rotate("+(G+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-minute {\n from {\n "+Object(r.p)("transform","translate(50px, 50px) rotate("+B+"deg)").join("\n")+"\n }\n to {\n "+Object(r.p)("transform","translate(50px, 50px) rotate("+(B+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-second {\n from {\n "+Object(r.p)("transform","translate(50px, 50px) rotate("+z+"deg)").join("\n")+"\n }\n to {\n "+Object(r.p)("transform","translate(50px, 50px) rotate("+(z+360)+"deg)").join("\n")+"\n }\n }\n </style>\n ",p.append(d),"datetime"===this.props.clockFormat){var H=document.createElement("span");H.className="date",H.textContent=Object(r.f)(N,"default"),H.style.fontSize=h+"px",this.props.color&&(H.style.color=this.props.color),p.append(H)}return p},e.prototype.createDigitalClock=function(){var t=document.createElement("div");t.className="digital-clock";var e=this.getElementSize().width,n=6/this.props.clockTimezone.length,i=20*e/100,o=10*e/100,s=Math.min(20*n*e/100,e/100*10),a=this.getOriginDate();if("datetime"===this.props.clockFormat){var l=document.createElement("span");l.className="date",l.textContent=Object(r.f)(a,"default"),l.style.fontSize=o+"px",this.props.color&&(l.style.color=this.props.color),t.append(l)}var c=document.createElement("span");c.className="time",c.textContent=Object(r.g)(a),c.style.fontSize=i+"px",this.props.color&&(c.style.color=this.props.color),t.append(c);var u=this.getHumanTimezone();if(u.length>0){var h=document.createElement("span");h.className="timezone",h.textContent=u,h.style.fontSize=s+"px",this.props.color&&(h.style.color=this.props.color),t.append(h)}return t},e.prototype.getOriginDate=function(t){void 0===t&&(t=null);var e=t||new Date,n=1e3*this.props.clockTimezoneOffset,i=60*e.getTimezoneOffset()*1e3,r=e.getTime()+n+i;return new Date(r)},e.prototype.getHumanTimezone=function(t){void 0===t&&(t=this.props.clockTimezone);var e=t.split("/")[1];return(void 0===e?"":e).replace("_"," ")},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 n=100;t>0&&e>0?n=Math.min(t,e):t>0?n=t:e>0&&(n=e);var i=0;return"datetime"===this.props.clockFormat&&(i=e/8),{width:n,height:n+i};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}(o.a),N=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),L=function(){return(L=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function D(t){return L({},Object(o.b)(t),{type:12,label:null,isLinkEnabled:!1,parentId:null,aclGroupId:null,borderWidth:Object(r.n)(t.borderWidth,0),borderColor:Object(r.k)(t.borderColor,null),fillColor:Object(r.k)(t.fillColor,null),fillTransparent:t.fillTransparent})}var z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");if(t.className="box",t.style.boxSizing="border-box",this.props.fillTransparent?t.style.backgroundColor="transparent":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,n=Math.min(this.props.borderWidth,e);t.style.borderWidth=n+"px",this.props.borderColor&&(t.style.borderColor=this.props.borderColor)}return t},e.prototype.updateDomElement=function(t){if(this.props.fillTransparent?t.style.backgroundColor="transparent":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,n=Math.min(this.props.borderWidth,e);t.style.borderWidth=n+"px",this.props.borderColor&&(t.style.borderColor=this.props.borderColor)}},e}(o.a),B=n(2),G=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),H=function(){return(H=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function W(t){var e=H({},Object(o.b)(H({},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:Object(r.n)(t.startX,0),y:Object(r.n)(t.startY,0)},endPosition:{x:Object(r.n)(t.endX,0),y:Object(r.n)(t.endY,0)},lineWidth:Object(r.n)(t.lineWidth||t.borderWidth,1),color:Object(r.k)(t.borderColor||t.color,null)});return H({},e,U.extractBoxSizeAndPosition(e.startPosition,e.endPosition))}var F="http://www.w3.org/2000/svg",U=function(t){function e(n,i){var o=t.call(this,H({},n,e.extractBoxSizeAndPosition(n.startPosition,n.endPosition)),H({},i),!0)||this;return o.circleRadius=8,o.moveMode=!1,o.isMoving=!1,o.lineMovedEventManager=new B.a,o.lineMovedEventDisposables=[],o.debouncedStartPositionMovementSave=Object(r.c)(500,function(t,e){o.isMoving=!1;var n={x:t,y:e};o.lineMovedEventManager.emit({item:o,startPosition:n,endPosition:o.props.endPosition})}),o.removeStartPositionMovement=null,o.debouncedEndPositionMovementSave=Object(r.c)(500,function(t,e){o.isMoving=!1;var n={x:t,y:e};o.lineMovedEventManager.emit({item:o,endPosition:n,startPosition:o.props.startPosition})}),o.removeEndPositionMovement=null,o.moveMode=i.editMode,o.init(),o}return G(e,t),e.prototype.initStartPositionMovementListener=function(t,e){var n=this;this.removeStartPositionMovement=Object(r.a)(t,function(t,e){var i={x:t+=n.circleRadius,y:e+=n.circleRadius};n.isMoving=!0,n.props=H({},n.props,{startPosition:i}),n.debouncedStartPositionMovementSave(t,e)},e)},e.prototype.stopStartPositionMovementListener=function(){this.removeStartPositionMovement&&(this.removeStartPositionMovement(),this.removeStartPositionMovement=null)},e.prototype.initEndPositionMovementListener=function(t,e){var n=this;this.removeEndPositionMovement=Object(r.a)(t,function(t,e){t+=n.circleRadius,e+=n.circleRadius,n.isMoving=!0,n.props=H({},n.props,{endPosition:{x:t,y:e}}),n.debouncedEndPositionMovementSave(t,e)},e)},e.prototype.stopEndPositionMovementListener=function(){this.removeEndPositionMovement&&(this.removeEndPositionMovement(),this.removeEndPositionMovement=null)},e.prototype.setProps=function(n){t.prototype.setProps.call(this,H({},n,e.extractBoxSizeAndPosition(n.startPosition,n.endPosition)))},e.prototype.setMeta=function(e){this.moveMode=e.editMode,t.prototype.setMeta.call(this,H({},e,{lineMode:!0}))},e.prototype.createDomElement=function(){var t=document.createElement("div");t.className="line";var e=this.props,n=e.x,i=e.y,r=e.width,o=e.height,s=e.lineWidth,a=e.startPosition,l=e.endPosition,c=e.color,u=a.x-n+s/2,h=a.y-i+s/2,p=l.x-n+s/2,d=l.y-i+s/2,_=document.createElementNS(F,"svg");_.setAttribute("width",""+(r+s)),_.setAttribute("height",""+(o+s));var m=document.createElementNS(F,"line");return m.setAttribute("x1",""+u),m.setAttribute("y1",""+h),m.setAttribute("x2",""+p),m.setAttribute("y2",""+d),m.setAttribute("stroke",c||"black"),m.setAttribute("stroke-width",""+s),_.append(m),t.append(_),t},e.prototype.updateDomElement=function(t){var e=this.props,n=e.x,i=e.y,r=e.width,o=e.height,s=e.lineWidth,a=e.startPosition,l=e.endPosition,c=e.color,u=a.x-n+s/2,h=a.y-i+s/2,p=l.x-n+s/2,d=l.y-i+s/2,_=t.getElementsByTagName("svg");if(_.length>0){var m=_.item(0);if(null!=m){m.setAttribute("width",""+(r+s)),m.setAttribute("height",""+(o+s));var f=m.getElementsByTagNameNS(F,"line");if(f.length>0){var y=f.item(0);null!=y&&(y.setAttribute("x1",""+u),y.setAttribute("y1",""+h),y.setAttribute("x2",""+p),y.setAttribute("y2",""+d),y.setAttribute("stroke",c||"black"),y.setAttribute("stroke-width",""+s))}}}if(this.moveMode){var b=a.x-l.x<=0,v=a.y-l.y<=0,g=document.createElement("div"),E=document.createElement("div");if(this.isMoving){var x=t.getElementsByClassName("visual-console-item-line-circle-start");if(x.length>0)(k=x.item(0))&&(g=k);var w=t.getElementsByClassName("visual-console-item-line-circle-end");if(w.length>0)(k=w.item(0))&&(E=k)}if(g.classList.add("visual-console-item-line-circle","visual-console-item-line-circle-start"),g.style.width=2*this.circleRadius+"px",g.style.height=2*this.circleRadius+"px",g.style.borderRadius="50%",g.style.backgroundColor=""+c,g.style.position="absolute",g.style.left=b?"-"+this.circleRadius+"px":r+s-this.circleRadius+"px",g.style.top=v?"-"+this.circleRadius+"px":o+s-this.circleRadius+"px",E.classList.add("visual-console-item-line-circle","visual-console-item-line-circle-end"),E.style.width=2*this.circleRadius+"px",E.style.height=2*this.circleRadius+"px",E.style.borderRadius="50%",E.style.backgroundColor=""+c,E.style.position="absolute",E.style.left=b?r+s-8+"px":"-"+this.circleRadius+"px",E.style.top=v?o+s-this.circleRadius+"px":"-"+this.circleRadius+"px",null!==t.parentElement){for(var O=t.parentElement.getElementsByClassName("visual-console-item-line-circle");O.length>0;){(k=O.item(0))&&k.remove()}t.parentElement.appendChild(g),t.parentElement.appendChild(E)}this.initStartPositionMovementListener(g,this.elementRef.parentElement),this.initEndPositionMovementListener(E,this.elementRef.parentElement)}else if(this.moveMode)this.stopStartPositionMovementListener();else if(this.stopStartPositionMovementListener(),null!==t.parentElement)for(O=t.parentElement.getElementsByClassName("visual-console-item-line-circle");O.length>0;){var k;(k=O.item(0))&&k.remove()}},e.extractBoxSizeAndPosition=function(t,e){return{width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y),x:Math.min(t.x,e.x),y:Math.min(t.y,e.y)}},e.prototype.move=function(e,n){t.prototype.moveElement.call(this,e,n);var i=this.props.startPosition.x-this.props.endPosition.x<=0,r=this.props.startPosition.y-this.props.endPosition.y<=0,o={x:i?e:this.props.width+e,y:r?n:this.props.height+n},s={x:i?this.props.width+e:e,y:r?this.props.height+n:n};this.props=H({},this.props,{startPosition:o,endPosition:s})},e.prototype.remove=function(){this.stopStartPositionMovementListener(),t.prototype.remove.call(this)},e.prototype.onLineMovementFinished=function(t){var e=this.lineMovedEventManager.on(t);return this.lineMovedEventDisposables.push(e),e},e}(o.a),V=U,q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),K=function(){return(K=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Y(t){return K({},Object(o.b)(t),{type:4},Object(r.i)(t))}var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="label",t.innerHTML=this.getLabelWithMacrosReplaced(),t},e.prototype.createLabelDomElement=function(){var t=document.createElement("div");return t.className="visual-console-item-label",t},e}(o.a),J=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Z=function(){return(Z=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Q=function(t){switch(t){case"string":case"image":return t;default:return"string"}},$=function(t){switch(t){case"none":case"avg":case"max":case"min":return t;default:return"none"}};function tt(t){if("string"!=typeof t.value||0===t.value.length)throw new TypeError("invalid value");var e=$(t.processValue);return Z({},Object(o.b)(t),{type:2,valueType:Q(t.valueType),value:t.value},"none"===e?{processValue:e}:{processValue:e,period:Object(r.n)(t.period,0)},Object(r.j)(t),Object(r.i)(t))}var et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return J(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 n=this.props.value,i=this.getLabelWithMacrosReplaced();i.length>0&&(n=Object(r.q)([{macro:/\(?_VALUE_\)?/i,value:n}],i)),t.innerHTML=n}return t},e.prototype.createLabelDomElement=function(){var t=document.createElement("div");return t.className="visual-console-item-label",t},e}(o.a),nt=n(6),it=Math.PI,rt=2*it,ot=rt-1e-6;function st(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function at(){return new st}st.prototype=at.prototype={constructor:st,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,c=o-t,u=s-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>1e-6)if(Math.abs(u*a-l*c)>1e-6&&r){var p=n-o,d=i-s,_=a*a+l*l,m=p*p+d*d,f=Math.sqrt(_),y=Math.sqrt(h),b=r*Math.tan((it-Math.acos((_+h-m)/(2*f*y)))/2),v=b/y,g=b/f;Math.abs(v-1)>1e-6&&(this._+="L"+(t+v*c)+","+(e+v*u)),this._+="A"+r+","+r+",0,0,"+ +(u*p>c*d)+","+(this._x1=t+g*a)+","+(this._y1=e+g*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,o){t=+t,e=+e;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+s,c=e+a,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%rt+rt),h>ot?this._+="A"+n+","+n+",0,1,"+u+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=it)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var lt=at,ct=function(t){return function(){return t}},ut=Math.abs,ht=Math.atan2,pt=Math.cos,dt=Math.max,_t=Math.min,mt=Math.sin,ft=Math.sqrt,yt=1e-12,bt=Math.PI,vt=bt/2,gt=2*bt;function Et(t){return t>=1?vt:t<=-1?-vt:Math.asin(t)}function xt(t){return t.innerRadius}function wt(t){return t.outerRadius}function Ot(t){return t.startAngle}function kt(t){return t.endAngle}function Mt(t){return t&&t.padAngle}function At(t,e,n,i,r,o,s){var a=t-n,l=e-i,c=(s?o:-o)/ft(a*a+l*l),u=c*l,h=-c*a,p=t+u,d=e+h,_=n+u,m=i+h,f=(p+_)/2,y=(d+m)/2,b=_-p,v=m-d,g=b*b+v*v,E=r-o,x=p*m-_*d,w=(v<0?-1:1)*ft(dt(0,E*E*g-x*x)),O=(x*v-b*w)/g,k=(-x*b-v*w)/g,M=(x*v+b*w)/g,A=(-x*b+v*w)/g,T=O-f,C=k-y,j=M-f,P=A-y;return T*T+C*C>j*j+P*P&&(O=M,k=A),{cx:O,cy:k,x01:-u,y01:-h,x11:O*(r/E-1),y11:k*(r/E-1)}}var Tt=function(){var t=xt,e=wt,n=ct(0),i=null,r=Ot,o=kt,s=Mt,a=null;function l(){var l,c,u,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=r.apply(this,arguments)-vt,_=o.apply(this,arguments)-vt,m=ut(_-d),f=_>d;if(a||(a=l=lt()),p<h&&(c=p,p=h,h=c),p>yt)if(m>gt-yt)a.moveTo(p*pt(d),p*mt(d)),a.arc(0,0,p,d,_,!f),h>yt&&(a.moveTo(h*pt(_),h*mt(_)),a.arc(0,0,h,_,d,f));else{var y,b,v=d,g=_,E=d,x=_,w=m,O=m,k=s.apply(this,arguments)/2,M=k>yt&&(i?+i.apply(this,arguments):ft(h*h+p*p)),A=_t(ut(p-h)/2,+n.apply(this,arguments)),T=A,C=A;if(M>yt){var j=Et(M/h*mt(k)),P=Et(M/p*mt(k));(w-=2*j)>yt?(E+=j*=f?1:-1,x-=j):(w=0,E=x=(d+_)/2),(O-=2*P)>yt?(v+=P*=f?1:-1,g-=P):(O=0,v=g=(d+_)/2)}var I=p*pt(v),S=p*mt(v),R=h*pt(x),N=h*mt(x);if(A>yt){var L,D=p*pt(g),z=p*mt(g),B=h*pt(E),G=h*mt(E);if(m<bt&&(L=function(t,e,n,i,r,o,s,a){var l=n-t,c=i-e,u=s-r,h=a-o,p=h*l-u*c;if(!(p*p<yt))return[t+(p=(u*(e-o)-h*(t-r))/p)*l,e+p*c]}(I,S,B,G,D,z,R,N))){var H=I-L[0],W=S-L[1],F=D-L[0],U=z-L[1],V=1/mt(((u=(H*F+W*U)/(ft(H*H+W*W)*ft(F*F+U*U)))>1?0:u<-1?bt:Math.acos(u))/2),q=ft(L[0]*L[0]+L[1]*L[1]);T=_t(A,(h-q)/(V-1)),C=_t(A,(p-q)/(V+1))}}O>yt?C>yt?(y=At(B,G,I,S,p,C,f),b=At(D,z,R,N,p,C,f),a.moveTo(y.cx+y.x01,y.cy+y.y01),C<A?a.arc(y.cx,y.cy,C,ht(y.y01,y.x01),ht(b.y01,b.x01),!f):(a.arc(y.cx,y.cy,C,ht(y.y01,y.x01),ht(y.y11,y.x11),!f),a.arc(0,0,p,ht(y.cy+y.y11,y.cx+y.x11),ht(b.cy+b.y11,b.cx+b.x11),!f),a.arc(b.cx,b.cy,C,ht(b.y11,b.x11),ht(b.y01,b.x01),!f))):(a.moveTo(I,S),a.arc(0,0,p,v,g,!f)):a.moveTo(I,S),h>yt&&w>yt?T>yt?(y=At(R,N,D,z,h,-T,f),b=At(I,S,B,G,h,-T,f),a.lineTo(y.cx+y.x01,y.cy+y.y01),T<A?a.arc(y.cx,y.cy,T,ht(y.y01,y.x01),ht(b.y01,b.x01),!f):(a.arc(y.cx,y.cy,T,ht(y.y01,y.x01),ht(y.y11,y.x11),!f),a.arc(0,0,h,ht(y.cy+y.y11,y.cx+y.x11),ht(b.cy+b.y11,b.cx+b.x11),f),a.arc(b.cx,b.cy,T,ht(b.y11,b.x11),ht(b.y01,b.x01),!f))):a.arc(0,0,h,x,E,f):a.lineTo(R,N)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-bt/2;return[pt(i)*n,mt(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ct(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ct(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ct(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:ct(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:ct(+t),l):r},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:ct(+t),l):o},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:ct(+t),l):s},l.context=function(t){return arguments.length?(a=null==t?null:t,l):a},l};function Ct(t){this._context=t}Ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var jt=function(t){return new Ct(t)};It(jt);function Pt(t){this._curve=t}function It(t){function e(e){return new Pt(t(e))}return e._curve=t,e}Pt.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};Array.prototype.slice;Math.sqrt(1/3);var St=Math.sin(bt/10)/Math.sin(7*bt/10),Rt=(Math.sin(gt/10),Math.cos(gt/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12),function(){});function Nt(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Lt(t){this._context=t}Lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Nt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Nt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Dt(t){this._context=t}Dt.prototype={areaStart:Rt,areaEnd:Rt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Nt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zt(t){this._context=t}zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Nt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Bt(t,e){this._basis=new Lt(t),this._beta=e}Bt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],s=t[n]-r,a=e[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*s),this._beta*e[l]+(1-this._beta)*(o+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};(function t(e){function n(t){return 1===e?new Lt(t):new Bt(t,e)}return n.beta=function(e){return t(+e)},n})(.85);function Gt(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ht(t,e){this._context=t,this._k=(1-e)/6}Ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Gt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new Ht(t,e)}return n.tension=function(e){return t(+e)},n})(0);function Wt(t,e){this._context=t,this._k=(1-e)/6}Wt.prototype={areaStart:Rt,areaEnd:Rt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new Wt(t,e)}return n.tension=function(e){return t(+e)},n})(0);function Ft(t,e){this._context=t,this._k=(1-e)/6}Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Gt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new Ft(t,e)}return n.tension=function(e){return t(+e)},n})(0);function Ut(t,e,n){var i=t._x1,r=t._y1,o=t._x2,s=t._y2;if(t._l01_a>yt){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>yt){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,s,t._x2,t._y2)}function Vt(t,e){this._context=t,this._alpha=e}Vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ut(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Vt(t,e):new Ht(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function qt(t,e){this._context=t,this._alpha=e}qt.prototype={areaStart:Rt,areaEnd:Rt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ut(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new qt(t,e):new Wt(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Kt(t,e){this._context=t,this._alpha=e}Kt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ut(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Kt(t,e):new Ft(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Yt(t){this._context=t}Yt.prototype={areaStart:Rt,areaEnd:Rt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Xt(t){return t<0?-1:1}function Jt(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),s=(n-t._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(Xt(o)+Xt(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Zt(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Qt(t,e,n){var i=t._x0,r=t._y0,o=t._x1,s=t._y1,a=(o-i)/3;t._context.bezierCurveTo(i+a,r+a*e,o-a,s-a*n,o,s)}function $t(t){this._context=t}function te(t){this._context=new ee(t)}function ee(t){this._context=t}function ne(t){this._context=t}function ie(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,s[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,s[e]-=n*s[e-1];for(r[i-1]=s[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(s[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}$t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Qt(this,this._t0,Zt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Qt(this,Zt(this,n=Jt(this,t,e)),n);break;default:Qt(this,this._t0,n=Jt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(te.prototype=Object.create($t.prototype)).point=function(t,e){$t.prototype.point.call(this,e,t)},ee.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},ne.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=ie(t),r=ie(e),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[s],e[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function re(t,e){this._context=t,this._t=e}re.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var oe=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),se=function(){return(se=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function ae(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 le(t){switch(t){case"percent":case"value":return t;default:return"percent"}}function ce(t){return se({},Object(o.b)(t),{type:3,percentileType:ae(t.percentileType||t.type),valueType:le(t.valueType),minValue:Object(r.n)(t.minValue,null),maxValue:Object(r.n)(t.maxValue,null),color:Object(r.k)(t.color,null),labelColor:Object(r.k)(t.labelColor,null),value:Object(r.m)(t.value,null),unit:Object(r.k)(t.unit,null)},Object(r.j)(t),Object(r.i)(t))}var ue="http://www.w3.org/2000/svg",he=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oe(e,t),e.prototype.createDomElement=function(){var t,e={background:"#000000",progress:this.props.color||"#F0F0F0",text:this.props.labelColor||"#444444"},n=this.getProgress(),i=document.createElement("div");null!=this.props.value&&(t=Intl?Intl.NumberFormat("en-EN").format(this.props.value):this.props.value);var r=document.createElementNS(ue,"svg");switch(this.props.percentileType){case"progress-bar":var o=document.createElementNS(ue,"rect");o.setAttribute("fill",e.background),o.setAttribute("fill-opacity","0.5"),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("rx","5"),o.setAttribute("ry","5");var s=document.createElementNS(ue,"rect");s.setAttribute("fill",e.progress),s.setAttribute("fill-opacity","1"),s.setAttribute("width",n+"%"),s.setAttribute("height","100%"),s.setAttribute("rx","5"),s.setAttribute("ry","5"),(h=document.createElementNS(ue,"text")).setAttribute("text-anchor","middle"),h.setAttribute("alignment-baseline","middle"),h.setAttribute("font-size","15"),h.setAttribute("font-family","arial"),h.setAttribute("font-weight","bold"),h.setAttribute("transform","translate("+this.props.width/2+", 17.5)"),h.setAttribute("fill",e.text),"value"===this.props.valueType?(h.style.fontSize="6pt",h.textContent=this.props.unit?t+" "+this.props.unit:""+t):h.textContent=n+"%",r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.append(o,s,h);break;case"bubble":case"circular-progress-bar":case"circular-progress-bar-alt":if(r.setAttribute("viewBox","0 0 100 100"),"bubble"===this.props.percentileType){(a=document.createElementNS(ue,"circle")).setAttribute("transform","translate(50 50)"),a.setAttribute("fill",e.background),a.setAttribute("fill-opacity","0.5"),a.setAttribute("r","50"),(l=document.createElementNS(ue,"circle")).setAttribute("transform","translate(50 50)"),l.setAttribute("fill",e.progress),l.setAttribute("fill-opacity","1"),l.setAttribute("r",""+n/2),r.append(a,l)}else{var a,l,c={innerRadius:"circular-progress-bar"===this.props.percentileType?30:0,outerRadius:50,startAngle:0,endAngle:2*Math.PI},u=Tt();(a=document.createElementNS(ue,"path")).setAttribute("transform","translate(50 50)"),a.setAttribute("fill",e.background),a.setAttribute("fill-opacity","0.5"),a.setAttribute("d",""+u(c)),(l=document.createElementNS(ue,"path")).setAttribute("transform","translate(50 50)"),l.setAttribute("fill",e.progress),l.setAttribute("fill-opacity","1"),l.setAttribute("d",""+u(se({},c,{endAngle:c.endAngle*(n/100)}))),r.append(a,l)}var h;if((h=document.createElementNS(ue,"text")).setAttribute("text-anchor","middle"),h.setAttribute("alignment-baseline","middle"),h.setAttribute("font-size","16"),h.setAttribute("font-family","arial"),h.setAttribute("font-weight","bold"),h.setAttribute("fill",e.text),"value"===this.props.valueType&&null!=this.props.value)if(this.props.unit&&this.props.unit.length>0){var p=document.createElementNS(ue,"tspan");p.setAttribute("x","0"),p.setAttribute("dy","1em"),p.textContent=""+t,p.style.fontSize="8pt";var d=document.createElementNS(ue,"tspan");d.setAttribute("x","0"),d.setAttribute("dy","1em"),d.textContent=""+this.props.unit,d.style.fontSize="8pt",h.append(p,d),h.setAttribute("transform","translate(50 33)")}else h.textContent=""+t,h.style.fontSize="8pt",h.setAttribute("transform","translate(50 50)");else h.textContent=n+"%",h.setAttribute("transform","translate(50 50)");r.append(h)}return null!==r&&i.append(r),i},e.prototype.updateDomElement=function(t){!1===this.meta.isBeingResized&&this.resizeElement(this.props.width,this.props.height),t.innerHTML=this.createDomElement().innerHTML},e.prototype.resizeElement=function(e,n){"progress-bar"===this.props.percentileType?t.prototype.resizeElement.call(this,e,35):t.prototype.resizeElement.call(this,e,e)},e.prototype.resize=function(e){this.resizeElement(e,e);var n=this.props.maxValue||0;"progress-bar"===this.props.percentileType&&(n=35),t.prototype.setProps.call(this,se({},this.props,{width:e,height:n}))},e.prototype.getProgress=function(){var t=this.props.minValue||0,e=this.props.maxValue||100,n=null==this.props.value?0:this.props.value;return n<=t?0:n>=e?100:Math.trunc((n-t)/(e-t)*100)},e}(o.a),pe=n(7),de=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_e=function(){return(_e=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},me=function(t){switch(t){case"white":case"black":case"transparent":return t;default:return"transparent"}},fe=function(t){switch(t){case"horizontal":case"vertical":return t;default:return"vertical"}};function ye(t){if(Object(r.s)(t.html)&&Object(r.s)(t.encodedHtml))throw new TypeError("missing html content.");return _e({},Object(o.b)(t),{type:18,html:Object(r.s)(t.html)?Object(r.d)(t.encodedHtml):t.html,backgroundColor:me(t.backgroundColor),typeGraph:fe(t.typeGraph),gridColor:Object(r.s)(t.gridColor)?"#000000":t.gridColor},Object(r.j)(t))}var be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return de(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="bars-graph",t.style.backgroundImage="url("+this.props.html+")",t.style.backgroundRepeat="no-repeat",t.style.backgroundSize=this.props.width+"px "+this.props.height+"px",t},e.prototype.updateDomElement=function(t){t.style.backgroundImage="url("+this.props.html+")",t.style.backgroundRepeat="no-repeat",t.style.backgroundSize=this.props.width+"px "+this.props.height+"px"},e}(o.a),ve=n(8),ge=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ee=function(){return(Ee=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function xe(t){if(null!==t.imageSrc){if("string"!=typeof t.statusImageSrc||0===t.imageSrc.statusImageSrc)throw new TypeError("invalid status image src.")}else if(Object(r.s)(t.encodedTitle))throw new TypeError("missing encode tittle content.");if(null===Object(r.n)(t.serviceId,null))throw new TypeError("invalid service id.");return Ee({},Object(o.b)(t),{type:10,serviceId:t.serviceId,imageSrc:Object(r.k)(t.imageSrc,null),statusImageSrc:Object(r.k)(t.statusImageSrc,null),encodedTitle:Object(r.k)(t.encodedTitle,null)})}var we,Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ge(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");return t.className="service",null!==this.props.statusImageSrc?(t.style.background="url("+this.props.statusImageSrc+") no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center"):null!==this.props.encodedTitle&&(t.innerHTML=Object(r.d)(this.props.encodedTitle)),t},e.prototype.updateDomElement=function(t){null!==this.props.statusImageSrc?(t.style.background="url("+this.props.statusImageSrc+") no-repeat",t.style.backgroundSize="contain",t.style.backgroundPosition="center",t.innerHTML=""):null!==this.props.encodedTitle&&(t.innerHTML=Object(r.d)(this.props.encodedTitle))},e}(o.a),ke=function(){return(ke=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Me(t){var e=Object(r.n)(t.type,null);if(null==e)throw new TypeError("missing item type.");switch(e){case 0:return c(t);case 1:return Object(ve.b)(t);case 2:case 6:case 7:case 8:return tt(t);case 3:case 9:case 15:case 16:return ce(t);case 4:return Y(t);case 5:return d(t);case 10:return xe(t);case 11:return A(t);case 12:return D(t);case 13:return W(t);case 14:return Object(nt.b)(t);case 17:return Object(pe.b)(t);case 18:return ye(t);case 19:return S(t);case 20:return g(t);default:throw new TypeError("decoder not found")}}var Ae=function(){function t(t,e,n){var i=this;this.elementsById={},this.elementIds=[],this.relations={},this.clickEventManager=new B.a,this.dblClickEventManager=new B.a,this.movedEventManager=new B.a,this.lineMovedEventManager=new B.a,this.resizedEventManager=new B.a,this.selectionChangedEventManager=new B.a,this.disposables=[],this.handleElementClick=function(t){i.clickEventManager.emit(t)},this.handleElementDblClick=function(t){i.dblClickEventManager.emit(t)},this.handleElementMovement=function(t){var e=t.item.props.id;i.getItemRelations(e).forEach(function(n){n.parentId===e?n.line.props=ke({},n.line.props,{startPosition:i.getVisualCenter(t.newPosition,t.item)}):n.childId===e&&(n.line.props=ke({},n.line.props,{endPosition:i.getVisualCenter(t.newPosition,t.item)}))})},this.handleElementMovementFinished=function(t){i.movedEventManager.emit(t)},this.handleLineElementMovementFinished=function(t){i.lineMovedEventManager.emit(t)},this.handleElementResizement=function(t){var e=t.item,n=e.props,r=n.id,o=i.getItemRelations(r),s={x:n.x,y:n.y},a=i.elementsById[r].meta;i.elementsById[r].meta=ke({},a,{isUpdating:!0}),o.forEach(function(t){t.parentId===r?t.line.props=ke({},t.line.props,{startPosition:i.getVisualCenter(s,e)}):t.childId===r&&(t.line.props=ke({},t.line.props,{endPosition:i.getVisualCenter(s,e)}))})},this.handleElementResizementFinished=function(t){i.resizedEventManager.emit(t)},this.handleElementRemove=function(t){i.elementIds=i.elementIds.filter(function(e){return e!==t.item.props.id}),delete i.elementsById[t.item.props.id],i.clearRelations(t.item.props.id)},this.handleElementSelectionChanged=function(t){i.elements.filter(function(t){return 1==t.meta.isSelected}).length>0?t.selected=!0:t.selected=!1,i.selectionChangedEventManager.emit(t)},this.handleContainerClick=function(){i.unSelectItems()},this.containerRef=t,this._props=function(t){var e=t.id,n=t.name,i=t.groupId,o=t.backgroundURL,s=t.backgroundColor,a=t.isFavorite,l=t.relationLineWidth;if(null==e||isNaN(parseInt(e)))throw new TypeError("invalid Id.");if("string"!=typeof n||0===n.length)throw new TypeError("invalid name.");if(null==i||isNaN(parseInt(i)))throw new TypeError("invalid group Id.");return ke({id:parseInt(e),name:n,groupId:parseInt(i),backgroundURL:Object(r.k)(o,null),backgroundColor:Object(r.k)(s,null),isFavorite:Object(r.l)(a),relationLineWidth:Object(r.n)(l,0)},Object(r.r)(t))}(e),this.render(),(n=n.sort(function(t,e){return null==t.id||null==e.id?0:t.id>e.id?1:-1})).forEach(function(t){return i.addElement(t,i)}),this.buildRelations(),this.containerRef.addEventListener("click",this.handleContainerClick)}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.addElement=function(t,e){void 0===e&&(e=this);try{var n=function(t){var e=Object(r.n)(t.type,null);if(null==e)throw new TypeError("missing item type.");var n=Object(r.h)(t);switch(e){case 0:return new u(c(t),n);case 1:return new ve.a(Object(ve.b)(t),n);case 2:case 6:case 7:case 8:return new et(tt(t),n);case 3:case 9:case 15:case 16:return new he(ce(t),n);case 4:return new X(Y(t),n);case 5:return new _(d(t),n);case 10:return new Oe(xe(t),n);case 11:return new T(A(t),n);case 12:return new z(D(t),n);case 13:return new V(W(t),n);case 14:return new nt.a(Object(nt.b)(t),n);case 17:return new pe.a(Object(pe.b)(t),n);case 18:return new be(ye(t),n);case 19:return new R(S(t),n);case 20:return new O(g(t),n);default:throw new TypeError("item not found")}}(t);return e.elementsById[n.props.id]=n,e.elementIds.push(n.props.id),n.onRemove(e.handleElementRemove),n.onSelectionChanged(e.handleElementSelectionChanged),n.onClick(e.handleElementClick),n.onDblClick(e.handleElementDblClick),n.onMoved(e.handleElementMovement),n.onMovementFinished(e.handleElementMovementFinished),n instanceof V?n.onLineMovementFinished(e.handleLineElementMovementFinished):(n.onResized(e.handleElementResizement),n.onResizeFinished(e.handleElementResizementFinished)),e.containerRef.append(n.elementRef),n}catch(t){console.log("Error creating a new element:",t.message)}},t.prototype.updateElements=function(t){var e=this,n=t.map(function(t){return t.id||null}).filter(function(t){return null!=t});this.elementIds.filter(function(t){return n.indexOf(t)<0}).forEach(function(t){null!=e.elementsById[t]&&(e.elementsById[t].remove(),delete e.elementsById[t])}),this.elementIds=n,t.forEach(function(t){if(t.id)if(null==e.elementsById[t.id])e.addElement(t);else try{e.elementsById[t.id].props=Me(t)}catch(t){console.log("Error updating an element:",t.message)}}),this.buildRelations()},t.prototype.updateElement=function(t){try{this.elementsById[t.id].props=Me(t)}catch(t){console.log("Error updating element:",t.message)}this.buildRelations()},Object.defineProperty(t.prototype,"props",{get:function(){return ke({},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=null!==this.props.backgroundURL?"url("+this.props.backgroundURL+")":null),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=null!==this.props.backgroundURL?"url("+this.props.backgroundURL+")":null,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=ke({},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.removeEventListener("click",this.handleContainerClick),this.containerRef.innerHTML=""},t.prototype.buildRelations=function(){var t=this;this.clearRelations(),this.elements.forEach(function(e){if(null!==e.props.parentId){var n=t.elementsById[e.props.parentId],i=t.elementsById[e.props.id];n&&i&&t.addRelationLine(n,i)}})},t.prototype.clearRelations=function(t){if(null!=t)for(var e in this.relations){var n=e.split("|"),i=Number.parseInt(n[0]),r=Number.parseInt(n[1]);t!==i&&t!==r||(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 n=t+"|"+e;return this.relations[n]||null},t.prototype.getItemRelations=function(t){var e=[];for(var n in this.relations){var i=n.split("|"),r=Number.parseInt(i[0]),o=Number.parseInt(i[1]);t!==r&&t!==o||e.push({parentId:r,childId:o,line:this.relations[n]})}return e},t.prototype.getVisualCenter=function(t,e){var n=t.x+e.elementRef.clientWidth/2,i=t.y+e.elementRef.clientHeight/2;if(void 0!==e.props.label||""!==e.props.label||null!==e.props.label)switch(e.props.labelPosition){case"up":i=t.y+(e.elementRef.clientHeight+e.labelElementRef.clientHeight)/2;break;case"down":i=t.y+(e.elementRef.clientHeight-e.labelElementRef.clientHeight)/2;break;case"right":n=t.x+(e.elementRef.clientWidth-e.labelElementRef.clientWidth)/2;break;case"left":n=t.x+(e.elementRef.clientWidth+e.labelElementRef.clientWidth)/2}return{x:n,y:i}},t.prototype.addRelationLine=function(t,e){var n=t.props.id+"|"+e.props.id;null!=this.relations[n]&&this.relations[n].remove();var i=this.getVisualCenter(t.props,t),o=i.x,s=i.y,a=this.getVisualCenter(e.props,e),l=a.x,c=a.y,u=new V(W({id:0,type:13,startX:o,startY:s,endX:l,endY:c,width:0,height:0,lineWidth:this.props.relationLineWidth,color:"#CCCCCC"}),Object(r.h)({receivedAt:new Date}));return this.relations[n]=u,u.elementRef.style.zIndex="0",this.containerRef.append(u.elementRef),u},t.prototype.onItemClick=function(t){var e=this.clickEventManager.on(t);return this.disposables.push(e),e},t.prototype.onItemDblClick=function(t){var e=this.dblClickEventManager.on(t);return this.disposables.push(e),e},t.prototype.onItemMoved=function(t){var e=this.movedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onLineMoved=function(t){var e=this.lineMovedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onItemResized=function(t){var e=this.resizedEventManager.on(t);return this.disposables.push(e),e},t.prototype.onItemSelectionChanged=function(t){var e=this.selectionChangedEventManager.on(t);return this.disposables.push(e),e},t.prototype.enableEditMode=function(){this.elements.forEach(function(t){t.meta=ke({},t.meta,{editMode:!0})}),this.containerRef.classList.add("is-editing")},t.prototype.disableEditMode=function(){this.elements.forEach(function(t){t.meta=ke({},t.meta,{editMode:!1})}),this.containerRef.classList.remove("is-editing")},t.prototype.selectItem=function(t,e){var n=this;void 0===e&&(e=!1),e?this.elementIds.forEach(function(e){var i=n.elementsById[e].meta;e!==t&&i.isSelected?n.elementsById[e].unSelectItem():e!==t||i.isSelected||n.elementsById[e].selectItem()}):this.elementsById[t]&&this.elementsById[t].selectItem()},t.prototype.unSelectItem=function(t){this.elementsById[t]&&(this.elementsById[t].meta.isSelected&&this.elementsById[t].unSelectItem())},t.prototype.unSelectItems=function(){var t=this;this.elementIds.forEach(function(e){t.elementsById[e]&&t.elementsById[e].unSelectItem()})},t.itemDescriptiveName=function(t){var e;switch(t.props.type){case 0:e=Object(r.t)("Static graph")+" - "+t.props.imageSrc;break;case 1:e=Object(r.t)("Module graph");break;case 19:e=Object(r.t)("Clock");break;case 18:e=Object(r.t)("Bars graph");break;case 14:e=Object(r.t)("Event history graph");break;case 3:e=Object(r.t)("Percentile bar");break;case 15:e=Object(r.t)("Circular progress bar");break;case 16:e=Object(r.t)("Circular progress bar (interior)");break;case 2:e=Object(r.t)("Simple Value");break;case 4:e=Object(r.t)("Label");break;case 11:e=Object(r.t)("Group");break;case 20:e=Object(r.t)("Color cloud");break;case 5:e=Object(r.t)("Icon")+" - "+t.props.imageSrc;break;default:e=Object(r.t)("Item")}var n=t.props;return null!=n.agentAlias&&null!=n.moduleName?e+=" ("+Object(r.e)(n.agentAlias,18)+" - "+Object(r.e)(n.moduleName,25)+")":null!=n.agentAlias&&(e+=" ("+Object(r.e)(n.agentAlias,25)+")"),e},t.items=((we={})[0]=u,we[1]=ve.a,we[2]=et,we[6]=et,we[7]=et,we[8]=et,we[3]=he,we[9]=he,we[15]=he,we[16]=he,we[4]=X,we[5]=_,we[10]=Oe,we[11]=T,we[12]=z,we[13]=V,we[14]=nt.a,we[17]=pe.a,we[18]=be,we[19]=R,we[20]=O,we),t}(),Te=function(){function t(t){this.cancellable={cancel:function(){}},this._status="waiting",this.statusChangeEventManager=new B.a,this.disposables=[],this.taskInitiator=t}return Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(t){this._status=t,this.statusChangeEventManager.emit(t)},enumerable:!0,configurable:!0}),t.prototype.init=function(){var t=this;this.cancellable=this.taskInitiator(function(){t.status="finished"}),this.status="started"},t.prototype.cancel=function(){this.cancellable.cancel(),this.status="cancelled"},t.prototype.onStatusChange=function(t){var e=this.statusChangeEventManager.on(t);return this.disposables.push(e),e},t}();var Ce=function(){function t(){this.tasks={}}return t.prototype.add=function(t,e,n){void 0===n&&(n=0),this.tasks[t]&&"started"===this.tasks[t].status&&this.tasks[t].cancel();var i=n>0?function(t,e){return new Te(function(){var n=null;return t.onStatusChange(function(i){"finished"===i&&(n=window.setTimeout(function(){t.init()},e))}),t.init(),{cancel:function(){n&&clearTimeout(n),t.cancel()}}})}(new Te(e),n):new Te(e);return this.tasks[t]=i,this.tasks[t]},t.prototype.init=function(t){!this.tasks[t]||"waiting"!==this.tasks[t].status&&"cancelled"!==this.tasks[t].status&&"finished"!==this.tasks[t].status||this.tasks[t].init()},t.prototype.cancel=function(t){this.tasks[t]&&"started"===this.tasks[t].status&&this.tasks[t].cancel()},t}();window.VisualConsole=Ae,window.VisualConsole.Form=m,window.AsyncTaskManager=Ce}]);
|
|
//# sourceMappingURL=vc.main.min.js.map
|