You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
64 KiB
JavaScript
16 lines
64 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/coercion"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-flowchart",["exports","@angular/core","rxjs","rxjs/operators","@angular/cdk/coercion","@angular/common"],t):t((e=e||self)["ngx-flowchart"]={},e.ng.core,e.rxjs,e.rxjs.operators,e.ng.cdk.coercion,e.ng.common)}(this,(function(e,t,n,o,i,r){"use strict";
|
|
/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function d(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function l(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function g(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}var p=new t.InjectionToken("fc-node.component.config"),h={htmlPrefix:"fc",leftConnectorType:"leftConnector",rightConnectorType:"rightConnector",curvedStyle:"curved",lineStyle:"line",dragAnimationRepaint:"repaint",dragAnimationShadow:"shadow",canvasClass:"fc-canvas",selectedClass:"fc-selected",editClass:"fc-edit",activeClass:"fc-active",hoverClass:"fc-hover",draggingClass:"fc-dragging",edgeClass:"fc-edge",edgeLabelClass:"fc-edge-label",connectorClass:"fc-connector",magnetClass:"fc-magnet",nodeClass:"fc-node",nodeOverlayClass:"fc-node-overlay",leftConnectorClass:"fc-leftConnectors",rightConnectorClass:"fc-rightConnectors",canvasResizeThreshold:200,canvasResizeStep:200},u=function(){Error.apply(this,arguments)};Object.defineProperty(u,"prototype",new Error);var f=function(e){function t(t){var n=e.call(this)||this;return n.message=t,n}return d(t,e),t}(u);function v(e){var t,n,o,i,r={};e.nodes.forEach((function(e){r[e.id]={incoming:0,outgoing:[]}})),e.edges.forEach((function(t){var n=e.nodes.filter((function(e){return e.connectors.some((function(e){return e.id===t.source}))}))[0],o=e.nodes.filter((function(e){return e.connectors.some((function(e){return e.id===t.destination}))}))[0];r[n.id].outgoing.push(o.id),r[o.id].incoming++}));var s=[],d=[];try{for(var a=g(Object.keys(r)),l=a.next();!l.done;l=a.next()){var c=l.value;0===r[c].incoming&&d.push(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}for(;0!==d.length;){for(var p=d.pop(),h=0;h<r[p].outgoing.length;h++){var u=r[p].outgoing[h];r[u].incoming--,0===r[u].incoming&&d.push(u),r[p].outgoing.splice(h,1),h--}s.push(p)}var f=!1;try{for(var v=g(Object.keys(r)),m=v.next();!m.done;m=v.next()){c=m.value;0!==r[c].incoming&&(f=!0)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return f?null:s}var m=function(){function e(e,t,i,r,s,d,l,c,g,p,h,u){var f=this;this.connectorsRectInfos={},this.nodesHtmlElements={},this.canvasHtmlElement=null,this.dragImage=null,this.svgHtmlElement=null,this.debouncer=new n.Subject,this.modelValidation=e,this.model=t,this.modelChanged=i,this.detectChangesSubject=r,this.canvasHtmlElement=h,this.svgHtmlElement=u,this.modelValidation.validateModel(this.model),this.selectedObjects=s,this.dropNode=d||function(){},this.createEdge=l||function(e,t){return n.of(a(a({},t),{label:"label"}))},this.edgeAddedCallback=c||function(){},this.nodeRemovedCallback=g||function(){},this.edgeRemovedCallback=p||function(){},this.connectors=new b(this),this.nodes=new C(this),this.edges=new S(this),this.debouncer.pipe(o.debounceTime(100)).subscribe((function(){return f.modelChanged.emit()}))}return e.prototype.notifyModelChanged=function(){this.debouncer.next()},e.prototype.detectChanges=function(){var e=this;setTimeout((function(){e.detectChangesSubject.next()}),0)},e.prototype.selectObject=function(e){this.isEditable()&&-1===this.selectedObjects.indexOf(e)&&this.selectedObjects.push(e)},e.prototype.deselectObject=function(e){if(this.isEditable()){var t=this.selectedObjects.indexOf(e);if(-1===t)throw new Error("Tried to deselect an unselected object");this.selectedObjects.splice(t,1)}},e.prototype.toggleSelectedObject=function(e){this.isSelectedObject(e)?this.deselectObject(e):this.selectObject(e)},e.prototype.isSelectedObject=function(e){return-1!==this.selectedObjects.indexOf(e)},e.prototype.selectAll=function(){var e=this;this.model.nodes.forEach((function(t){t.readonly||e.nodes.select(t)})),this.model.edges.forEach((function(t){e.edges.select(t)})),this.detectChanges()},e.prototype.deselectAll=function(){this.selectedObjects.splice(0,this.selectedObjects.length),this.detectChanges()},e.prototype.isEditObject=function(e){return 1===this.selectedObjects.length&&-1!==this.selectedObjects.indexOf(e)},e.prototype.inRectBox=function(e,t,n){return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom},e.prototype.getItemInfoAtPoint=function(e,t){return{node:this.getNodeAtPoint(e,t),edge:this.getEdgeAtPoint(e,t)}},e.prototype.getNodeAtPoint=function(e,t){var n,o;try{for(var i=g(this.model.nodes),r=i.next();!r.done;r=i.next()){var s=r.value,d=this.nodes.getHtmlElement(s.id).getBoundingClientRect();if(e>=d.left&&e<=d.right&&t>=d.top&&t<=d.bottom)return s}}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return null},e.prototype.getEdgeAtPoint=function(e,t){var n=document.elementFromPoint(e,t).id,o=-1;return n&&(n.startsWith("fc-edge-path-")?o=Number(n.substring("fc-edge-path-".length)):n.startsWith("fc-edge-label-")&&(o=Number(n.substring("fc-edge-label-".length)))),o>-1?this.model.edges[o]:null},e.prototype.selectAllInRect=function(e){var t=this;this.model.nodes.forEach((function(n){var o=t.nodes.getHtmlElement(n.id).getBoundingClientRect();if(!n.readonly){var i=o.left+o.width/2,r=o.top+o.height/2;t.inRectBox(i,r,e)?t.nodes.select(n):t.nodes.isSelected(n)&&t.nodes.deselect(n)}}));var n=this.canvasHtmlElement.getBoundingClientRect();this.model.edges.forEach((function(o){var i=t.edges.sourceCoord(o),r=t.edges.destCoord(o),s=(i.x+r.x)/2+n.left,d=(i.y+r.y)/2+n.top;t.inRectBox(s,d,e)?t.edges.select(o):t.edges.isSelected(o)&&t.edges.deselect(o)}))},e.prototype.deleteSelected=function(){var e=this;this.edges.getSelectedEdges().forEach((function(t){e.edges.delete(t)})),this.nodes.getSelectedNodes().forEach((function(t){e.nodes.delete(t)}))},e.prototype.isEditable=function(){return void 0===this.dropTargetId},e.prototype.isDropSource=function(){return void 0!==this.dropTargetId},e.prototype.getDragImage=function(){return this.dragImage||(this.dragImage=new Image,this.dragImage.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",this.dragImage.style.visibility="hidden"),this.dragImage},e}(),y=function(){function e(e){this.modelService=e}return e.prototype.select=function(e){this.modelService.selectObject(e)},e.prototype.deselect=function(e){this.modelService.deselectObject(e)},e.prototype.toggleSelected=function(e){this.modelService.toggleSelectedObject(e)},e.prototype.isSelected=function(e){return this.modelService.isSelectedObject(e)},e.prototype.isEdit=function(e){return this.modelService.isEditObject(e)},e}(),b=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.prototype.getConnector=function(e){var t,n,o,i,r=this.modelService.model;try{for(var s=g(r.nodes),d=s.next();!d.done;d=s.next()){var a=d.value;try{for(var l=(o=void 0,g(a.connectors)),c=l.next();!c.done;c=l.next()){var p=c.value;if(p.id===e)return p}}catch(e){o={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}},t.prototype.getConnectorRectInfo=function(e){return this.modelService.connectorsRectInfos[e]},t.prototype.setConnectorRectInfo=function(e,t){this.modelService.connectorsRectInfos[e]=t,this.modelService.detectChanges()},t.prototype._getCoords=function(e,t){var n=this.getConnectorRectInfo(e),o=this.modelService.canvasHtmlElement;if(null==n||null===o)return{x:0,y:0};var i=n.type===h.leftConnectorType?n.nodeRectInfo.left():n.nodeRectInfo.right(),r=n.nodeRectInfo.top()+n.nodeRectInfo.height()/2;return t||(i-=n.width/2,r-=n.height/2),{x:Math.round(i),y:Math.round(r)}},t.prototype.getCoords=function(e){return this._getCoords(e,!1)},t.prototype.getCenteredCoord=function(e){return this._getCoords(e,!0)},t}(y),C=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.prototype.getConnectorsByType=function(e,t){return e.connectors.filter((function(e){return e.type===t}))},t.prototype._addConnector=function(e,t){e.connectors.push(t);try{this.modelService.modelValidation.validateNode(e)}catch(n){throw e.connectors.splice(e.connectors.indexOf(t),1),n}},t.prototype.delete=function(e){this.isSelected(e)&&this.deselect(e);var t=this.modelService.model,n=t.nodes.indexOf(e);if(-1===n){if(void 0===e)throw new Error("Passed undefined");throw new Error("Tried to delete not existing node")}for(var o=this.getConnectorIds(e),i=0;i<t.edges.length;i++){var r=t.edges[i];-1===o.indexOf(r.source)&&-1===o.indexOf(r.destination)||(this.modelService.edges.delete(r),i--)}t.nodes.splice(n,1),this.modelService.notifyModelChanged(),this.modelService.nodeRemovedCallback(e)},t.prototype.getSelectedNodes=function(){var e=this;return this.modelService.model.nodes.filter((function(t){return e.modelService.nodes.isSelected(t)}))},t.prototype.handleClicked=function(e,t){t?this.modelService.nodes.toggleSelected(e):(this.modelService.deselectAll(),this.modelService.nodes.select(e))},t.prototype._addNode=function(e){var t=this.modelService.model;try{t.nodes.push(e),this.modelService.modelValidation.validateNodes(t.nodes)}catch(n){throw t.nodes.splice(t.nodes.indexOf(e),1),n}},t.prototype.getConnectorIds=function(e){return e.connectors.map((function(e){return e.id}))},t.prototype.getNodeByConnectorId=function(e){var t,n,o=this.modelService.model;try{for(var i=g(o.nodes),r=i.next();!r.done;r=i.next()){var s=r.value;if(this.getConnectorIds(s).indexOf(e)>-1)return s}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return null},t.prototype.getHtmlElement=function(e){return this.modelService.nodesHtmlElements[e]},t.prototype.setHtmlElement=function(e,t){this.modelService.nodesHtmlElements[e]=t,this.modelService.detectChanges()},t}(y),S=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.prototype.sourceCoord=function(e){return this.modelService.connectors.getCenteredCoord(e.source)},t.prototype.destCoord=function(e){return this.modelService.connectors.getCenteredCoord(e.destination)},t.prototype.delete=function(e){var t=this.modelService.model,n=t.edges.indexOf(e);if(-1===n)throw new Error("Tried to delete not existing edge");this.isSelected(e)&&this.deselect(e),t.edges.splice(n,1),this.modelService.notifyModelChanged(),this.modelService.edgeRemovedCallback(e)},t.prototype.getSelectedEdges=function(){var e=this;return this.modelService.model.edges.filter((function(t){return e.modelService.edges.isSelected(t)}))},t.prototype.handleEdgeMouseClick=function(e,t){t?this.modelService.edges.toggleSelected(e):(this.modelService.deselectAll(),this.modelService.edges.select(e))},t.prototype.putEdge=function(e){this.modelService.model.edges.push(e),this.modelService.notifyModelChanged()},t.prototype._addEdge=function(e,t,n,o){var i=this;this.modelService.modelValidation.validateConnector(t),this.modelService.modelValidation.validateConnector(n);var r={};r.source=t.id,r.destination=n.id,r.label=o;var s=this.modelService.model;this.modelService.modelValidation.validateEdges(s.edges.concat([r]),s.nodes),this.modelService.createEdge(e,r).subscribe((function(e){s.edges.push(e),i.modelService.notifyModelChanged(),i.modelService.edgeAddedCallback(e)}))},t}(y),D=function(){function e(){}return e.prototype.validateModel=function(e){return this.validateNodes(e.nodes),this._validateEdges(e.edges,e.nodes),e},e.prototype.validateNodes=function(e){var t=this,n=[];e.forEach((function(e){if(t.validateNode(e),-1!==n.indexOf(e.id))throw new f("Id not unique.");n.push(e.id)}));var o=[];return e.forEach((function(e){e.connectors.forEach((function(e){if(-1!==o.indexOf(e.id))throw new f("Id not unique.");o.push(e.id)}))})),e},e.prototype.validateNode=function(e){var t=this;if(void 0===e.id)throw new f("Id not valid.");if("string"!=typeof e.name)throw new f("Name not valid.");if("number"!=typeof e.x||e.x<0||Math.round(e.x)!==e.x)throw new f("Coordinates not valid.");if("number"!=typeof e.y||e.y<0||Math.round(e.y)!==e.y)throw new f("Coordinates not valid.");if(!Array.isArray(e.connectors))throw new f("Connectors not valid.");return e.connectors.forEach((function(e){t.validateConnector(e)})),e},e.prototype._validateEdges=function(e,t){var n=this;if(e.forEach((function(e){n._validateEdge(e,t)})),e.forEach((function(t,n){e.forEach((function(e,o){if(n!==o&&(t.source===e.source&&t.destination===e.destination||t.source===e.destination&&t.destination===e.source))throw new f("Duplicated edge.")}))})),null===v({nodes:t,edges:e}))throw new f("Graph has a circle.");return e},e.prototype.validateEdges=function(e,t){return this.validateNodes(t),this._validateEdges(e,t)},e.prototype._validateEdge=function(e,t){if(void 0===e.source)throw new f("Source not valid.");if(void 0===e.destination)throw new f("Destination not valid.");if(e.source===e.destination)throw new f("Edge with same source and destination connectors.");var n=t.filter((function(t){return t.connectors.some((function(t){return t.id===e.source}))}))[0];if(void 0===n)throw new f("Source not valid.");var o=t.filter((function(t){return t.connectors.some((function(t){return t.id===e.destination}))}))[0];if(void 0===o)throw new f("Destination not valid.");if(n===o)throw new f("Edge with same source and destination nodes.");return e},e.prototype.validateEdge=function(e,t){return this.validateNodes(t),this._validateEdge(e,t)},e.prototype.validateConnector=function(e){if(void 0===e.id)throw new f("Id not valid.");if(void 0===e.type||null===e.type||"string"!=typeof e.type)throw new f("Type not valid.");return e},e=l([t.Injectable(),c("design:paramtypes",[])],e)}(),E={dropElement:null},w=function(){function e(e,t,n,o){this.nodeDraggingScope={shadowDragStarted:!1,dropElement:null,draggedNodes:[],shadowElements:[]},this.dragOffsets=[],this.draggedElements=[],this.destinationHtmlElements=[],this.oldDisplayStyles=[],this.modelService=e,this.automaticResize=n,this.dragAnimation=o,this.applyFunction=t}return e.prototype.getCoordinate=function(e,t){return e=Math.max(e,0),e=Math.min(e,t)},e.prototype.getXCoordinate=function(e){return this.getCoordinate(e,this.modelService.canvasHtmlElement.offsetWidth)},e.prototype.getYCoordinate=function(e){return this.getCoordinate(e,this.modelService.canvasHtmlElement.offsetHeight)},e.prototype.resizeCanvas=function(e,t){if(this.automaticResize&&!this.modelService.isDropSource()){var n=this.modelService.canvasHtmlElement;n.offsetWidth<e.x+t.offsetWidth+h.canvasResizeThreshold&&(n.style.width=n.offsetWidth+h.canvasResizeStep+"px"),n.offsetHeight<e.y+t.offsetHeight+h.canvasResizeThreshold&&(n.style.height=n.offsetHeight+h.canvasResizeStep+"px")}},e.prototype.isDraggingNode=function(e){return this.nodeDraggingScope.draggedNodes.includes(e)},e.prototype.dragstart=function(e,t){var n,o,i,r;if(!t.readonly){this.dragOffsets.length=0,this.draggedElements.length=0,this.nodeDraggingScope.draggedNodes.length=0,this.nodeDraggingScope.shadowElements.length=0,this.destinationHtmlElements.length=0,this.oldDisplayStyles.length=0;var s=[],d=[];if(this.modelService.nodes.isSelected(t)){var a=this.modelService.nodes.getSelectedNodes();try{for(var l=g(a),c=l.next();!c.done;c=l.next()){var p=c.value,u=$(this.modelService.nodes.getHtmlElement(p.id));s.push(u),d.push(p)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}}else s.push($(e.target)),d.push(t);var f=[],v=[];try{for(var m=g(s),y=m.next();!y.done;y=m.next()){u=y.value;f.push(parseInt(u.css("left"),10)-e.clientX),v.push(parseInt(u.css("top"),10)-e.clientY)}}catch(e){i={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(i)throw i.error}}var b=e.originalEvent||e;if(this.modelService.isDropSource()){E.dropElement&&(E.dropElement.parentNode.removeChild(E.dropElement),E.dropElement=null),E.dropElement=s[0][0].cloneNode(!0);var C=$(this.modelService.canvasHtmlElement).offset();E.dropElement.offsetInfo={offsetX:Math.round(f[0]+C.left),offsetY:Math.round(v[0]+C.top)},E.dropElement.style.position="absolute",E.dropElement.style.pointerEvents="none",E.dropElement.style.zIndex="9999",document.body.appendChild(E.dropElement);var S={node:t,dropTargetId:this.modelService.dropTargetId,offsetX:Math.round(f[0]+C.left),offsetY:Math.round(v[0]+C.top)};if(b.dataTransfer.setData("text",JSON.stringify(S)),b.dataTransfer.setDragImage)b.dataTransfer.setDragImage(this.modelService.getDragImage(),0,0);else{var D=e.target,w=D.cloneNode(!0);D.parentNode.insertBefore(w,D),D.style.visibility="collapse",setTimeout((function(){D.parentNode.removeChild(w),D.style.visibility="visible"}),0)}}else{this.nodeDraggingScope.draggedNodes=d;for(var x=0;x<s.length;x++)this.draggedElements.push(s[x][0]),this.dragOffsets.push({x:f[x],y:v[x]});if(this.dragAnimation===h.dragAnimationShadow)for(x=0;x<this.draggedElements.length;x++){var k=this.dragOffsets[x],O=this.nodeDraggingScope.draggedNodes[x],I=$('<div style="position: absolute; opacity: 0.7; top: '+this.getYCoordinate(k.y+e.clientY)+"px; left: "+this.getXCoordinate(k.x+e.clientX)+'px; "><div class="innerNode"><p style="padding: 0 15px;">'+O.name+"</p> </div></div>"),R=$(this.draggedElements[x]).children()[0];I.children()[0].style.backgroundColor=R.style.backgroundColor,this.nodeDraggingScope.shadowElements.push(I),this.modelService.canvasHtmlElement.appendChild(this.nodeDraggingScope.shadowElements[x][0])}if(b.dataTransfer.setData("text","Just to support firefox"),b.dataTransfer.setDragImage)b.dataTransfer.setDragImage(this.modelService.getDragImage(),0,0);else if(this.draggedElements.forEach((function(e){var t=e.cloneNode(!0);e.parentNode.insertBefore(t,e),e.style.visibility="collapse",setTimeout((function(){e.parentNode.removeChild(t),e.style.visibility="visible"}),0)})),this.dragAnimation===h.dragAnimationShadow){for(x=0;x<this.draggedElements.length;x++)this.destinationHtmlElements.push(this.draggedElements[x]),this.oldDisplayStyles.push(this.destinationHtmlElements[x].style.display),this.destinationHtmlElements[x].style.display="none";this.nodeDraggingScope.shadowDragStarted=!0}}}},e.prototype.drop=function(e){var t=this;if(this.modelService.isDropSource())return e.preventDefault(),!1;var n=null,o=(e.originalEvent||e).dataTransfer.getData("text");if(o){var i=null;try{i=JSON.parse(o)}catch(e){}if(i&&i.dropTargetId&&this.modelService.canvasHtmlElement.id&&this.modelService.canvasHtmlElement.id===i.dropTargetId){n=i.node;var r=$(this.modelService.canvasHtmlElement).offset(),s=e.clientX-r.left,d=e.clientY-r.top;n.x=Math.round(this.getXCoordinate(i.offsetX+s)),n.y=Math.round(this.getYCoordinate(i.offsetY+d))}}return n?(this.modelService.dropNode(e,n),e.preventDefault(),!1):this.nodeDraggingScope.draggedNodes.length?this.applyFunction((function(){for(var n=0;n<t.nodeDraggingScope.draggedNodes.length;n++){var o=t.nodeDraggingScope.draggedNodes[n],i=t.dragOffsets[n];o.x=Math.round(t.getXCoordinate(i.x+e.clientX)),o.y=Math.round(t.getYCoordinate(i.y+e.clientY))}return e.preventDefault(),t.modelService.notifyModelChanged(),!1})):void 0},e.prototype.dragover=function(e){var t=this;if(E.dropElement){var n=E.dropElement.offsetInfo;return E.dropElement.style.left=n.offsetX+e.clientX+"px",E.dropElement.style.top=n.offsetY+e.clientY+"px",this.nodeDraggingScope.shadowDragStarted&&this.applyFunction((function(){t.destinationHtmlElements[0].style.display=t.oldDisplayStyles[0],t.nodeDraggingScope.shadowDragStarted=!1})),void e.preventDefault()}if(this.modelService.isDropSource())e.preventDefault();else if(this.nodeDraggingScope.draggedNodes.length){if(this.dragAnimation===h.dragAnimationRepaint){if(this.nodeDraggingScope.draggedNodes.length)return this.applyFunction((function(){for(var n=0;n<t.nodeDraggingScope.draggedNodes.length;n++){var o=t.nodeDraggingScope.draggedNodes[n],i=t.dragOffsets[n];o.x=t.getXCoordinate(i.x+e.clientX),o.y=t.getYCoordinate(i.y+e.clientY),t.resizeCanvas(o,t.draggedElements[n])}return e.preventDefault(),t.modelService.notifyModelChanged(),!1}))}else if(this.dragAnimation===h.dragAnimationShadow&&this.nodeDraggingScope.draggedNodes.length){this.nodeDraggingScope.shadowDragStarted&&this.applyFunction((function(){for(var e=0;e<t.nodeDraggingScope.draggedNodes.length;e++)t.destinationHtmlElements[e].style.display=t.oldDisplayStyles[e];t.nodeDraggingScope.shadowDragStarted=!1}));for(var o=0;o<this.nodeDraggingScope.draggedNodes.length;o++){var i=this.nodeDraggingScope.draggedNodes[o],r=this.dragOffsets[o];this.nodeDraggingScope.shadowElements[o].css("left",this.getXCoordinate(r.x+e.clientX)+"px"),this.nodeDraggingScope.shadowElements[o].css("top",this.getYCoordinate(r.y+e.clientY)+"px"),this.resizeCanvas(i,this.draggedElements[o])}e.preventDefault()}}else e.preventDefault()},e.prototype.dragend=function(e){var t=this;this.applyFunction((function(){if(E.dropElement&&(E.dropElement.parentNode.removeChild(E.dropElement),E.dropElement=null),!t.modelService.isDropSource()){if(t.nodeDraggingScope.shadowElements.length){for(var e=0;e<t.nodeDraggingScope.draggedNodes.length;e++){var n=t.nodeDraggingScope.draggedNodes[e],o=t.nodeDraggingScope.shadowElements[e];n.x=parseInt(o.css("left").replace("px",""),10),n.y=parseInt(o.css("top").replace("px",""),10),t.modelService.canvasHtmlElement.removeChild(o[0])}t.nodeDraggingScope.shadowElements.length=0,t.modelService.notifyModelChanged()}t.nodeDraggingScope.draggedNodes.length&&(t.nodeDraggingScope.draggedNodes.length=0,t.draggedElements.length=0,t.dragOffsets.length=0)}}))},e}(),x=function(){function e(){}return e.prototype.getEdgeDAttribute=function(e,t,n){var o="M "+e.x+", "+e.y+" ";if(n===h.curvedStyle){var i=this.computeEdgeSourceTangent(e,t),r=this.computeEdgeDestinationTangent(e,t);o+="C "+i.x+", "+i.y+" "+(r.x-50)+", "+r.y+" "+t.x+", "+t.y}else o+="L "+t.x+", "+t.y;return o},e.prototype.getEdgeCenter=function(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}},e.prototype.computeEdgeTangentOffset=function(e,t){return(t.y-e.y)/2},e.prototype.computeEdgeSourceTangent=function(e,t){return{x:e.x,y:e.y+this.computeEdgeTangentOffset(e,t)}},e.prototype.computeEdgeDestinationTangent=function(e,t){return{x:t.x,y:t.y-this.computeEdgeTangentOffset(e,t)}},e=l([t.Injectable(),c("design:paramtypes",[])],e)}(),k=function(){function e(e,t,n,o,i,r,s,d){this.edgeDragging={isDragging:!1,dragPoint1:null,dragPoint2:null,shadowDragStarted:!1},this.draggedEdgeSource=null,this.dragOffset={},this.destinationHtmlElement=null,this.oldDisplayStyle="",this.modelValidation=e,this.edgeDrawingService=t,this.modelService=n,this.model=o,this.isValidEdgeCallback=i||function(){return!0},this.applyFunction=r,this.dragAnimation=s,this.edgeStyle=d}return e.prototype.dragstart=function(e,t){var n,o,i,r,s,d=this;if(t.type===h.leftConnectorType){var a=function(e){if(e.destination===t.id)return i=l.modelService.connectors.getConnector(e.source),r=e.label,s=e,l.applyFunction((function(){d.modelService.edges.delete(e)})),"break"},l=this;try{for(var c=g(this.model.edges),p=c.next();!p.done;p=c.next()){if("break"===a(p.value))break}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}}this.edgeDragging.isDragging=!0,void 0!==i?(this.draggedEdgeSource=i,this.edgeDragging.dragPoint1=this.modelService.connectors.getCenteredCoord(i.id),this.edgeDragging.dragLabel=r,this.edgeDragging.prevEdge=s):(this.draggedEdgeSource=t,this.edgeDragging.dragPoint1=this.modelService.connectors.getCenteredCoord(t.id));var u=this.modelService.canvasHtmlElement;if(!u)throw new Error("No canvas while edgedraggingService found.");this.dragOffset.x=-u.getBoundingClientRect().left,this.dragOffset.y=-u.getBoundingClientRect().top,this.edgeDragging.dragPoint2={x:e.clientX+this.dragOffset.x,y:e.clientY+this.dragOffset.y};var f=e.originalEvent||e;f.dataTransfer.setData("Text","Just to support firefox"),f.dataTransfer.setDragImage?f.dataTransfer.setDragImage(this.modelService.getDragImage(),0,0):(this.destinationHtmlElement=e.target,this.oldDisplayStyle=this.destinationHtmlElement.style.display,this.destinationHtmlElement.style.display="none",this.dragAnimation===h.dragAnimationShadow&&(this.edgeDragging.shadowDragStarted=!0)),this.dragAnimation===h.dragAnimationShadow&&(void 0===this.edgeDragging.gElement&&(this.edgeDragging.gElement=$(document.querySelectorAll(".shadow-svg-class")),this.edgeDragging.pathElement=$(document.querySelectorAll(".shadow-svg-class")).find("path"),this.edgeDragging.circleElement=$(document.querySelectorAll(".shadow-svg-class")).find("circle")),this.edgeDragging.gElement.css("display","block"),this.edgeDragging.pathElement.attr("d",this.edgeDrawingService.getEdgeDAttribute(this.edgeDragging.dragPoint1,this.edgeDragging.dragPoint2,this.edgeStyle)),this.edgeDragging.circleElement.attr("cx",this.edgeDragging.dragPoint2.x),this.edgeDragging.circleElement.attr("cy",this.edgeDragging.dragPoint2.y)),e.stopPropagation()},e.prototype.dragover=function(e){var t=this;if(this.edgeDragging.isDragging)if(this.edgeDragging.magnetActive||this.dragAnimation!==h.dragAnimationShadow){if(this.dragAnimation===h.dragAnimationRepaint)return this.applyFunction((function(){null!==t.destinationHtmlElement&&(t.destinationHtmlElement.style.display=t.oldDisplayStyle),t.edgeDragging.dragPoint2={x:e.clientX+t.dragOffset.x,y:e.clientY+t.dragOffset.y}}))}else null!==this.destinationHtmlElement&&(this.destinationHtmlElement.style.display=this.oldDisplayStyle),this.edgeDragging.shadowDragStarted&&this.applyFunction((function(){t.edgeDragging.shadowDragStarted=!1})),this.edgeDragging.dragPoint2={x:e.clientX+this.dragOffset.x,y:e.clientY+this.dragOffset.y},this.edgeDragging.pathElement.attr("d",this.edgeDrawingService.getEdgeDAttribute(this.edgeDragging.dragPoint1,this.edgeDragging.dragPoint2,this.edgeStyle)),this.edgeDragging.circleElement.attr("cx",this.edgeDragging.dragPoint2.x),this.edgeDragging.circleElement.attr("cy",this.edgeDragging.dragPoint2.y)},e.prototype.dragoverConnector=function(e,t){if(this.edgeDragging.isDragging){this.dragover(e);try{this.modelValidation.validateEdges(this.model.edges.concat([{source:this.draggedEdgeSource.id,destination:t.id}]),this.model.nodes)}catch(e){if(e instanceof f)return!0;throw e}if(this.isValidEdgeCallback(this.draggedEdgeSource,t))return e.preventDefault(),e.stopPropagation(),!1}},e.prototype.dragleaveMagnet=function(e){this.edgeDragging.magnetActive=!1},e.prototype.dragoverMagnet=function(e,t){var n=this;if(this.edgeDragging.isDragging){this.dragover(e);try{this.modelValidation.validateEdges(this.model.edges.concat([{source:this.draggedEdgeSource.id,destination:t.id}]),this.model.nodes)}catch(e){if(e instanceof f)return!0;throw e}if(this.isValidEdgeCallback(this.draggedEdgeSource,t)){if(this.dragAnimation===h.dragAnimationShadow)return this.edgeDragging.magnetActive=!0,this.edgeDragging.dragPoint2=this.modelService.connectors.getCenteredCoord(t.id),this.edgeDragging.pathElement.attr("d",this.edgeDrawingService.getEdgeDAttribute(this.edgeDragging.dragPoint1,this.edgeDragging.dragPoint2,this.edgeStyle)),this.edgeDragging.circleElement.attr("cx",this.edgeDragging.dragPoint2.x),this.edgeDragging.circleElement.attr("cy",this.edgeDragging.dragPoint2.y),e.preventDefault(),e.stopPropagation(),!1;if(this.dragAnimation===h.dragAnimationRepaint)return this.applyFunction((function(){return n.edgeDragging.dragPoint2=n.modelService.connectors.getCenteredCoord(t.id),e.preventDefault(),e.stopPropagation(),!1}))}}},e.prototype.dragend=function(e){var t=this;if(this.edgeDragging.isDragging&&(this.edgeDragging.isDragging=!1,this.edgeDragging.dragPoint1=null,this.edgeDragging.dragPoint2=null,this.edgeDragging.dragLabel=null,e.stopPropagation(),this.dragAnimation===h.dragAnimationShadow&&this.edgeDragging.gElement.css("display","none"),this.edgeDragging.prevEdge)){var n=this.edgeDragging.prevEdge;this.edgeDragging.prevEdge=null,this.applyFunction((function(){t.modelService.edges.putEdge(n)}))}},e.prototype.drop=function(e,t){if(this.edgeDragging.isDragging){try{this.modelValidation.validateEdges(this.model.edges.concat([{source:this.draggedEdgeSource.id,destination:t.id}]),this.model.nodes)}catch(e){if(e instanceof f)return!0;throw e}if(this.isValidEdgeCallback(this.draggedEdgeSource,t))return this.edgeDragging.prevEdge=null,this.modelService.edges._addEdge(e,this.draggedEdgeSource,t,this.edgeDragging.dragLabel),e.stopPropagation(),e.preventDefault(),!1}},e}(),O=function(){function e(e){this.mouseoverscope={connector:null,edge:null,node:null},this.applyFunction=e}return e.prototype.nodeMouseOver=function(e,t){var n=this;return this.applyFunction((function(){n.mouseoverscope.node=t}))},e.prototype.nodeMouseOut=function(e,t){var n=this;return this.applyFunction((function(){n.mouseoverscope.node=null}))},e.prototype.connectorMouseEnter=function(e,t){var n=this;return this.applyFunction((function(){n.mouseoverscope.connector=t}))},e.prototype.connectorMouseLeave=function(e,t){var n=this;return this.applyFunction((function(){n.mouseoverscope.connector=null}))},e.prototype.edgeMouseEnter=function(e,t){this.mouseoverscope.edge=t},e.prototype.edgeMouseLeave=function(e,t){this.mouseoverscope.edge=null},e}(),I=/(auto|scroll)/,R=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},M=function(e){return I.test(R(e,"overflow")+R(e,"overflow-y")+R(e,"overflow-x"))},j=function(e){return e&&e!==document.body?M(e)?e:j(e.parentNode):document.body},A=function(){function e(e,t,n){this.selectRect={x1:0,x2:0,y1:0,y2:0},this.modelService=e,this.selectElement=t,this.$canvasElement=$(this.modelService.canvasHtmlElement),this.$scrollParent=$(j(this.modelService.canvasHtmlElement)),this.applyFunction=n}return e.prototype.mousedown=function(e){if(this.modelService.isEditable()&&!e.ctrlKey&&!e.metaKey&&0===e.button&&this.selectElement.hidden){this.selectElement.hidden=!1;var t=this.$canvasElement.offset();this.selectRect.x1=Math.round(e.pageX-t.left),this.selectRect.y1=Math.round(e.pageY-t.top),this.selectRect.x2=this.selectRect.x1,this.selectRect.y2=this.selectRect.y1,this.updateSelectRect()}},e.prototype.mousemove=function(e){if(this.modelService.isEditable()&&!e.ctrlKey&&!e.metaKey&&0===e.button&&!this.selectElement.hidden){var t=this.$canvasElement.offset();this.selectRect.x2=Math.round(e.pageX-t.left),this.selectRect.y2=Math.round(e.pageY-t.top),this.updateScroll(t),this.updateSelectRect()}},e.prototype.updateScroll=function(e){var t=this.$scrollParent[0].getBoundingClientRect(),n=t.bottom-e.top,o=t.right-e.left,i=t.top-e.top,r=t.left-e.left;if(this.selectRect.y2-i<25){var s=25-(this.selectRect.y2-i),d=this.$scrollParent.scrollTop();this.$scrollParent.scrollTop(d-s)}else if(n-this.selectRect.y2<40){var a=40-(n-this.selectRect.y2),l=this.$scrollParent.scrollTop();this.$scrollParent.scrollTop(l+a)}if(this.selectRect.x2-r<25){var c=25-(this.selectRect.x2-r),g=this.$scrollParent.scrollLeft();this.$scrollParent.scrollLeft(g-c)}else if(o-this.selectRect.x2<40){var p=40-(o-this.selectRect.x2),h=this.$scrollParent.scrollLeft();this.$scrollParent.scrollLeft(h+p)}},e.prototype.mouseup=function(e){if(this.modelService.isEditable()&&!e.ctrlKey&&!e.metaKey&&0===e.button&&!this.selectElement.hidden){var t=this.selectElement.getBoundingClientRect();this.selectElement.hidden=!0,this.selectObjects(t)}},e.prototype.updateSelectRect=function(){var e=Math.min(this.selectRect.x1,this.selectRect.x2),t=Math.max(this.selectRect.x1,this.selectRect.x2),n=Math.min(this.selectRect.y1,this.selectRect.y2),o=Math.max(this.selectRect.y1,this.selectRect.y2);this.selectElement.style.left=e+"px",this.selectElement.style.top=n+"px",this.selectElement.style.width=t-e+"px",this.selectElement.style.height=o-n+"px"},e.prototype.selectObjects=function(e){var t=this;this.applyFunction((function(){t.modelService.selectAllInRect(e)}))},e}(),N=function(){function e(e,i,r,s,d,a){var l=this;this.elementRef=e,this.differs=i,this.modelValidation=r,this.edgeDrawingService=s,this.cd=d,this.zone=a,this.modelChanged=new t.EventEmitter,this.fitModelSizeByDefaultValue=!0,this.flowchartConstants=h,this.nodesDiffer=this.differs.find([]).create((function(e,t){return t})),this.edgesDiffer=this.differs.find([]).create((function(e,t){return t})),this.detectChangesSubject=new n.Subject,this.arrowDefId="arrow-"+Math.random(),this.arrowDefIdSelected=this.arrowDefId+"-selected",this.detectChangesSubject.pipe(o.debounceTime(50)).subscribe((function(){return l.cd.detectChanges()}))}return Object.defineProperty(e.prototype,"canvasClass",{get:function(){return h.canvasClass},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitModelSizeByDefault",{get:function(){return this.fitModelSizeByDefaultValue},set:function(e){this.fitModelSizeByDefaultValue=i.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e,t,n=this;if(!this.dropTargetId&&this.edgeStyle!==h.curvedStyle&&this.edgeStyle!==h.lineStyle)throw new Error("edgeStyle not supported.");this.nodeHeight=this.nodeHeight||200,this.nodeWidth=this.nodeWidth||200,this.dragAnimation=this.dragAnimation||h.dragAnimationRepaint,this.userCallbacks=this.userCallbacks||{},this.automaticResize=this.automaticResize||!1;try{for(var o=g(Object.keys(this.userCallbacks)),i=o.next();!i.done;i=o.next()){var r=i.value;if("function"!=typeof this.userCallbacks[r]&&"nodeCallbacks"!==r)throw new Error("All callbacks should be functions.")}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.userNodeCallbacks=this.userCallbacks.nodeCallbacks;var s=$(this.elementRef.nativeElement);this.modelService=new m(this.modelValidation,this.model,this.modelChanged,this.detectChangesSubject,this.selectedObjects,this.userCallbacks.dropNode,this.userCallbacks.createEdge,this.userCallbacks.edgeAdded,this.userCallbacks.nodeRemoved,this.userCallbacks.edgeRemoved,s[0],s[0].querySelector("svg")),this.dropTargetId&&(this.modelService.dropTargetId=this.dropTargetId);var d=this.zone.run.bind(this.zone);this.nodeDraggingService=new w(this.modelService,d,this.automaticResize,this.dragAnimation),this.edgeDraggingService=new k(this.modelValidation,this.edgeDrawingService,this.modelService,this.model,this.userCallbacks.isValidEdge||null,d,this.dragAnimation,this.edgeStyle),this.mouseoverService=new O(d),this.rectangleSelectService=new A(this.modelService,s[0].querySelector("#select-rectangle"),d),this.callbacks={nodeDragstart:this.nodeDraggingService.dragstart.bind(this.nodeDraggingService),nodeDragend:this.nodeDraggingService.dragend.bind(this.nodeDraggingService),edgeDragstart:this.edgeDraggingService.dragstart.bind(this.edgeDraggingService),edgeDragend:this.edgeDraggingService.dragend.bind(this.edgeDraggingService),edgeDrop:this.edgeDraggingService.drop.bind(this.edgeDraggingService),edgeDragoverConnector:this.edgeDraggingService.dragoverConnector.bind(this.edgeDraggingService),edgeDragoverMagnet:this.edgeDraggingService.dragoverMagnet.bind(this.edgeDraggingService),edgeDragleaveMagnet:this.edgeDraggingService.dragleaveMagnet.bind(this.edgeDraggingService),nodeMouseOver:this.mouseoverService.nodeMouseOver.bind(this.mouseoverService),nodeMouseOut:this.mouseoverService.nodeMouseOut.bind(this.mouseoverService),connectorMouseEnter:this.mouseoverService.connectorMouseEnter.bind(this.mouseoverService),connectorMouseLeave:this.mouseoverService.connectorMouseLeave.bind(this.mouseoverService),nodeClicked:function(e,t){n.modelService.nodes.handleClicked(t,e.ctrlKey),e.stopPropagation(),e.preventDefault()}},this.adjustCanvasSize(this.fitModelSizeByDefault)},e.prototype.ngDoCheck=function(){if(this.model){var e=this.nodesDiffer.diff(this.model.nodes),t=this.edgesDiffer.diff(this.model.edges),n=!1,o=!1;null!==e&&(e.forEachAddedItem((function(){n=!0})),e.forEachRemovedItem((function(){n=!0}))),null!==t&&(t.forEachAddedItem((function(){o=!0})),t.forEachRemovedItem((function(){o=!0}))),n&&this.adjustCanvasSize(this.fitModelSizeByDefault),(n||o)&&this.detectChangesSubject.next()}},e.prototype.getEdgeDAttribute=function(e){return this.edgeDrawingService.getEdgeDAttribute(this.modelService.edges.sourceCoord(e),this.modelService.edges.destCoord(e),this.edgeStyle)},e.prototype.adjustCanvasSize=function(e){var t,n,o=this,i=0,r=0,s=$(this.elementRef.nativeElement);this.model.nodes.forEach((function(e){i=Math.max(e.x+o.nodeWidth,i),r=Math.max(e.y+o.nodeHeight,r)})),e?(t=i,n=r):(t=Math.max(i,s.prop("offsetWidth")),n=Math.max(r,s.prop("offsetHeight"))),s.css("width",t+"px"),s.css("height",n+"px")},e.prototype.canvasClick=function(e){},e.prototype.edgeMouseDown=function(e,t){e.stopPropagation()},e.prototype.edgeClick=function(e,t){this.modelService.edges.handleEdgeMouseClick(t,e.ctrlKey),e.stopPropagation(),e.preventDefault()},e.prototype.edgeRemove=function(e,t){this.modelService.edges.delete(t),e.stopPropagation(),e.preventDefault()},e.prototype.edgeEdit=function(e,t){this.userCallbacks.edgeEdit&&this.userCallbacks.edgeEdit(e,t)},e.prototype.edgeDoubleClick=function(e,t){this.userCallbacks.edgeDoubleClick&&this.userCallbacks.edgeDoubleClick(e,t)},e.prototype.edgeMouseOver=function(e,t){this.userCallbacks.edgeMouseOver&&this.userCallbacks.edgeMouseOver(e,t)},e.prototype.edgeMouseEnter=function(e,t){this.mouseoverService.edgeMouseEnter(e,t)},e.prototype.edgeMouseLeave=function(e,t){this.mouseoverService.edgeMouseLeave(e,t)},e.prototype.dragover=function(e){this.nodeDraggingService.dragover(e),this.edgeDraggingService.dragover(e)},e.prototype.drop=function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),this.nodeDraggingService.drop(e)},e.prototype.mousedown=function(e){this.rectangleSelectService.mousedown(e)},e.prototype.mousemove=function(e){this.rectangleSelectService.mousemove(e)},e.prototype.mouseup=function(e){this.rectangleSelectService.mouseup(e)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.IterableDiffers},{type:D},{type:x},{type:t.ChangeDetectorRef},{type:t.NgZone}]},l([t.HostBinding("attr.class"),c("design:type",String),c("design:paramtypes",[])],e.prototype,"canvasClass",null),l([t.Input(),c("design:type",Object)],e.prototype,"model",void 0),l([t.Input(),c("design:type",Array)],e.prototype,"selectedObjects",void 0),l([t.Input(),c("design:type",String)],e.prototype,"edgeStyle",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"userCallbacks",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"automaticResize",void 0),l([t.Input(),c("design:type",String)],e.prototype,"dragAnimation",void 0),l([t.Input(),c("design:type",Number)],e.prototype,"nodeWidth",void 0),l([t.Input(),c("design:type",Number)],e.prototype,"nodeHeight",void 0),l([t.Input(),c("design:type",String)],e.prototype,"dropTargetId",void 0),l([t.Output(),c("design:type",Object)],e.prototype,"modelChanged",void 0),l([t.Input(),c("design:type",Boolean),c("design:paramtypes",[Boolean])],e.prototype,"fitModelSizeByDefault",null),l([t.HostListener("dragover",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragover",null),l([t.HostListener("drop",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"drop",null),l([t.HostListener("mousedown",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mousedown",null),l([t.HostListener("mousemove",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mousemove",null),l([t.HostListener("mouseup",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mouseup",null),e=l([t.Component({selector:"fc-canvas",template:'<div (click)="canvasClick($event)" class="fc-canvas-container">\n <svg class="fc-canvas-svg">\n <defs>\n <marker class="fc-arrow-marker" [attr.id]="arrowDefId" markerWidth="5" markerHeight="5" viewBox="-6 -6 12 12" refX="10" refY="0" markerUnits="strokeWidth" orient="auto">\n <polygon points="-2,0 -5,5 5,0 -5,-5" stroke="gray" fill="gray" stroke-width="1px"/>\n </marker>\n <marker class="fc-arrow-marker-selected" [attr.id]="arrowDefIdSelected" markerWidth="5" markerHeight="5" viewBox="-6 -6 12 12" refX="10" refY="0" markerUnits="strokeWidth" orient="auto">\n <polygon points="-2,0 -5,5 5,0 -5,-5" stroke="red" fill="red" stroke-width="1px"/>\n </marker>\n </defs>\n <g *ngFor="let edge of model.edges; let $index = index">\n <path\n [attr.id]="\'fc-edge-path-\'+$index"\n (mousedown)="edgeMouseDown($event, edge)"\n (click)="edgeClick($event, edge)"\n (dblclick)="edgeDoubleClick($event, edge)"\n (mouseover)="edgeMouseOver($event, edge)"\n (mouseenter)="edgeMouseEnter($event, edge)"\n (mouseleave)="edgeMouseLeave($event, edge)"\n [attr.class]="(modelService.edges.isSelected(edge) && flowchartConstants.selectedClass + \' \' + flowchartConstants.edgeClass) ||\n edge === mouseoverService.mouseoverscope.edge && flowchartConstants.hoverClass + \' \' + flowchartConstants.edgeClass ||\n edge.active && flowchartConstants.activeClass + \' \' + flowchartConstants.edgeClass ||\n flowchartConstants.edgeClass"\n [attr.d]="getEdgeDAttribute(edge)"\n [attr.marker-end]="\'url(#\' + (modelService.edges.isSelected(edge) ? arrowDefIdSelected : arrowDefId) + \')\'">\n </path>\n </g>\n <g *ngIf="dragAnimation === flowchartConstants.dragAnimationRepaint && edgeDraggingService.edgeDragging.isDragging">\n <path [attr.class]="flowchartConstants.edgeClass + \' \' + flowchartConstants.draggingClass"\n [attr.d]="edgeDrawingService.getEdgeDAttribute(edgeDraggingService.edgeDragging.dragPoint1, edgeDraggingService.edgeDragging.dragPoint2, edgeStyle)"></path>\n <circle class="edge-endpoint" r="4"\n [attr.cx]="edgeDraggingService.edgeDragging.dragPoint2.x"\n [attr.cy]="edgeDraggingService.edgeDragging.dragPoint2.y">\n </circle>\n </g>\n <g *ngIf="dragAnimation === flowchartConstants.dragAnimationShadow"\n class="shadow-svg-class {{ flowchartConstants.edgeClass }} {{ flowchartConstants.draggingClass }}"\n style="display:none">\n <path d=""></path>\n <circle class="edge-endpoint" r="4"></circle>\n </g>\n </svg>\n <ng-container *ngFor="let node of model.nodes">\n <fc-node\n [selected]="modelService.nodes.isSelected(node)"\n [edit]="modelService.nodes.isEdit(node)"\n [underMouse]="node === mouseoverService.mouseoverscope.node"\n [node]="node"\n [mouseOverConnector]="mouseoverService.mouseoverscope.connector"\n [modelservice]="modelService"\n [dragging]="nodeDraggingService.isDraggingNode(node)"\n [callbacks]="callbacks"\n [userNodeCallbacks]="userNodeCallbacks">\n </fc-node>\n </ng-container>\n <div *ngIf="dragAnimation === flowchartConstants.dragAnimationRepaint && edgeDraggingService.edgeDragging.isDragging"\n [attr.class]="\'fc-noselect \' + flowchartConstants.edgeLabelClass"\n [ngStyle]="{\n top: (edgeDrawingService.getEdgeCenter(edgeDraggingService.edgeDragging.dragPoint1, edgeDraggingService.edgeDragging.dragPoint2).y)+\'px\',\n left: (edgeDrawingService.getEdgeCenter(edgeDraggingService.edgeDragging.dragPoint1, edgeDraggingService.edgeDragging.dragPoint2).x)+\'px\'\n }">\n <div class="fc-edge-label-text">\n <span [attr.id]="\'fc-edge-label-dragging\'" *ngIf="edgeDraggingService.edgeDragging.dragLabel">{{edgeDraggingService.edgeDragging.dragLabel}}</span>\n </div>\n </div>\n <div\n (mousedown)="edgeMouseDown($event, edge)"\n (click)="edgeClick($event, edge)"\n (dblclick)="edgeDoubleClick($event, edge)"\n (mouseover)="edgeMouseOver($event, edge)"\n (mouseenter)="edgeMouseEnter($event, edge)"\n (mouseleave)="edgeMouseLeave($event, edge)"\n [attr.class]="\'fc-noselect \' + ((modelService.edges.isEdit(edge) && flowchartConstants.editClass + \' \' + flowchartConstants.edgeLabelClass) ||\n (modelService.edges.isSelected(edge) && flowchartConstants.selectedClass + \' \' + flowchartConstants.edgeLabelClass) ||\n edge === mouseoverService.mouseoverscope.edge && flowchartConstants.hoverClass + \' \' + flowchartConstants.edgeLabelClass ||\n edge.active && flowchartConstants.activeClass + \' \' + flowchartConstants.edgeLabelClass ||\n flowchartConstants.edgeLabelClass)"\n [ngStyle]="{\n top: (edgeDrawingService.getEdgeCenter(modelService.edges.sourceCoord(edge), modelService.edges.destCoord(edge)).y)+\'px\',\n left: (edgeDrawingService.getEdgeCenter(modelService.edges.sourceCoord(edge), modelService.edges.destCoord(edge)).x)+\'px\'\n }"\n *ngFor="let edge of model.edges; let $index = index">\n <div class="fc-edge-label-text">\n <div *ngIf="modelService.isEditable()" class="fc-noselect fc-nodeedit" (click)="edgeEdit($event, edge)">\n <i class="fa fa-pencil" aria-hidden="true"></i>\n </div>\n <div *ngIf="modelService.isEditable()" class="fc-noselect fc-nodedelete" (click)="edgeRemove($event, edge)">\n ×\n </div>\n <span [attr.id]="\'fc-edge-label-\'+$index" *ngIf="edge.label">{{edge.label}}</span>\n </div>\n </div>\n <div id="select-rectangle" class="fc-select-rectangle" hidden>\n </div>\n</div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[":host{display:block;position:relative;width:100%;height:100%;background-size:25px 25px;background-image:linear-gradient(to right,rgba(0,0,0,.1) 1px,transparent 1px),linear-gradient(to bottom,rgba(0,0,0,.1) 1px,transparent 1px);background-color:transparent;min-width:100%;min-height:100%;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .fc-canvas-container{display:block;position:relative;width:100%;height:100%}:host .fc-canvas-container svg.fc-canvas-svg{display:block;position:relative;width:100%;height:100%}:host .fc-edge{stroke:gray;stroke-width:4;-webkit-transition:stroke-width .2s;transition:stroke-width .2s;fill:transparent}:host .fc-edge.fc-hover{stroke:gray;stroke-width:6;fill:transparent}:host .fc-edge.fc-selected{stroke:red;stroke-width:4;fill:transparent}:host .fc-edge.fc-active{-webkit-animation:3s linear infinite dash;animation:3s linear infinite dash;stroke-dasharray:20}:host .fc-edge.fc-dragging{pointer-events:none}:host .fc-arrow-marker polygon{stroke:gray;fill:gray}:host .fc-arrow-marker-selected polygon{stroke:red;fill:red}:host .edge-endpoint{fill:gray}:host .fc-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .fc-edge-label{position:absolute;opacity:.8;-webkit-transition:-webkit-transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s;-webkit-transform-origin:bottom left;transform-origin:bottom left;margin:0 auto}:host .fc-edge-label .fc-edge-label-text{position:absolute;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);white-space:nowrap;text-align:center;font-size:16px}:host .fc-edge-label .fc-edge-label-text span{cursor:default;border:solid #ff3d00;border-radius:10px;color:#ff3d00;background-color:#fff;padding:3px 5px}:host .fc-edge-label .fc-nodeedit{top:-30px;right:14px}:host .fc-edge-label .fc-nodedelete{top:-30px;right:-13px}:host .fc-edge-label.fc-hover{-webkit-transform:scale(1.25);transform:scale(1.25)}:host .fc-edge-label.fc-edit .fc-edge-label-text span,:host .fc-edge-label.fc-selected .fc-edge-label-text span{border:solid red;color:#fff;font-weight:600;background-color:red}:host .fc-select-rectangle{border:2px dashed #5262ff;position:absolute;background:rgba(20,125,255,.1);z-index:2}@-webkit-keyframes dash{from{stroke-dashoffset:500}}@keyframes dash{from{stroke-dashoffset:500}}:host ::ng-deep .fc-nodeedit{display:none;font-size:15px}:host ::ng-deep .fc-nodedelete{display:none;font-size:18px}:host ::ng-deep .fc-edit .fc-nodedelete,:host ::ng-deep .fc-edit .fc-nodeedit{display:block;position:absolute;border:2px solid #eee;border-radius:50%;font-weight:600;line-height:20px;height:20px;padding-top:2px;width:22px;background:#494949;color:#fff;text-align:center;vertical-align:bottom;cursor:pointer}:host ::ng-deep .fc-edit .fc-nodeedit{top:-24px;right:16px}:host ::ng-deep .fc-edit .fc-nodedelete{top:-24px;right:-13px}"]}),c("design:paramtypes",[t.ElementRef,t.IterableDiffers,D,x,t.ChangeDetectorRef,t.NgZone])],e)}(),P=function(){function e(e){this.elementRef=e}return e.prototype.ngOnInit=function(){$(this.elementRef.nativeElement).addClass(h.magnetClass)},e.prototype.dragover=function(e){return this.callbacks.edgeDragoverMagnet(e,this.connector)},e.prototype.dragleave=function(e){this.callbacks.edgeDragleaveMagnet(e)},e.prototype.drop=function(e){return this.callbacks.edgeDrop(e,this.connector)},e.prototype.dragend=function(e){this.callbacks.edgeDragend(e)},e.ctorParameters=function(){return[{type:t.ElementRef}]},l([t.Input(),c("design:type",Object)],e.prototype,"callbacks",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"connector",void 0),l([t.HostListener("dragover",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragover",null),l([t.HostListener("dragleave",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragleave",null),l([t.HostListener("drop",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"drop",null),l([t.HostListener("dragend",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragend",null),e=l([t.Directive({selector:"[fc-magnet]"}),c("design:paramtypes",[t.ElementRef])],e)}(),H=function(){function e(e){this.elementRef=e}return e.prototype.ngOnInit=function(){var e=$(this.elementRef.nativeElement);e.addClass(h.connectorClass),this.modelservice.isEditable()&&(e.attr("draggable","true"),this.updateConnectorClass());var t={type:this.connector.type,width:this.elementRef.nativeElement.offsetWidth,height:this.elementRef.nativeElement.offsetHeight,nodeRectInfo:this.nodeRectInfo};this.modelservice.connectors.setConnectorRectInfo(this.connector.id,t)},e.prototype.ngOnChanges=function(e){var t,n,o=!1;try{for(var i=g(Object.keys(e)),r=i.next();!r.done;r=i.next()){var s=r.value,d=e[s];d.firstChange||d.currentValue===d.previousValue||"mouseOverConnector"===s&&(o=!0)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}o&&this.modelservice.isEditable()&&this.updateConnectorClass()},e.prototype.updateConnectorClass=function(){var e=$(this.elementRef.nativeElement);this.connector===this.mouseOverConnector?e.addClass(h.hoverClass):e.removeClass(h.hoverClass)},e.prototype.dragover=function(e){},e.prototype.drop=function(e){if(this.modelservice.isEditable())return this.callbacks.edgeDrop(e,this.connector)},e.prototype.dragend=function(e){this.modelservice.isEditable()&&this.callbacks.edgeDragend(e)},e.prototype.dragstart=function(e){this.modelservice.isEditable()&&this.callbacks.edgeDragstart(e,this.connector)},e.prototype.mouseenter=function(e){this.modelservice.isEditable()&&this.callbacks.connectorMouseEnter(e,this.connector)},e.prototype.mouseleave=function(e){this.modelservice.isEditable()&&this.callbacks.connectorMouseLeave(e,this.connector)},e.ctorParameters=function(){return[{type:t.ElementRef}]},l([t.Input(),c("design:type",Object)],e.prototype,"callbacks",void 0),l([t.Input(),c("design:type",m)],e.prototype,"modelservice",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"connector",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"nodeRectInfo",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"mouseOverConnector",void 0),l([t.HostListener("dragover",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragover",null),l([t.HostListener("drop",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"drop",null),l([t.HostListener("dragend",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragend",null),l([t.HostListener("dragstart",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragstart",null),l([t.HostListener("mouseenter",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mouseenter",null),l([t.HostListener("mouseleave",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mouseleave",null),e=l([t.Directive({selector:"[fc-connector]"}),c("design:paramtypes",[t.ElementRef])],e)}(),F=function(){function e(e,t,n){this.nodeComponentConfig=e,this.elementRef=t,this.componentFactoryResolver=n}var n,o;return Object.defineProperty(e.prototype,"nodeId",{get:function(){return this.node.id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.node.y+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this.node.x+"px"},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.userNodeCallbacks||(this.userNodeCallbacks={}),this.userNodeCallbacks.nodeEdit=this.userNodeCallbacks.nodeEdit||function(){},this.userNodeCallbacks.doubleClick=this.userNodeCallbacks.doubleClick||function(){},this.userNodeCallbacks.mouseDown=this.userNodeCallbacks.mouseDown||function(){},this.userNodeCallbacks.mouseEnter=this.userNodeCallbacks.mouseEnter||function(){},this.userNodeCallbacks.mouseLeave=this.userNodeCallbacks.mouseLeave||function(){};var e=$(this.elementRef.nativeElement);e.addClass(h.nodeClass),this.node.readonly||e.attr("draggable","true"),this.updateNodeClass(),this.modelservice.nodes.setHtmlElement(this.node.id,e[0]),this.nodeContentContainer.clear();var t=this.componentFactoryResolver.resolveComponentFactory(this.nodeComponentConfig.nodeComponentType),n=this.nodeContentContainer.createComponent(t);this.nodeComponent=n.instance,this.nodeComponent.callbacks=this.callbacks,this.nodeComponent.userNodeCallbacks=this.userNodeCallbacks,this.nodeComponent.node=this.node,this.nodeComponent.modelservice=this.modelservice,this.updateNodeComponent(),this.nodeComponent.width=this.elementRef.nativeElement.offsetWidth,this.nodeComponent.height=this.elementRef.nativeElement.offsetHeight},e.prototype.ngAfterViewInit=function(){this.nodeComponent.width=this.elementRef.nativeElement.offsetWidth,this.nodeComponent.height=this.elementRef.nativeElement.offsetHeight},e.prototype.ngOnChanges=function(e){var t,n,o=!1;try{for(var i=g(Object.keys(e)),r=i.next();!r.done;r=i.next()){var s=r.value,d=e[s];d.firstChange||d.currentValue===d.previousValue||["selected","edit","underMouse","mouseOverConnector","dragging"].includes(s)&&(o=!0)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}o&&(this.updateNodeClass(),this.updateNodeComponent())},e.prototype.updateNodeClass=function(){var e=$(this.elementRef.nativeElement);this.toggleClass(e,h.selectedClass,this.selected),this.toggleClass(e,h.editClass,this.edit),this.toggleClass(e,h.hoverClass,this.underMouse),this.toggleClass(e,h.draggingClass,this.dragging)},e.prototype.updateNodeComponent=function(){this.nodeComponent.selected=this.selected,this.nodeComponent.edit=this.edit,this.nodeComponent.underMouse=this.underMouse,this.nodeComponent.mouseOverConnector=this.mouseOverConnector,this.nodeComponent.dragging=this.dragging},e.prototype.toggleClass=function(e,t,n){n?e.addClass(t):e.removeClass(t)},e.prototype.mousedown=function(e){e.stopPropagation()},e.prototype.dragstart=function(e){this.node.readonly||this.callbacks.nodeDragstart(e,this.node)},e.prototype.dragend=function(e){this.node.readonly||this.callbacks.nodeDragend(e)},e.prototype.click=function(e){this.node.readonly||this.callbacks.nodeClicked(e,this.node)},e.prototype.mouseover=function(e){this.node.readonly||this.callbacks.nodeMouseOver(e,this.node)},e.prototype.mouseout=function(e){this.node.readonly||this.callbacks.nodeMouseOut(e,this.node)},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[p]}]},{type:t.ElementRef},{type:t.ComponentFactoryResolver}]},l([t.Input(),c("design:type",Object)],e.prototype,"callbacks",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"userNodeCallbacks",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"node",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"selected",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"edit",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"underMouse",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"mouseOverConnector",void 0),l([t.Input(),c("design:type",m)],e.prototype,"modelservice",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"dragging",void 0),l([t.HostBinding("attr.id"),c("design:type",String),c("design:paramtypes",[])],e.prototype,"nodeId",null),l([t.HostBinding("style.top"),c("design:type",String),c("design:paramtypes",[])],e.prototype,"top",null),l([t.HostBinding("style.left"),c("design:type",String),c("design:paramtypes",[])],e.prototype,"left",null),l([t.ViewChild("nodeContent",{read:t.ViewContainerRef,static:!0}),c("design:type",t.ViewContainerRef)],e.prototype,"nodeContentContainer",void 0),l([t.HostListener("mousedown",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mousedown",null),l([t.HostListener("dragstart",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragstart",null),l([t.HostListener("dragend",["$event"]),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],e.prototype,"dragend",null),l([t.HostListener("click",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"click",null),l([t.HostListener("mouseover",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mouseover",null),l([t.HostListener("mouseout",["$event"]),c("design:type",Function),c("design:paramtypes",[MouseEvent]),c("design:returntype",void 0)],e.prototype,"mouseout",null),e=l([t.Component({selector:"fc-node",template:"<ng-template #nodeContent></ng-template>",styles:[":host{position:absolute;z-index:1}:host.fc-dragging{z-index:10}:host ::ng-deep .fc-leftConnectors,:host ::ng-deep .fc-rightConnectors{position:absolute;top:0;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;z-index:-10}:host ::ng-deep .fc-leftConnectors .fc-magnet,:host ::ng-deep .fc-rightConnectors .fc-magnet{-webkit-box-align:center;align-items:center}:host ::ng-deep .fc-leftConnectors{left:-20px}:host ::ng-deep .fc-rightConnectors{right:-20px}:host ::ng-deep .fc-magnet{display:-webkit-box;display:flex;-webkit-box-flex:1;flex-grow:1;height:60px;-webkit-box-pack:center;justify-content:center}:host ::ng-deep .fc-connector{width:18px;height:18px;border:10px solid transparent;-moz-background-clip:padding;-webkit-background-clip:padding;background-clip:padding-box;border-radius:50%;background-color:#f7a789;color:#fff;pointer-events:all}:host ::ng-deep .fc-connector.fc-hover{background-color:#000}"]}),(n=0,o=t.Inject(p),function(e,t){o(e,t,n)}),c("design:paramtypes",[Object,t.ElementRef,t.ComponentFactoryResolver])],e)}(),T=function(){function e(){var e=this;this.flowchartConstants=h,this.nodeRectInfo={top:function(){return e.node.y},left:function(){return e.node.x},bottom:function(){return e.node.y+e.height},right:function(){return e.node.x+e.width},width:function(){return e.width},height:function(){return e.height}}}return e.prototype.ngOnInit=function(){},l([t.Input(),c("design:type",Object)],e.prototype,"callbacks",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"userNodeCallbacks",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"node",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"selected",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"edit",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"underMouse",void 0),l([t.Input(),c("design:type",Object)],e.prototype,"mouseOverConnector",void 0),l([t.Input(),c("design:type",m)],e.prototype,"modelservice",void 0),l([t.Input(),c("design:type",Boolean)],e.prototype,"dragging",void 0),e=l([t.Directive()],e)}(),L=function(e){function n(){return e.call(this)||this}return d(n,e),n=l([t.Component({selector:"fc-default-node",template:'<div\n (dblclick)="userNodeCallbacks.doubleClick($event, node)">\n <div class="{{flowchartConstants.nodeOverlayClass}}"></div>\n <div class="innerNode">\n <p>{{ node.name }}</p>\n\n <div class="{{flowchartConstants.leftConnectorClass}}">\n <div fc-magnet [connector]="connector" [callbacks]="callbacks"\n *ngFor="let connector of modelservice.nodes.getConnectorsByType(node, flowchartConstants.leftConnectorType)">\n <div fc-connector [connector]="connector"\n [nodeRectInfo]="nodeRectInfo"\n [mouseOverConnector]="mouseOverConnector"\n [callbacks]="callbacks"\n [modelservice]="modelservice"></div>\n </div>\n </div>\n <div class="{{flowchartConstants.rightConnectorClass}}">\n <div fc-magnet [connector]="connector" [callbacks]="callbacks"\n *ngFor="let connector of modelservice.nodes.getConnectorsByType(node, flowchartConstants.rightConnectorType)">\n <div fc-connector [connector]="connector"\n [nodeRectInfo]="nodeRectInfo"\n [mouseOverConnector]="mouseOverConnector"\n [callbacks]="callbacks"\n [modelservice]="modelservice"></div>\n </div>\n </div>\n </div>\n <div *ngIf="modelservice.isEditable() && !node.readonly" class="fc-nodeedit" (click)="userNodeCallbacks.nodeEdit($event, node)">\n <i class="fa fa-pencil" aria-hidden="true"></i>\n </div>\n <div *ngIf="modelservice.isEditable() && !node.readonly" class="fc-nodedelete" (click)="modelservice.nodes.delete(node)">\n ×\n </div>\n</div>\n',styles:[":host .fc-node-overlay{position:absolute;pointer-events:none;left:0;top:0;right:0;bottom:0;background-color:#000;opacity:0}:host :host-context(.fc-hover) .fc-node-overlay{opacity:.25;-webkit-transition:opacity .2s;transition:opacity .2s}:host :host-context(.fc-selected) .fc-node-overlay{opacity:.25}:host .innerNode{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;min-width:100px;border-radius:5px;background-color:#f15b26;color:#fff;font-size:16px;pointer-events:none}:host .innerNode p{padding:0 15px;text-align:center}"]}),c("design:paramtypes",[])],n)}(T),B={nodeComponentType:L},z=function(){function e(){}return e=l([t.NgModule({entryComponents:[L],declarations:[N,P,H,F,L],providers:[D,x,{provide:p,useValue:B}],imports:[r.CommonModule],exports:[N,P,H,L]})],e)}();e.DefaultFcNodeComponent=L,e.FC_NODE_COMPONENT_CONFIG=p,e.FcConnectorDirective=H,e.FcMagnetDirective=P,e.FcNodeComponent=T,e.FlowchartConstants=h,e.ModelvalidationError=f,e.NgxFlowchartComponent=N,e.NgxFlowchartModule=z,e.fcTopSort=v,e.ɵ0=B,e.ɵa=F,e.ɵb=D,e.ɵc=x,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
//# sourceMappingURL=ngx-flowchart.umd.min.js.map
|