pandorafms/pandora_console/include/visual-console-client/vc.main.min.js

2 lines
153 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=15)}([function(t,e,n){"use strict";n.d(e,"p",function(){return l}),n.d(e,"o",function(){return c}),n.d(e,"v",function(){return u}),n.d(e,"m",function(){return p}),n.d(e,"n",function(){return h}),n.d(e,"r",function(){return _}),n.d(e,"u",function(){return m}),n.d(e,"l",function(){return f}),n.d(e,"k",function(){return v}),n.d(e,"j",function(){return b}),n.d(e,"s",function(){return y}),n.d(e,"e",function(){return g}),n.d(e,"h",function(){return E}),n.d(e,"i",function(){return x}),n.d(e,"t",function(){return w}),n.d(e,"d",function(){return C}),n.d(e,"a",function(){return M}),n.d(e,"b",function(){return I}),n.d(e,"w",function(){return k}),n.d(e,"g",function(){return T}),n.d(e,"q",function(){return j}),n.d(e,"f",function(){return A}),n.d(e,"c",function(){return P});var i=n(10),r=n.n(i),a=n(4),o=n(5),s=(n(13),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)});function l(t,e){return"number"==typeof t?t:"string"==typeof t&&t.length>0&&!isNaN(parseInt(t))?parseInt(t):e}function c(t,e){return"number"==typeof t?t:"string"==typeof t&&t.length>0&&!isNaN(parseFloat(t))?parseFloat(t):e}function u(t){return null==t||0===t.length}function p(t,e){return"string"==typeof t&&t.length>0?t:e}function h(t){return"boolean"==typeof t?t:"number"==typeof t?t>0:"string"==typeof t&&("1"===t||"true"===t)}function d(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),a=i-n.length*r,o="",s=0;s<r;s++)o+=n;return 0===a?""+o+t:""+o+n.substring(0,a)+t}function _(t){return{x:l(t.x,0),y:l(t.y,0)}}function m(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 f(t){return s({moduleId:l(t.moduleId,null),moduleName:p(t.moduleName,null),moduleDescription:p(t.moduleDescription,null)},function(t){var e={agentId:l(t.agentId,null),agentName:p(t.agentName,null),agentAlias:p(t.agentAlias,null),agentDescription:p(t.agentDescription,null),agentAddress:p(t.agentAddress,null)};return null!=t.metaconsoleId?s({metaconsoleId:t.metaconsoleId},e):e}(t))}function v(t){var e={linkedLayoutStatusType:"default"};switch(t.linkedLayoutStatusType){case"weight":var n=l(t.linkedLayoutStatusTypeWeight,null);if(null==n)throw new TypeError("invalid status calculation properties.");t.linkedLayoutStatusTypeWeight&&(e={linkedLayoutStatusType:"weight",linkedLayoutStatusTypeWeight:n});break;case"service":var i=l(t.linkedLayoutStatusTypeWarningThreshold,null),r=l(t.linkedLayoutStatusTypeCriticalThreshold,null);if(null==i||null==r)throw new TypeError("invalid status calculation properties.");e={linkedLayoutStatusType:"service",linkedLayoutStatusTypeWarningThreshold:i,linkedLayoutStatusTypeCriticalThreshold:r}}return s({linkedLayoutId:l(t.linkedLayoutId,null),linkedLayoutNodeId:l(t.linkedLayoutNodeId,null)},e)}function b(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:h(t.editMode),isFromCache:h(t.isFromCache),isFetching:!1,isUpdating:!1,isBeingMoved:!1,isBeingResized:!1,isSelected:!1}}function y(t,e){var n=t+": "+e+";";return["-webkit-"+n,"-moz-"+n,"-ms-"+n,"-o-"+n,""+n]}function g(t){return decodeURIComponent(escape(window.atob(t)))}function E(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 d(t.getDate(),2,0)+"/"+d(t.getMonth()+1,2,0)+"/"+d(t.getFullYear(),4,0)}function x(t){return d(t.getHours(),2,0)+":"+d(t.getMinutes(),2,0)+":"+d(t.getSeconds(),2,0)}function w(t,e){return t.reduce(function(t,e){var n=e.macro,i=e.value;return t.replace(n,i)},e)}function O(t,e){var n=0;return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var a=Date.now();if(!(a-n<t))return n=a,e.apply(void 0,i)}}function C(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 D(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 M(t,e,n){var i=n||t.parentElement,r=t.draggable,a=0,o=0,s=0,l=0,c=0,u=0,p=i.getBoundingClientRect(),h=D(i),d=h.top,_=d+p.height,m=h.left,f=m+p.width,v=t.getBoundingClientRect(),b=window.getComputedStyle(t).borderWidth||"0",y=2*Number.parseInt(b),g=C(32,e),E=O(16,e),x=function(t){var e=0,n=0,i=t.pageX,r=t.pageY,h=i-s,b=r-l,x=p.width-v.width+y,w=p.height-v.height+y,O=i<m||0===a&&h>0&&i<m+c,C=i>f||h+a+v.width-y>p.width||a===x&&h<0&&i>m+x+c,D=r<d||0===o&&b>0&&r<d+u,M=r>_||b+o+v.height-y>p.height||o===w&&b<0&&r>d+w+u;(e=O?0:C?x:h+a)<0&&(e=0),(n=D?0:M?w:b+o)<0&&(n=0),s=i,l=r,e===a&&n===o||(E(e,n),g(e,n),a=e,o=n)},w=function(){a=0,o=0,s=0,l=0,document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",w),t.draggable=r,document.body.style.userSelect="auto"},M=function(e){if(2!==e.button){e.stopPropagation(),t.draggable=!1;var n=D(t,i);a=n.left,o=n.top,s=e.pageX,l=e.pageY,c=e.offsetX,u=e.offsetY,p=i.getBoundingClientRect(),h=D(i),d=h.top,_=d+p.height,m=h.left,f=m+p.width,v=t.getBoundingClientRect(),b=window.getComputedStyle(t).borderWidth||"0",y=2*Number.parseInt(b),document.addEventListener("mousemove",x),document.addEventListener("mouseup",w),document.body.style.userSelect="none"}};return t.addEventListener("mousedown",M),function(){t.removeEventListener("mousedown",M),w()}}function I(t,e){var n=document.createElement("div");n.className="resize-draggable",t.appendChild(n);var i=t.parentElement,r=t.draggable,a=0,o=0,s=0,l=0,c=0,u=i.getBoundingClientRect(),p=D(i),h=p.top,d=h+u.height,_=p.left,m=_+u.width,f=D(t),v=f.top,b=f.left,y=window.getComputedStyle(t).borderWidth||"0",g=Number.parseInt(y),E=C(32,e),x=O(16,e),w=function(t){var e=a+(t.pageX-s),n=o+(t.pageY-l);e===a&&n===o||e<a&&t.pageX>b+(a-c)||(e<15?e=15:e+b-g/2>=m&&(e=m-b),n<15?n=15:n+v-g/2>=d&&(n=d-v),x(e,n),E(e,n),a=e,o=n,s=t.pageX,l=t.pageY)},M=function(){a=0,o=0,s=0,l=0,c=0,0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",M),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,y=n.height;a=r,o=y,s=e.pageX,l=e.pageY,c=e.offsetX,e.offsetY,u=i.getBoundingClientRect(),p=D(i),h=p.top,d=h+u.height,_=p.left,m=_+u.width,f=D(t),v=f.top,b=f.left,document.addEventListener("mousemove",w),document.addEventListener("mouseup",M),document.body.style.userSelect="none"}),function(){n.remove(),M()}}function k(t){return t}function T(t){var e=document.createElement("a");e.className="tip";var n=document.createElement("img");return n.src=r.a,n.className="forced_title",n.setAttribute("alt",t),n.setAttribute("data-title",t),n.setAttribute("data-use_title_for_force_title","1"),e.appendChild(n),e}function j(t,e,n,i){null===t&&(t=0);var r,s=e?e.value:0,c=null!=t?t:s,u=document.createElement("div"),p=document.createElement("div"),h=document.createElement("select"),d=document.createElement("a"),_=document.createElement("div"),m=document.createElement("input"),f=document.createElement("select"),v=document.createElement("a"),b=[{value:"1",text:k("Seconds").toLowerCase()},{value:"60",text:k("Minutes").toLowerCase()},{value:"3600",text:k("Hours").toLowerCase()},{value:"86400",text:k("Days").toLowerCase()},{value:"604800",text:k("Weeks").toLowerCase()},{value:"2592000",text:k("Months").toLowerCase()},{value:"31104000",text:k("Years").toLowerCase()}],y=function(t){i(c=t)},g=function(t){return n.sort(function(t,e){return t.value<e.value?1:-1}).find(function(e){return t>=e.value})},E=function(t){return b.map(function(t){return Number.parseInt(t.value)}).sort(function(t,e){return t<e?1:-1}).find(function(e){return t%e==0})};if(p.appendChild(h),p.appendChild(d),_.appendChild(m),_.appendChild(f),_.appendChild(v),n.find(function(e){return e.value===t})||e&&e.value===t?u.appendChild(p):u.appendChild(_),h.addEventListener("change",function(t){return y(l(t.target.value,s))}),e){var x=document.createElement("option");x.value=""+e.value,x.text=e.text,h.appendChild(x)}return n.forEach(function(t){var e=document.createElement("option");e.value=""+t.value,e.text=t.text,h.appendChild(e)}),r=g(t),h.value=""+(r?r.value:s),d.appendChild(Object(a.a)(o.d,k("Show manual period input"),{size:"small"})),d.addEventListener("click",function(t){var e;t.preventDefault(),(e=E(c))?(m.value=""+c/e,f.value=""+e):(m.value=""+c,f.value="1"),u.replaceChild(_,p)}),m.type="number",m.min="0",m.required=!0,m.addEventListener("change",function(t){return y(l(t.target.value,0)*l(f.value,1))}),f.addEventListener("change",function(t){return y(l(m.value,0)*l(t.target.value,1))}),b.forEach(function(t){var e=document.createElement("option");e.value=""+t.value,e.text=t.text,f.appendChild(e)}),function(t){var e=E(t);e?(m.value=""+t/e,f.value=""+e):(m.value=""+t,f.value="1")}(t),v.appendChild(Object(a.a)(o.c,k("Show periods selector"),{size:"small"})),v.addEventListener("click",function(t){var e,n;t.preventDefault(),e=g(c),n=e?e.value:s,h.value=""+n,n!==c&&y(n),u.replaceChild(p,_)}),u}function A(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 P(t,e,n,i){var r=document.createElement("div");r.classList.add("autocomplete");var a=document.createElement("input");a.type="text",null!==t&&(a.value=t);var o=document.createElement("div");o.classList.add("autocomplete-items");var s=function(){o.innerHTML=""};return a.addEventListener("keyup",function(t){var r=t.target.value;r?e(r,function(t){s(),t instanceof Array&&t.forEach(function(t){var e=n(t);e.addEventListener("click",function(){a.value=i(t),s()}),o.appendChild(e)})}):s()}),r.appendChild(a),r.appendChild(o),r}},function(t,e,n){"use strict";n.d(e,"c",function(){return b}),n.d(e,"b",function(){return y}),n.d(e,"a",function(){return g}),n.d(e,"e",function(){return x});var i,r=n(0),a=n(3),o=n(2),s=n(5),l=n(4),c=(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)}),u=function(){return(u=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){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Link enabled");var n=document.createElement("input");n.id="checkbox-switch",n.className="checkbox-switch",n.type="checkbox",n.name="checkbox-enable-link",n.value="1",n.checked=this.currentData.isLinkEnabled||this.initialData.isLinkEnabled||!1,n.addEventListener("change",function(e){return t.updateData({isLinkEnabled:e.target.checked})});var i=document.createElement("label");return i.className="label-switch",i.htmlFor="checkbox-switch",e.appendChild(n),e.appendChild(i),e},e}(o.InputGroup),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Show on top");var n=document.createElement("input");n.id="checkbox-switch",n.className="checkbox-switch",n.type="checkbox",n.name="checkbox-show-on-top",n.value="1",n.checked=this.currentData.isOnTop||this.initialData.isOnTop||!1,n.addEventListener("change",function(e){return t.updateData({isOnTop:e.target.checked})});var i=document.createElement("label");return i.className="label-switch",i.htmlFor="checkbox-switch",e.appendChild(Object(r.g)(Object(r.w)("It allows the element to be superimposed to the rest of items of the visual console"))),e.appendChild(n),e.appendChild(i),e},e}(o.InputGroup),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Position");var n=document.createElement("input");n.type="number",n.min="0",n.required=!0,n.value=""+(this.currentData.x||this.initialData.x||0),n.addEventListener("change",function(e){return t.updateData({x:Object(r.p)(e.target.value,0)})});var i=document.createElement("input");return i.type="number",i.min="0",i.required=!0,i.value=""+(this.currentData.y||this.initialData.y||0),i.addEventListener("change",function(e){return t.updateData({y:Object(r.p)(e.target.value,0)})}),e.appendChild(n),e.appendChild(i),e},e}(o.InputGroup),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Size");var n=document.createElement("input");n.type="number",n.min="0",n.required=!0,n.value=""+(this.currentData.width||this.initialData.width||0),n.addEventListener("change",function(e){return t.updateData({width:Object(r.p)(e.target.value,0)})});var i=document.createElement("input");return i.type="number",i.min="0",i.required=!0,i.value=""+(this.currentData.height||this.initialData.height||0),i.addEventListener("change",function(e){return t.updateData({height:Object(r.p)(e.target.value,0)})}),e.appendChild(Object(r.g)(Object(r.w)("In order to use the original image file size, set width and height to 0."))),e.appendChild(n),e.appendChild(i),e},e}(o.InputGroup),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Parent");var n=document.createElement("select");return n.required=!0,this.requestData("parent",{id:this.initialData.id},function(e,i){var a=document.createElement("option");a.value="0",a.textContent=Object(r.w)("None"),n.appendChild(a),i instanceof Array&&i.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,n.appendChild(e)}),n.addEventListener("change",function(e){t.updateData({parentId:Object(r.p)(e.target.value,0)})}),n.value=""+(t.currentData.parentId||t.initialData.parentId||0)}),e.appendChild(n),e},e}(o.InputGroup),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Restrict access to group");var n=Object(l.a)(s.a,Object(r.w)("Spinner"),{size:"small",spin:!0});return e.appendChild(n),this.requestData("acl-group",{},function(i,a){if(n.remove(),i&&e.appendChild(Object(l.a)(s.b,Object(r.w)("Error"),{size:"small",color:"#e63c52"})),a instanceof Array){var o=document.createElement("select");o.required=!0,a.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.innerHTML=t.text,o.appendChild(e)}),o.addEventListener("change",function(e){t.updateData({aclGroupId:Object(r.p)(e.target.value,0)})}),o.value=""+(t.currentData.aclGroupId||t.initialData.aclGroupId||0),e.appendChild(o)}}),e},e}(o.InputGroup),v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Cache expiration");var n=Object(r.q)(this.currentData.cacheExpiration||this.initialData.cacheExpiration||0,{text:Object(r.w)("No cache"),value:0},[{text:Object(r.w)("10 seconds"),value:10},{text:Object(r.w)("30 seconds"),value:30},{text:Object(r.w)("60 seconds"),value:60},{text:Object(r.w)("5 minutes"),value:300},{text:Object(r.w)("15 minutes"),value:900},{text:Object(r.w)("30 minutes"),value:1800},{text:Object(r.w)("1 hour"),value:3600}],function(e){return t.updateData({cacheExpiration:e})});return e.appendChild(n),e},e}(o.InputGroup),b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getLinkedVisualConsoleTypeSelector=function(t){var n=document.createElement("div"),i=document.createElement("div");if(0===t)return n;var a=document.createElement("label");a.textContent=Object(r.w)("Type of the status calculation of the linked visual console");var o,s=document.createElement("select");switch(s.required=!1,[{value:"default",text:Object(r.w)("By default")},{value:"weight",text:Object(r.w)("By status weight")},{value:"service",text:Object(r.w)("By critical elements")}].forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,s.appendChild(e)}),o=void 0===e.currentData.linkedLayoutStatusType?void 0===e.initialData.linkedLayoutStatusType?"default":e.initialData.linkedLayoutStatusType:e.currentData.linkedLayoutStatusType,s.value=o,a.appendChild(s),n.appendChild(a),o){case"weight":i.appendChild(e.getLinkedVisualConsoleTypeWeihtInput());break;case"service":i.appendChild(e.getLinkedVisualConsoleTypeServiceInput())}return n.appendChild(i),s.addEventListener("change",function(t){var n=t.target.value,r="weight"!==n&&"service"!==n?"default":n;switch(i.childNodes.forEach(function(t){return t.remove()}),r){case"weight":e.updateData({linkedLayoutStatusType:r,linkedLayoutStatusTypeWeight:0}),i.appendChild(e.getLinkedVisualConsoleTypeWeihtInput());break;case"service":e.updateData({linkedLayoutStatusType:r,linkedLayoutStatusTypeWarningThreshold:0,linkedLayoutStatusTypeCriticalThreshold:0}),i.appendChild(e.getLinkedVisualConsoleTypeServiceInput());break;default:e.updateData({linkedLayoutStatusType:r})}}),n},e.getLinkedVisualConsoleTypeWeihtInput=function(){var t=document.createElement("div"),n=document.createElement("label");n.textContent=Object(r.w)("Linked visual console weight");var i,a,o=document.createElement("input");return o.type="number",o.min="0",o.required=!0,"weight"===e.currentData.linkedLayoutStatusType&&(i=e.currentData.linkedLayoutStatusTypeWeight),"weight"===e.initialData.linkedLayoutStatusType&&(a=e.initialData.linkedLayoutStatusTypeWeight),o.value=""+(i||a||0),o.addEventListener("change",function(t){return e.updateData({linkedLayoutStatusTypeWeight:Object(r.p)(t.target.value,0)})}),n.appendChild(o),t.appendChild(n),t},e.getLinkedVisualConsoleTypeServiceInput=function(){var t=document.createElement("div"),n=document.createElement("label");n.textContent=Object(r.w)("Critical weight");var i,a,o=document.createElement("input");o.type="number",o.min="0",o.required=!0,"service"===e.currentData.linkedLayoutStatusType&&(i=e.currentData.linkedLayoutStatusTypeCriticalThreshold),"service"===e.initialData.linkedLayoutStatusType&&(a=e.initialData.linkedLayoutStatusTypeCriticalThreshold),o.value=""+(i||a||0),o.addEventListener("change",function(t){return e.updateData({linkedLayoutStatusTypeCriticalThreshold:Object(r.p)(t.target.value,0)})});var s=document.createElement("label");s.textContent=Object(r.w)("Warning weight");var l,c,u=document.createElement("input");return u.type="number",u.min="0",u.required=!0,"service"===e.currentData.linkedLayoutStatusType&&(l=e.currentData.linkedLayoutStatusTypeWarningThreshold),"service"===e.initialData.linkedLayoutStatusType&&(c=e.initialData.linkedLayoutStatusTypeWarningThreshold),u.value=""+(l||c||0),u.addEventListener("change",function(t){return e.updateData({linkedLayoutStatusTypeWarningThreshold:Object(r.p)(t.target.value,0)})}),s.appendChild(u),t.appendChild(s),n.appendChild(o),t.appendChild(n),t},e}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("label");i.textContent=Object(r.w)("Linked visual console\t");var a=Object(l.a)(s.a,Object(r.w)("Spinner"),{size:"small",spin:!0});return i.appendChild(a),this.requestData("link-console",{},function(o,c){a.remove(),o&&i.appendChild(Object(l.a)(s.b,Object(r.w)("Error"),{size:"small",color:"#e63c52"}));var u=document.createElement("select");u.required=!0;var p=document.createElement("option");if(p.value="0",p.textContent=Object(r.w)("none"),u.appendChild(p),c instanceof Array){c.forEach(function(t){var e=t.id;t.nodeId&&(e=t.id+"|"+t.nodeId);var n=document.createElement("option");n.value=e,n.textContent=t.name,u.appendChild(n)});var h=void 0;void 0!==t.currentData.linkedLayoutId&&(h=void 0!==t.currentData.linkedLayoutNodeId&&0!==t.currentData.linkedLayoutNodeId?t.currentData.linkedLayoutId+"|"+t.currentData.linkedLayoutNodeId:""+t.currentData.linkedLayoutId);var d=void 0;void 0!==t.initialData.linkedLayoutId&&(d=void 0!==t.initialData.linkedLayoutNodeId&&0!==t.initialData.linkedLayoutNodeId?t.initialData.linkedLayoutId+"|"+t.initialData.linkedLayoutNodeId:""+t.initialData.linkedLayoutId),u.value=""+(h||d||0),u.addEventListener("change",function(e){var i=e.target.value.split("|"),a=0,o=0;i instanceof Array&&(o=Object(r.p)(i[0],0),a=Object(r.p)(i[1],0)),t.updateData({linkedLayoutId:o,linkedLayoutNodeId:a,linkedLayoutStatusType:"default"}),n.childNodes.forEach(function(t){return t.remove()}),n.appendChild(t.getLinkedVisualConsoleTypeSelector(o))}),i.appendChild(u),e.appendChild(i),n.appendChild(t.getLinkedVisualConsoleTypeSelector(Object(r.p)(t.initialData.linkedLayoutId,0))),e.appendChild(n)}else i.appendChild(u),e.appendChild(i)}),e},e}(o.InputGroup),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=this.initialData.imageKey,n=document.createElement("label");n.textContent=Object(r.w)("Image");var i=document.createElement("div"),a=Object(l.a)(s.a,Object(r.w)("Spinner"),{size:"small",spin:!0});return n.appendChild(a),this.requestData("image-console",{},function(o,c){if(a.remove(),o&&n.appendChild(Object(l.a)(s.b,Object(r.w)("Error"),{size:"small",color:"#e63c52"})),c instanceof Array){var u=document.createElement("select");u.required=!0,c.forEach(function(t){var e=document.createElement("option");e.value=t.name,e.textContent=t.name,u.appendChild(e)}),u.addEventListener("change",function(n){var r,a=n.target.value;if(t.updateData(((r={})[e]=a,r)),null!=a){var o=c.find(function(t){return t.name===a});t.getImage(o,i)}});var p=""+(t.currentData[e]||t.initialData[e]||null);if(u.value=p,n.appendChild(u),null!=p){var h=c.find(function(t){return t.name===p});n.appendChild(t.getImage(h,i))}}}),n},e.prototype.getImage=function(t,e){if(t)if(e.querySelectorAll(".img-vc-elements").forEach(function(t){e.removeChild(t)}),this.initialData.showStatusImg){["","_bad","_ok","_warning"].forEach(function(n){var i=document.createElement("img");i.alt=Object(r.w)("Image VC"),i.style.width="40px",i.style.height="40px",i.className="img-vc-elements",i.src=""+t.src+n+".png",e.appendChild(i)})}else{var n=document.createElement("img");n.alt=Object(r.w)("Image VC"),n.style.width="40px",n.style.height="40px",n.className="img-vc-elements",n.src=t.src+".png",e.appendChild(n)}return e},e}(o.InputGroup),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Agent");var n=document.createElement("input");n.type="text",n.required=!0,n.className="autocomplete-agent",n.value=""+(this.currentData.agentId||this.initialData.agentId||0);var i=this.initialData.agentAddress?this.initialData.agentAlias+" - "+this.initialData.agentAddress:this.initialData.agentAlias;e.appendChild(Object(r.c)(Object(r.m)(i,null),function(e,n){t.requestData("autocomplete-agent",{value:e},function(e,i){var a=document.getElementById("select-autocomplete-agent-module");a&&a.remove(),e?n([]):i instanceof Array&&n(i.reduce(function(e,n){if("object"==typeof n&&null!==n){var i=Object(r.p)(n.id,null);null!==i&&e.push({agentId:i,agentName:Object(r.m)(n.name,null),agentAlias:Object(r.m)(n.alias,null),agentAddress:Object(r.m)(n.ip,null),agentDescription:Object(r.m)(n.agentDescription,null),metaconsoleId:Object(r.p)(n.metaconsoleId,null),type:Object(r.p)(t.initialData.type,null)})}return e},[]))})},function(t){var e=document.createElement("div");return e.textContent=t.agentAddress?t.agentAlias+" - "+t.agentAddress:t.agentAlias,e},function(n){t.updateData({agentId:n.agentId,metaconsoleId:n.metaconsoleId});var i=n.agentAddress?n.agentAlias+" - "+n.agentAddress:n.agentAlias;return e.appendChild(t.agentModuleInput(n)),""+(i||"")}));var a=Object(r.p)(this.initialData.agentId,null);return null!==a&&e.appendChild(this.agentModuleInput({agentId:a,agentName:Object(r.m)(this.initialData.agentName,null),agentAlias:Object(r.m)(this.initialData.agentAlias,null),agentAddress:Object(r.m)(this.initialData.agentAddress,null),agentDescription:Object(r.m)(this.initialData.agentDescription,null),metaconsoleId:Object(r.p)(this.initialData.metaconsoleId,null),type:Object(r.p)(this.initialData.type,null)})),e},e.prototype.agentModuleInput=function(t){var e=this,n=document.getElementById("select-autocomplete-agent-module");n&&n.remove();var i=document.createElement("label");i.id="select-autocomplete-agent-module",i.textContent=Object(r.w)("Module");var a=Object(l.a)(s.a,Object(r.w)("Spinner"),{size:"small",spin:!0});return i.appendChild(a),this.requestData("autocomplete-module",u({},t),function(t,n){if(a.remove(),t&&i.appendChild(Object(l.a)(s.b,Object(r.w)("Error"),{size:"small",color:"#e63c52"})),n instanceof Array){var o=document.createElement("select");o.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.moduleId,e.textContent=t.moduleName,o.appendChild(e)}),o.addEventListener("change",function(t){e.updateData({moduleId:Object(r.p)(t.target.value,0)})}),o.value=""+(e.currentData.moduleId||e.initialData.moduleId||0),i.appendChild(o)}}),i},e}(o.InputGroup),E=function(t){switch(t){case"up":case"right":case"down":case"left":return t;default:return"down"}};function x(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 u({id:parseInt(t.id),type:parseInt(t.type),label:Object(r.m)(t.label,null),labelPosition:E(t.labelPosition),isLinkEnabled:Object(r.n)(t.isLinkEnabled),link:Object(r.m)(t.link,null),isOnTop:Object(r.n)(t.isOnTop),parentId:Object(r.p)(t.parentId,null),aclGroupId:Object(r.p)(t.aclGroupId,null),cacheExpiration:Object(r.p)(t.cacheExpiration,null)},Object(r.u)(t),Object(r.r)(t))}var w=function(){function t(t,e,n){var i=this;void 0===n&&(n=!1),this.elementRef=document.createElement("div"),this.labelElementRef=document.createElement("div"),this.childElementRef=document.createElement("div"),this.clickEventManager=new a.a,this.dblClickEventManager=new a.a,this.movedEventManager=new a.a,this.movementFinishedEventManager=new a.a,this.resizedEventManager=new a.a,this.resizeFinishedEventManager=new a.a,this.removeEventManager=new a.a,this.selectionChangedEventManager=new a.a,this.disposables=[],this.debouncedMovementSave=Object(r.d)(500,function(t,e){i._metadata.isBeingMoved=!1;var n={x:i.props.x,y:i.props.y},r={x:t,y:e};i.positionChanged(n,r)&&(i.move(t,e),i.movementFinishedEventManager.emit({item:i,prevPosition:n,newPosition:r}))}),this.removeMovement=null,this.debouncedResizementSave=Object(r.d)(500,function(t,e){i._metadata.isBeingResized=!1;var n={width:i.props.width,height:i.props.height},r={width:t,height:e};i.sizeChanged(n,r)&&(i.resize(t,e),i.resizeFinishedEventManager.emit({item:i,prevSize:n,newSize:r}))}),this.removeResizement=null,this.itemProps=t,this._metadata=e,n||this.init()}return t.prototype.initMovementListener=function(t){var e=this;this.removeMovement=Object(r.a)(t,function(t,n){var i={x:e.props.x,y:e.props.y},r={x:t,y:n};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(r.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,a=i.height;switch(e.props.labelPosition){case"up":case"down":n-=a;break;case"left":case"right":t-=r}}var o={width:e.props.width,height:e.props.height},s={width:t,height:n};e.sizeChanged(o,s)&&(e.resizeElement(t,n),e.resizedEventManager.emit({item:e,prevSize:o,newSize:s}),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=document.createElement("div"),t.className="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.dblClickEventManager.emit({item:e,nativeEvent:t})}),t.addEventListener("click",function(t){e.meta.editMode&&(t.preventDefault(),t.stopPropagation()),e.meta.isBeingMoved||e.meta.isBeingResized||e.clickEventManager.emit({item:e,nativeEvent:t})}),this.meta.editMode&&(t.classList.add("is-editing"),this.initMovementListener(t),this.initResizementListener(t)),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"),a=document.createElement("tr"),o=document.createElement("td");switch(o.innerHTML=e,i.appendChild(o),n.appendChild(r),n.appendChild(i),n.appendChild(a),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(r.t)([{macro:"_date_",value:Object(r.h)(new Date)},{macro:"_time_",value:Object(r.i)(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 u({},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 u({},this._metadata)},set:function(t){this.setMeta(t)},enumerable:!0,configurable:!0}),t.prototype.setMeta=function(t){var e=this._metadata;this._metadata=u({},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||this.props.isLinkEnabled&&t.link!==this.props.link)){var r=this.createContainerDomElement();r.innerHTML=this.elementRef.innerHTML;for(var a=this.elementRef.attributes,o=0;o<a.length;o++)"id"!==a[o].nodeName&&r.setAttributeNode(a[o]);null!==this.elementRef.parentNode&&this.elementRef.parentNode.replaceChild(r,this.elementRef),this.elementRef=r}if(e&&e.editMode===this.meta.editMode||(this.meta.editMode?(this.elementRef.classList.add("is-editing"),this.initMovementListener(this.elementRef),this.initResizementListener(this.elementRef)):(this.elementRef.classList.remove("is-editing"),this.stopMovementListener(),this.stopResizementListener())),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 s=document.createElement("div");s.className="div-visual-console-spinner";var l=document.createElement("div");l.className="visual-console-spinner",s.appendChild(l),this.elementRef.appendChild(s)}else{this.elementRef.classList.remove("is-updating");var c=this.elementRef.querySelector(".div-visual-console-spinner");if(null!==c){var u=c.parentElement;null!==u&&u.removeChild(c)}}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=u({},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=u({},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.getFormContainer=function(){return new o.FormContainer(Object(r.w)("Item"),[new d("position",this.props),new _("size",this.props),new p("link",this.props),new h("show-on-top",this.props),new m("parent",this.props),new f("acl-group",this.props),new v("cache-expiration",this.props)],["position","size","link","show-on-top","parent","acl-group","cache-expiration"])},t.getFormContainer=function(t){return new o.FormContainer(Object(r.w)("Item"),[new d("position",t),new _("size",t),new p("link",t),new h("show-on-top",t),new m("parent",t),new f("acl-group",t),new v("cache-expiration",t)],["position","size","link","show-on-top","parent","acl-group","cache-expiration"])},t}();e.d=w},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(3),r=n(0),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)},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 a({},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=a({},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.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=a({},t,e.inputGroupsByName[n].data)),t},{})})});var i=document.createElement("div");i.className="input-groups",this.enabledInputGroupNames.forEach(function(t){e.inputGroupsByName[t]&&i.appendChild(e.inputGroupsByName[t].element)});var o=document.createElement("input");return o.className="sub upd",o.type="submit",o.value="creation"===t?Object(r.w)("Create"):Object(r.w)("Update"),n.appendChild(i),n.appendChild(o),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";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(12);var i="http://www.w3.org/2000/svg";e.a=function(t,e,n){var r=void 0===n?{}:n,a=r.size,o=r.color,s=r.spin,l=r.pulse,c=document.createElement("figure");c.title=e,c.className="fa fa-"+t.iconName,a&&c.classList.add("fa-"+a),s?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]),o&&u.setAttribute("fill",o);var p=document.createElementNS(i,"path"),h="string"==typeof t.icon[4]?t.icon[4]:t.icon[4][0];return p.setAttribute("d",h),u.appendChild(p),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 a}),n.d(e,"d",function(){return o}),n.d(e,"e",function(){return s}),n.d(e,"f",function(){return l});var i={prefix:"fas",iconName:"circle-notch",icon:[512,512,[],"f1ce","M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z"]},r={prefix:"fas",iconName:"exclamation-circle",icon:[512,512,[],"f06a","M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]},a={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"]},o={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"]},s={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"]},l={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),_Form__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(2),__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)},MaxTimeInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Max. Time");var n=document.createElement("select");return n.required=!0,[{value:"86400",text:"24h"},{value:"43200",text:"12h"},{value:"28800",text:"8h"},{value:"7200",text:"2h"},{value:"3600",text:"1h"}].forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,n.appendChild(e)}),n.value=""+(this.currentData.maxTime||this.initialData.maxTime||"86400"),n.addEventListener("change",function(e){t.updateData({maxTime:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.p)(e.target.value,0)})}),e.appendChild(n),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup);function eventsHistoryPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.e)(t),{type:14,maxTime:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.p)(t.maxTime,null),html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.e)(t.encodedHtml):t.html},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.l)(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.prototype.getFormContainer=function(){var t=_super.prototype.getFormContainer.call(this);return t.addInputGroup(new MaxTimeInputGroup("max-time",this.props)),t.addInputGroup(new _Item__WEBPACK_IMPORTED_MODULE_1__.a("agent-autocomplete",this.props)),t},EventsHistory}(_Item__WEBPACK_IMPORTED_MODULE_1__.d);__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),_Form__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(2),__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__.v)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.e)(t),{type:17,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.e)(t.encodedHtml):t.html,legendBackgroundColor:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.legendBackgroundColor)?"#000000":t.legendBackgroundColor},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.l)(t),Object(_lib__WEBPACK_IMPORTED_MODULE_0__.k)(t))}var LegendBackgroundColorInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Resume data color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.legendBackgroundColor||this.initialData.legendBackgroundColor||"#000000"),n.addEventListener("change",function(e){t.updateData({legendBackgroundColor:e.target.value})}),e.appendChild(n),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),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.prototype.getFormContainer=function(){var t=_super.prototype.getFormContainer.call(this);return t.addInputGroup(new _Item__WEBPACK_IMPORTED_MODULE_1__.c("link-console",this.props)),t.addInputGroup(new LegendBackgroundColorInputGroup("legend-background-color",this.props)),t.addInputGroup(new _Item__WEBPACK_IMPORTED_MODULE_1__.a("agent-autocomplete",this.props)),t},DonutGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.d);__webpack_exports__.a=DonutGraph},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return barsGraphPropsDecoder});var _lib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_Item__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),_Form__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(2),__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)},parseBarsGraphProps=function(t){switch(t){case"white":case"black":case"transparent":return t;default:return"transparent"}},parseTypeGraph=function(t){switch(t){case"horizontal":case"vertical":return t;default:return"vertical"}},BackgroundColorInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Background color");var n=[{value:"white",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("White")},{value:"black",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Black")},{value:"transparent",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Transparent")}],i=document.createElement("select");return i.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.value=this.currentData.backgroundColor||this.initialData.backgroundColor||"default",i.addEventListener("change",function(e){t.updateData({backgroundColor:parseBarsGraphProps(e.target.value)})}),e.appendChild(i),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),TypeGraphInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Graph Type");var n=[{value:"horizontal",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Horizontal")},{value:"vertical",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Vertical")}],i=document.createElement("select");return i.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.value=this.currentData.typeGraph||this.initialData.typeGraph||"vertical",i.addEventListener("change",function(e){t.updateData({typeGraph:parseTypeGraph(e.target.value)})}),e.appendChild(i),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),GridColorInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Grid color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.gridColor||this.initialData.gridColor||"#000000"),n.addEventListener("change",function(e){t.updateData({gridColor:e.target.value})}),e.appendChild(n),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup);function barsGraphPropsDecoder(t){if(Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.e)(t),{type:18,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.e)(t.encodedHtml):t.html,backgroundColor:parseBarsGraphProps(t.backgroundColor),typeGraph:parseTypeGraph(t.typeGraph),gridColor:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.gridColor)?"#000000":t.gridColor},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.l)(t))}var BarsGraph=function(_super){function BarsGraph(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(BarsGraph,_super),BarsGraph.prototype.createDomElement=function(){var element=document.createElement("div");element.className="bars-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},BarsGraph.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())},BarsGraph.prototype.getFormContainer=function(){var t=_super.prototype.getFormContainer.call(this);return t.addInputGroup(new BackgroundColorInputGroup("backgroundColor-type",this.props)),t.addInputGroup(new TypeGraphInputGroup("type-graph",this.props)),t.addInputGroup(new GridColorInputGroup("grid-color",this.props)),t.addInputGroup(new _Item__WEBPACK_IMPORTED_MODULE_1__.a("agent-autocomplete",this.props)),t},BarsGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.d);__webpack_exports__.b=BarsGraph},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),_Form__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(2),_lib_FontAwesomeIcon__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(4),_fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(5),__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__.v)(t.html)&&Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.encodedHtml))throw new TypeError("missing html content.");return __assign({},Object(_Item__WEBPACK_IMPORTED_MODULE_1__.e)(t),{type:1,html:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.v)(t.html)?Object(_lib__WEBPACK_IMPORTED_MODULE_0__.e)(t.encodedHtml):t.html,backgroundType:parseBackgroundType(t.backgroundType),period:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.p)(t.period,null),graphType:parseGraphType(t.graphType)},Object(_lib__WEBPACK_IMPORTED_MODULE_0__.l)(t),Object(_lib__WEBPACK_IMPORTED_MODULE_0__.k)(t))}var BackgroundTypeInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Background color");var n=[{value:"white",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("White")},{value:"black",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Black")},{value:"transparent",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Transparent")}],i=document.createElement("select");return i.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.value=this.currentData.backgroundType||this.initialData.backgroundType||"default",i.addEventListener("change",function(e){t.updateData({backgroundType:parseBackgroundType(e.target.value)})}),e.appendChild(i),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),ChooseTypeInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=document.createElement("div"),e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Module Graph"),t.appendChild(e);var n=document.createElement("input");n.type="radio",n.name="type-graph",n.value="module",n.required=!0,t.appendChild(n),n.addEventListener("change",function(t){for(var e=document.getElementsByClassName("input-group-agent-autocomplete"),n=0;n<e.length;n++)e[n].classList.add("show-elements"),e[n].classList.remove("hide-elements")});var i=document.createElement("label");i.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Custom Graph"),t.appendChild(i);var r=document.createElement("input");return r.type="radio",r.name="type-graph",r.value="module",r.required=!0,t.appendChild(r),r.addEventListener("change",function(t){for(var e=document.getElementsByClassName("input-group-agent-autocomplete"),n=0;n<e.length;n++)e[n].classList.add("hide-elements"),e[n].classList.remove("show-elements")}),t},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),CustomGraphInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=document.createElement("label");t.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Custom graph");var e=Object(_lib_FontAwesomeIcon__WEBPACK_IMPORTED_MODULE_3__.a)(_fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.a,Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Spinner"),{size:"small",spin:!0});return t.appendChild(e),this.requestData("custom-graph-list",{},function(n,i){if(e.remove(),n&&t.appendChild(Object(_lib_FontAwesomeIcon__WEBPACK_IMPORTED_MODULE_3__.a)(_fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_4__.b,Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Error"),{size:"small",color:"#e63c52"})),i instanceof Array){var r=document.createElement("select");r.required=!0,i.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,r.appendChild(e)}),t.appendChild(r)}}),t},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),GraphTypeInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Graph Type");var n=[{value:"line",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Line")},{value:"area",text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Area")}],i=document.createElement("select");return i.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.value=this.currentData.graphType||this.initialData.graphType||"line",i.addEventListener("change",function(e){t.updateData({graphType:parseGraphType(e.target.value)})}),e.appendChild(i),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),PeriodInputGroup=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("Period");var n=Object(_lib__WEBPACK_IMPORTED_MODULE_0__.q)(this.currentData.period||this.initialData.period||300,null,[{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("5 minutes"),value:300},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("30 minutes"),value:1800},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("6 hours"),value:21600},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("1 day"),value:86400},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("1 week"),value:604800},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("15 days"),value:1296e3},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("1 month"),value:2592e3},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("3 months"),value:7776e3},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("6 months"),value:15552e3},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("1 year"),value:31104e3},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("2 years"),value:62208e3},{text:Object(_lib__WEBPACK_IMPORTED_MODULE_0__.w)("3 years"),value:93312e3}],function(e){return t.updateData({period:e})});return e.appendChild(n),e},e}(_Form__WEBPACK_IMPORTED_MODULE_2__.InputGroup),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.className="module-graph",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"),_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.prototype.getFormContainer=function(){var t=_super.prototype.getFormContainer.call(this);return t.addInputGroup(new BackgroundTypeInputGroup("background-type",this.props)),t.addInputGroup(new GraphTypeInputGroup("graph-type",this.props)),t.addInputGroup(new PeriodInputGroup("period-graph",this.props)),t.addInputGroup(new _Item__WEBPACK_IMPORTED_MODULE_1__.c("link-console",this.props)),t.addInputGroup(new ChooseTypeInputGroup("show-type-graph",this.props)),t.addInputGroup(new _Item__WEBPACK_IMPORTED_MODULE_1__.a("agent-autocomplete",this.props)),t.addInputGroup(new CustomGraphInputGroup("custom-graph-list",this.props)),t},ModuleGraph}(_Item__WEBPACK_IMPORTED_MODULE_1__.d);__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(11);var i,r=n(0),a=n(1),o=n(2),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)}),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)},c=function(t){switch(t){case"default":case"enabled":case"disabled":return t;default:return"default"}};function u(t){if("string"!=typeof t.imageSrc||0===t.imageSrc.length)throw new TypeError("invalid image src.");return l({},Object(a.e)(t),{type:0,imageSrc:t.imageSrc,showLastValueTooltip:c(t.showLastValueTooltip),statusImageSrc:Object(r.m)(t.statusImageSrc,null),lastValue:Object(r.m)(t.lastValue,null)},Object(r.l)(t),Object(r.k)(t))}var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Show Last Value");var n=[{value:"default",text:Object(r.w)("Hide last value on boolean modules")},{value:"disabled",text:Object(r.w)("Disabled")},{value:"enabled",text:Object(r.w)("Enabled")}],i=document.createElement("select");i.required=!0;var a=this.currentData.showLastValueTooltip||this.initialData.showLastValueTooltip||"default";return n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,a==e.value&&(e.selected=!0),i.appendChild(e)}),i.addEventListener("change",function(e){t.updateData({showLastValueTooltip:c(e.target.value)})}),e.appendChild(i),e},e}(o.InputGroup),h=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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.addInputGroup(new a.b("image-console",l({},this.props,{imageKey:"imageSrc",showStatusImg:!0}))),e.addInputGroup(new a.c("link-console",this.props)),e.addInputGroup(new p("show-last-value",this.props)),e.addInputGroup(new a.a("agent-autocomplete",this.props)),e},e}(a.d),d=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)}}(),_=function(){return(_=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 m(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 _({},Object(a.e)(t),{type:5,image:t.image,imageSrc:t.imageSrc},Object(r.k)(t))}var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.addInputGroup(new a.c("link-console",this.props)),e.addInputGroup(new a.b("image-console",_({},this.props,{imageKey:"image"}))),e},e}(a.d),v=n(4),b=n(5),y=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)}}(),g=function(){return(g=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 E(t){if("string"!=typeof t.color||0===t.color.length)throw new TypeError("invalid color.");return g({},Object(a.e)(t),{type:20,color:t.color,defaultColor:t.defaultColor,colorRanges:t.colorRanges},Object(r.l)(t),Object(r.k)(t))}var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Default color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.defaultColor||this.initialData.defaultColor||"#000000"),n.addEventListener("change",function(e){t.updateData({defaultColor:e.target.value})}),e.appendChild(n),e},e}(o.InputGroup),w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.createContent=function(){var t=this,e=this.createLabel("Ranges"),n=document.createElement("div"),i=document.createElement("div");n.appendChild(i),e.appendChild(n);var r,a=this.currentData.colorRanges||this.initialData.colorRanges||[];return(r=function(e){i.innerHTML="",e.forEach(function(e,n){return i.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}),r(i)}}(n)))})})(a),n.appendChild(this.initialRangeContainer(function(e){var n=(t.currentData.colorRanges||t.initialData.colorRanges||[]).concat([e]);t.updateData({colorRanges:n}),r(n)})),e},e.prototype.initialRangeContainer=function(t){var e={color:"#ffffff"},n=g({},e),i=document.createElement("div"),a=document.createElement("div"),o=this.createLabel("From Value"),s=this.createInputNumber(null,function(t){n.fromValue=t});a.appendChild(o),a.appendChild(s),i.appendChild(a);var l=document.createElement("div"),c=this.createLabel("To Value"),u=this.createInputNumber(null,function(t){n.toValue=t});a.appendChild(c),a.appendChild(u),i.appendChild(l);var p=document.createElement("div"),h=this.createLabel("Color"),d=this.createInputColor(e.color,function(t){n.color=t});a.appendChild(h),a.appendChild(d),i.appendChild(p);var _=document.createElement("a");_.appendChild(Object(v.a)(b.e,Object(r.w)("Create color range")));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),s.value=""+(n.fromValue||""),u.value=""+(n.toValue||""),d.value=""+n.color}),i.appendChild(_),i},e.prototype.rangeContainer=function(t,e,n){var i=g({},t),a=document.createElement("div"),o=document.createElement("div"),s=this.createLabel("From Value"),l=this.createInputNumber(t.fromValue,function(t){i.fromValue=t,e(g({},i))});o.appendChild(s),o.appendChild(l),a.appendChild(o);var c=document.createElement("div"),u=this.createLabel("To Value"),p=this.createInputNumber(t.toValue,function(t){i.toValue=t,e(g({},i))});o.appendChild(u),o.appendChild(p),a.appendChild(c);var h=document.createElement("div"),d=this.createLabel("Color"),_=this.createInputColor(t.color,function(t){i.color=t,e(g({},i))});o.appendChild(d),o.appendChild(_),a.appendChild(h);var m=document.createElement("a");return m.appendChild(Object(v.a)(b.f,Object(r.w)("Delete color range"))),m.addEventListener("click",n),a.appendChild(m),a},e.prototype.createLabel=function(t){var e=document.createElement("label");return e.textContent=Object(r.w)(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}(o.InputGroup),O="http://www.w3.org/2000/svg",C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(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(O,"svg");e.setAttribute("viewBox","0 0 100 100");var n=document.createElementNS(O,"defs"),i=document.createElementNS(O,"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(O,"stop");r.setAttribute("offset","0%"),r.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0.9");var a=document.createElementNS(O,"stop");a.setAttribute("offset","100%"),a.setAttribute("style","stop-color:"+this.props.color+";stop-opacity:0");var o=document.createElementNS(O,"circle");return o.setAttribute("fill","url(#"+t+")"),o.setAttribute("cx","50%"),o.setAttribute("cy","50%"),o.setAttribute("r","50%"),i.append(r,a),n.append(i),e.append(n,o),e},e.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.addInputGroup(new a.a("agent-autocomplete",this.props)),e.addInputGroup(new a.c("link-console",this.props)),e.addInputGroup(new x("color-cloud",this.props)),e.addInputGroup(new w("ranges-cloud",this.props)),e},e}(a.d),D=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 I(t){if(("string"!=typeof t.imageSrc||0===t.imageSrc.length)&&null===t.encodedHtml)throw new TypeError("invalid image src.");if(null===Object(r.p)(t.groupId,null))throw new TypeError("invalid group Id.");var e=Object(r.n)(t.showStatistics),n=e?function(t){return Object(r.v)(t.html)?Object(r.v)(t.encodedHtml)?null:Object(r.e)(t.encodedHtml):t.html}(t):null;return M({},Object(a.e)(t),{type:11,groupId:parseInt(t.groupId),imageSrc:Object(r.m)(t.imageSrc,null),statusImageSrc:Object(r.m)(t.statusImageSrc,null),showStatistics:e,html:n},Object(r.k)(t))}var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return D(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Show statistics");var n=document.createElement("input");n.id="checkbox-switch",n.className="checkbox-switch",n.type="checkbox",n.name="checkbox-enable-link",n.value="1",n.checked=this.currentData.showStatistics||this.initialData.showStatistics||!1,n.addEventListener("change",function(e){return t.updateData({showStatistics:e.target.checked})});var i=document.createElement("label");return i.className="label-switch",i.htmlFor="checkbox-switch",e.appendChild(n),e.appendChild(i),e},e}(o.InputGroup),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return D(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.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.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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.addInputGroup(new a.c("link-console",this.props)),e.addInputGroup(new a.b("image-console",M({},this.props,{imageKey:"imageSrc",showStatusImg:!0}))),e.addInputGroup(new k("show-statistic",this.props)),e},e}(a.d),j=(n(14),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)}}()),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)},P=function(t){switch(t){case"analogic":case"digital":return t;default:return"analogic"}},L=function(t){switch(t){case"datetime":case"time":return t;default:return"datetime"}};function R(t){if("string"!=typeof t.clockTimezone||0===t.clockTimezone.length)throw new TypeError("invalid timezone.");return A({},Object(a.e)(t),{type:19,clockType:P(t.clockType),clockFormat:L(t.clockFormat),clockTimezone:t.clockTimezone,clockTimezoneOffset:Object(r.p)(t.clockTimezoneOffset,0),showClockTimezone:Object(r.n)(t.showClockTimezone),color:Object(r.m)(t.color,null)},Object(r.k)(t))}var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Clock animation");var n=[{value:"analogic",text:Object(r.w)("Simple analogic")},{value:"digital",text:Object(r.w)("Simple digital")}],i=document.createElement("select");return i.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.value=this.currentData.clockType||this.initialData.clockType||"analogic",i.addEventListener("change",function(e){t.updateData({clockType:P(e.target.value)})}),e.appendChild(i),e},e}(o.InputGroup),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Time format");var n=[{value:"time",text:Object(r.w)("Only time")},{value:"datetime",text:Object(r.w)("Time and date")}],i=document.createElement("select");return i.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.value=this.currentData.clockFormat||this.initialData.clockFormat||"time",i.addEventListener("change",function(e){t.updateData({clockFormat:L(e.target.value)})}),e.appendChild(i),e},e}(o.InputGroup),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Width");var n=document.createElement("input");return n.type="number",n.required=!0,n.value=""+(this.currentData.width||this.initialData.width),n.addEventListener("change",function(e){t.updateData({width:Object(r.p)(e.target.value,0)})}),e.appendChild(n),e},e}(o.InputGroup),G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.createContent=function(){var t=document.createElement("label");t.textContent=Object(r.w)("Time zone");var e=[{value:"Africa",text:Object(r.w)("Africa")},{value:"America",text:Object(r.w)("America")},{value:"Antarctica",text:Object(r.w)("Antarctica")},{value:"Arctic",text:Object(r.w)("Arctic")},{value:"Asia",text:Object(r.w)("Asia")},{value:"Atlantic",text:Object(r.w)("Atlantic")},{value:"Australia",text:Object(r.w)("Australia")},{value:"Europe",text:Object(r.w)("Europe")},{value:"Indian",text:Object(r.w)("Indian")},{value:"Pacific",text:Object(r.w)("Pacific")},{value:"UTC",text:Object(r.w)("UTC")}],n=document.createElement("select");n.required=!0,e.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,n.appendChild(e)});var i=(this.currentData.clockTimezone||this.initialData.clockTimezone||"Europe/Madrid").split("/"),a=i[0];i[1];return n.value=a,n.addEventListener("change",function(t){}),t.appendChild(n),t},e}(o.InputGroup),W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Fill color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.color||this.initialData.color),n.addEventListener("change",function(e){t.updateData({color:e.target.value})}),e.appendChild(n),e},e}(o.InputGroup),z=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 j(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.remove=function(){this.stopTick(),t.prototype.remove.call(this)},e.prototype.resizeElement=function(e,n){var i=this.getElementSize(e,n),r=i.width,a=i.height;t.prototype.resizeElement.call(this,r,a),"digital"===this.props.clockType&&(this.childElementRef.innerHTML=this.createClock().innerHTML)},e.prototype.createClock=function(){switch(this.props.clockType){case"analogic":return this.createAnalogicClock();case"digital":return this.createDigitalClock();default:throw new Error("invalid clock type.")}},e.prototype.createAnalogicClock=function(){var t="http://www.w3.org/2000/svg",e="#FFFFF0",n="#242124",i="#242124",a="#242124",o="#525252",s="#DC143C",l=this.getElementSize(),c=l.width,u=l.height,p=10*c/100,h=document.createElement("div");h.className="analogic-clock",h.style.width=c+"px",h.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 v=document.createElementNS(t,"text");v.setAttribute("text-anchor","middle"),v.setAttribute("font-size","8"),v.setAttribute("transform","translate(30 50) rotate(90)"),v.setAttribute("fill",i),v.textContent=f,_.append(v)}var b=document.createElementNS(t,"g");b.setAttribute("class","marks");var y=document.createElementNS(t,"g");y.setAttribute("class","mark"),y.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"),y.append(g,E),b.append(y);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 C=document.createElementNS(t,"line");C.setAttribute("class","hour-hand-a"),C.setAttribute("x1","0"),C.setAttribute("y1","0"),C.setAttribute("x2","30"),C.setAttribute("y2","0"),C.setAttribute("stroke",o),C.setAttribute("stroke-width","4"),C.setAttribute("stroke-linecap","round");var D=document.createElementNS(t,"line");D.setAttribute("class","hour-hand-b"),D.setAttribute("x1","0"),D.setAttribute("y1","0"),D.setAttribute("x2","29.9"),D.setAttribute("y2","0"),D.setAttribute("stroke",a),D.setAttribute("stroke-width","3.1"),D.setAttribute("stroke-linecap","round"),O.append(C,D);var M=document.createElementNS(t,"g");M.setAttribute("class","minute-hand"),M.setAttribute("transform","translate(50 50)");var I=document.createElementNS(t,"line");I.setAttribute("class","minute-hand-a"),I.setAttribute("x1","0"),I.setAttribute("y1","0"),I.setAttribute("x2","40"),I.setAttribute("y2","0"),I.setAttribute("stroke",o),I.setAttribute("stroke-width","2"),I.setAttribute("stroke-linecap","round");var k=document.createElementNS(t,"line");k.setAttribute("class","minute-hand-b"),k.setAttribute("x1","0"),k.setAttribute("y1","0"),k.setAttribute("x2","39.9"),k.setAttribute("y2","0"),k.setAttribute("stroke",a),k.setAttribute("stroke-width","1.5"),k.setAttribute("stroke-linecap","round");var T=document.createElementNS(t,"circle");T.setAttribute("r","3"),T.setAttribute("fill",a),M.append(I,k,T);var j=document.createElementNS(t,"g");j.setAttribute("class","second-hand"),j.setAttribute("transform","translate(50 50)");var A=document.createElementNS(t,"line");A.setAttribute("x1","0"),A.setAttribute("y1","0"),A.setAttribute("x2","46"),A.setAttribute("y2","0"),A.setAttribute("stroke",s),A.setAttribute("stroke-width","1"),A.setAttribute("stroke-linecap","round");var P=document.createElementNS(t,"circle");P.setAttribute("r","2"),P.setAttribute("fill",s),j.append(A,P);var L=document.createElementNS(t,"circle");L.setAttribute("cx","50"),L.setAttribute("cy","50"),L.setAttribute("r","0.3"),L.setAttribute("fill",a);var R=this.getOriginDate(),S=R.getSeconds(),N=R.getMinutes(),B=6*S,G=6*N+S/60*6,W=30*R.getHours()+N/60*30;if(O.setAttribute("transform","translate(50 50) rotate("+W+")"),M.setAttribute("transform","translate(50 50) rotate("+G+")"),j.setAttribute("transform","translate(50 50) rotate("+B+")"),d.append(_,b,O,M,j,L),d.setAttribute("transform","rotate(-90)"),h.innerHTML="\n <style>\n @keyframes rotate-hour {\n from {\n "+Object(r.s)("transform","translate(50px, 50px) rotate("+W+"deg)").join("\n")+"\n }\n to {\n "+Object(r.s)("transform","translate(50px, 50px) rotate("+(W+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-minute {\n from {\n "+Object(r.s)("transform","translate(50px, 50px) rotate("+G+"deg)").join("\n")+"\n }\n to {\n "+Object(r.s)("transform","translate(50px, 50px) rotate("+(G+360)+"deg)").join("\n")+"\n }\n }\n @keyframes rotate-second {\n from {\n "+Object(r.s)("transform","translate(50px, 50px) rotate("+B+"deg)").join("\n")+"\n }\n to {\n "+Object(r.s)("transform","translate(50px, 50px) rotate("+(B+360)+"deg)").join("\n")+"\n }\n }\n </style>\n ",h.append(d),"datetime"===this.props.clockFormat){var z=document.createElement("span");z.className="date",z.textContent=Object(r.h)(R,"default"),z.style.fontSize=p+"px",this.props.color&&(z.style.color=this.props.color),h.append(z)}return h},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,a=10*e/100,o=Math.min(20*n*e/100,e/100*10),s=this.getOriginDate();if("datetime"===this.props.clockFormat){var l=document.createElement("span");l.className="date",l.textContent=Object(r.h)(s,"default"),l.style.fontSize=a+"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.i)(s),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 p=document.createElement("span");p.className="timezone",p.textContent=u,p.style.fontSize=o+"px",this.props.color&&(p.style.color=this.props.color),t.append(p)}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;return t>0&&e>0?n=Math.min(t,e):t>0?n=t:e>0&&(n=e),{width:n,height:n};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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.removeInputGroup("size"),e.removeInputGroup("link"),e.removeInputGroup("parent"),e.removeInputGroup("acl-group"),e.addInputGroup(new S("ClockType",this.props)),e.addInputGroup(new N("clockFormat",this.props)),e.addInputGroup(new B("widthInput",this.props)),e.addInputGroup(new G("clockTimezone",this.props)),e.addInputGroup(new W("fillColor",this.props)),e},e.TICK_INTERVAL=1e3,e}(a.d),U=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 F(t){return K({},Object(a.e)(t),{type:12,label:null,isLinkEnabled:!1,parentId:null,aclGroupId:null,borderWidth:Object(r.p)(t.borderWidth,0),borderColor:Object(r.m)(t.borderColor,null),fillColor:Object(r.m)(t.fillColor,null)})}var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return U(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Border color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.borderColor||this.initialData.borderColor||"#000000"),n.addEventListener("change",function(e){t.updateData({borderColor:e.target.value})}),e.appendChild(n),e},e}(o.InputGroup),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return U(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Border Width");var n=document.createElement("input");return n.type="number",n.min="0",n.required=!0,n.value=""+(this.currentData.borderWidth||this.initialData.borderWidth||0),n.addEventListener("change",function(e){return t.updateData({borderWidth:Object(r.p)(e.target.value,0)})}),e.appendChild(n),e},e}(o.InputGroup),H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return U(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Fill color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.fillColor||this.initialData.fillColor||"#000000"),n.addEventListener("change",function(e){t.updateData({fillColor:e.target.value})}),e.appendChild(n),e},e}(o.InputGroup),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return U(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");if(t.className="box",t.style.boxSizing="border-box",this.props.fillColor&&(t.style.backgroundColor=this.props.fillColor),this.props.borderWidth>0){t.style.borderStyle="solid";var e=Math.min(this.props.width,this.props.height)/2,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.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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.addInputGroup(new q("border-color",this.props)),e.addInputGroup(new V("border-width",this.props)),e.addInputGroup(new H("fill-width",this.props)),e},e}(a.d),X=n(3),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)};function Q(t){var e=Z({},Object(a.e)(Z({},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.p)(t.startX,0),y:Object(r.p)(t.startY,0)},endPosition:{x:Object(r.p)(t.endX,0),y:Object(r.p)(t.endY,0)},lineWidth:Object(r.p)(t.lineWidth||t.borderWidth,1),color:Object(r.m)(t.borderColor||t.color,null)});return Z({},e,tt.extractBoxSizeAndPosition(e.startPosition,e.endPosition))}var $="http://www.w3.org/2000/svg",tt=function(t){function e(n,i){var a=t.call(this,Z({},n,e.extractBoxSizeAndPosition(n.startPosition,n.endPosition)),Z({},i,{editMode:!1}),!0)||this;return a.circleRadius=8,a.moveMode=!1,a.isMoving=!1,a.lineMovedEventManager=new X.a,a.lineMovedEventDisposables=[],a.debouncedStartPositionMovementSave=Object(r.d)(500,function(t,e){a.isMoving=!1;var n={x:t,y:e};a.lineMovedEventManager.emit({item:a,startPosition:n,endPosition:a.props.endPosition})}),a.removeStartPositionMovement=null,a.debouncedEndPositionMovementSave=Object(r.d)(500,function(t,e){a.isMoving=!1;var n={x:t,y:e};a.lineMovedEventManager.emit({item:a,endPosition:n,startPosition:a.props.startPosition})}),a.removeEndPositionMovement=null,a.moveMode=i.editMode,a.init(),a}return J(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=Z({},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=Z({},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,Z({},n,e.extractBoxSizeAndPosition(n.startPosition,n.endPosition)))},e.prototype.setMeta=function(e){this.moveMode=e.editMode,t.prototype.setMeta.call(this,Z({},e,{editMode:!1}))},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,a=e.height,o=e.lineWidth,s=e.startPosition,l=e.endPosition,c=e.color,u=s.x-n+o/2,p=s.y-i+o/2,h=l.x-n+o/2,d=l.y-i+o/2,_=document.createElementNS($,"svg");_.setAttribute("width",""+(r+o)),_.setAttribute("height",""+(a+o));var m=document.createElementNS($,"line");return m.setAttribute("x1",""+u),m.setAttribute("y1",""+p),m.setAttribute("x2",""+h),m.setAttribute("y2",""+d),m.setAttribute("stroke",c||"black"),m.setAttribute("stroke-width",""+o),_.append(m),t.append(_),t},e.prototype.updateDomElement=function(t){var e=this.props,n=e.x,i=e.y,r=e.width,a=e.height,o=e.lineWidth,s=e.startPosition,l=e.endPosition,c=e.color,u=s.x-n+o/2,p=s.y-i+o/2,h=l.x-n+o/2,d=l.y-i+o/2,_=t.getElementsByTagName("svg");if(_.length>0){var m=_.item(0);if(null!=m){m.setAttribute("width",""+(r+o)),m.setAttribute("height",""+(a+o));var f=m.getElementsByTagNameNS($,"line");if(f.length>0){var v=f.item(0);null!=v&&(v.setAttribute("x1",""+u),v.setAttribute("y1",""+p),v.setAttribute("x2",""+h),v.setAttribute("y2",""+d),v.setAttribute("stroke",c||"black"),v.setAttribute("stroke-width",""+o))}}}if(this.moveMode){var b=s.x-l.x<=0,y=s.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)(C=x.item(0))&&(g=C);var w=t.getElementsByClassName("visual-console-item-line-circle-end");if(w.length>0)(C=w.item(0))&&(E=C)}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="white",g.style.position="absolute",g.style.left=b?"-"+this.circleRadius+"px":r+o-this.circleRadius+"px",g.style.top=y?"-"+this.circleRadius+"px":a+o-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="black",E.style.position="absolute",E.style.left=b?r+o-8+"px":"-"+this.circleRadius+"px",E.style.top=y?a+o-this.circleRadius+"px":"-"+this.circleRadius+"px",this.isMoving||(t.appendChild(g),t.appendChild(E),this.initStartPositionMovementListener(g,this.elementRef.parentElement),this.initEndPositionMovementListener(E,this.elementRef.parentElement))}else if(!this.isMoving){this.stopStartPositionMovementListener();for(var O=t.getElementsByClassName("visual-console-item-line-circle");O.length>0;){var C;(C=O.item(0))&&C.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.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}(a.d),et=tt,nt=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)}}(),it=function(){return(it=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 rt(t){return it({},Object(a.e)(t),{type:4},Object(r.k)(t))}var at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nt(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.addInputGroup(new a.c("link-console",this.props)),e},e}(a.d),ot=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)}}(),st=function(){return(st=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)},lt=function(t){switch(t){case"string":case"image":return t;default:return"string"}},ct=function(t){switch(t){case"none":case"avg":case"max":case"min":return t;default:return"none"}},ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getPeriodSelector=function(){var t=document.createElement("label");t.textContent=Object(r.w)("Period");var n=300;e.currentData,e.initialData,"avg"!==e.currentData.processValue&&"max"!==e.currentData.processValue&&"min"!==e.currentData.processValue||null==e.currentData.period?"avg"!==e.initialData.processValue&&"max"!==e.initialData.processValue&&"min"!==e.initialData.processValue||null==e.initialData.period||(n=e.initialData.period):n=e.currentData.period;var i=Object(r.q)(n,{text:Object(r.w)("None"),value:0},[{text:Object(r.w)("5 minutes"),value:300},{text:Object(r.w)("30 minutes"),value:1800},{text:Object(r.w)("1 hours"),value:3600},{text:Object(r.w)("6 hours"),value:21600},{text:Object(r.w)("12 hours"),value:43200},{text:Object(r.w)("1 day"),value:86400},{text:Object(r.w)("1 week"),value:604800},{text:Object(r.w)("15 days"),value:1296e3},{text:Object(r.w)("1 month"),value:2592e3},{text:Object(r.w)("3 months"),value:7776e3},{text:Object(r.w)("6 months"),value:15552e3},{text:Object(r.w)("1 year"),value:31104e3},{text:Object(r.w)("2 years"),value:62208e3},{text:Object(r.w)("3 years"),value:93312e3}],function(t){return e.updateData({period:t})});return t.appendChild(i),t},e}return ot(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label"),n=document.createElement("div");e.textContent=Object(r.w)("Process");var i=[{value:"none",text:Object(r.w)("None")},{value:"avg",text:Object(r.w)("Avg Value")},{value:"max",text:Object(r.w)("Max Value")},{value:"min",text:Object(r.w)("Min Value")}],a=document.createElement("select");a.required=!0,i.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,a.appendChild(e)});var o=this.currentData.processValue||this.initialData.processValue||"none";switch(a.value=o,o){case"avg":case"max":case"min":n.appendChild(this.getPeriodSelector())}return a.addEventListener("change",function(e){var i=e.target.value;switch(n.childNodes.forEach(function(t){return t.remove()}),i){case"avg":case"max":case"min":n.appendChild(t.getPeriodSelector()),t.updateData({processValue:i});break;case"none":default:t.updateData({processValue:"none"})}}),e.appendChild(a),e.appendChild(n),e},e}(o.InputGroup);function pt(t){if("string"!=typeof t.value||0===t.value.length)throw new TypeError("invalid value");var e=ct(t.processValue);return st({},Object(a.e)(t),{type:2,valueType:lt(t.valueType),value:t.value},"none"===e?{processValue:e}:{processValue:e,period:Object(r.p)(t.period,0)},Object(r.l)(t),Object(r.k)(t))}var ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ot(e,t),e.prototype.createDomElement=function(){var t=document.createElement("div");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.t)([{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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.addInputGroup(new a.c("link-console",this.props)),e.addInputGroup(new ut("process-operation",this.props)),e.addInputGroup(new a.a("agent-autocomplete",this.props)),e},e}(a.d),dt=n(6),_t=Math.PI,mt=2*_t,ft=mt-1e-6;function vt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function bt(){return new vt}vt.prototype=bt.prototype={constructor:vt,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,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+a)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var a=this._x1,o=this._y1,s=n-t,l=i-e,c=a-t,u=o-e,p=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(p>1e-6)if(Math.abs(u*s-l*c)>1e-6&&r){var h=n-a,d=i-o,_=s*s+l*l,m=h*h+d*d,f=Math.sqrt(_),v=Math.sqrt(p),b=r*Math.tan((_t-Math.acos((_+p-m)/(2*f*v)))/2),y=b/v,g=b/f;Math.abs(y-1)>1e-6&&(this._+="L"+(t+y*c)+","+(e+y*u)),this._+="A"+r+","+r+",0,0,"+ +(u*h>c*d)+","+(this._x1=t+g*s)+","+(this._y1=e+g*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,a){t=+t,e=+e;var o=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=t+o,c=e+s,u=1^a,p=a?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&&(p<0&&(p=p%mt+mt),p>ft?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):p>1e-6&&(this._+="A"+n+","+n+",0,"+ +(p>=_t)+","+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 yt=bt,gt=function(t){return function(){return t}},Et=Math.abs,xt=Math.atan2,wt=Math.cos,Ot=Math.max,Ct=Math.min,Dt=Math.sin,Mt=Math.sqrt,It=1e-12,kt=Math.PI,Tt=kt/2,jt=2*kt;function At(t){return t>=1?Tt:t<=-1?-Tt:Math.asin(t)}function Pt(t){return t.innerRadius}function Lt(t){return t.outerRadius}function Rt(t){return t.startAngle}function St(t){return t.endAngle}function Nt(t){return t&&t.padAngle}function Bt(t,e,n,i,r,a,o){var s=t-n,l=e-i,c=(o?a:-a)/Mt(s*s+l*l),u=c*l,p=-c*s,h=t+u,d=e+p,_=n+u,m=i+p,f=(h+_)/2,v=(d+m)/2,b=_-h,y=m-d,g=b*b+y*y,E=r-a,x=h*m-_*d,w=(y<0?-1:1)*Mt(Ot(0,E*E*g-x*x)),O=(x*y-b*w)/g,C=(-x*b-y*w)/g,D=(x*y+b*w)/g,M=(-x*b+y*w)/g,I=O-f,k=C-v,T=D-f,j=M-v;return I*I+k*k>T*T+j*j&&(O=D,C=M),{cx:O,cy:C,x01:-u,y01:-p,x11:O*(r/E-1),y11:C*(r/E-1)}}var Gt=function(){var t=Pt,e=Lt,n=gt(0),i=null,r=Rt,a=St,o=Nt,s=null;function l(){var l,c,u,p=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-Tt,_=a.apply(this,arguments)-Tt,m=Et(_-d),f=_>d;if(s||(s=l=yt()),h<p&&(c=h,h=p,p=c),h>It)if(m>jt-It)s.moveTo(h*wt(d),h*Dt(d)),s.arc(0,0,h,d,_,!f),p>It&&(s.moveTo(p*wt(_),p*Dt(_)),s.arc(0,0,p,_,d,f));else{var v,b,y=d,g=_,E=d,x=_,w=m,O=m,C=o.apply(this,arguments)/2,D=C>It&&(i?+i.apply(this,arguments):Mt(p*p+h*h)),M=Ct(Et(h-p)/2,+n.apply(this,arguments)),I=M,k=M;if(D>It){var T=At(D/p*Dt(C)),j=At(D/h*Dt(C));(w-=2*T)>It?(E+=T*=f?1:-1,x-=T):(w=0,E=x=(d+_)/2),(O-=2*j)>It?(y+=j*=f?1:-1,g-=j):(O=0,y=g=(d+_)/2)}var A=h*wt(y),P=h*Dt(y),L=p*wt(x),R=p*Dt(x);if(M>It){var S,N=h*wt(g),B=h*Dt(g),G=p*wt(E),W=p*Dt(E);if(m<kt&&(S=function(t,e,n,i,r,a,o,s){var l=n-t,c=i-e,u=o-r,p=s-a,h=p*l-u*c;if(!(h*h<It))return[t+(h=(u*(e-a)-p*(t-r))/h)*l,e+h*c]}(A,P,G,W,N,B,L,R))){var z=A-S[0],U=P-S[1],K=N-S[0],F=B-S[1],q=1/Dt(((u=(z*K+U*F)/(Mt(z*z+U*U)*Mt(K*K+F*F)))>1?0:u<-1?kt:Math.acos(u))/2),V=Mt(S[0]*S[0]+S[1]*S[1]);I=Ct(M,(p-V)/(q-1)),k=Ct(M,(h-V)/(q+1))}}O>It?k>It?(v=Bt(G,W,A,P,h,k,f),b=Bt(N,B,L,R,h,k,f),s.moveTo(v.cx+v.x01,v.cy+v.y01),k<M?s.arc(v.cx,v.cy,k,xt(v.y01,v.x01),xt(b.y01,b.x01),!f):(s.arc(v.cx,v.cy,k,xt(v.y01,v.x01),xt(v.y11,v.x11),!f),s.arc(0,0,h,xt(v.cy+v.y11,v.cx+v.x11),xt(b.cy+b.y11,b.cx+b.x11),!f),s.arc(b.cx,b.cy,k,xt(b.y11,b.x11),xt(b.y01,b.x01),!f))):(s.moveTo(A,P),s.arc(0,0,h,y,g,!f)):s.moveTo(A,P),p>It&&w>It?I>It?(v=Bt(L,R,N,B,p,-I,f),b=Bt(A,P,G,W,p,-I,f),s.lineTo(v.cx+v.x01,v.cy+v.y01),I<M?s.arc(v.cx,v.cy,I,xt(v.y01,v.x01),xt(b.y01,b.x01),!f):(s.arc(v.cx,v.cy,I,xt(v.y01,v.x01),xt(v.y11,v.x11),!f),s.arc(0,0,p,xt(v.cy+v.y11,v.cx+v.x11),xt(b.cy+b.y11,b.cx+b.x11),f),s.arc(b.cx,b.cy,I,xt(b.y11,b.x11),xt(b.y01,b.x01),!f))):s.arc(0,0,p,x,E,f):s.lineTo(L,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-kt/2;return[wt(i)*n,Dt(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:gt(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:gt(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:gt(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:gt(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:gt(+t),l):r},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:gt(+t),l):a},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:gt(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l};function Wt(t){this._context=t}Wt.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 zt=function(t){return new Wt(t)};Kt(zt);function Ut(t){this._curve=t}function Kt(t){function e(e){return new Ut(t(e))}return e._curve=t,e}Ut.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 Ft=Math.sin(kt/10)/Math.sin(7*kt/10),qt=(Math.sin(jt/10),Math.cos(jt/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12),function(){});function Vt(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 Ht(t){this._context=t}Ht.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:Vt(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:Vt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Yt(t){this._context=t}Yt.prototype={areaStart:qt,areaEnd:qt,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:Vt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Xt(t){this._context=t}Xt.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:Vt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Jt(t,e){this._basis=new Ht(t),this._beta=e}Jt.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],a=e[0],o=t[n]-r,s=e[n]-a,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*o),this._beta*e[l]+(1-this._beta)*(a+i*s));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 Ht(t):new Jt(t,e)}return n.beta=function(e){return t(+e)},n})(.85);function Zt(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 Qt(t,e){this._context=t,this._k=(1-e)/6}Qt.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:Zt(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:Zt(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 Qt(t,e)}return n.tension=function(e){return t(+e)},n})(0);function $t(t,e){this._context=t,this._k=(1-e)/6}$t.prototype={areaStart:qt,areaEnd:qt,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:Zt(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 $t(t,e)}return n.tension=function(e){return t(+e)},n})(0);function te(t,e){this._context=t,this._k=(1-e)/6}te.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:Zt(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 te(t,e)}return n.tension=function(e){return t(+e)},n})(0);function ee(t,e,n){var i=t._x1,r=t._y1,a=t._x2,o=t._y2;if(t._l01_a>It){var s=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*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>It){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);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,a,o,t._x2,t._y2)}function ne(t,e){this._context=t,this._alpha=e}ne.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:ee(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 ne(t,e):new Qt(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function ie(t,e){this._context=t,this._alpha=e}ie.prototype={areaStart:qt,areaEnd:qt,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:ee(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 ie(t,e):new $t(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function re(t,e){this._context=t,this._alpha=e}re.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:ee(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 re(t,e):new te(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function ae(t){this._context=t}ae.prototype={areaStart:qt,areaEnd:qt,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 oe(t){return t<0?-1:1}function se(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),s=(a*r+o*i)/(i+r);return(oe(a)+oe(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function le(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ce(t,e,n){var i=t._x0,r=t._y0,a=t._x1,o=t._y1,s=(a-i)/3;t._context.bezierCurveTo(i+s,r+s*e,a-s,o-s*n,a,o)}function ue(t){this._context=t}function pe(t){this._context=new he(t)}function he(t){this._context=t}function de(t){this._context=t}function _e(t){var e,n,i=t.length-1,r=new Array(i),a=new Array(i),o=new Array(i);for(r[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,a[i-1]=7,o[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(r[i-1]=o[i-1]/a[i-1],e=i-2;e>=0;--e)r[e]=(o[e]-r[e+1])/a[e];for(a[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)a[e]=2*t[e+1]-r[e+1];return[r,a]}ue.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:ce(this,this._t0,le(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,ce(this,le(this,n=se(this,t,e)),n);break;default:ce(this,this._t0,n=se(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(pe.prototype=Object.create(ue.prototype)).point=function(t,e){ue.prototype.point.call(this,e,t)},he.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,a){this._context.bezierCurveTo(e,t,i,n,a,r)}},de.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=_e(t),r=_e(e),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(i[0][a],r[0][a],i[1][a],r[1][a],t[o],e[o]);(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 me(t,e){this._context=t,this._t=e}me.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 fe=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)}}(),ve=function(){return(ve=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 be(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 ye(t){switch(t){case"percent":case"value":return t;default:return"percent"}}function ge(t){return ve({},Object(a.e)(t),{type:3,percentileType:be(t.percentileType||t.type),valueType:ye(t.valueType),minValue:Object(r.p)(t.minValue,null),maxValue:Object(r.p)(t.maxValue,null),color:Object(r.m)(t.color,null),labelColor:Object(r.m)(t.labelColor,null),value:Object(r.o)(t.value,null),unit:Object(r.m)(t.unit,null)},Object(r.l)(t),Object(r.k)(t))}var Ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Diameter");var n=document.createElement("input");return n.type="number",n.required=!0,n.value=""+(this.currentData.width||this.initialData.width),n.addEventListener("change",function(e){t.updateData({width:Object(r.p)(e.target.value,0)})}),e.appendChild(n),e},e}(o.InputGroup),xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Min Value");var n=document.createElement("input");return n.type="number",n.required=!0,n.value=""+(this.currentData.minValue||this.initialData.minValue||0),n.addEventListener("change",function(e){t.updateData({minValue:Object(r.p)(e.target.value,0)})}),e.appendChild(n),e},e}(o.InputGroup),we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Max Value");var n=document.createElement("input");return n.type="number",n.required=!0,n.value=""+(this.currentData.maxValue||this.initialData.maxValue||0),n.addEventListener("change",function(e){t.updateData({maxValue:Object(r.p)(e.target.value,0)})}),e.appendChild(n),e},e}(o.InputGroup),Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Type");var n=[{value:"progress-bar",text:Object(r.w)("Percentile")},{value:"bubble",text:Object(r.w)("Bubble")},{value:"circular-progress-bar",text:Object(r.w)("Circular porgress bar")},{value:"circular-progress-bar-alt",text:Object(r.w)("Circular progress bar (interior)")}],i=document.createElement("select");return i.required=!0,n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.value=this.currentData.percentileType||this.initialData.percentileType||"progress-bar",i.addEventListener("change",function(e){t.updateData({percentileType:be(e.target.value)})}),e.appendChild(i),e},e}(o.InputGroup),Ce=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Value to show");var n=[{value:"percent",text:Object(r.w)("Percent")},{value:"value",text:Object(r.w)("Value")}],i=document.createElement("select");return i.required=!0,i.value=this.currentData.valueType||this.initialData.valueType||"percent",n.forEach(function(t){var e=document.createElement("option");e.value=t.value,e.textContent=t.text,i.appendChild(e)}),i.addEventListener("change",function(e){t.updateData({valueType:ye(e.target.value)})}),e.appendChild(i),e},e}(o.InputGroup),De=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Element color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.color||this.initialData.color),n.addEventListener("change",function(e){t.updateData({color:e.target.value})}),e.appendChild(n),e},e}(o.InputGroup),Me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Value color");var n=document.createElement("input");return n.type="color",n.required=!0,n.value=""+(this.currentData.labelColor||this.initialData.labelColor),n.addEventListener("change",function(e){t.updateData({labelColor:e.target.value})}),e.appendChild(n),e},e}(o.InputGroup),Ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.createContent=function(){var t=this,e=document.createElement("label");e.textContent=Object(r.w)("Label");var n=document.createElement("input");return n.type="text",n.required=!0,n.value=(this.currentData.label||this.initialData.label||"")+" ",n.addEventListener("change",function(e){t.updateData({label:e.target.value})}),e.appendChild(n),e},e}(o.InputGroup),ke="http://www.w3.org/2000/svg",Te=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(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"),r=document.createElementNS(ke,"svg");switch(null!=this.props.value&&(t=Intl?Intl.NumberFormat("en-EN").format(this.props.value):this.props.value),this.props.percentileType){case"progress-bar":var a=document.createElementNS(ke,"rect");a.setAttribute("fill",e.background),a.setAttribute("fill-opacity","0.5"),a.setAttribute("width","100"),a.setAttribute("height","20"),a.setAttribute("rx","5"),a.setAttribute("ry","5");var o=document.createElementNS(ke,"rect");o.setAttribute("fill",e.progress),o.setAttribute("fill-opacity","1"),o.setAttribute("width",""+n),o.setAttribute("height","20"),o.setAttribute("rx","5"),o.setAttribute("ry","5"),(p=document.createElementNS(ke,"text")).setAttribute("text-anchor","middle"),p.setAttribute("alignment-baseline","middle"),p.setAttribute("font-size","12"),p.setAttribute("font-family","arial"),p.setAttribute("font-weight","bold"),p.setAttribute("transform","translate(50 11)"),p.setAttribute("fill",e.text),"value"===this.props.valueType?(p.style.fontSize="6pt",p.textContent=this.props.unit?t+" "+this.props.unit:""+t):p.textContent=n+"%",r.setAttribute("viewBox","0 0 100 20"),r.append(a,o,p);break;case"bubble":case"circular-progress-bar":case"circular-progress-bar-alt":if(r.setAttribute("viewBox","0 0 100 100"),"bubble"===this.props.percentileType){(s=document.createElementNS(ke,"circle")).setAttribute("transform","translate(50 50)"),s.setAttribute("fill",e.background),s.setAttribute("fill-opacity","0.5"),s.setAttribute("r","50"),(l=document.createElementNS(ke,"circle")).setAttribute("transform","translate(50 50)"),l.setAttribute("fill",e.progress),l.setAttribute("fill-opacity","1"),l.setAttribute("r",""+n/2),r.append(s,l)}else{var s,l,c={innerRadius:"circular-progress-bar"===this.props.percentileType?30:0,outerRadius:50,startAngle:0,endAngle:2*Math.PI},u=Gt();(s=document.createElementNS(ke,"path")).setAttribute("transform","translate(50 50)"),s.setAttribute("fill",e.background),s.setAttribute("fill-opacity","0.5"),s.setAttribute("d",""+u(c)),(l=document.createElementNS(ke,"path")).setAttribute("transform","translate(50 50)"),l.setAttribute("fill",e.progress),l.setAttribute("fill-opacity","1"),l.setAttribute("d",""+u(ve({},c,{endAngle:c.endAngle*(n/100)}))),r.append(s,l)}var p;if((p=document.createElementNS(ke,"text")).setAttribute("text-anchor","middle"),p.setAttribute("alignment-baseline","middle"),p.setAttribute("font-size","16"),p.setAttribute("font-family","arial"),p.setAttribute("font-weight","bold"),p.setAttribute("fill",e.text),"value"===this.props.valueType&&null!=this.props.value)if(this.props.unit&&this.props.unit.length>0){var h=document.createElementNS(ke,"tspan");h.setAttribute("x","0"),h.setAttribute("dy","1em"),h.textContent=""+t,h.style.fontSize="8pt";var d=document.createElementNS(ke,"tspan");d.setAttribute("x","0"),d.setAttribute("dy","1em"),d.textContent=""+this.props.unit,d.style.fontSize="8pt",p.append(h,d),p.setAttribute("transform","translate(50 33)")}else p.textContent=""+t,p.style.fontSize="8pt",p.setAttribute("transform","translate(50 50)");else p.textContent=n+"%",p.setAttribute("transform","translate(50 50)");r.append(p)}return i.append(r),i},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.prototype.getFormContainer=function(){var e=t.prototype.getFormContainer.call(this);return e.removeInputGroup("size"),e.addInputGroup(new Ee("diameter",this.props)),e.addInputGroup(new xe("min-value",this.props)),e.addInputGroup(new we("max-value",this.props)),e.addInputGroup(new Oe("type",this.props)),e.addInputGroup(new Ce("value-to-show",this.props)),e.addInputGroup(new De("element-color",this.props)),e.addInputGroup(new Me("value-color",this.props)),e.addInputGroup(new Ie("label-percentile",this.props)),e.addInputGroup(new a.c("link-console",this.props)),e},e}(a.d),je=n(7),Ae=n(8),Pe=n(9),Le=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)}}(),Re=function(){return(Re=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 Se(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.v)(t.encodedTitle))throw new TypeError("missing encode tittle content.");if(null===Object(r.p)(t.serviceId,null))throw new TypeError("invalid service id.");return Re({},Object(a.e)(t),{type:10,serviceId:t.serviceId,imageSrc:Object(r.m)(t.imageSrc,null),statusImageSrc:Object(r.m)(t.statusImageSrc,null),encodedTitle:Object(r.m)(t.encodedTitle,null)})}var Ne,Be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Le(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.e)(this.props.encodedTitle)),t},e}(a.d),Ge=function(){return(Ge=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 We(t){var e=Object(r.p)(t.type,null);if(null==e)throw new TypeError("missing item type.");switch(e){case 0:return u(t);case 1:return Object(Pe.b)(t);case 2:case 6:case 7:case 8:return pt(t);case 3:case 9:case 15:case 16:return ge(t);case 4:return rt(t);case 5:return m(t);case 10:return Se(t);case 11:return I(t);case 12:return F(t);case 13:return Q(t);case 14:return Object(dt.b)(t);case 17:return Object(je.b)(t);case 18:return Object(Ae.a)(t);case 19:return R(t);case 20:return E(t);default:throw new TypeError("decoder not found")}}var ze=function(){function t(t,e,n){var i=this;this.elementsById={},this.elementIds=[],this.relations={},this.clickEventManager=new X.a,this.dblClickEventManager=new X.a,this.movedEventManager=new X.a,this.lineMovedEventManager=new X.a,this.resizedEventManager=new X.a,this.selectionChangedEventManager=new X.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=Ge({},n.line.props,{startPosition:i.getVisualCenter(t.newPosition,t.item)}):n.childId===e&&(n.line.props=Ge({},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,a=i.getItemRelations(r),o={x:n.x,y:n.y};a.forEach(function(t){t.parentId===r?t.line.props=Ge({},t.line.props,{startPosition:i.getVisualCenter(o,e)}):t.childId===r&&(t.line.props=Ge({},t.line.props,{endPosition:i.getVisualCenter(o,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,a=t.backgroundURL,o=t.backgroundColor,s=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 Ge({id:parseInt(e),name:n,groupId:parseInt(i),backgroundURL:Object(r.m)(a,null),backgroundColor:Object(r.m)(o,null),isFavorite:Object(r.n)(s),relationLineWidth:Object(r.p)(l,0)},Object(r.u)(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.p)(t.type,null);if(null==e)throw new TypeError("missing item type.");var n=Object(r.j)(t);switch(e){case 0:return new h(u(t),n);case 1:return new Pe.a(Object(Pe.b)(t),n);case 2:case 6:case 7:case 8:return new ht(pt(t),n);case 3:case 9:case 15:case 16:return new Te(ge(t),n);case 4:return new at(rt(t),n);case 5:return new f(m(t),n);case 10:return new Be(Se(t),n);case 11:return new T(I(t),n);case 12:return new Y(F(t),n);case 13:return new et(Q(t),n);case 14:return new dt.a(Object(dt.b)(t),n);case 17:return new je.a(Object(je.b)(t),n);case 18:return new Ae.b(Object(Ae.a)(t),n);case 19:return new z(R(t),n);case 20:return new C(E(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 instanceof et?n.onLineMovementFinished(e.handleLineElementMovementFinished):(n.onClick(e.handleElementClick),n.onDblClick(e.handleElementDblClick),n.onMoved(e.handleElementMovement),n.onMovementFinished(e.handleElementMovementFinished),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=We(t)}catch(t){console.log("Error updating an element:",t.message)}}),this.buildRelations()},t.prototype.updateElement=function(t){try{this.elementsById[t.id].props=We(t)}catch(t){console.log("Error updating element:",t.message)}this.buildRelations()},Object.defineProperty(t.prototype,"props",{get:function(){return Ge({},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=Ge({},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]),a=Number.parseInt(i[1]);t!==r&&t!==a||e.push({parentId:r,childId:a,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),a=i.x,o=i.y,s=this.getVisualCenter(e.props,e),l=s.x,c=s.y,u=new et(Q({id:0,type:13,startX:a,startY:o,endX:l,endY:c,width:0,height:0,lineWidth:this.props.relationLineWidth,color:"#CCCCCC"}),Object(r.j)({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=Ge({},t.meta,{editMode:!0})}),this.containerRef.classList.add("is-editing")},t.prototype.disableEditMode=function(){this.elements.forEach(function(t){t.meta=Ge({},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].meta=Ge({},i,{isSelected:!1}):e!==t||i.isSelected||(n.elementsById[e].meta=Ge({},i,{isSelected:!0}))}):this.elementsById[t]&&(this.elementsById[t].meta=Ge({},this.elementsById[t].meta,{isSelected:!0}))},t.prototype.unselectItem=function(t){if(this.elementsById[t]){var e=this.elementsById[t].meta;e.isSelected&&(this.elementsById[t].meta=Ge({},e,{isSelected:!1}))}},t.prototype.unselectItems=function(){var t=this;this.elementIds.forEach(function(e){if(t.elementsById[e]){var n=t.elementsById[e].meta;n.isSelected&&(t.elementsById[e].meta=Ge({},n,{isSelected:!1}))}})},t.itemDescriptiveName=function(t){var e;switch(t.props.type){case 0:e=Object(r.w)("Static graph")+" - "+t.props.imageSrc;break;case 1:e=Object(r.w)("Module graph");break;case 19:e=Object(r.w)("Clock");break;case 18:e=Object(r.w)("Bars graph");break;case 14:e=Object(r.w)("Auto SLA Graph");break;case 3:e=Object(r.w)("Percentile bar");break;case 15:e=Object(r.w)("Circular progress bar");break;case 16:e=Object(r.w)("Circular progress bar (interior)");break;case 2:e=Object(r.w)("Simple Value");break;case 4:e=Object(r.w)("Label");break;case 11:e=Object(r.w)("Group");break;case 20:e=Object(r.w)("Color cloud");break;case 5:e=Object(r.w)("Icon")+" - "+t.props.imageSrc;break;default:e=Object(r.w)("Item")}var n=t.props;return null!=n.agentAlias&&null!=n.moduleName?e+=" ("+Object(r.f)(n.agentAlias,18)+" - "+Object(r.f)(n.moduleName,25)+")":null!=n.agentAlias&&(e+=" ("+Object(r.f)(n.agentAlias,25)+")"),e},t.items=((Ne={})[0]=h,Ne[1]=Pe.a,Ne[2]=ht,Ne[6]=ht,Ne[7]=ht,Ne[8]=ht,Ne[3]=Te,Ne[9]=Te,Ne[15]=Te,Ne[16]=Te,Ne[4]=at,Ne[5]=f,Ne[10]=Be,Ne[11]=T,Ne[12]=Y,Ne[13]=et,Ne[14]=dt.a,Ne[17]=je.a,Ne[18]=Ae.b,Ne[19]=z,Ne[20]=C,Ne),t}(),Ue=function(){function t(t){this.cancellable={cancel:function(){}},this._status="waiting",this.statusChangeEventManager=new X.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 Ke=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 Ue(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 Ue(e),n):new Ue(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=ze,window.VisualConsole.Form=o,window.AsyncTaskManager=Ke}]);
//# sourceMappingURL=vc.main.min.js.map